![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The fxlc95000_accel_i2c.c file implements the ISSDK FXLC95000 sensor driver example demonstration as for I2C Mode. More...
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_lptmr.h"
#include "fsl_debug_console.h"
#include "Driver_I2C.h"
#include "issdk_hal.h"
#include "fxlc95000_drv.h"
#include "systick_utils.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_i2c.c file implements the ISSDK FXLC95000 sensor driver example demonstration as for I2C Mode.
Definition in file fxlc95000_accel_i2c.c.
#define fxlc95000_odr_callback LPTMR0_IRQHandler /* Timer timeout Callback. */ |
Definition at line 35 of file fxlc95000_accel_i2c.c.
#define FXLC95000_SAMPLE_SIZE (10) /* 4-Byte timestamp and 2-Byte X,Y,Z Data each. */ |
Definition at line 34 of file fxlc95000_accel_i2c.c.
Referenced by main().
#define SAMPLING_RATE_us (100000) /* Timeout for the ODR Timer. */ |
Definition at line 33 of file fxlc95000_accel_i2c.c.
Referenced by main().
void fxlc95000_odr_callback | ( | void | ) |
Definition at line 77 of file fxlc95000_accel_i2c.c.
References gFxlc95000DataRead.
int main | ( | void | ) |
Main function.
Initialize the MCU hardware
Initialize the I2C driver.
Set the I2C Power mode.
Set the I2C bus 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 86 of file fxlc95000_accel_i2c.c.
References fxlc95000_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), data, FXLC95000_BUILD_ID, FXLC95000_I2C_ADDR, FXLC95000_I2C_CommandResponse(), FXLC95000_I2C_Initialize(), FXLC95000_I2C_SetIdleTask(), FXLC95000_SAMPLE_SIZE, fxlc95000Driver, gFxlc95000DataRead, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), rawData, SAMPLING_RATE_us, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), status, and fxlc95000_acceldata_t::timestamp.
const uint8_t cFxlc95000_SetODR_Cmd[] |
Create commands for setting FXLC95000L desired configuration.
Definition at line 41 of file fxlc95000_accel_i2c.c.
const uint8_t cFxlc95000_SetRange_Cmd[] |
Definition at line 45 of file fxlc95000_accel_i2c.c.
const uint8_t cFxlc95000_SetResolution_Cmd[] |
Definition at line 43 of file fxlc95000_accel_i2c.c.
const registercommandlist_t cFxlc95000ConfigMBox[] |
Prepare the register write list to initialize FXLC95000L with desired MBox Settings.
Definition at line 49 of file fxlc95000_accel_i2c.c.
const registercommandlist_t cFxlc95000ConfigSensor[] |
Prepare the register write list to configure FXLC95000L with desired Sampling Settings.
Definition at line 56 of file fxlc95000_accel_i2c.c.
const registerreadlist_t cFxlc95000ReadSample[] |
Prepare the register read list to read the Timestamp and Accel data from FXLC95000.
Definition at line 65 of file fxlc95000_accel_i2c.c.
volatile bool gFxlc95000DataRead |
Definition at line 71 of file fxlc95000_accel_i2c.c.
Referenced by fxlc95000_odr_callback(), and main().