12 #include "frc/ErrorBase.h"
14 enum HAL_I2CPort : int32_t;
26 enum Port { kOnboard = 0, kMXP };
34 I2C(Port port,
int deviceAddress);
39 I2C& operator=(
const I2C&) =
delete;
53 bool Transaction(uint8_t* dataToSend,
int sendSize, uint8_t* dataReceived,
77 bool Write(
int registerAddress, uint8_t data);
105 bool Read(
int registerAddress,
int count, uint8_t* data);
118 bool ReadOnly(
int count, uint8_t* buffer);
135 bool VerifySensor(
int registerAddress,
int count,
const uint8_t* expected);
I2C(Port port, int deviceAddress)
Constructor.
bool Read(int registerAddress, int count, uint8_t *data)
Execute a read transaction with the device.
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
bool AddressOnly()
Attempt to address a device on the I2C bus.
bool VerifySensor(int registerAddress, int count, const uint8_t *expected)
Verify that a device's registers contain expected values.
bool WriteBulk(uint8_t *data, int count)
Execute a bulk write transaction with the device.
I2C bus interface class.
Definition: I2C.h:24
bool Write(int registerAddress, uint8_t data)
Execute a write transaction with the device.
bool Transaction(uint8_t *dataToSend, int sendSize, uint8_t *dataReceived, int receiveSize)
Generic transaction.
Base class for most objects.
Definition: ErrorBase.h:74
bool ReadOnly(int count, uint8_t *buffer)
Execute a read only transaction with the device.