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

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"
Include dependency graph for fxls8962_fifo_spi.c:

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
 

Detailed Description

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.

Macro Definition Documentation

◆ FXLS8962_DATA_SIZE

#define FXLS8962_DATA_SIZE   (6)

Definition at line 39 of file fxls8962_fifo_spi.c.

Referenced by main().

◆ FXLS8962_FIFO_WMRK_SIZE

#define FXLS8962_FIFO_WMRK_SIZE   (16)

Definition at line 40 of file fxls8962_fifo_spi.c.

Referenced by main().

Function Documentation

◆ fxls8962_int_data_ready_callback()

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().

Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:

Variable Documentation

◆ cFxls8962ConfigFIFO

const registerwritelist_t cFxls8962ConfigFIFO[]
Initial value:
= {
#define FXLS8962_BUF_CONFIG1_BUF_MODE_STOP_MODE
Definition: fxls8962.h:1055
#define FXLS8962_BUF_CONFIG1_BUF_MODE_MASK
Definition: fxls8962.h:1041
#define FXLS8962_INT_EN_BUF_EN_EN
Definition: fxls8962.h:859
#define FXLS8962_SENS_CONFIG1_FSR_2G
Definition: fxls8962.h:453
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define FXLS8962_SENS_CONFIG3_WAKE_ODR_MASK
Definition: fxls8962.h:551
#define FXLS8962_SENS_CONFIG3_WAKE_ODR_12_5HZ
Definition: fxls8962.h:565
#define FXLS8962_FIFO_WMRK_SIZE
#define FXLS8962_INT_EN_BUF_EN_MASK
Definition: fxls8962.h:847
#define FXLS8962_SENS_CONFIG1_FSR_MASK
Definition: fxls8962.h:423
#define FXLS8962_BUF_CONFIG2_BUF_WMRK_MASK
Definition: fxls8962.h:1091

Register settings for FIFO (buffered) mode.

Definition at line 46 of file fxls8962_fifo_spi.c.

◆ cFxls8962OutputFIF0

const registerreadlist_t cFxls8962OutputFIF0[]
Initial value:
= {
#define FXLS8962_DATA_SIZE
#define FXLS8962_FIFO_WMRK_SIZE
#define __END_READ_DATA__
Definition: sensor_drv.h:51

Address of Raw Accel Data in FIFO Mode.

Definition at line 60 of file fxls8962_fifo_spi.c.

◆ gFxls8962DataReady

volatile bool gFxls8962DataReady = false

Definition at line 66 of file fxls8962_fifo_spi.c.

Referenced by fxls8962_int_data_ready_callback(), and main().