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

The fxls8974cf_spi.c file implements the ISSDK FXLS8974CF 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 "fxls8974_drv.h"
#include "systick_utils.h"
#include "Driver_SPI.h"
Include dependency graph for fxls8974cf_spi.c:

Go to the source code of this file.

Macros

#define FXLS8974_DATA_SIZE   (6)
 

Functions

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

Variables

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

Detailed Description

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

Definition in file fxls8974cf_spi.c.

Macro Definition Documentation

◆ FXLS8974_DATA_SIZE

#define FXLS8974_DATA_SIZE   (6)

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

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

Configure the FXLS8974 sensor driver.

Wait for data ready from the FXLS8974.

Read the raw sensor data from the FXLS8974.

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

Definition at line 70 of file fxls8974cf_spi.c.

References fxls8974_acceldata_t::accel, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), data, FXLS8962_WHOAMI_VALUE, FXLS8964_WHOAMI_VALUE, FXLS8967_WHOAMI_VALUE, FXLS8968_WHOAMI_VALUE, FXLS8974_CS, FXLS8974_DATA_SIZE, FXLS8974_INT_STATUS_SRC_DRDY_MASK, FXLS8974_SPI_Configure(), FXLS8974_SPI_Initialize(), FXLS8974_SPI_ReadData(), FXLS8974_SPI_SetIdleTask(), FXLS8974_WHOAMI_VALUE, fxls8974Driver, 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

◆ cfxls8974ConfigNormal

const registerwritelist_t cfxls8974ConfigNormal[]
Initial value:

Register settings for Normal (non buffered) mode.

Definition at line 44 of file fxls8974cf_spi.c.

◆ cfxls8974DRDYEvent

const registerreadlist_t cfxls8974DRDYEvent[] = {{.readFrom = FXLS8974_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}

Address of DATA Ready Status Register.

Definition at line 52 of file fxls8974cf_spi.c.

◆ cfxls8974OutputNormal

const registerreadlist_t cfxls8974OutputNormal[]
Initial value:
= {{.readFrom = FXLS8974_OUT_X_LSB, .numBytes = FXLS8974_DATA_SIZE},
#define __END_READ_DATA__
Definition: sensor_drv.h:51
#define FXLS8974_DATA_SIZE

Address of Raw Accel Data in Normal Mode.

Definition at line 55 of file fxls8974cf_spi.c.