32 #define I2C_ERROR_OK (0)
41bool I2CReadByte(uint8_t address, uint8_t reg, uint8_t *destination);
42bool I2CReadBytes(uint8_t address, uint8_t reg, uint8_t *destination,
int num_bytes);
43bool I2CWriteByte(uint8_t address, uint8_t reg, uint8_t value);
44bool I2CWriteBytes(uint8_t address, uint8_t reg,
const uint8_t *value,
45 unsigned int num_bytes);
57 uint16_t slaveAddress,
72 uint16_t slaveAddress,
77 uint16_t peripheralAddress, uint8_t offset,
78 uint8_t length, uint8_t *pOutBuffer);
The driver_sensors_types.h file contains sensor state structs and error definitions.
bool I2CReadBytes(byte address, byte reg, byte *destination, int num_bytes)
Read num_bytes bytes from address starting at register. Assumes device auto-increments the register....
bool I2CWriteBytes(byte address, byte reg, const byte *value, unsigned int num_bytes)
Write multiple bytes starting at register to I2C address Assumes device auto-increments the I2C regis...
bool I2CReadByte(byte address, byte reg, byte *destination)
Read single byte from address and place in destination Returns true if successful,...
bool I2CWriteByte(byte address, byte reg, byte value)
Write single byte to register at address Returns true if successful, false if error.
int8_t Sensor_I2C_Write_List(registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registerwritelist_t *pRegWriteList)
Write register data to a sensor.
int32_t Sensor_I2C_Read(registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registerReadlist_t *pReadList, uint8_t *pOutBuffer)
Read register data from a sensor.
bool I2CInitialize(int pin_sda, int pin_scl)
Initialize the I2C system at max clock rate supported by sensors. pin_sda and pin_scl indicate the pi...
This structure defines the device specific info required by register I/O.
This structure defines the Read command List.
This structure defines the Write command List.