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

Go to the source code of this file.

Macros

#define FXLS8964_DATA_SIZE   6
 
#define FXLS8964_STANDBY_MODE   0
 
#define FXLS8964_ACTIVE_MODE   1
 

Functions

void fxls896x_int_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 cFxls896xAwsConfig []
 Register settings for configuring SDCD-OT for tap-detection and Auto-Wake/Sleep in interrupt mode. More...
 
const registerreadlist_t cFxls896xReadSysMode [] = {{.readFrom = FXLS896x_SYS_MODE, .numBytes = 1}, __END_READ_DATA__}
 Read register list to read SysMode Register. More...
 
const registerreadlist_t cFxls896xReadIntStatus [] = {{.readFrom = FXLS896x_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}
 Read register list to read INT_STATUS Register. More...
 
volatile bool gFxls896xIntFlag = false
 
ARM_DRIVER_I2C * I2Cdrv = &I2C_S_DRIVER
 
fxls896x_i2c_sensorhandle_t fxls896xDriver
 
GENERIC_DRIVER_GPIOpGpioDriver = &Driver_GPIO_KSDK
 

Macro Definition Documentation

◆ FXLS8964_ACTIVE_MODE

#define FXLS8964_ACTIVE_MODE   1

Definition at line 40 of file fxls896xaf_motion_wakeup.c.

◆ FXLS8964_DATA_SIZE

#define FXLS8964_DATA_SIZE   6

Definition at line 38 of file fxls896xaf_motion_wakeup.c.

◆ FXLS8964_STANDBY_MODE

#define FXLS8964_STANDBY_MODE   0

Definition at line 39 of file fxls896xaf_motion_wakeup.c.

Function Documentation

◆ fxls896x_int_callback()

void fxls896x_int_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.

void There is no return value.

Set flag to indicate Sensor has signalled data ready.

Definition at line 95 of file fxls896xaf_motion_wakeup.c.

References gFxls896xIntFlag.

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.

void There is no return value.

Initialize the MCU hardware.

Initialize FXLS8964 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.

Read new raw sensor data from the FXLS8964.

Wake Mode Detected.

Definition at line 107 of file fxls896xaf_motion_wakeup.c.

References BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), GENERIC_DRIVER_GPIO::clr_pin, FXLS8962_WHOAMI_VALUE, FXLS8964_WHOAMI_VALUE, FXLS8967_WHOAMI_VALUE, FXLS8968_WHOAMI_VALUE, FXLS896x_I2C_ADDR, FXLS896x_I2C_Configure(), FXLS896x_I2C_Initialize(), FXLS896x_I2C_ReadData(), FXLS896x_I2C_SetIdleTask(), FXLS896x_INT1, fxls896x_int_callback(), FXLS896x_SYS_MODE_SYS_MODE_WAKE, FXLS8974_WHOAMI_VALUE, gFxls896xIntFlag, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), GENERIC_DRIVER_GPIO::pin_init, RED_LED, SENSOR_ERROR_NONE, GENERIC_DRIVER_GPIO::set_pin, SMC, SMC_SetPowerModeVlpr(), SMC_SetPowerModeWait(), and status.

Here is the call graph for this function:

Variable Documentation

◆ cFxls896xAwsConfig

