![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The fxas21002_poll_spi.c file implements the ISSDK FXAS21002 SPI sensor driver example demonstration for SPI Mode with polling. More...
#include "board.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "fsl_debug_console.h"
#include "issdk_hal.h"
#include "gpio_driver.h"
#include "fxas21002_drv.h"
#include "Driver_SPI.h"
Go to the source code of this file.
Functions | |
int | main (void) |
This is the The main function implementation. More... | |
Variables | |
const registerwritelist_t | cFxas21002_Config_Normal [] |
const registerreadlist_t | cFxas21002_DataReady [] = {{.readFrom = FXAS21002_STATUS, .numBytes = 1}, __END_READ_DATA__} |
const registerreadlist_t | cFxas21002_Output_Values [] |
The fxas21002_poll_spi.c file implements the ISSDK FXAS21002 SPI sensor driver example demonstration for SPI Mode with polling.
Definition in file fxas21002_poll_spi.c.
int main | ( | void | ) |
This is the The main function implementation.
This function invokes board initializes routines, then then brings up the sensor and finally enters an endless loop to continuously read available samples.
[in] | void | This is no input parameter. |
Initialize the MCU hardware.
Initialize the SPI driver.
Set the SPI Power mode.
Set the SPI Slave speed.
Initialize the FXAS21002 sensor driver.
Set the task to be executed while waiting for SPI transactions to complete.
Configure the FXAS21002 sensor driver.
Wait for data ready from the FXAS21002.
Read the raw sensor data from the FXAS21002.
Convert the raw sensor data for display to the debug port.
Definition at line 62 of file fxas21002_poll_spi.c.
References BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FXAS21002_CS, FXAS21002_DR_STATUS_ZYXDR_MASK, FXAS21002_GYRO_DATA_SIZE, FXAS21002_SPI_Configure(), FXAS21002_SPI_Initialize(), FXAS21002_SPI_ReadData(), FXAS21002_SPI_SetIdleTask(), FXAS21002_WHO_AM_I_WHOAMI_PROD_VALUE, fxas21002_gyrodata_t::gyro, int32_t(), rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), SPI_S_BAUDRATE, SPI_S_DEVICE_INDEX, SPI_S_DRIVER, SPI_S_SIGNAL_EVENT, and status.
const registerwritelist_t cFxas21002_Config_Normal[] |
Prepare the register write list to configure FXAS21002 in non-FIFO mode.
Definition at line 38 of file fxas21002_poll_spi.c.
const registerreadlist_t cFxas21002_DataReady[] = {{.readFrom = FXAS21002_STATUS, .numBytes = 1}, __END_READ_DATA__} |
Prepare the register read list to read FXAS21002 DataReady status.
Definition at line 44 of file fxas21002_poll_spi.c.
const registerreadlist_t cFxas21002_Output_Values[] |
Prepare the register read list to read the raw gyro data from the FXAS21002.
Definition at line 47 of file fxas21002_poll_spi.c.