I2C Constants
This page aggregates all I2C-related constants used by functions and methods from the C and C++ APIs.
- group I2C-related constants
I2C General Constants
-
MAX_I2C_TRANSFER_LENGTH
Maximum I2C payload length in bytes per transfer request.
I2C Bulk Transfer Limits
Limits for every bulk command in the I2C group: the controller transfers (CMD_I2C_CONTROLLER_WRITE_BULK, CMD_I2C_CONTROLLER_READ_BULK) and the target-memory pair (CMD_I2C_TARGET_WRITE_MEMORY, CMD_I2C_TARGET_READ_MEMORY).
-
I2C_BULK_MAX_PAYLOAD
Largest payload any bulk I2C command can move in one call.
Both roles draw on the same shared bulk-staging pool: up to 32 KB on Supernova, 16 KB on Pulsar. This is only the compile-time upper bound. The real per-call ceiling is what the device reports for GROUP_I2C in
SYS_GET_BULK_CAPABILITIES— ask for that rather than assuming this one, because it differs by product and by firmware build.
-
I2C_BULK_PAYLOAD_TIMEOUT_MS
How long the host will spend moving one bulk I2C payload over the vendor endpoint. Matches the SPI bulk budget for the same reason: it is a stall ceiling, not a throughput budget.
I2C Bus Selection
-
I2C_BUS_A
Select I2C bus/channel A. For Pulsar, accessible through the I2C-dedicated Qwiic connector. For Supernova, it is accessible though both the I2C-dedicated Qwiic connector and the 2x15 pin connector.
-
I2C_DUTY_CYCLE_DEFAULT
highPctfor i2cSetDutyCycle that returns to the default SCL timing. It means “default”, not 0% high.
-
I2C_BUS_B
Select I2C bus/channel B. This bus id applies only for the Pulsar. This bus is accessible through the 2x15 pin connector and the external breakout board.
I2C Pull-up Resistor Options
Encoded pull-up resistor selections used by CMD_I2C_SET_PULLUP_RESISTORS.
-
I2C_PULLUP_150Ohm
Configure 150 Ohm pull-up resistance.
-
I2C_PULLUP_220Ohm
Configure 220 Ohm pull-up resistance.
-
I2C_PULLUP_330Ohm
Configure 330 Ohm pull-up resistance.
-
I2C_PULLUP_470Ohm
Configure 470 Ohm pull-up resistance.
-
I2C_PULLUP_680Ohm
Configure 680 Ohm pull-up resistance.
-
I2C_PULLUP_1kOhm
Configure 1.0 kOhm pull-up resistance.
-
I2C_PULLUP_1_5kOhm
Configure 1.5 kOhm pull-up resistance.
-
I2C_PULLUP_2_2kOhm
Configure 2.2 kOhm pull-up resistance.
-
I2C_PULLUP_3_3kOhm
Configure 3.3 kOhm pull-up resistance.
-
I2C_PULLUP_4kOhm
Configure 4.0 kOhm pull-up resistance.
-
I2C_PULLUP_4_7kOhm
Configure 4.7 kOhm pull-up resistance.
-
I2C_PULLUP_10kOhm
Configure 10 kOhm pull-up resistance.
-
I2C_PULLUP_DISABLE
Disable internal pull-up resistors.
I2C Target Mode
Enumerations selecting the behavior of the device while acting as an I2C target.
-
enum I2cTargetModel
Device emulation model presented on the bus while in I2C target mode.
Values:
-
enumerator I2C_TARGET_MODEL_MEMORY
Flat byte-addressable arena with an auto-incrementing pointer.
-
enumerator I2C_TARGET_MODEL_EEPROM
24Cxx-style EEPROM: page-wrap, busy timing, write-protect.
-
enumerator I2C_TARGET_MODEL_REGISTER_MAP
Register device with per-region access policies and width.
-
enumerator I2C_TARGET_MODEL_MEMORY
-
enum I2cTargetAddressMode
Addressing mode the I2C target answers to.
Values:
-
enumerator I2C_TARGET_ADDRESS_MODE_7BIT
7-bit slave address (0x08..0x77).
-
enumerator I2C_TARGET_ADDRESS_MODE_10BIT
10-bit slave address (0x000..0x3FF), emulated on the 7-bit slave.
-
enumerator I2C_TARGET_ADDRESS_MODE_7BIT
-
enum I2cTargetMemoryLayout
Register-addressing width for the I2C target arena.
Values:
-
enumerator I2C_TARGET_MEMORY_LAYOUT_8BIT
8-bit register addressing (arena 0..255).
-
enumerator I2C_TARGET_MEMORY_LAYOUT_16BIT
16-bit register addressing (full arena).
-
enumerator I2C_TARGET_MEMORY_LAYOUT_8BIT
-
enum I2cTargetEepromBusyBehavior
How the EEPROM model stalls the bus while completing a write/erase cycle.
Values:
-
enumerator I2C_TARGET_EEPROM_BUSY_NACK
NACK the address until done (ack-polling).
-
enumerator I2C_TARGET_EEPROM_BUSY_CLOCK_STRETCH
Hold SCL low (clock-stretch) until done.
-
enumerator I2C_TARGET_EEPROM_BUSY_NACK
-
enum I2cTargetEraseScope
Scope of a host-triggered EEPROM erase.
Values:
-
enumerator I2C_TARGET_ERASE_SCOPE_PAGE
Erase the page containing the given address.
-
enumerator I2C_TARGET_ERASE_SCOPE_CHIP
Erase the whole arena.
-
enumerator I2C_TARGET_ERASE_SCOPE_PAGE
-
enum I2cTargetRegisterAccess
Register access permission for a region of the REGISTER_MAP model.
Values:
-
enumerator I2C_TARGET_REGISTER_ACCESS_RW
Read/write.
-
enumerator I2C_TARGET_REGISTER_ACCESS_RO
Read-only; writes are acknowledged and discarded.
-
enumerator I2C_TARGET_REGISTER_ACCESS_WO
Write-only; reads return the fill value.
-
enumerator I2C_TARGET_REGISTER_ACCESS_RC
Read-clear; the region clears to 0 on STOP after a read.
-
enumerator I2C_TARGET_REGISTER_ACCESS_W1C
Write-1-to-clear; a written 1 bit clears that bit.
-
enumerator I2C_TARGET_REGISTER_ACCESS_RESERVED
Unimplemented; reads return the fill value, writes discarded.
-
enumerator I2C_TARGET_REGISTER_ACCESS_RW
-
MAX_I2C_TRANSFER_LENGTH