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

The fxls8962_interrupt.c file implements the ISSDK FXLS8962 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 "fxls8962_drv.h"
#include "systick_utils.h"
Include dependency graph for fxls8962_interrupt.c:

Go to the source code of this file.

Macros

#define FXLS8962_DATA_SIZE   6
 

Functions

void fxls8962_int_data_ready_callback (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 cFxls8962ConfigNormal []
 Register settings for Interrupt (non buffered) mode. More...
 
const registerreadlist_t cFxls8962OutputNormal []
 Address of Raw Accel Data in Normal Mode. More...
 
volatile bool gFxls8962DataReady = false
 

Detailed Description

The fxls8962_interrupt.c file implements the ISSDK FXLS8962 sensor driver example demonstration with interrupt mode.

Definition in file fxls8962_interrupt.c.

Macro Definition Documentation

◆ FXLS8962_DATA_SIZE

#define FXLS8962_DATA_SIZE   6

Definition at line 39 of file fxls8962_interrupt.c.

Referenced by main().

Function Documentation

◆ fxls8962_int_data_ready_callback()

void fxls8962_int_data_ready_callback ( 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 74 of file fxls8962_interrupt.c.

References gFxls8962DataReady.

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 FXLS8962 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 FXLS8962 sensor driver.

Set the task to be executed while waiting for I2C transactions to complete.

Configure the FXLS8962 sensor.

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

Read new raw sensor data from the FXLS8962.

Process the sample and convert the raw sensor data.

Definition at line 88 of file fxls8962_interrupt.c.

References fxls8962_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), data, Driver_GPIO_KSDK, FXLS8962_DATA_SIZE, FXLS8962_I2C_ADDR, FXLS8962_I2C_Configure(), FXLS8962_I2C_Initialize(), FXLS8962_I2C_ReadData(), FXLS8962_I2C_SetIdleTask(), FXLS8962_INT1, fxls8962_int_data_ready_callback(), FXLS8962_WHOAMI_VALUE, fxls8962Driver, FXLS8964_WHOAMI_VALUE, FXLS8967_WHOAMI_VALUE, FXLS8974_WHOAMI_VALUE, gFxls8962DataReady, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), pGpioDriver, 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

◆ cFxls8962ConfigNormal

const registerwritelist_t cFxls8962ConfigNormal[]
Initial value:

Register settings for Interrupt (non buffered) mode.

Definition at line 45 of file fxls8962_interrupt.c.

◆ cFxls8962OutputNormal

const registerreadlist_t cFxls8962OutputNormal[]
Initial value:
= {{.readFrom = FXLS8962_OUT_X_LSB, .numBytes = FXLS8962_DATA_SIZE},
#define FXLS8962_DATA_SIZE
#define __END_READ_DATA__
Definition: sensor_drv.h:51

Address of Raw Accel Data in Normal Mode.

Definition at line 55 of file fxls8962_interrupt.c.

◆ gFxls8962DataReady

volatile bool gFxls8962DataReady = false

Definition at line 61 of file fxls8962_interrupt.c.

Referenced by fxls8962_int_data_ready_callback(), and main().