![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
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"
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 |
The fxls896xaf_interrupt.c file implements the ISSDK FXLS896xAF sensor driver example demonstration with interrupt mode.
Definition in file fxls896xaf_interrupt.c.
#define FXLS896x_DATA_SIZE 6 |
Definition at line 38 of file fxls896xaf_interrupt.c.
Referenced by main().
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.
[in] | pUserData | This is a void pointer to the instance of the user specific data structure for the ISR. |
Set flag to indicate Sensor has signalled data ready.
Definition at line 73 of file fxls896xaf_interrupt.c.
References gFxls896xDataReady.
Referenced by 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.
[in] | void | This is no input parameter. |
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.
const registerwritelist_t cFxls896xConfigNormal[] |
Register settings for Interrupt (non buffered) mode.
Definition at line 44 of file fxls896xaf_interrupt.c.
const registerreadlist_t cFxls896xOutputNormal[] |
Address of Raw Accel Data in Normal Mode.
Definition at line 54 of file fxls896xaf_interrupt.c.
volatile bool gFxls896xDataReady = false |
Definition at line 60 of file fxls896xaf_interrupt.c.
Referenced by fxls896x_int_data_ready_callback(), and main().