75 bool Transaction(uint8_t* dataToSend,
int sendSize, uint8_t* dataReceived,
99 bool Write(
int registerAddress, uint8_t data);
127 bool Read(
int registerAddress,
int count, uint8_t* data);
157 bool VerifySensor(
int registerAddress,
int count,
const uint8_t* expected);
I2C bus interface class.
Definition I2C.h:24
I2C(Port port, int deviceAddress)
Constructor.
bool Read(int registerAddress, int count, uint8_t *data)
Execute a read transaction with the device.
bool ReadOnly(int count, uint8_t *buffer)
Execute a read only transaction with the device.
bool Transaction(uint8_t *dataToSend, int sendSize, uint8_t *dataReceived, int receiveSize)
Generic transaction.
bool Write(int registerAddress, uint8_t data)
Execute a write transaction with the device.
I2C & operator=(I2C &&)=default
bool WriteBulk(uint8_t *data, int count)
Execute a bulk write transaction with the device.
bool VerifySensor(int registerAddress, int count, const uint8_t *expected)
Verify that a device's registers contain expected values.
int GetDeviceAddress() const
Returns I2C device address.
Port GetPort() const
Returns I2C port.
bool AddressOnly()
Attempt to address a device on the I2C bus.
Port
I2C connection ports.
Definition I2C.h:29
@ kOnboard
Onboard I2C port.
Definition I2C.h:31
@ kMXP
MXP (roboRIO MXP) I2C port.
Definition I2C.h:33
A move-only C++ wrapper around a HAL handle.
Definition Types.h:96