const registerwritelist_t cFxls896xAwsConfig[]
Initial value:
= {
#define FXLS896x_SENS_CONFIG1_FSR_4G
Definition: fxls896x.h:455
#define FXLS896x_SENS_CONFIG3_WAKE_ODR_400HZ
Definition: fxls896x.h:560
#define FXLS896x_SDCD_CONFIG2_SDCD_EN_EN
Definition: fxls896x.h:1628
#define FXLS896x_INT_PIN_SEL_WK_OUT_INT2_DIS
Definition: fxls896x.h:968
#define FXLS896x_SENS_CONFIG4_INT_POL_MASK
Definition: fxls896x.h:618
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define FXLS896x_INT_EN_WAKE_OUT_EN_MASK
Definition: fxls896x.h:829
#define FXLS896x_SDCD_CONFIG2_SDCD_EN_MASK
Definition: fxls896x.h:1621
#define FXLS896x_SDCD_CONFIG1_X_OT_EN_MASK
Definition: fxls896x.h:1526
#define FXLS896x_SDCD_CONFIG1_Y_OT_EN_EN
Definition: fxls896x.h:1552
#define FXLS896x_SDCD_CONFIG1_OT_ELE_MASK
Definition: fxls896x.h:1532
#define FXLS896x_SENS_CONFIG3_SLEEP_ODR_MASK
Definition: fxls896x.h:548
#define FXLS896x_SENS_CONFIG1_FSR_MASK
Definition: fxls896x.h:423
#define FXLS896x_SDCD_CONFIG1_Y_OT_EN_MASK
Definition: fxls896x.h:1523
#define FXLS896x_SENS_CONFIG4_WK_SDCD_OT_MASK
Definition: fxls896x.h:633
#define FXLS896x_SDCD_CONFIG2_REF_UPDM_SDCD_REF
Definition: fxls896x.h:1633
#define FXLS896x_SENS_CONFIG4_WK_SDCD_OT_EN
Definition: fxls896x.h:655
#define FXLS896x_SENS_CONFIG3_SLEEP_ODR_6_25HZ
Definition: fxls896x.h:579
#define FXLS896x_SDCD_CONFIG1_X_OT_EN_EN
Definition: fxls896x.h:1548
#define FXLS896x_INT_PIN_SEL_WK_OUT_INT2_MASK
Definition: fxls896x.h:913
#define FXLS896x_SDCD_CONFIG2_REF_UPDM_MASK
Definition: fxls896x.h:1618
#define FXLS896x_SDCD_CONFIG1_Z_OT_EN_MASK
Definition: fxls896x.h:1520
#define FXLS896x_SENS_CONFIG4_INT_POL_ACT_HIGH
Definition: fxls896x.h:680
#define FXLS896x_SDCD_CONFIG1_Z_OT_EN_EN
Definition: fxls896x.h:1556
#define FXLS896x_SDCD_CONFIG1_OT_ELE_DIS
Definition: fxls896x.h:1538
#define FXLS896x_SENS_CONFIG3_WAKE_ODR_MASK
Definition: fxls896x.h:551
#define FXLS896x_INT_EN_WAKE_OUT_EN_EN
Definition: fxls896x.h:876

Register settings for configuring SDCD-OT for tap-detection and Auto-Wake/Sleep in interrupt mode.

Definition at line 45 of file fxls896xaf_motion_wakeup.c.

◆ cFxls896xReadIntStatus

const registerreadlist_t cFxls896xReadIntStatus[] = {{.readFrom = FXLS896x_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}

Read register list to read INT_STATUS Register.

Definition at line 76 of file fxls896xaf_motion_wakeup.c.

◆ cFxls896xReadSysMode

const registerreadlist_t cFxls896xReadSysMode[] = {{.readFrom = FXLS896x_SYS_MODE, .numBytes = 1}, __END_READ_DATA__}

Read register list to read SysMode Register.

Definition at line 73 of file fxls896xaf_motion_wakeup.c.

◆ fxls896xDriver

Definition at line 84 of file fxls896xaf_motion_wakeup.c.

Referenced by main().

◆ gFxls896xIntFlag

volatile bool gFxls896xIntFlag = false

Definition at line 81 of file fxls896xaf_motion_wakeup.c.

Referenced by fxls896x_int_callback(), and main().

◆ I2Cdrv

ARM_DRIVER_I2C* I2Cdrv = &I2C_S_DRIVER

Definition at line 83 of file fxls896xaf_motion_wakeup.c.

Referenced by main().

◆ pGpioDriver

Definition at line 85 of file fxls896xaf_motion_wakeup.c.