A helper class that represents I2C addresses.
An address instance remembers whether it was constructed as a seven-bit or ten-bit address. This attribute can be used by Initiators to determine the i2c addressing style to transmit.
Note: Per the above, a ten-bit constructed instance may still have an an address of seven or fewer bits.
Public Member Functions | |
Address (uint16_t address) | |
uint8_t | GetSevenBit () const |
uint16_t | GetTenBit () const |
uint16_t | GetAddress () const |
constexpr bool | IsTenBit () const |
Static Public Member Functions | |
template<uint16_t kAddress> | |
static constexpr Address | TenBit () |
static Address | TenBit (uint16_t address) |
template<uint8_t kAddress> | |
static constexpr Address | SevenBit () |
static Address | SevenBit (uint16_t address) |
Static Public Attributes | |
static constexpr uint8_t | kMaxSevenBitAddress = (1 << 7) - 1 |
static constexpr uint16_t | kMaxTenBitAddress = (1 << 10) - 1 |
Friends | |
bool | operator== (const Address &a1, const Address &a2) |