![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The sensor_io_i2c.h file declares low-level interface functions for reading and writing sensor registers. More...
Go to the source code of this file.
Functions | |
int32_t | Sensor_I2C_BlockWrite (ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registercommandlist_t *pCommandList, uint8_t error_mask) |
Write commands to a sensor. More... | |
int32_t | Sensor_I2C_Write (ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registerwritelist_t *pRegWriteList) |
Write register data to a sensor. More... | |
int32_t | Sensor_I2C_Read (ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registerreadlist_t *pReadList, uint8_t *pOutBuffer) |
Read register data from a sensor. More... | |
The sensor_io_i2c.h file declares low-level interface functions for reading and writing sensor registers.
Definition in file sensor_io_i2c.h.
int32_t Sensor_I2C_BlockWrite | ( | ARM_DRIVER_I2C * | pCommDrv, |
registerDeviceInfo_t * | devInfo, | ||
uint16_t | slaveAddress, | ||
const registercommandlist_t * | pCommandList, | ||
uint8_t | error_mask | ||
) |
Write commands 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] | pCommandList | a list of one or more commands to write |
[in] | error_mask | The mask for Error Code Bits in CoCo Byte |
The interface function to block write commands to a sensor.
Validate for the correct handle.
Update register values based on register write list unless the next Cmd is the list terminator
Write the command based on the values in the command and value pair.
Wait for Command Completion.
Definition at line 24 of file sensor_io_i2c.c.
References BOARD_DELAY_ms(), int32_t(), registercommandlist_t::numBytes, registercommandlist_t::pWriteBuffer, Register_I2C_BlockWrite(), Register_I2C_Read(), SENSOR_ERROR_BAD_ADDRESS, SENSOR_ERROR_NONE, SENSOR_ERROR_READ, SENSOR_ERROR_WRITE, status, and registercommandlist_t::writeTo.
Referenced by FXLC95000_I2C_CommandResponse(), FXLC95000_I2C_FlashCommands(), MMA9553_I2C_CommandResponse(), MMA9553_I2C_Configure(), MMA9553_I2C_DeInit(), and MMA9553_I2C_Initialize().
int32_t Sensor_I2C_Read | ( | ARM_DRIVER_I2C * | pCommDrv, |
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 |
The interface function to read register data from a sensor.
Validate for the correct handle.
Traverse the read list and read the registers one by one unless the register read list numBytes is zero
Definition at line 105 of file sensor_io_i2c.c.
References int32_t(), registerreadlist_t::numBytes, registerreadlist_t::readFrom, Register_I2C_Read(), SENSOR_ERROR_BAD_ADDRESS, SENSOR_ERROR_NONE, SENSOR_ERROR_READ, and status.
Referenced by DBAP_I2C_ReadData(), FXAS21002_I2C_ReadData(), FXLC95000_I2C_CommandResponse(), FXLS8471Q_Read(), FXLS8962_I2C_ReadData(), FXLS896x_I2C_ReadData(), FXLS8974_I2C_ReadData(), FXOS8700_I2C_ReadData(), FXOS8700_Init(), FXOS8700_ReadMagData(), FXPQ3115_I2C_ReadData(), ISL29023_I2C_ReadData(), MAG3110_I2C_ReadData(), MAG3110_Read(), MMA845x_I2C_ReadData(), MMA8491Q_I2C_ReadData(), MMA865x_I2C_ReadData(), MMA9553_I2C_CommandResponse(), and MPL3115_I2C_ReadData().
int32_t Sensor_I2C_Write | ( | ARM_DRIVER_I2C * | pCommDrv, |
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 |
The interface function to write register data to a sensor.
Validate for the correct handle.
Update register values based on register write list unless the next Cmd is the list terminator
Set the register based on the values in the register value pair.
Definition at line 71 of file sensor_io_i2c.c.
References int32_t(), registerwritelist_t::mask, Register_I2C_Write(), SENSOR_ERROR_BAD_ADDRESS, SENSOR_ERROR_NONE, SENSOR_ERROR_WRITE, status, registerwritelist_t::value, and registerwritelist_t::writeTo.
Referenced by DBAP_I2C_Configure(), FXAS21002_I2C_Configure(), FXLS8471Q_Idle(), FXLS8471Q_Init(), FXLS8962_I2C_Configure(), FXLS896x_I2C_Configure(), FXLS8974_I2C_Configure(), FXOS8700_I2C_Configure(), FXOS8700_Idle(), FXOS8700_Init(), FXPQ3115_I2C_Configure(), ISL29023_I2C_Configure(), MAG3110_I2C_Configure(), MAG3110_Idle(), MAG3110_Init(), main(), MMA845x_I2C_Configure(), MMA865x_I2C_Configure(), and MPL3115_I2C_Configure().