46 #include "clock_config.h" 47 #include "fsl_debug_console.h" 52 #include "issdk_hal.h" 53 #include "gpio_driver.h" 59 #include "Driver_SPI.h" 115 PRINTF(
"\r\n ISSDK FXLS8471Q sensor driver example demonstration with fifo mode\r\n");
119 if (ARM_DRIVER_OK != status)
121 PRINTF(
"\r\n SPI Initialization Failed\r\n");
126 status = pSPIdriver->PowerControl(ARM_POWER_FULL);
127 if (ARM_DRIVER_OK != status)
129 PRINTF(
"\r\n SPI Power Mode setting Failed\r\n");
134 status = pSPIdriver->Control(ARM_SPI_MODE_MASTER | ARM_SPI_CPOL0_CPHA0,
SPI_S_BAUDRATE);
135 if (ARM_DRIVER_OK != status)
137 PRINTF(
"\r\n SPI Control Mode setting Failed\r\n");
146 PRINTF(
"\r\n FXLS8471Q Sensor Initialization Failed\r\n");
149 PRINTF(
"\r\n Successfully Initiliazed FXLS8471Q Sensor\r\n");
158 PRINTF(
"\r\n FXLS8471Q Sensor Configuration Failed, Err = %d\r\n", status);
161 PRINTF(
"\r\n Successfully Applied FXLS8471Q Sensor Configuration\r\n");
174 if (ARM_DRIVER_OK != status)
176 PRINTF(
"\r\nRead Failed.\r\n");
185 rawData.
accel[0] /= 4;
188 rawData.
accel[1] /= 4;
191 rawData.
accel[2] /= 4;
194 PRINTF(
"\r\n Accel X = %d Y = %d Z = %d \r\n", rawData.
accel[0], rawData.
accel[1], rawData.
accel[2]);
#define __END_WRITE_DATA__
The fxls8471q_drv.h file describes the fxls8471q driver interface and structures. ...
#define BOARD_BootClockRUN
int main(void)
This is the The main function implementation.
int32_t FXLS8471Q_SPI_Initialize(fxls8471q_spi_sensorhandle_t *pSensorHandle, ARM_DRIVER_SPI *pBus, uint8_t index, void *pSlaveSelect, uint8_t whoAmi)
The interface function to initialize the sensor for I2C.
uint8_t data[FXLS8962_DATA_SIZE]
#define FXLS8471Q_F_STATUS_F_WMRK_FLAG_MASK
const registerreadlist_t cFxls8471q_Output_Values[]
void BOARD_InitDebugConsole(void)
#define FXLS8471Q_CTRL_REG1_DR_MASK
#define FXLS8471Q_WHO_AM_I_WHOAMI_VALUE
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
#define FXLS8471Q_F_SETUP_F_MODE_FIFOSTOP
#define __END_READ_DATA__
void FXLS8471Q_SPI_SetIdleTask(fxls8471q_spi_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the SPI Idle Task.
#define FXLS8471Q_F_SETUP_F_WMRK_SHIFT
int32_t FXLS8471Q_SPI_ReadData(fxls8471q_spi_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
const registerwritelist_t cFxls8471q_Config_with_Fifo[]
#define ASK_USER_TO_RESUME(x)
#define SPI_S_DEVICE_INDEX
const registerreadlist_t cFxls8471q_Fifo_Event[]
This structure defines the fxls8471q raw data buffer.
#define FIFO_SIZE
The watermark value configured for FXLS8471Q FIFO Buffer.
#define FXLS8471Q_F_SETUP_F_MODE_MASK
#define FXLS8471Q_ACCEL_DATA_SIZE
The size of the FXLS8471Q accel data.
#define FXLS8471Q_F_SETUP_F_WMRK_MASK
This defines the sensor specific information for SPI.
int32_t FXLS8471Q_SPI_Configure(fxls8471q_spi_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
#define SPI_S_BAUDRATE
Transfer baudrate - 500k.
fxls8962_acceldataUser_t rawData
#define SPI_S_SIGNAL_EVENT
This structure defines the Write command List.
#define FXLS8471Q_CTRL_REG1_DR_12DOT5HZ
This structure defines the Read command List.
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
void BOARD_InitPins(void)
Configures pin routing and optionally pin electrical features.