![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The fxls8974cf_interrupt.c file implements the ISSDK FXLS8974CF 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 "fxls8974_drv.h"
#include "systick_utils.h"
Go to the source code of this file.
Macros | |
#define | FXLS8974_DATA_SIZE 6 |
Functions | |
void | fxls8974_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 | cFxls8974ConfigNormal [] |
Register settings for Interrupt (non buffered) mode. More... | |
const registerreadlist_t | cFxls8974OutputNormal [] |
Address of Raw Accel Data in Normal Mode. More... | |
volatile bool | gFxls8974DataReady = false |
The fxls8974cf_interrupt.c file implements the ISSDK FXLS8974CF sensor driver example demonstration with interrupt mode.
Definition in file fxls8974cf_interrupt.c.
#define FXLS8974_DATA_SIZE 6 |
Definition at line 38 of file fxls8974cf_interrupt.c.
Referenced by main().
void fxls8974_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 fxls8974cf_interrupt.c.
References gFxls8974DataReady.
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 FXLS8974 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 FXLS8974 sensor driver.
Set the task to be executed while waiting for I2C transactions to complete.
Configure the FXLS8974 sensor.
Clear the data ready flag, it will be set again by the ISR.
Read new raw sensor data from the FXLS8974.
Process the sample and convert the raw sensor data.
Definition at line 87 of file fxls8974cf_interrupt.c.
References fxls8974_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, FXLS8974_DATA_SIZE, FXLS8974_I2C_ADDR, FXLS8974_I2C_Configure(), FXLS8974_I2C_Initialize(), FXLS8974_I2C_ReadData(), FXLS8974_I2C_SetIdleTask(), FXLS8974_INT1, fxls8974_int_data_ready_callback(), FXLS8974_WHOAMI_VALUE, fxls8974Driver, gFxls8974DataReady, 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 cFxls8974ConfigNormal[] |
Register settings for Interrupt (non buffered) mode.
Definition at line 44 of file fxls8974cf_interrupt.c.
const registerreadlist_t cFxls8974OutputNormal[] |
Address of Raw Accel Data in Normal Mode.
Definition at line 54 of file fxls8974cf_interrupt.c.
volatile bool gFxls8974DataReady = false |
Definition at line 60 of file fxls8974cf_interrupt.c.
Referenced by fxls8974_int_data_ready_callback(), and main().