ISSDK  1.8
IoT Sensing Software Development Kit
Functions
register_io_i2c.h File Reference

The register_io_i2c.h file declares low-level interface functions for reading and writing sensor registers. More...

#include "sensor_drv.h"
#include "Driver_I2C.h"
Include dependency graph for register_io_i2c.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int32_t Register_I2C_BlockWrite (ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, uint8_t offset, const uint8_t *pBuffer, uint8_t bytesToWrite)
 The interface function to write a sensor register. More...
 
int32_t Register_I2C_Write (ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, uint8_t offset, uint8_t value, uint8_t mask, bool repeatedStart)
 The interface function to write a sensor register. More...
 
int32_t Register_I2C_Read (ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, uint8_t offset, uint8_t length, uint8_t *pOutBuffer)
 The interface function to read a sensor register. More...
 

Detailed Description

The register_io_i2c.h file declares low-level interface functions for reading and writing sensor registers.

Definition in file register_io_i2c.h.

Function Documentation

◆ Register_I2C_BlockWrite()

int32_t Register_I2C_BlockWrite ( ARM_DRIVER_I2C *  pCommDrv,
registerDeviceInfo_t devInfo,
uint16_t  slaveAddress,
uint8_t  offset,
const uint8_t *  pBuffer,
uint8_t  bytesToWrite 
)

The interface function to write a sensor register.

Parameters
ARM_DRIVER_I2C*pCommDrv - The I2C driver to use.
registerDeviceInfo_t*devInfo - The I2C device number and idle function.
uint16_tslaveAddress - the sensor's I2C slave address.
uint8_toffset - The register/offset to write to.
uint8_t*pBuffer - The buffer containing bytes to write.
uint8_tbytesToWrite - A number of bytes to write.
Returns
ARM_DRIVER_OK if success or ARM_DRIVER_ERROR if error.

The interface function to block write sensor registers.

Definition at line 149 of file register_io_i2c.c.

References b_I2C_CompletionFlag, registerDeviceInfo_t::deviceInstance, registerDeviceInfo_t::functionParam, g_I2C_ErrorEvent, registerDeviceInfo_t::idleFunction, int32_t(), SENSOR_MAX_REGISTER_COUNT, and status.

Referenced by ADS_FXLC95000Query(), ADS_MMA9553Query(), FXLC95000_I2C_CheckRomMode(), FXLC95000_I2C_Initialize(), Host_IO_Receive(), MMA9553_I2C_Initialize(), and Sensor_I2C_BlockWrite().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Register_I2C_Read()

int32_t Register_I2C_Read ( ARM_DRIVER_I2C *  pCommDrv,
registerDeviceInfo_t devInfo,
uint16_t  slaveAddress,
uint8_t  offset,
uint8_t  length,
uint8_t *  pOutBuffer 
)

The interface function to read a sensor register.

Parameters
ARM_DRIVER_I2C*pCommDrv - The I2C driver to use.
registerDeviceInfo_t*devInfo - The I2C device number and idle function.
uint16_tslaveAddress - the sensor's I2C slave address.
uint8_toffset - The register/offset to read from
uint8_tlength - The number of bytes to read
uint8_t*pOutBuffer - The pointer to the buffer to store the register value read.
Returns
ARM_DRIVER_OK if success or ARM_DRIVER_ERROR if error.

The interface function to read a sensor register.

Read and update the value.

Definition at line 310 of file register_io_i2c.c.

References b_I2C_CompletionFlag, registerDeviceInfo_t::deviceInstance, registerDeviceInfo_t::functionParam, g_I2C_ErrorEvent, registerDeviceInfo_t::idleFunction, int32_t(), and status.

Referenced by ADS_DetectShield(), ADS_MMA9553Query(), DBAP_I2C_Initialize(), FXAS21002_I2C_Initialize(), FXLS8471Q_Init(), FXLS8962_I2C_Initialize(), FXLS896x_I2C_Initialize(), FXLS8974_I2C_Initialize(), FXOS8700_I2C_Initialize(), FXOS8700_Init(), FXPQ3115_I2C_Initialize(), Host_IO_Receive(), ISL29023_I2C_Initialize(), MAG3110_I2C_Initialize(), MAG3110_Init(), MMA845x_I2C_Initialize(), MMA8491Q_I2C_Initialize(), MMA865x_I2C_Initialize(), MMA9553_I2C_Configure(), MMA9553_I2C_Initialize(), MPL3115_I2C_Initialize(), Sensor_I2C_BlockWrite(), and Sensor_I2C_Read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Register_I2C_Write()

int32_t Register_I2C_Write ( ARM_DRIVER_I2C *  pCommDrv,
registerDeviceInfo_t devInfo,
uint16_t  slaveAddress,
uint8_t  offset,
uint8_t  value,
uint8_t  mask,
bool  repeatedStart 
)

The interface function to write a sensor register.

Parameters
ARM_DRIVER_I2C*pCommDrv - The I2C driver to use.
registerDeviceInfo_t*devInfo - The I2C device number and idle function.
uint16_tslaveAddress - the sensor's I2C slave address.
uint8_toffset - The register/offset to write to
uint8_tvalue - The value to write to the register
uint8_tmask - A mask value to use when writing. A non-zero mask indicates that a read-modify-write operation should be used. where only the bits set in the mask will be updated according to the value param.
boolrepeatedStart - Indicates whether to send STOP or REPEATED_START bit after the write
Returns
ARM_DRIVER_OK if success or ARM_DRIVER_ERROR if error.

The interface function to write a sensor register.

Set the register based on the values in the register value pair configuration.

Send the register address to read from.

Read the value.

'OR' in the requested values to the current contents of the register

Overwrite the register with specified value.

Write the updated value.

Definition at line 193 of file register_io_i2c.c.

References b_I2C_CompletionFlag, registerDeviceInfo_t::deviceInstance, registerDeviceInfo_t::functionParam, g_I2C_ErrorEvent, registerDeviceInfo_t::idleFunction, int32_t(), and status.

Referenced by FXAS21002_I2C_Configure(), FXAS21002_I2C_Deinit(), FXLS8962_I2C_Configure(), FXLS8962_I2C_DeInit(), FXLS896x_I2C_Configure(), FXLS896x_I2C_DeInit(), FXLS8974_I2C_Configure(), FXLS8974_I2C_DeInit(), FXOS8700_I2C_Configure(), FXOS8700_I2C_Deinit(), FXPQ3115_I2C_Configure(), FXPQ3115_I2C_DeInit(), ISL29023_I2C_DeInit(), MAG3110_I2C_Configure(), MAG3110_I2C_DeInit(), main(), MMA845x_I2C_Configure(), MMA845x_I2C_Deinit(), MMA865x_I2C_Configure(), MMA865x_I2C_DeInit(), MPL3115_I2C_Configure(), MPL3115_I2C_DeInit(), perform_selftest(), and Sensor_I2C_Write().

Here is the call graph for this function:
Here is the caller graph for this function: