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

The fxls8471q_poll_spi.c file implements the ISSDK FXLS8471Q sensor driver example demonstration for SPI Mode with polling. 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_poll.c:

Go to the source code of this file.

Functions

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

Variables

const registerwritelist_t cFxls8471q_Config_Normal []
 
const registerreadlist_t cFxls8471q_DataReady [] = {{.readFrom = FXLS8471Q_STATUS, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t cFxls8471q_Output_Values []
 

Detailed Description

The fxls8471q_poll_spi.c file implements the ISSDK FXLS8471Q sensor driver example demonstration for SPI Mode with polling.

Definition in file fxls8471q_spi_poll.c.

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 data ready from the FXLS8471Q.

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 89 of file fxls8471q_spi_poll.c.

References fxls8471q_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FXLS8471_SPI_CS, FXLS8471Q_ACCEL_DATA_SIZE, FXLS8471Q_SPI_Configure(), FXLS8471Q_SPI_Initialize(), FXLS8471Q_SPI_ReadData(), FXLS8471Q_SPI_SetIdleTask(), FXLS8471Q_STATUS_ZYXDR_MASK, FXLS8471Q_WHO_AM_I_WHOAMI_VALUE, gFxls8471qDataReady, 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_Normal

const registerwritelist_t cFxls8471q_Config_Normal[]
Initial value:

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

Definition at line 65 of file fxls8471q_spi_poll.c.

◆ cFxls8471q_DataReady

const registerreadlist_t cFxls8471q_DataReady[] = {{.readFrom = FXLS8471Q_STATUS, .numBytes = 1}, __END_READ_DATA__}

Prepare the register read list to read FXLS8471Q DataReady status.

Definition at line 71 of file fxls8471q_spi_poll.c.

◆ cFxls8471q_Output_Values

const registerreadlist_t cFxls8471q_Output_Values[]
Initial value:
= {
#define __END_READ_DATA__
Definition: sensor_drv.h:77
#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 74 of file fxls8471q_spi_poll.c.