Expand description
I2C device addressing per the NXP I2C-bus specification (UM10204).
An I2C transfer begins with the controller sending the device’s address. The exact bytes are pinned down by the specification, and they are easy to get subtly wrong: the 7-bit address shares its byte with the read/write bit, so the value a datasheet prints is not the byte that goes on the wire, and the 10-bit extension spends a reserved prefix and spreads its bits across two bytes. This module builds those bytes exactly and rejects an address that is out of range or, on request, one the specification reserves.
Structs§
- Address
- An I2C device address, 7-bit or 10-bit, validated to its range.
- Address
Frame - The bytes an
Addressputs on the bus to address a device.
Enums§
- Direction
- Whether an I2C transfer reads from or writes to the device.
Constants§
- RESERVED_
BELOW - The first 7-bit address above the reserved block at the bottom of the range.
- RESERVED_
FROM - The lowest 7-bit address the specification keeps for itself.