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

The fxls896xaf_spi.c file implements the ISSDK FXLS896xAF SPI sensor driver example demonstration for SPI Mode with polling. 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 "fxls896x_drv.h"
#include "systick_utils.h"
#include "Driver_SPI.h"
Include dependency graph for fxls896xaf_spi.c:

Go to the source code of this file.

Macros

#define FXLS896x_DATA_SIZE   (6)
 

Functions

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

Variables

const registerwritelist_t cFxls896xConfigNormal []
 Register settings for Normal (non buffered) mode. More...
 
const registerreadlist_t cFxls896xDRDYEvent [] = {{.readFrom = FXLS896x_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}
 Address of DATA Ready Status Register. More...
 
const registerreadlist_t cFxls896xOutputNormal []
 Address of Raw Accel Data in Normal Mode. More...
 

Detailed Description

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

Definition in file fxls896xaf_spi.c.

Macro Definition Documentation

◆ FXLS896x_DATA_SIZE

#define FXLS896x_DATA_SIZE   (6)

Definition at line 38 of file fxls896xaf_spi.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 fxls896x sensor driver.

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

Configure the FXLS896x sensor driver.

Wait for data ready from the FXLS896x.

Read the raw sensor data from the FXLS896x.

Convert the raw sensor data for display to the debug port.

Definition at line 70 of file fxls896xaf_spi.c.

References fxls896x_acceldata_t::accel, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), data, FXLS8962_WHOAMI_VALUE, FXLS8964_WHOAMI_VALUE, FXLS8967_WHOAMI_VALUE, FXLS8968_WHOAMI_VALUE, FXLS896x_CS, FXLS896x_DATA_SIZE, FXLS896x_INT_STATUS_SRC_DRDY_MASK, FXLS896x_SPI_Configure(), FXLS896x_SPI_Initialize(), FXLS896x_SPI_ReadData(), FXLS896x_SPI_SetIdleTask(), fxls896xDriver, FXLS8974_WHOAMI_VALUE, gFxls896xDataReady, int32_t(), rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), 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

◆ cFxls896xConfigNormal

const registerwritelist_t cFxls896xConfigNormal[]
Initial value:

Register settings for Normal (non buffered) mode.

Definition at line 44 of file fxls896xaf_spi.c.

◆ cFxls896xDRDYEvent

const registerreadlist_t cFxls896xDRDYEvent[] = {{.readFrom = FXLS896x_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}

Address of DATA Ready Status Register.

Definition at line 52 of file fxls896xaf_spi.c.

◆ cFxls896xOutputNormal

const registerreadlist_t cFxls896xOutputNormal[]
Initial value:
= {{.readFrom = FXLS896x_OUT_X_LSB, .numBytes = FXLS896x_DATA_SIZE},
#define __END_READ_DATA__
Definition: sensor_drv.h:51
#define FXLS896x_DATA_SIZE

Address of Raw Accel Data in Normal Mode.

Definition at line 55 of file fxls896xaf_spi.c.