|
XPoint 0.1.0
Hardware-agnostic crosspoint matrix routing library
|
Abstract I2C bus interface. More...
#include <I2CInterface.h>
Public Member Functions | |
| virtual | ~I2CInterface () |
| virtual void | begin () |
| Initialize the I2C bus. | |
| virtual void | writeRegister (uint8_t addr, uint8_t reg, uint8_t val)=0 |
| Write one byte to a device register. | |
| virtual void | writeByte (uint8_t addr, uint8_t data) |
| Write a single data byte to a device (no register address byte). | |
Abstract I2C bus interface.
Decouples MCP23017Driver from any specific I2C implementation so the same driver code compiles and tests on both Arduino targets and host machines.
|
inlinevirtual |
|
inlinevirtual |
Initialize the I2C bus.
Default no-op: safe for mock objects or buses started elsewhere. WireI2C overrides this to call Wire.begin().
Reimplemented in TCA9548AInterface, and WireI2C.
|
inlinevirtual |
Write a single data byte to a device (no register address byte).
Used by bus-multiplexer adapters such as TCA9548AInterface whose protocol is a bare one-byte control word with no register field.
Default: calls writeRegister(addr, data, 0u). Devices that ignore trailing bytes (TCA9548A latches only the first data byte) work correctly with this default. WireI2C overrides to emit exactly one data byte on the wire.
| [in] | addr | 7-bit I2C device address. |
| [in] | data | Control byte to write. |
Reimplemented in WireI2C.
|
pure virtual |
Write one byte to a device register.
| [in] | addr | 7-bit I2C device address. |
| [in] | reg | Register index within the device. |
| [in] | val | Byte value to write. |
Implemented in WireI2C, and TCA9548AInterface.