16 #include "gpio_driver.h" 38 *(pWBuff) = offset | 0x80;
55 *(pWBuff) = offset & 0x7F;
59 memcpy(pWBuff + FXLS896x_SPI_CMD_LEN, pWritebuffer, size);
75 if ((pSensorHandle == NULL) || (pBus == NULL) || (pSlaveSelect == NULL))
96 pGPIODriver->
set_pin(pSlaveSelect);
100 pGPIODriver->
clr_pin(pSlaveSelect);
108 if (ARM_DRIVER_OK != status)
135 if ((pSensorHandle == NULL) || (pRegWriteList == NULL))
150 if (ARM_DRIVER_OK != status)
158 if (ARM_DRIVER_OK != status)
167 if (ARM_DRIVER_OK != status)
182 if ((pSensorHandle == NULL) || (pReadList == NULL) || (pBuffer == NULL))
196 if (ARM_DRIVER_OK != status)
208 if (pSensorHandle == NULL)
222 if (ARM_DRIVER_OK != status)
246 if ((pSensorHandle == NULL) || (pBus == NULL))
259 if (ARM_DRIVER_OK != status)
290 if ((pSensorHandle == NULL) || (pRegWriteList == NULL))
305 if (ARM_DRIVER_OK != status)
313 if (ARM_DRIVER_OK != status)
322 if (ARM_DRIVER_OK != status)
337 if ((pSensorHandle == NULL) || (pReadList == NULL) || (pBuffer == NULL))
351 if (ARM_DRIVER_OK != status)
363 if (pSensorHandle == NULL)
378 if (ARM_DRIVER_OK != status)
void(* set_pin)(pinID_t aPinId)
The fxls896x_drv.h file describes the FXLS8964/67AF driver interface and structures.
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.
This structure defines the Write command List.
GENERIC_DRIVER_GPIO * pGPIODriver
ARM_DRIVER_SPI * pCommDrv
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.
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.
void BOARD_DELAY_ms(uint32_t delay_ms)
Function to insert delays.
int32_t FXLS896x_I2C_Initialize(fxls896x_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t *whoami)
The interface function to initialize the sensor.
This defines the sensor specific information for SPI.
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.
Access structure of the GPIO Driver.
registerDeviceInfo_t deviceInfo
#define FXLS896x_TBOOT_MAX
#define SPI_SS_ACTIVE_LOW
#define FXLS896x_SENS_CONFIG1_ACTIVE_STANDBY
int32_t FXLS896x_I2C_DeInit(fxls896x_i2c_sensorhandle_t *pSensorHandle)
The interface function to De Initialize sensor..
void(* clr_pin)(pinID_t aPinId)
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
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.
#define FXLS8967_WHOAMI_VALUE
uint8_t fxls896x_spiWrite_CmdDataBuffer[FXLS896x_SPI_MAX_MSG_SIZE]
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.
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
#define FXLS896x_SPI_MAX_MSG_SIZE
#define FXLS896x_SPI_CMD_LEN
The size of the Sensor specific SPI Header.
fpSpiReadPreprocessFn_t pReadPreprocessFN
The SPI Slave Transfer Command Params SDK2.0 Driver.
GENERIC_DRIVER_GPIO Driver_GPIO_KSDK
This defines the sensor specific information for I2C.
int32_t FXLS896x_SPI_Initialize(fxls896x_spi_sensorhandle_t *pSensorHandle, ARM_DRIVER_SPI *pBus, uint8_t index, void *pSlaveSelect, uint8_t *whoami)
The interface function to initialize the sensor.
int32_t FXLS896x_I2C_Configure(fxls896x_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
#define FXLS896x_SENS_CONFIG1_RST_RST
int32_t FXLS896x_I2C_ReadData(fxls896x_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
void FXLS896x_SPI_ReadPreprocess(void *pCmdOut, uint32_t offset, uint32_t size)
The SPI Read Pre-Process function to generate Sensor specific SPI Message Header. ...
ARM_DRIVER_I2C * pCommDrv
registerDeviceInfo_t deviceInfo
uint8_t fxls896x_spiRead_DataBuffer[FXLS896x_SPI_MAX_MSG_SIZE]
void FXLS896x_I2C_SetIdleTask(fxls896x_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
void FXLS896x_SPI_SetIdleTask(fxls896x_spi_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the SPI Idle Task.
fpSpiWritePreprocessFn_t pWritePreprocessFN
void(* pin_init)(pinID_t aPinId, gpio_direction_t dir, void *apPinConfig, gpio_isr_handler_t aIsrHandler, void *apUserData)
This structure defines the Read command List.
#define FXLS896x_SENS_CONFIG1_RST_MASK
#define FXLS8974_WHOAMI_VALUE
#define FXLS896x_SENS_CONFIG1_ACTIVE_MASK
#define FXLS8968_WHOAMI_VALUE
int32_t Sensor_SPI_Write(ARM_DRIVER_SPI *pCommDrv, registerDeviceInfo_t *devInfo, void *pWriteParams, const registerwritelist_t *pRegWriteList)
Write register data to a sensor.
void FXLS896x_SPI_WritePreprocess(void *pCmdOut, uint32_t offset, uint32_t size, void *pWritebuffer)
The SPI Write Pre-Process function to generate Sensor specific SPI Message Header.
uint8_t fxls896x_spiRead_CmdBuffer[FXLS896x_SPI_MAX_MSG_SIZE]
int32_t FXLS896x_SPI_Configure(fxls896x_spi_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
#define FXLS8962_WHOAMI_VALUE
int32_t FXLS896x_SPI_ReadData(fxls896x_spi_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
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.
#define FXLS896x_SS_ACTIVE_VALUE
Is the Slave Select Pin Active Low or High.
spiSlaveSpecificParams_t slaveParams
registeridlefunction_t idleFunction
#define FXLS8964_WHOAMI_VALUE
int32_t FXLS896x_SPI_Deinit(fxls896x_spi_sensorhandle_t *pSensorHandle)
The interface function to De Initialize sensor..
#define FXLS896x_SENS_CONFIG1_ACTIVE_ACTIVE