ISSDK  1.7
IoT Sensing Software Development Kit
Macros | Functions | Variables
fxls8471q_spi_fifo.c File Reference

The fxls8471q_fifo.c file implements the ISSDK FXLS8471Q sensor driver example demonstration for SPI mode with FIFOs. More...

#include "board.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "fsl_debug_console.h"
#include "issdk_hal.h"
#include "gpio_driver.h"
#include "fxls8471q_drv.h"
#include "Driver_SPI.h"
Include dependency graph for fxls8471q_spi_fifo.c:

Go to the source code of this file.

Macros

#define FIFO_SIZE   16
 The watermark value configured for FXLS8471Q FIFO Buffer. More...
 

Functions

int main (void)
 This is the The main function implementation. More...
 

Variables

const registerwritelist_t cFxls8471q_Config_with_Fifo []
 
const registerreadlist_t cFxls8471q_Fifo_Event [] = {{.readFrom = FXLS8471Q_F_STATUS, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t cFxls8471q_Output_Values []
 

Detailed Description

The fxls8471q_fifo.c file implements the ISSDK FXLS8471Q sensor driver example demonstration for SPI mode with FIFOs.

Definition in file fxls8471q_spi_fifo.c.

Macro Definition Documentation

◆ FIFO_SIZE

#define FIFO_SIZE   16

The watermark value configured for FXLS8471Q FIFO Buffer.

Definition at line 67 of file fxls8471q_spi_fifo.c.

Referenced by main().

Function Documentation

◆ 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.
Returns
void There is no return value.
Constraints:
None

No

Initialize the MCU hardware.

Initialize the SPI driver.

Set the SPI Power mode.

Set the SPI Slave speed.

Initialize the FXLS8471Q sensor driver.

Set the task to be executed while waiting for SPI transactions to complete.

Configure the FXLS8471Q sensor driver.

Wait for the FIFO watermark event.

Read the raw sensor data from the FXLS8471Q.

Convert the raw sensor data to signed 16-bit container for display to the debug port.

Definition at line 100 of file fxls8471q_spi_fifo.c.

References fxls8471q_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FIFO_SIZE, FXLS8471_SPI_CS, FXLS8471Q_ACCEL_DATA_SIZE, FXLS8471Q_F_STATUS_F_WMRK_FLAG_MASK, FXLS8471Q_SPI_Configure(), FXLS8471Q_SPI_Initialize(), FXLS8471Q_SPI_ReadData(), FXLS8471Q_SPI_SetIdleTask(), FXLS8471Q_WHO_AM_I_WHOAMI_VALUE, int32_t(), rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeWait(), SPI_S_BAUDRATE, SPI_S_DEVICE_INDEX, SPI_S_DRIVER, SPI_S_SIGNAL_EVENT, and status.

Here is the call graph for this function:

Variable Documentation

◆ cFxls8471q_Config_with_Fifo

const registerwritelist_t cFxls8471q_Config_with_Fifo[]
Initial value:
= {
#define __END_WRITE_DATA__
Definition: sensor_drv.h:71
#define FXLS8471Q_CTRL_REG1_DR_MASK
Definition: fxls8471q.h:1674
#define FXLS8471Q_F_SETUP_F_MODE_FIFOSTOP
Definition: fxls8471q.h:332
#define FXLS8471Q_F_SETUP_F_WMRK_SHIFT
Definition: fxls8471q.h:320
#define FIFO_SIZE
The watermark value configured for FXLS8471Q FIFO Buffer.
#define FXLS8471Q_F_SETUP_F_MODE_MASK
Definition: fxls8471q.h:322
#define FXLS8471Q_F_SETUP_F_WMRK_MASK
Definition: fxls8471q.h:319
#define FXLS8471Q_CTRL_REG1_DR_12DOT5HZ
Definition: fxls8471q.h:1695

Prepare the register write list to configure FXLS8471Q in FIFO mode.

Definition at line 73 of file fxls8471q_spi_fifo.c.

◆ cFxls8471q_Fifo_Event

const registerreadlist_t cFxls8471q_Fifo_Event[] = {{.readFrom = FXLS8471Q_F_STATUS, .numBytes = 1}, __END_READ_DATA__}

Prepare the register read list to read FXLS8471Q FIFO event.

Definition at line 82 of file fxls8471q_spi_fifo.c.

◆ cFxls8471q_Output_Values

const registerreadlist_t cFxls8471q_Output_Values[]
Initial value:
= {
#define __END_READ_DATA__
Definition: sensor_drv.h:77
#define FIFO_SIZE
The watermark value configured for FXLS8471Q FIFO Buffer.
#define FXLS8471Q_ACCEL_DATA_SIZE
The size of the FXLS8471Q accel data.
Definition: fxls8471q_drv.h:74

Prepare the register read list to read the raw accel data from the FXLS8471Q.

Definition at line 85 of file fxls8471q_spi_fifo.c.