![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
The sensor_io_spi.h file declares low-level interface functions for reading and writing sensor registers using CMSIS APIs. More...
Go to the source code of this file.
Functions | |
int32_t | Sensor_SPI_BlockWrite (ARM_DRIVER_SPI *pCommDrv, registerDeviceInfo_t *devInfo, void *pWriteParams, const registercommandlist_t *pCommandList, uint8_t error_mask) |
Write commands to a sensor. More... | |
int32_t | Sensor_SPI_Write (ARM_DRIVER_SPI *pCommDrv, registerDeviceInfo_t *devInfo, void *pWriteParams, const registerwritelist_t *pRegWriteList) |
Write register data to a sensor. More... | |
int32_t | Sensor_SPI_Read (ARM_DRIVER_SPI *pCommDrv, registerDeviceInfo_t *devInfo, void *pReadParams, const registerreadlist_t *pReadList, uint8_t *pOutBuffer) |
Read register data from a sensor. More... | |
The sensor_io_spi.h file declares low-level interface functions for reading and writing sensor registers using CMSIS APIs.
Definition in file sensor_io_spi.h.
int32_t Sensor_SPI_BlockWrite | ( | ARM_DRIVER_SPI * | pCommDrv, |
registerDeviceInfo_t * | devInfo, | ||
void * | pWriteParams, | ||
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 SPI device number and idle function. |
[in] | pWriteParams | The SPI slave slect handle of the sensor 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 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
Write the command based on the values in the command and value pair.
Wait for Command Completion.
Definition at line 50 of file sensor_io_spi.c.
References BOARD_DELAY_ms(), int32_t(), registercommandlist_t::numBytes, registercommandlist_t::pWriteBuffer, Register_SPI_BlockWrite(), Register_SPI_Read(), SENSOR_ERROR_BAD_ADDRESS, SENSOR_ERROR_NONE, SENSOR_ERROR_READ, SENSOR_ERROR_WRITE, status, and registercommandlist_t::writeTo.
Referenced by FXLC95000_SPI_CommandResponse(), MMA9553_SPI_CommandResponse(), MMA9553_SPI_Configure(), MMA9553_SPI_DeInit(), and MMA9553_SPI_Initialize().
int32_t Sensor_SPI_Read | ( | ARM_DRIVER_SPI * | pCommDrv, |
registerDeviceInfo_t * | devInfo, | ||
void * | pReadParams, | ||
const registerreadlist_t * | pReadList, | ||
uint8_t * | pOutBuffer | ||
) |
Read register data from a sensor.
[in] | pCommDrv | Pointer to the SPI ARM driver to use. |
[in] | devInfo | The SPI device number and idle function. |
[in] | pReadParams | SPI slave Params 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 130 of file sensor_io_spi.c.
References int32_t(), registerreadlist_t::numBytes, registerreadlist_t::readFrom, Register_SPI_Read(), SENSOR_ERROR_BAD_ADDRESS, SENSOR_ERROR_NONE, SENSOR_ERROR_READ, and status.
Referenced by DIFF_P_SPI_ReadData(), FXAS21002_SPI_ReadData(), FXLC95000_SPI_CommandResponse(), FXLS8471Q_Read(), FXLS8471Q_SPI_ReadData(), FXLS8962_SPI_ReadData(), FXOS8700_SPI_ReadData(), and MMA9553_SPI_CommandResponse().
int32_t Sensor_SPI_Write | ( | ARM_DRIVER_SPI * | pCommDrv, |
registerDeviceInfo_t * | devInfo, | ||
void * | pWriteParams, | ||
const registerwritelist_t * | pRegWriteList | ||
) |
Write register data to a sensor.
[in] | pCommDrv | Pointer to the SPI ARM driver to use |
[in] | devInfo | The SPI device number and idle function. |
[in] | pWriteParams | SPI slave Params 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 97 of file sensor_io_spi.c.
References int32_t(), registerwritelist_t::mask, Register_SPI_Write(), SENSOR_ERROR_BAD_ADDRESS, SENSOR_ERROR_NONE, SENSOR_ERROR_WRITE, status, registerwritelist_t::value, and registerwritelist_t::writeTo.
Referenced by DIFF_P_SPI_Configure(), FXAS21002_SPI_Configure(), FXLS8471Q_Idle(), FXLS8471Q_Init(), FXLS8471Q_SPI_Configure(), FXLS8962_SPI_Configure(), FXOS8700_SPI_Configure(), and main().