ISSDK  1.8
IoT Sensing Software Development Kit
Data Structures | Macros | Typedefs | Functions
register_io_spi.h File Reference

The register_io_spi.h file declares low-level interface functions for reading and writing sensor registers using CMSIS APIs. More...

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

Go to the source code of this file.

Data Structures

struct  spiControlParams_t
 The SPI Slave Control Command Params SDK2.0 Driver. More...
 
struct  spi_mater_SlaveCmd
 The SPI Slave Transfer Command Params SDK2.0 Driver. More...
 
struct  spiSlaveSpecificParams_t
 This structure defines the spi slave command format. More...
 

Macros

#define SPI_SS_ACTIVE_LOW   (ARM_SPI_SS_INACTIVE)
 
#define SPI_SS_ACTIVE_HIGH   (ARM_SPI_SS_ACTIVE)
 

Typedefs

typedef void(* fpSpiReadPreprocessFn_t) (void *pCmdOut, uint32_t offset, uint32_t size)
 
typedef void(* fpSpiWritePreprocessFn_t) (void *pCmdOut, uint32_t offset, uint32_t size, void *pWritebuffer)
 
typedef struct spi_mater_SlaveCmd spiCmdParams_t
 The SPI Slave Transfer Command Params SDK2.0 Driver. More...
 

Functions

int32_t Register_SPI_BlockWrite (ARM_DRIVER_SPI *pCommDrv, registerDeviceInfo_t *devInfo, void *pWriteParams, uint8_t offset, const uint8_t *pBuffer, uint8_t bytesToWrite)
 The interface function to block write to a sensor register. More...
 
int32_t Register_SPI_Write (ARM_DRIVER_SPI *pCommDrv, registerDeviceInfo_t *devInfo, void *pWriteParams, uint8_t offset, uint8_t value, uint8_t mask)
 The interface function to write a sensor register. More...
 
int32_t Register_SPI_Read (ARM_DRIVER_SPI *pCommDrv, registerDeviceInfo_t *devInfo, void *pReadParams, uint8_t offset, uint8_t length, uint8_t *pOutBuffer)
 The interface function to read a sensor register. More...
 

Detailed Description

The register_io_spi.h file declares low-level interface functions for reading and writing sensor registers using CMSIS APIs.

Definition in file register_io_spi.h.

Macro Definition Documentation

◆ SPI_SS_ACTIVE_HIGH

#define SPI_SS_ACTIVE_HIGH   (ARM_SPI_SS_ACTIVE)

Definition at line 22 of file register_io_spi.h.

◆ SPI_SS_ACTIVE_LOW

#define SPI_SS_ACTIVE_LOW   (ARM_SPI_SS_INACTIVE)

Typedef Documentation

◆ fpSpiReadPreprocessFn_t

typedef void(* fpSpiReadPreprocessFn_t) (void *pCmdOut, uint32_t offset, uint32_t size)

Function pointer for the slave read information

Definition at line 25 of file register_io_spi.h.

◆ fpSpiWritePreprocessFn_t

typedef void(* fpSpiWritePreprocessFn_t) (void *pCmdOut, uint32_t offset, uint32_t size, void *pWritebuffer)

Function pointer for the slave write information

Definition at line 27 of file register_io_spi.h.

◆ spiCmdParams_t

The SPI Slave Transfer Command Params SDK2.0 Driver.

Function Documentation

◆ Register_SPI_BlockWrite()

int32_t Register_SPI_BlockWrite ( ARM_DRIVER_SPI *  pCommDrv,
registerDeviceInfo_t devInfo,
void *  pWriteParams,
uint8_t  offset,
const uint8_t *  pBuffer,
uint8_t  bytesToWrite 
)

The interface function to block write to a sensor register.

Parameters
ARM_DRIVER_SPI*pCommDrv - The SPI driver to use.
registerDeviceInfo_t*devInfo - The SPI device number and idle function.
void*pWriteParams - the sensor's SPI slave select params.
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.

Write and the value.

Definition at line 151 of file register_io_spi.c.

