ISSDK  1.8
IoT Sensing Software Development Kit
Macros | Functions | Variables
fxas21002_fifo.c File Reference
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_debug_console.h"
#include "Driver_I2C.h"
#include "issdk_hal.h"
#include "fxas21002_drv.h"
Include dependency graph for fxas21002_fifo.c:

Go to the source code of this file.

Macros

#define FIFO_SIZE   4
 The watermark value configured for FXAS21002 FIFO Buffer. More...
 

Functions

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

Variables

const registerwritelist_t fxas21002_Config_with_Fifo []
 
const registerreadlist_t fxas21002_Fifo_Event [] = {{.readFrom = FXAS21002_F_EVENT, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t fxas21002_Output_Values []
 

Macro Definition Documentation

◆ FIFO_SIZE

#define FIFO_SIZE   4

The watermark value configured for FXAS21002 FIFO Buffer.

Definition at line 35 of file fxas21002_fifo.c.

Referenced by main().

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 the FIFO watermark event.

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 63 of file fxas21002_fifo.c.

References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FIFO_SIZE, FXAS21002_F_EVENT_F_EVENT_MASK, FXAS21002_GYRO_DATA_SIZE, FXAS21002_I2C_ADDR, FXAS21002_I2C_Configure(), FXAS21002_I2C_Initialize(), FXAS21002_I2C_ReadData(), FXAS21002_WHO_AM_I_WHOAMI_PROD_VALUE, fxas21002_gyrodata_t::gyro, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), rawData, SENSOR_ERROR_NONE, and status.

Here is the call graph for this function:

Variable Documentation

◆ fxas21002_Config_with_Fifo

const registerwritelist_t fxas21002_Config_with_Fifo[]
Initial value:
= {
#define FIFO_SIZE
The watermark value configured for FXAS21002 FIFO Buffer.
#define FXAS21002_F_SETUP_F_MODE_STOP_MODE
Definition: fxas21002.h:282
#define FXAS21002_CTRL_REG3_WRAPTOONE_ROLL_DATA
Definition: fxas21002.h:848
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define FXAS21002_CTRL_REG3_WRAPTOONE_MASK
Definition: fxas21002.h:829
#define FXAS21002_F_SETUP_F_WMRK_SHIFT
Definition: fxas21002.h:271
#define FXAS21002_F_SETUP_F_WMRK_MASK
Definition: fxas21002.h:270
#define FXAS21002_CTRL_REG1_DR_MASK
Definition: fxas21002.h:684
#define FXAS21002_CTRL_REG1_DR_12_5HZ
Definition: fxas21002.h:710
#define FXAS21002_F_SETUP_F_MODE_MASK
Definition: fxas21002.h:273

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

Definition at line 41 of file fxas21002_fifo.c.

◆ fxas21002_Fifo_Event

const registerreadlist_t fxas21002_Fifo_Event[] = {{.readFrom = FXAS21002_F_EVENT, .numBytes = 1}, __END_READ_DATA__}

Prepare the register read list to read FXAS21002 FIFO event.

Definition at line 51 of file fxas21002_fifo.c.

◆ fxas21002_Output_Values

const registerreadlist_t fxas21002_Output_Values[]
Initial value:
= {
#define FIFO_SIZE
The watermark value configured for FXAS21002 FIFO Buffer.
#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 54 of file fxas21002_fifo.c.