ISSDK  1.8
IoT Sensing Software Development Kit
Functions | Variables
fxas21002_poll_spi.c File Reference

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"
Include dependency graph for fxas21002_poll_spi.c:

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 []
 

Detailed Description

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.

Function Documentation

◆ main()

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.

Parameters
[in]voidThis is no input parameter.
Returns
void There is no return value.
Constraints:
None

No

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.

Here is the call graph for this function:

Variable Documentation

◆ cFxas21002_Config_Normal

const registerwritelist_t cFxas21002_Config_Normal[]
Initial value:

Prepare the register write list to configure FXAS21002 in non-FIFO mode.

Definition at line 38 of file fxas21002_poll_spi.c.

◆ cFxas21002_DataReady

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.

◆ cFxas21002_Output_Values

const registerreadlist_t cFxas21002_Output_Values[]
Initial value:
= {
#define __END_READ_DATA__
Definition: sensor_drv.h:51
#define FXAS21002_GYRO_DATA_SIZE
The size of the FXAS21002 gyro data.
Definition: fxas21002_drv.h:61

Prepare the register read list to read the raw gyro data from the FXAS21002.

Definition at line 47 of file fxas21002_poll_spi.c.