References b_SPI_CompletionFlag, spiControlParams_t::cmdCode, registerDeviceInfo_t::deviceInstance, registerDeviceInfo_t::functionParam, g_SPI_ErrorEvent, registerDeviceInfo_t::idleFunction, int32_t(), spi_mater_SlaveCmd::pReadBuffer, spiSlaveSpecificParams_t::pTargetSlavePinID, spi_mater_SlaveCmd::pWriteBuffer, spiSlaveSpecificParams_t::pWritePreprocessFN, register_spi_control(), spi_mater_SlaveCmd::size, spiSlaveSpecificParams_t::ssActiveValue, and status.

Referenced by FXLC95000_SPI_Initialize(), Host_IO_Receive(), MMA9553_SPI_Initialize(), and Sensor_SPI_BlockWrite().

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

◆ Register_SPI_Read()

int32_t Register_SPI_Read ( ARM_DRIVER_SPI *  pCommDrv,
registerDeviceInfo_t devInfo,
void *  pReadParams,
uint8_t  offset,
uint8_t  length,
uint8_t *  pOutBuffer 
)

The interface function to read a sensor register.

Parameters
ARM_DRIVER_SPI*pCommDrv - The SPI driver to use.
registerDeviceInfo_t*devInfo - The SPI device number and idle function.
void*pReadParams - the sensor's SPI slave select params.
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 the value.

Definition at line 302 of file register_io_spi.c.

References b_SPI_CompletionFlag, spiControlParams_t::cmdCode, registerDeviceInfo_t::deviceInstance, registerDeviceInfo_t::functionParam, g_SPI_ErrorEvent, registerDeviceInfo_t::idleFunction, int32_t(), spi_mater_SlaveCmd::pReadBuffer, spiSlaveSpecificParams_t::pReadPreprocessFN, spiSlaveSpecificParams_t::pTargetSlavePinID, spi_mater_SlaveCmd::pWriteBuffer, register_spi_control(), spi_mater_SlaveCmd::size, spiSlaveSpecificParams_t::spiCmdLen, spiSlaveSpecificParams_t::ssActiveValue, and status.

Referenced by ADS_DIFF_PQuery(), ADS_FXLS8471Query(), ADS_FXLS8962Query(), FXAS21002_SPI_Initialize(), FXLS8471Q_Init(), FXLS8471Q_SPI_Initialize(), FXLS8962_SPI_Initialize(), FXLS896x_SPI_Initialize(), FXLS8974_SPI_Initialize(), FXOS8700_SPI_Initialize(), Host_IO_Receive(), MMA9553_SPI_Configure(), MMA9553_SPI_Initialize(), Sensor_SPI_BlockWrite(), and Sensor_SPI_Read().

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

◆ Register_SPI_Write()

int32_t Register_SPI_Write ( ARM_DRIVER_SPI *  pCommDrv,
registerDeviceInfo_t devInfo,
void *  pWriteParams,
uint8_t  offset,
uint8_t  value,
uint8_t  mask 
)

The interface function to write a sensor register.

Parameters
ARM_DRIVER_SPI*pCommDrv - The SPI driver to use.
registerDeviceInfo_t*devInfo - The SPI device number and idle function.
void*pWriteParams - the sensor's SPI slave select params.
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.
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.

Read the register value.

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

Overwrite the register with specified value.

Write and the value.

Definition at line 205 of file register_io_spi.c.

References b_SPI_CompletionFlag, spiControlParams_t::cmdCode, registerDeviceInfo_t::deviceInstance, registerDeviceInfo_t::functionParam, g_SPI_ErrorEvent, registerDeviceInfo_t::idleFunction, int32_t(), spi_mater_SlaveCmd::pReadBuffer, spiSlaveSpecificParams_t::pReadPreprocessFN, spiSlaveSpecificParams_t::pTargetSlavePinID, spi_mater_SlaveCmd::pWriteBuffer, spiSlaveSpecificParams_t::pWritePreprocessFN, register_spi_control(), spi_mater_SlaveCmd::size, spiSlaveSpecificParams_t::spiCmdLen, spiSlaveSpecificParams_t::ssActiveValue, and status.

Referenced by FXAS21002_SPI_Configure(), FXAS21002_SPI_Deinit(), FXLS8471Q_SPI_Configure(), FXLS8962_SPI_Configure(), FXLS8962_SPI_Deinit(), FXLS896x_SPI_Configure(), FXLS896x_SPI_Deinit(), FXLS8974_SPI_Configure(), FXLS8974_SPI_Deinit(), FXOS8700_SPI_Configure(), FXOS8700_SPI_Deinit(), and Sensor_SPI_Write().

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