|
Sensor Fusion Library 0.6.1
Orientation sensing for Espressif (ESP32, ESP8266) processors
|
The hal_i2c.h file declares low-level interface functions for reading and writing sensor registers using I2C. More...


Go to the source code of this file.
Macros | |
| #define | I2C_ERROR_OK (0) |
Functions | |
| 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 pin numbers to which the I2C SDA and SCL lines of the sensors are connected. Pass -1 to use the default Arduino pins. | |
| bool | I2CReadByte (uint8_t address, uint8_t reg, uint8_t *destination) |
| bool | I2CReadBytes (uint8_t address, uint8_t reg, uint8_t *destination, int num_bytes) |
| bool | I2CWriteByte (uint8_t address, uint8_t reg, uint8_t value) |
| bool | I2CWriteBytes (uint8_t address, uint8_t reg, const uint8_t *value, unsigned int num_bytes) |
| 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. | |
| int32_t | Sensor_I2C_Read_Register (registerDeviceInfo_t *devInfo, uint16_t peripheralAddress, uint8_t offset, uint8_t length, uint8_t *pOutBuffer) |
The hal_i2c.h file declares low-level interface functions for reading and writing sensor registers using I2C.
Definition in file hal_i2c.h.
| 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 pin numbers to which the I2C SDA and SCL lines of the sensors are connected. Pass -1 to use the default Arduino pins.
Returns true if successful, false if problem initializing I2C.
Definition at line 37 of file hal_i2c.cc.
| int32_t Sensor_I2C_Read | ( | registerDeviceInfo_t * | devInfo, |
| uint16_t | slaveAddress, | ||
| const registerReadlist_t * | pReadList, | ||
| uint8_t * | pOutBuffer | ||
| ) |
Read register data from a sensor.
| [in] | pCommDrv | pointer to the I2C ARM driver to use |
| [in] | devInfo | The I2C device number and idle function. |
| [in] | slaveAddress | the I2C slave address to read from |
| [in] | pReadList | a list of one or more register addresses and lengths to read |
| [in] | pOutBuffer | a pointer of sufficient size to contain the requested read data |
Definition at line 177 of file hal_i2c.cc.
| int32_t Sensor_I2C_Read_Register | ( | registerDeviceInfo_t * | devInfo, |
| uint16_t | peripheralAddress, | ||
| uint8_t | offset, | ||
| uint8_t | length, | ||
| uint8_t * | pOutBuffer | ||
| ) |
Definition at line 204 of file hal_i2c.cc.
| int8_t Sensor_I2C_Write_List | ( | registerDeviceInfo_t * | devInfo, |
| uint16_t | slaveAddress, | ||
| const registerwritelist_t * | pRegWriteList | ||
| ) |
Write register data to a sensor.
| [in] | pCommDrv | pointer to the I2C ARM driver to use |
| [in] | devInfo | The I2C device number and idle function. |
| [in] | slaveAddress | the I2C slave address to write to |
| [in] | pRegWriteList | a list of one or more register/value pairs to write |
Definition at line 145 of file hal_i2c.cc.