![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
#include <stdio.h>
#include <stdint.h>
#include "diff_p.h"
#include "mma9553.h"
#include "mpl3115.h"
#include "mag3110.h"
#include "mma865x.h"
#include "fxls8962.h"
#include "fxpq3115.h"
#include "fxos8700.h"
#include "fxas21002.h"
#include "fxlc95000.h"
#include "fxls8471q.h"
#include "issdk_hal.h"
#include "gpio_driver.h"
#include "systick_utils.h"
#include "register_io_spi.h"
#include "register_io_i2c.h"
#include "auto_detection_shield.h"
#include "auto_detection_service.h"
#include "fsl_flashiap.h"
Go to the source code of this file.
Macros | |
#define | FXLS8471Q_SPI_CMD_LEN (2) |
These variables are specific to SPI access to the FXLS8471 for ADS. More... | |
#define | FXLS8471Q_SS_ACTIVE_VALUE SPI_SS_ACTIVE_LOW |
#define | FXLS8962_SPI_CMD_LEN (2) |
These variables are specific to SPI access to the FXLS8962 for ADS. More... | |
#define | FXLS8962_SS_ACTIVE_VALUE SPI_SS_ACTIVE_LOW |
#define | DIFF_P_SPI_CMD_LEN (1) |
These variables are specific to SPI access to the DIFF_P for ADS. More... | |
#define | DIFF_P_SS_ACTIVE_VALUE SPI_SS_ACTIVE_LOW |
#define | ADS_NVM_SECTOR_NUM (ADS_NVM_ADDR / FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES) |
#define | ADS_QUERY_NUM (sizeof(ADS_SensorQueryList) / sizeof(sensorAccess_t)) |
#define | ADS_NUM_BOARDS (sizeof(gADS_QueryMap) / ADS_QUERY_NUM) |
#define | SPI_MAX_MSG_SIZE (64) |
Functions | |
void | ADS_FXLS8471Q_SPI_ReadPreprocess (void *pCmdOut, uint32_t offset, uint32_t size) |
void | ADS_FXLS8471Q_SPI_WritePreprocess (void *pCmdOut, uint32_t offset, uint32_t size, void *pWritebuffer) |
void | ADS_InitSPI_FXLS8471 () |
ADS_Status_t | ADS_FXLS8471Query (uint8_t whoAmiAddr, uint8_t whoAmi) |
void | ADS_FXLS8962_SPI_ReadPreprocess (void *pCmdOut, uint32_t offset, uint32_t size) |
void | ADS_FXLS8962_SPI_WritePreprocess (void *pCmdOut, uint32_t offset, uint32_t size, void *pWritebuffer) |
void | ADS_InitSPI_FXLS8962 () |
ADS_Status_t | ADS_FXLS8962Query (uint8_t whoAmiAddr, uint8_t whoAmi) |
void | ADS_DIFF_P_SPI_ReadPreprocess (void *pCmdOut, uint32_t offset, uint32_t size) |
void | ADS_DIFF_P_SPI_WritePreprocess (void *pCmdOut, uint32_t offset, uint32_t size, void *pWritebuffer) |
void | ADS_InitSPI_DIFF_P () |
ADS_Status_t | ADS_DIFF_PQuery (uint8_t whoAmiAddr, uint8_t whoAmi) |
ADS_Status_t | ADS_FXLC95000Query () |
ADS_Status_t | ADS_MMA9553Query () |
int | ADS_InitI2CBuses () |
int | ADS_InitSPIBus () |
int | ADS_DeInitI2CBuses () |
int | ADS_DeInitSPIBus () |
int | ADS_DetectShield (char *pShieldString, size_t bufferLength) |
int | ADS_DetectLPC (char *pBoardString, size_t bufferLength) |
ADS_FlashStatus_t | ADS_FlashCompare (char *pResultString) |
ADS_Status_t | ADS_FlashUpdate (char *pResultString) |
void | BOARD_RunADS (const char *appName, char *boardString, char *shieldString, size_t bufferLength) |
The function to register Application Name and initialte ADS. More... | |
Variables | |
const uint8_t | ReadVersionInfo_MMA9553 [4] = {0x00, 0x00, 0x00, 0x0C} |
The Read Version Info Command for FXLC95000. More... | |
const mcuDEVID_t | ADS_ValidDEVIDValues [] |
This constant data structure contains the expected valid MCU Device ID combinations. Refer : LPC5411x User manual - UM10914, Section: 33.5.12. More... | |
const sensorAccess_t | ADS_SensorQueryList [] |
This constant data structure contains the expected valid comm/sensor/who_am_i combinations. More... | |
const ADS_Status_t | gADS_QueryMap [][ADS_QUERY_NUM] |
These are the expected query signatures for the shield boards. More... | |
ADS_Status_t | gADS_QueryResults [ADS_QUERY_NUM] |
This global contains the results from the sensor query. More... | |
char | ADS_ShieldList [][ADS_MAX_STRING_LENGTH] |
ARM_DRIVER_SPI * | SPIdrv = &SPI_S_DRIVER |
These values hold the ARM CMSIS Driver interface pointers. More... | |
ARM_DRIVER_I2C * | I2CextDrv = &I2C_S1_DRIVER |
GENERIC_DRIVER_GPIO * | pGPIODriver = &Driver_GPIO_KSDK |
spiSlaveSpecificParams_t | spiParams_8471 |
spiSlaveSpecificParams_t | spiParams_8962 |
spiSlaveSpecificParams_t | spiParams_diff_p |
uint8_t | spiRead_CmdBuffer [SPI_MAX_MSG_SIZE] = {0} |
uint8_t | spiRead_DataBuffer [SPI_MAX_MSG_SIZE] = {0} |
uint8_t | spiWrite_CmdDataBuffer [SPI_MAX_MSG_SIZE] = {0} |
#define ADS_NUM_BOARDS (sizeof(gADS_QueryMap) / ADS_QUERY_NUM) |
Definition at line 63 of file auto_detection_service.c.
Referenced by ADS_DetectShield().
#define ADS_NVM_SECTOR_NUM (ADS_NVM_ADDR / FSL_FEATURE_SYSCON_FLASH_SECTOR_SIZE_BYTES) |
Definition at line 60 of file auto_detection_service.c.
Referenced by ADS_FlashUpdate().
#define ADS_QUERY_NUM (sizeof(ADS_SensorQueryList) / sizeof(sensorAccess_t)) |
Definition at line 62 of file auto_detection_service.c.
Referenced by ADS_DetectShield().
#define DIFF_P_SPI_CMD_LEN (1) |
These variables are specific to SPI access to the DIFF_P for ADS.
Definition at line 58 of file auto_detection_service.c.
Referenced by ADS_DIFF_P_SPI_ReadPreprocess(), ADS_DIFF_P_SPI_WritePreprocess(), and ADS_InitSPI_DIFF_P().
#define DIFF_P_SS_ACTIVE_VALUE SPI_SS_ACTIVE_LOW |
Definition at line 59 of file auto_detection_service.c.
Referenced by ADS_InitSPI_DIFF_P().
#define FXLS8471Q_SPI_CMD_LEN (2) |
These variables are specific to SPI access to the FXLS8471 for ADS.
Definition at line 46 of file auto_detection_service.c.
Referenced by ADS_FXLS8471Q_SPI_ReadPreprocess(), ADS_FXLS8471Q_SPI_WritePreprocess(), and ADS_InitSPI_FXLS8471().
#define FXLS8471Q_SS_ACTIVE_VALUE SPI_SS_ACTIVE_LOW |
Definition at line 47 of file auto_detection_service.c.
Referenced by ADS_InitSPI_FXLS8471().
#define FXLS8962_SPI_CMD_LEN (2) |
These variables are specific to SPI access to the FXLS8962 for ADS.
Definition at line 52 of file auto_detection_service.c.
Referenced by ADS_FXLS8962_SPI_ReadPreprocess(), ADS_FXLS8962_SPI_WritePreprocess(), and ADS_InitSPI_FXLS8962().
#define FXLS8962_SS_ACTIVE_VALUE SPI_SS_ACTIVE_LOW |
Definition at line 53 of file auto_detection_service.c.
Referenced by ADS_InitSPI_FXLS8962().
#define SPI_MAX_MSG_SIZE (64) |
Definition at line 64 of file auto_detection_service.c.
int ADS_DeInitI2CBuses | ( | ) |
De-Initialize the External I2C driver.
Definition at line 655 of file auto_detection_service.c.
References I2CextDrv, int32_t(), and status.
Referenced by ADS_DetectShield().
int ADS_DeInitSPIBus | ( | ) |
De-Initialize the SPI0 driver.
Definition at line 669 of file auto_detection_service.c.
References int32_t(), SPIdrv, and status.
Referenced by ADS_DetectShield().
int ADS_DetectLPC | ( | char * | pBoardString, |
size_t | bufferLength | ||
) |
Definition at line 802 of file auto_detection_service.c.
References ADS_LPC_54113J128, ADS_LPC_54113J256, ADS_LPC_54114J256, ADS_NO_BOARD_DETECTED, ADS_ValidDEVIDValues, mcuDEVID_t::board, int32_t(), mcuDEVID_t::mcuDeviceId, and status.
Referenced by BOARD_RunADS().
int ADS_DetectShield | ( | char * | pShieldString, |
size_t | bufferLength | ||
) |
Definition at line 684 of file auto_detection_service.c.
References ADS_DeInitI2CBuses(), ADS_DeInitSPIBus(), ADS_DIFF_PQuery(), ADS_FAIL, ADS_FXLC95000Query(), ADS_FXLS8471Query(), ADS_FXLS8962Query(), ADS_I2C_EXT, ADS_InitI2CBuses(), ADS_InitSPI_DIFF_P(), ADS_InitSPI_FXLS8471(), ADS_InitSPI_FXLS8962(), ADS_InitSPIBus(), ADS_MMA9553Query(), ADS_NO_SHIELD_DETECTED, ADS_NULL, ADS_NUM_BOARDS, ADS_OK, ADS_QUERY_NUM, ADS_ShieldList, ADS_SPI_DEV, registerDeviceInfo_t::deviceInstance, DIFF_P, FXLC95000, FXLS8471, FXLS8962, gADS_QueryMap, gADS_QueryResults, I2C_S1_DEVICE_INDEX, I2CextDrv, int32_t(), MMA9553, Register_I2C_Read(), and status.
Referenced by BOARD_RunADS().
void ADS_DIFF_P_SPI_ReadPreprocess | ( | void * | pCmdOut, |
uint32_t | offset, | ||
uint32_t | size | ||
) |
Definition at line 468 of file auto_detection_service.c.
References DIFF_P_SPI_CMD_LEN, spi_mater_SlaveCmd::pReadBuffer, spi_mater_SlaveCmd::pWriteBuffer, spi_mater_SlaveCmd::size, spiRead_CmdBuffer, and spiRead_DataBuffer.
Referenced by ADS_InitSPI_DIFF_P().
void ADS_DIFF_P_SPI_WritePreprocess | ( | void * | pCmdOut, |
uint32_t | offset, | ||
uint32_t | size, | ||
void * | pWritebuffer | ||
) |
Definition at line 484 of file auto_detection_service.c.
References DIFF_P_SPI_CMD_LEN, spi_mater_SlaveCmd::pReadBuffer, spi_mater_SlaveCmd::pWriteBuffer, spi_mater_SlaveCmd::size, and spiWrite_CmdDataBuffer.
Referenced by ADS_InitSPI_DIFF_P().
ADS_Status_t ADS_DIFF_PQuery | ( | uint8_t | whoAmiAddr, |
uint8_t | whoAmi | ||
) |
Read and store the device's WHO_AM_I.
Definition at line 523 of file auto_detection_service.c.
References ADS_FAIL, ADS_OK, registerDeviceInfo_t::deviceInstance, int32_t(), Register_SPI_Read(), SPI_S_DEVICE_INDEX, SPIdrv, and status.
Referenced by ADS_DetectShield().
ADS_FlashStatus_t ADS_FlashCompare | ( | char * | pResultString | ) |
Definition at line 852 of file auto_detection_service.c.
References ADS_COOKIE_VALUE, ADS_FLASH_RECORD_CHANGE, ADS_FLASH_RECORD_NO_CHANGE, ADS_NO_FLASH_RECORD, ADS_NVM_ADDR, ADSFlashRecord_t::ADSString, ADSFlashRecord_t::cookie, ADSFlashRecord_t::length, and status.
Referenced by BOARD_RunADS().
ADS_Status_t ADS_FlashUpdate | ( | char * | pResultString | ) |
Definition at line 881 of file auto_detection_service.c.
References ADS_COOKIE_VALUE, ADS_FAIL, ADS_NVM_ADDR, ADS_NVM_SECTOR_NUM, ADS_OK, ADSFlashRecord_t::ADSString, ADSFlashRecord_t::cookie, ADSFlashRecord_t::length, and SystemCoreClock.
Referenced by BOARD_RunADS().
ADS_Status_t ADS_FXLC95000Query | ( | ) |
Definition at line 543 of file auto_detection_service.c.
References registerDeviceInfo_t::deviceInstance, FXLC95000_I2C_ADDR, I2C_S1_DEVICE_INDEX, I2CextDrv, int32_t(), Register_I2C_BlockWrite(), and status.
Referenced by ADS_DetectShield().
void ADS_FXLS8471Q_SPI_ReadPreprocess | ( | void * | pCmdOut, |
uint32_t | offset, | ||
uint32_t | size | ||
) |
Definition at line 314 of file auto_detection_service.c.
References FXLS8471Q_SPI_CMD_LEN, spi_mater_SlaveCmd::pReadBuffer, spi_mater_SlaveCmd::pWriteBuffer, spi_mater_SlaveCmd::size, spiRead_CmdBuffer, and spiRead_DataBuffer.
Referenced by ADS_InitSPI_FXLS8471().
void ADS_FXLS8471Q_SPI_WritePreprocess | ( | void * | pCmdOut, |
uint32_t | offset, | ||
uint32_t | size, | ||
void * | pWritebuffer | ||
) |
Definition at line 331 of file auto_detection_service.c.
References FXLS8471Q_SPI_CMD_LEN, spi_mater_SlaveCmd::pReadBuffer, spi_mater_SlaveCmd::pWriteBuffer, spi_mater_SlaveCmd::size, and spiWrite_CmdDataBuffer.
Referenced by ADS_InitSPI_FXLS8471().
ADS_Status_t ADS_FXLS8471Query | ( | uint8_t | whoAmiAddr, |
uint8_t | whoAmi | ||
) |
Read and store the device's WHO_AM_I.
Definition at line 371 of file auto_detection_service.c.
References ADS_FAIL, ADS_OK, registerDeviceInfo_t::deviceInstance, int32_t(), Register_SPI_Read(), SPI_S_DEVICE_INDEX, SPIdrv, and status.
Referenced by ADS_DetectShield().
void ADS_FXLS8962_SPI_ReadPreprocess | ( | void * | pCmdOut, |
uint32_t | offset, | ||
uint32_t | size | ||
) |
Definition at line 391 of file auto_detection_service.c.
References FXLS8962_SPI_CMD_LEN, spi_mater_SlaveCmd::pReadBuffer, spi_mater_SlaveCmd::pWriteBuffer, spi_mater_SlaveCmd::size, spiRead_CmdBuffer, and spiRead_DataBuffer.
Referenced by ADS_InitSPI_FXLS8962().
void ADS_FXLS8962_SPI_WritePreprocess | ( | void * | pCmdOut, |
uint32_t | offset, | ||
uint32_t | size, | ||
void * | pWritebuffer | ||
) |
Definition at line 408 of file auto_detection_service.c.
References FXLS8962_SPI_CMD_LEN, spi_mater_SlaveCmd::pReadBuffer, spi_mater_SlaveCmd::pWriteBuffer, spi_mater_SlaveCmd::size, and spiWrite_CmdDataBuffer.
Referenced by ADS_InitSPI_FXLS8962().
ADS_Status_t ADS_FXLS8962Query | ( | uint8_t | whoAmiAddr, |
uint8_t | whoAmi | ||
) |
Read and store the device's WHO_AM_I.
Definition at line 448 of file auto_detection_service.c.
References ADS_FAIL, ADS_OK, registerDeviceInfo_t::deviceInstance, int32_t(), Register_SPI_Read(), SPI_S_DEVICE_INDEX, SPIdrv, and status.
Referenced by ADS_DetectShield().
int ADS_InitI2CBuses | ( | ) |
Initialize the External I2C driver.
Set the External I2C Power mode.
Set the External I2C bus speed.
Definition at line 599 of file auto_detection_service.c.
References I2C_S1_SIGNAL_EVENT, I2CextDrv, int32_t(), and status.
Referenced by ADS_DetectShield().
void ADS_InitSPI_DIFF_P | ( | ) |
Definition at line 503 of file auto_detection_service.c.
References ADS_DIFF_P_SPI_ReadPreprocess(), ADS_DIFF_P_SPI_WritePreprocess(), GENERIC_DRIVER_GPIO::clr_pin, DIFF_P_SPI_CMD_LEN, DIFF_P_SPI_CS, DIFF_P_SS_ACTIVE_VALUE, GPIO_DIRECTION_OUT, GENERIC_DRIVER_GPIO::pin_init, spiSlaveSpecificParams_t::pReadPreprocessFN, spiSlaveSpecificParams_t::pTargetSlavePinID, spiSlaveSpecificParams_t::pWritePreprocessFN, GENERIC_DRIVER_GPIO::set_pin, SPI_SS_ACTIVE_LOW, spiSlaveSpecificParams_t::spiCmdLen, and spiSlaveSpecificParams_t::ssActiveValue.
Referenced by ADS_DetectShield().
void ADS_InitSPI_FXLS8471 | ( | ) |
Definition at line 351 of file auto_detection_service.c.
References ADS_FXLS8471Q_SPI_ReadPreprocess(), ADS_FXLS8471Q_SPI_WritePreprocess(), GENERIC_DRIVER_GPIO::clr_pin, FXLS8471_SPI_CS, FXLS8471Q_SPI_CMD_LEN, FXLS8471Q_SS_ACTIVE_VALUE, GPIO_DIRECTION_OUT, GENERIC_DRIVER_GPIO::pin_init, spiSlaveSpecificParams_t::pReadPreprocessFN, spiSlaveSpecificParams_t::pTargetSlavePinID, spiSlaveSpecificParams_t::pWritePreprocessFN, GENERIC_DRIVER_GPIO::set_pin, SPI_SS_ACTIVE_LOW, spiSlaveSpecificParams_t::spiCmdLen, and spiSlaveSpecificParams_t::ssActiveValue.
Referenced by ADS_DetectShield().
void ADS_InitSPI_FXLS8962 | ( | ) |
Initialize the sensor handle.
Definition at line 428 of file auto_detection_service.c.
References ADS_FXLS8962_SPI_ReadPreprocess(), ADS_FXLS8962_SPI_WritePreprocess(), GENERIC_DRIVER_GPIO::clr_pin, FXLS8962_CS, FXLS8962_SPI_CMD_LEN, FXLS8962_SS_ACTIVE_VALUE, GPIO_DIRECTION_OUT, GENERIC_DRIVER_GPIO::pin_init, spiSlaveSpecificParams_t::pReadPreprocessFN, spiSlaveSpecificParams_t::pTargetSlavePinID, spiSlaveSpecificParams_t::pWritePreprocessFN, GENERIC_DRIVER_GPIO::set_pin, SPI_SS_ACTIVE_LOW, spiSlaveSpecificParams_t::spiCmdLen, and spiSlaveSpecificParams_t::ssActiveValue.
Referenced by ADS_DetectShield().
int ADS_InitSPIBus | ( | ) |
Initialize the SPI driver.
Set the SPI Power mode.
Set the SPI Slave speed.
Definition at line 627 of file auto_detection_service.c.
References int32_t(), SPI_S_BAUDRATE, SPI_S_SIGNAL_EVENT, SPIdrv, and status.
Referenced by ADS_DetectShield().
ADS_Status_t ADS_MMA9553Query | ( | ) |
Definition at line 572 of file auto_detection_service.c.
References ADS_FAIL, ADS_OK, BOARD_DELAY_ms(), registerDeviceInfo_t::deviceInstance, I2C_S1_DEVICE_INDEX, I2CextDrv, int32_t(), MMA9553_HDR_SIZE, MMA9553_I2C_ADDR, ReadVersionInfo_MMA9553, Register_I2C_BlockWrite(), Register_I2C_Read(), and status.
Referenced by ADS_DetectShield().
void BOARD_RunADS | ( | const char * | appName, |
char * | boardString, | ||
char * | shieldString, | ||
size_t | bufferLength | ||
) |
The function to register Application Name and initialte ADS.
The API will read the Application Name from the user and return the result string with the ADS detection results. It will also update the FLASH with the new results.
[in] | pAppName | - pointer to a buffer where the application name is placed. |
Definition at line 917 of file auto_detection_service.c.
Referenced by main().
const sensorAccess_t ADS_SensorQueryList[] |
This constant data structure contains the expected valid comm/sensor/who_am_i combinations.
Definition at line 85 of file auto_detection_service.c.
char ADS_ShieldList[][ADS_MAX_STRING_LENGTH] |
Definition at line 291 of file auto_detection_service.c.
Referenced by ADS_DetectShield().
const mcuDEVID_t ADS_ValidDEVIDValues[] |
This constant data structure contains the expected valid MCU Device ID combinations. Refer : LPC5411x User manual - UM10914, Section: 33.5.12.
Definition at line 76 of file auto_detection_service.c.
Referenced by ADS_DetectLPC(), and ADS_DetectQN().
const ADS_Status_t gADS_QueryMap[][ADS_QUERY_NUM] |
These are the expected query signatures for the shield boards.
Definition at line 104 of file auto_detection_service.c.
Referenced by ADS_DetectShield().
ADS_Status_t gADS_QueryResults[ADS_QUERY_NUM] |
This global contains the results from the sensor query.
Definition at line 289 of file auto_detection_service.c.
Referenced by ADS_DetectShield().
ARM_DRIVER_I2C* I2CextDrv = &I2C_S1_DRIVER |
Definition at line 301 of file auto_detection_service.c.
Referenced by ADS_DeInitI2CBuses(), ADS_DetectShield(), ADS_FXLC95000Query(), ADS_InitI2CBuses(), and ADS_MMA9553Query().
GENERIC_DRIVER_GPIO* pGPIODriver = &Driver_GPIO_KSDK |
Definition at line 302 of file auto_detection_service.c.
Referenced by FXAS21002_SPI_Initialize(), FXLC95000_SPI_Initialize(), FXLS8471Q_Init(), FXLS8471Q_SPI_Initialize(), FXLS8962_SPI_Initialize(), FXLS896x_SPI_Initialize(), FXLS8974_SPI_Initialize(), FXOS8700_SPI_Initialize(), and MMA9553_SPI_Initialize().
const uint8_t ReadVersionInfo_MMA9553[4] = {0x00, 0x00, 0x00, 0x0C} |
The Read Version Info Command for FXLC95000.
Definition at line 70 of file auto_detection_service.c.
Referenced by ADS_MMA9553Query().
ARM_DRIVER_SPI* SPIdrv = &SPI_S_DRIVER |
These values hold the ARM CMSIS Driver interface pointers.
Definition at line 300 of file auto_detection_service.c.
Referenced by ADS_DeInitSPIBus(), ADS_DIFF_PQuery(), ADS_FXLS8471Query(), ADS_FXLS8962Query(), and ADS_InitSPIBus().
spiSlaveSpecificParams_t spiParams_8471 |
Definition at line 304 of file auto_detection_service.c.
spiSlaveSpecificParams_t spiParams_8962 |
Definition at line 305 of file auto_detection_service.c.
spiSlaveSpecificParams_t spiParams_diff_p |
Definition at line 306 of file auto_detection_service.c.
uint8_t spiRead_CmdBuffer[SPI_MAX_MSG_SIZE] = {0} |
Definition at line 307 of file auto_detection_service.c.
Referenced by ADS_DIFF_P_SPI_ReadPreprocess(), ADS_FXLS8471Q_SPI_ReadPreprocess(), and ADS_FXLS8962_SPI_ReadPreprocess().
uint8_t spiRead_DataBuffer[SPI_MAX_MSG_SIZE] = {0} |
Definition at line 308 of file auto_detection_service.c.
Referenced by ADS_DIFF_P_SPI_ReadPreprocess(), ADS_FXLS8471Q_SPI_ReadPreprocess(), and ADS_FXLS8962_SPI_ReadPreprocess().
uint8_t spiWrite_CmdDataBuffer[SPI_MAX_MSG_SIZE] = {0} |
Definition at line 309 of file auto_detection_service.c.
Referenced by ADS_DIFF_P_SPI_WritePreprocess(), ADS_FXLS8471Q_SPI_WritePreprocess(), and ADS_FXLS8962_SPI_WritePreprocess().