![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
The fxlc95000_accel_spi.c file implements the ISSDK FXLC95000 sensor driver example demonstration as for SPI Mode. More...
#include "board.h"
#include "pin_mux.h"
#include "fsl_lptmr.h"
#include "clock_config.h"
#include "fsl_debug_console.h"
#include "issdk_hal.h"
#include "gpio_driver.h"
#include "fxlc95000_drv.h"
#include "systick_utils.h"
#include "Driver_SPI.h"
Go to the source code of this file.
Macros | |
#define | SAMPLING_RATE_us (100000) /* Timeout for the ODR Timer. */ |
#define | FXLC95000_SAMPLE_SIZE (10) /* 4-Byte timestamp and 2-Byte X,Y,Z Data each. */ |
#define | fxlc95000_odr_callback LPTMR0_IRQHandler /* Timer timeout Callback. */ |
Functions | |
void | fxlc95000_odr_callback (void) |
int | main (void) |
Main function. More... | |
Variables | |
const uint8_t | cFxlc95000_SetODR_Cmd [] |
const uint8_t | cFxlc95000_SetResolution_Cmd [] |
const uint8_t | cFxlc95000_SetRange_Cmd [] |
const registercommandlist_t | cFxlc95000ConfigMBox [] |
const registercommandlist_t | cFxlc95000ConfigSensor [] |
const registerreadlist_t | cFxlc95000ReadSample [] |
volatile bool | gFxlc95000DataRead |
The fxlc95000_accel_spi.c file implements the ISSDK FXLC95000 sensor driver example demonstration as for SPI Mode.
Definition in file fxlc95000_accel_spi.c.
#define fxlc95000_odr_callback LPTMR0_IRQHandler /* Timer timeout Callback. */ |
Definition at line 68 of file fxlc95000_accel_spi.c.
#define FXLC95000_SAMPLE_SIZE (10) /* 4-Byte timestamp and 2-Byte X,Y,Z Data each. */ |
Definition at line 67 of file fxlc95000_accel_spi.c.
Referenced by main().
#define SAMPLING_RATE_us (100000) /* Timeout for the ODR Timer. */ |
Definition at line 66 of file fxlc95000_accel_spi.c.
Referenced by main().
void fxlc95000_odr_callback | ( | void | ) |
Definition at line 110 of file fxlc95000_accel_spi.c.
References gFxlc95000DataRead.
int main | ( | void | ) |
Main function.
Initialize the MCU hardware.
Initialize the SPI driver.
Set the SPI Power mode.
Set the SPI Slave speed.
Initialize the FXLC95000 sensor driver.
Set the task to be executed while waiting for I2C transactions to complete.
Configure the FXLC95000 with MBox settings.
Configure the FXLC95000 with Sampling settings.
Read the raw sensor data from the FXLC95000.
Convert the raw bytes to sensor data with correct endianness.
Definition at line 119 of file fxlc95000_accel_spi.c.
References fxlc95000_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), data, FXLC95000_BUILD_ID, FXLC95000_PDB_B, FXLC95000_RST_GPIO, FXLC95000_SAMPLE_SIZE, FXLC95000_SPI_CommandResponse(), FXLC95000_SPI_Initialize(), FXLC95000_SPI_SetIdleTask(), FXLC95000_SSB_IO3, fxlc95000Driver, gFxlc95000DataRead, int32_t(), rawData, SAMPLING_RATE_us, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeWait(), SPI_S_BAUDRATE, SPI_S_DEVICE_INDEX, SPI_S_DRIVER, SPI_S_SIGNAL_EVENT, status, and fxlc95000_acceldata_t::timestamp.
const uint8_t cFxlc95000_SetODR_Cmd[] |
Create commands for setting FXLC95000L desired configuration.
Definition at line 74 of file fxlc95000_accel_spi.c.
const uint8_t cFxlc95000_SetRange_Cmd[] |
Definition at line 78 of file fxlc95000_accel_spi.c.
const uint8_t cFxlc95000_SetResolution_Cmd[] |
Definition at line 76 of file fxlc95000_accel_spi.c.
const registercommandlist_t cFxlc95000ConfigMBox[] |
Prepare the register write list to initialize FXLC95000L with desired MBox Settings.
Definition at line 82 of file fxlc95000_accel_spi.c.
const registercommandlist_t cFxlc95000ConfigSensor[] |
Prepare the register write list to configure FXLC95000L with desired Sampling Settings.
Definition at line 89 of file fxlc95000_accel_spi.c.
const registerreadlist_t cFxlc95000ReadSample[] |
Prepare the register read list to read the Timestamp and Accel data from FXLC95000.
Definition at line 98 of file fxlc95000_accel_spi.c.
volatile bool gFxlc95000DataRead |
Definition at line 104 of file fxlc95000_accel_spi.c.
Referenced by fxlc95000_odr_callback(), and main().