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

The fxas21002_interrupt.c file implements the ISSDK FXAS21002 sensor driver example demonstration with interrupt mode. More...

#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 "gpio_driver.h"
#include "fxas21002_drv.h"
Include dependency graph for fxas21002_interrupt.c:

Go to the source code of this file.

Functions

void fxas21002_isr (void *pUserData)
 This is the Sensor Data Ready ISR implementation. More...
 
int main (void)
 This is the The main function implementation. More...
 

Variables

const registerwritelist_t fxas21002_Config_Isr []
 
const registerreadlist_t fxas21002_DRDY [] = {{.readFrom = FXAS21002_STATUS, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t fxas21002_Output_Values []
 
volatile bool fxas21002Interrupt = false
 

Detailed Description

The fxas21002_interrupt.c file implements the ISSDK FXAS21002 sensor driver example demonstration with interrupt mode.

Definition in file fxas21002_interrupt.c.

Function Documentation

◆ fxas21002_isr()

void fxas21002_isr ( void *  pUserData)

This is the Sensor Data Ready ISR implementation.


This function sets the flag which indicates if a new sample(s) is available for reading.

Parameters
[in]pUserDataThis is a void pointer to the instance of the user specific data structure for the ISR.
Returns
void There is no return value.
Constraints:
None

Yes

Set flag to indicate Sensor has signalled data ready.

Definition at line 70 of file fxas21002_interrupt.c.

References fxas21002Interrupt.

Referenced by main().

Here is the caller graph for this function:

◆ 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 INT1_FXAS21002 pin used by FRDM board

Initialize RGB LED pin used by FRDM board

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.

Clear the data ready flag, it will be set again by the ISR.

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 84 of file fxas21002_interrupt.c.

References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, Driver_GPIO_KSDK, FXAS21002_GYRO_DATA_SIZE, FXAS21002_I2C_ADDR, FXAS21002_I2C_Configure(), FXAS21002_I2C_Initialize(), FXAS21002_I2C_ReadData(), FXAS21002_I2C_SetIdleTask(), FXAS21002_INT1, fxas21002_isr(), FXAS21002_WHO_AM_I_WHOAMI_PROD_VALUE, fxas21002Interrupt, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, fxas21002_gyrodata_t::gyro, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), GENERIC_DRIVER_GPIO::pin_init, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), SMC_SetPowerModeWait(), status, and GENERIC_DRIVER_GPIO::toggle_pin.

Here is the call graph for this function:

Variable Documentation

◆ fxas21002_Config_Isr

const registerwritelist_t fxas21002_Config_Isr[]
Initial value:

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

Definition at line 39 of file fxas21002_interrupt.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 49 of file fxas21002_interrupt.c.

◆ fxas21002_Output_Values

const registerreadlist_t fxas21002_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 52 of file fxas21002_interrupt.c.

◆ fxas21002Interrupt

volatile bool fxas21002Interrupt = false

Definition at line 57 of file fxas21002_interrupt.c.

Referenced by fxas21002_isr(), and main().