ISSDK  1.7
IoT Sensing Software Development Kit
Functions | Variables
fxas21002_poll.c File Reference

The fxas21002_poll.c file implements the ISSDK FXAS21002 sensor driver example demonstration with polling mode. More...

#include "board.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "fsl_debug_console.h"
#include "Driver_I2C.h"
#include "issdk_hal.h"
#include "fxas21002_drv.h"
Include dependency graph for fxas21002_poll.c:

Go to the source code of this file.

Functions

int main (void)
 Main function. More...
 

Variables

const registerwritelist_t fxas21002_Config_Normal []
 
const registerreadlist_t fxas21002_DRDY [] = {{.readFrom = FXAS21002_STATUS, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t fxas21002_Output_Values []
 

Detailed Description

The fxas21002_poll.c file implements the ISSDK FXAS21002 sensor driver example demonstration with polling mode.

Definition in file fxas21002_poll.c.

Function Documentation

◆ main()

int main ( void  )

Main function.

Initialize the MCU hardware.

Initialize the I2C driver.

Set the I2C Power mode.

Set the I2C bus speed.

Initialize the FXAS21002 sensor driver.

Set the task to be executed while waiting for I2C 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 to signed 16-bit container for display to the debug port.

Definition at line 76 of file fxas21002_poll.c.

References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FXAS21002_DR_STATUS_ZYXDR_MASK, FXAS21002_GYRO_DATA_SIZE, FXAS21002_I2C_ADDR, FXAS21002_I2C_Configure(), FXAS21002_I2C_Initialize(), FXAS21002_I2C_ReadData(), FXAS21002_I2C_SetIdleTask(), FXAS21002_WHO_AM_I_WHOAMI_PROD_VALUE, fxas21002_gyrodata_t::gyro, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, int32_t(), rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeWait(), and status.

Here is the call graph for this function:

Variable Documentation

◆ fxas21002_Config_Normal

const registerwritelist_t fxas21002_Config_Normal[]
Initial value:

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

Definition at line 58 of file fxas21002_poll.c.

◆ fxas21002_DRDY

const registerreadlist_t fxas21002_DRDY[] = {{.readFrom = FXAS21002_STATUS, .numBytes = 1}, __END_READ_DATA__}

Prepare the register read list to read FXAS21002 DataReady status.

Definition at line 64 of file fxas21002_poll.c.

◆ fxas21002_Output_Values

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

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

Definition at line 67 of file fxas21002_poll.c.