![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The fxls8962_fifo_spi.c file implements the ISSDK FXLS8962 SPI sensor driver example demonstration for FIFO Mode. More...
#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 "fxls8962_drv.h"
#include "systick_utils.h"
#include "Driver_SPI.h"
Go to the source code of this file.
Macros | |
#define | FXLS8962_DATA_SIZE (6) |
#define | FXLS8962_FIFO_WMRK_SIZE (16) |
Functions | |
void | fxls8962_int_data_ready_callback (void *pUserData) |
The Data ready ISR callback function. More... | |
int | main (void) |
Main function. More... | |
Variables | |
const registerwritelist_t | cFxls8962ConfigFIFO [] |
Register settings for FIFO (buffered) mode. More... | |
const registerreadlist_t | cFxls8962OutputFIF0 [] |
Address of Raw Accel Data in FIFO Mode. More... | |
volatile bool | gFxls8962DataReady = false |
The fxls8962_fifo_spi.c file implements the ISSDK FXLS8962 SPI sensor driver example demonstration for FIFO Mode.
Definition in file fxls8962_fifo_spi.c.
#define FXLS8962_DATA_SIZE (6) |
Definition at line 39 of file fxls8962_fifo_spi.c.
Referenced by main().
#define FXLS8962_FIFO_WMRK_SIZE (16) |
Definition at line 40 of file fxls8962_fifo_spi.c.
Referenced by main().
void fxls8962_int_data_ready_callback | ( | void * | pUserData | ) |
The Data ready ISR callback function.
Set flag to indicate Sensor has signalled data ready.
Definition at line 74 of file fxls8962_fifo_spi.c.
References gFxls8962DataReady.
Referenced by main().
int main | ( | void | ) |
Main function.
Initialize the MCU hardware.
Initialize FXLS8962 pin used by FRDM board
Initialize RGB LED pin used by FRDM board
Initialize the SPI driver.
Set the SPI Power mode.
Set the SPI Slave speed.
Initialize FXLS8962 sensor driver.
Set the task to be executed while waiting for SPI 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.
Convert the raw sensor data to signed 16-bit container for display to the debug port.
Display to the debug port the last sample. NOTE: PRINTF is relatively expensive in terms of CPU time, specially when used with-in execution loop.
Definition at line 82 of file fxls8962_fifo_spi.c.
References fxls8962_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), data, Driver_GPIO_KSDK, FXLS8962_CS, FXLS8962_DATA_SIZE, FXLS8962_FIFO_WMRK_SIZE, FXLS8962_INT1, fxls8962_int_data_ready_callback(), FXLS8962_SPI_Configure(), FXLS8962_SPI_Initialize(), FXLS8962_SPI_ReadData(), FXLS8962_SPI_SetIdleTask(), FXLS8962_WHOAMI_VALUE, fxls8962Driver, gFxls8962DataReady, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, int32_t(), pGpioDriver, GENERIC_DRIVER_GPIO::pin_init, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), SMC_SetPowerModeWait(), SPI_S_BAUDRATE, SPI_S_DEVICE_INDEX, SPI_S_DRIVER, SPI_S_SIGNAL_EVENT, status, and GENERIC_DRIVER_GPIO::toggle_pin.
const registerwritelist_t cFxls8962ConfigFIFO[] |
Register settings for FIFO (buffered) mode.
Definition at line 46 of file fxls8962_fifo_spi.c.
const registerreadlist_t cFxls8962OutputFIF0[] |
Address of Raw Accel Data in FIFO Mode.
Definition at line 60 of file fxls8962_fifo_spi.c.
volatile bool gFxls8962DataReady = false |
Definition at line 66 of file fxls8962_fifo_spi.c.
Referenced by fxls8962_int_data_ready_callback(), and main().