Abstract I2C bus interface.
More...
#include <I2CInterface.h>
|
| 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.
|
| |
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.
◆ ~I2CInterface()
| virtual I2CInterface::~I2CInterface |
( |
| ) |
|
|
inlinevirtual |
◆ begin()
| virtual void I2CInterface::begin |
( |
| ) |
|
|
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 WireI2C.
◆ writeRegister()
| virtual void I2CInterface::writeRegister |
( |
uint8_t |
addr, |
|
|
uint8_t |
reg, |
|
|
uint8_t |
val |
|
) |
| |
|
pure virtual |
Write one byte to a device register.
- Parameters
-
| [in] | addr | 7-bit I2C device address. |
| [in] | reg | Register index within the device. |
| [in] | val | Byte value to write. |
Implemented in WireI2C.
The documentation for this class was generated from the following file: