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

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

Go to the source code of this file.

Macros

#define FXLS896x_DATA_SIZE   6
 

Functions

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

Detailed Description

The fxls896xaf_interrupt.c file implements the ISSDK FXLS896xAF sensor driver example demonstration with interrupt mode.

Definition in file fxls896xaf_interrupt.c.

Macro Definition Documentation

◆ FXLS896x_DATA_SIZE

#define FXLS896x_DATA_SIZE   6

Definition at line 38 of file fxls896xaf_interrupt.c.

Referenced by main().

Function Documentation

◆ fxls896x_int_data_ready_callback()

void fxls896x_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 73 of file fxls896xaf_interrupt.c.

References gFxls896xDataReady.

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

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

Configure the FXLS896x sensor.

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

Read new raw sensor data from the FXLS896x.

Process the sample and convert the raw sensor data.

Definition at line 87 of file fxls896xaf_interrupt.c.

References fxls896x_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), data, Driver_GPIO_KSDK, FXLS8962_WHOAMI_VALUE, FXLS8964_WHOAMI_VALUE, FXLS8967_WHOAMI_VALUE, FXLS8968_WHOAMI_VALUE, FXLS896x_DATA_SIZE, FXLS896x_I2C_ADDR, FXLS896x_I2C_Configure(), FXLS896x_I2C_Initialize(), FXLS896x_I2C_ReadData(), FXLS896x_I2C_SetIdleTask(), FXLS896x_INT1, fxls896x_int_data_ready_callback(), fxls896xDriver, FXLS8974_WHOAMI_VALUE, gFxls896xDataReady, 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

◆ cFxls896xConfigNormal

const registerwritelist_t cFxls896xConfigNormal[]
Initial value:

Register settings for Interrupt (non buffered) mode.

Definition at line 44 of file fxls896xaf_interrupt.c.

◆ cFxls896xOutputNormal

const registerreadlist_t cFxls896xOutputNormal[]
Initial value:
= {{.readFrom = FXLS896x_OUT_X_LSB, .numBytes = FXLS896x_DATA_SIZE},
#define FXLS896x_DATA_SIZE
#define __END_READ_DATA__
Definition: sensor_drv.h:51

Address of Raw Accel Data in Normal Mode.

Definition at line 54 of file fxls896xaf_interrupt.c.

◆ gFxls896xDataReady

volatile bool gFxls896xDataReady = false

Definition at line 60 of file fxls896xaf_interrupt.c.

Referenced by fxls896x_int_data_ready_callback(), and main().