![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
The fxls8962_demo.c file implements the ISSDK FXLS8962 sensor demo example demonstration with interrupt mode. More...
#include "board.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "Driver_I2C.h"
#include "Driver_USART.h"
#include "issdk_hal.h"
#include "gpio_driver.h"
#include "fxls8962_drv.h"
#include "host_io_uart.h"
#include "systick_utils.h"
#include "auto_detection_service.h"
Go to the source code of this file.
Data Structures | |
struct | fxls8962_acceldataUser_t |
This structure defines the fxls8962 raw data buffer. More... | |
Macros | |
#define | FXLS8962_DATA_SIZE 8 |
#define | FXLS8962_STREAM_DATA_SIZE 12 |
#define | FXLS8962_STREAM_SELF_TEST_SIZE 18 |
#define | APPLICATION_NAME "FXLS8962 Accelerometer Demo" |
Unique Name for this application which should match the target GUI pkg name. More... | |
#define | APPLICATION_VERSION "2.5" |
Version to distinguish between instances the same application based on target Shield and updates. More... | |
#define | HOST_CMD_RESET 6 /* 6 (Reset Sensor) */ |
#define | HOST_CMD_SELFTEST 7 /* 7 (Self Test Sensor) */ |
Functions | |
void | fxls8962_int_data_ready_callback (void *pUserData) |
bool | process_host_command (uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize) |
int | main (void) |
Main function. More... | |
The fxls8962_demo.c file implements the ISSDK FXLS8962 sensor demo example demonstration with interrupt mode.
Definition in file fxls8962_demo.c.
#define APPLICATION_NAME "FXLS8962 Accelerometer Demo" |
Unique Name for this application which should match the target GUI pkg name.
Definition at line 71 of file fxls8962_demo.c.
Referenced by main().
#define APPLICATION_VERSION "2.5" |
Version to distinguish between instances the same application based on target Shield and updates.
Definition at line 73 of file fxls8962_demo.c.
Referenced by main().
#define FXLS8962_DATA_SIZE 8 |
Definition at line 67 of file fxls8962_demo.c.
Referenced by main().
#define FXLS8962_STREAM_DATA_SIZE 12 |
Definition at line 68 of file fxls8962_demo.c.
Referenced by main().
#define FXLS8962_STREAM_SELF_TEST_SIZE 18 |
Definition at line 69 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
#define HOST_CMD_RESET 6 /* 6 (Reset Sensor) */ |
Definition at line 74 of file fxls8962_demo.c.
Referenced by process_host_command().
#define HOST_CMD_SELFTEST 7 /* 7 (Self Test Sensor) */ |
Definition at line 75 of file fxls8962_demo.c.
Referenced by process_host_command().
void fxls8962_int_data_ready_callback | ( | void * | pUserData | ) |
Set flag to indicate Sensor has signalled data ready.
Definition at line 212 of file fxls8962_demo.c.
References bFxls8962DataReady.
Referenced by main().
int main | ( | void | ) |
Main function.
Initialize the MCU hardware.
Initialize FXLS8962 pin used by FRDM board
Initialize RGB LED pin used by FRDM board
Initialize the I2C driver.
Set the I2C Power mode.
Set the I2C bus speed.
Initialize the UART driver.
Set the UART Power mode.
Set UART Baud Rate.
Initialize FXLS8962 sensor driver.
Set the task to be executed while waiting for I2C transactions to complete.
Configure the FXLS8962 sensor.
Initialize streaming and assign a Stream ID.
Populate streaming header.
Clear the data ready flag, it will be set again by the ISR.
Read new raw sensor data from the FXLS8962.
Convert the raw sensor data to signed 16-bit container for display to the debug port.
Clear the data ready flag, it will be set again by the ISR.
Read new raw sensor data from the FXLS8962.
Convert the raw sensor data to signed 16-bit container for display to the debug port.
Definition at line 404 of file fxls8962_demo.c.
References fxls8962_acceldataUser_t::accel, ADS_MAX_STRING_LENGTH, APPLICATION_NAME, APPLICATION_VERSION, bFxls8962DataReady, bFxls8962Ready, BOARD_BootClockRUN, BOARD_DEBUG_UART_BAUDRATE, BOARD_RunADS(), BOARD_SystickElapsedTime_us(), BOARD_SystickEnable(), boardString, bStreamingEnabled, GENERIC_DRIVER_GPIO::clr_pin, data, fxls8962_i2c_sensorhandle_t::deviceInfo, embAppName, FXAS21002_CS, FXLS8962_DATA_SIZE, FXLS8962_I2C_ADDR, FXLS8962_I2C_Configure(), FXLS8962_I2C_Initialize(), FXLS8962_I2C_ReadData(), FXLS8962_I2C_SetIdleTask(), FXLS8962_INT1, fxls8962_int_data_ready_callback(), FXLS8962_STREAM_DATA_SIZE, FXLS8962_STREAM_SELF_TEST_SIZE, FXLS8962_WHOAMI_VALUE, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, gStreamID, gSystick, HOST_FORMAT_HDLC, Host_IO_Add_ISO_Header(), Host_IO_Init(), Host_IO_Receive(), Host_IO_Send(), HOST_S_DRIVER, HOST_S_SIGNAL_EVENT, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, int32_t(), fxls8962_i2c_sensorhandle_t::pCommDrv, GENERIC_DRIVER_GPIO::pin_init, process_host_command(), Register_I2C_Write(), fxls8962_acceldataUser_t::sdcd, fxls8962_acceldataUser_t::selftest, SENSOR_ERROR_NONE, SHIELD_NAME, shieldString, SMC, SMC_SetPowerModeWait(), st_on, st_sample, st_xn, st_xp, st_yn, st_yp, st_zn, st_zp, status, STREAMING_HEADER_LEN, streamingPacket, streamingPacket1, fxls8962_acceldataUser_t::temp, fxls8962_acceldataUser_t::timestamp, and GENERIC_DRIVER_GPIO::toggle_pin.
bool process_host_command | ( | uint8_t | tag, |
uint8_t * | hostCommand, | ||
uint8_t * | hostResponse, | ||
size_t * | hostMsgSize, | ||
size_t | respBufferSize | ||
) |
Definition at line 218 of file fxls8962_demo.c.
References bFxls8962Ready, BOARD_SystickStart(), boardString, bStreamingEnabled, GENERIC_DRIVER_GPIO::clr_pin, embAppName, fsr_scale, FXLS8962_I2C_ADDR, FXLS8962_I2C_Configure(), FXLS8962_I2C_DeInit(), FXLS8962_I2C_Initialize(), FXLS8962_STREAM_SELF_TEST_SIZE, FXLS8962_WHOAMI_VALUE, GREEN_LED, gStreamID, gSystick, HOST_CMD_RESET, HOST_CMD_SELFTEST, HOST_CMD_START, HOST_CMD_STOP, HOST_FORMAT_HDLC, Host_IO_Send(), HOST_MSG_CMD_ACT_OFFSET, HOST_MSG_LEN_LSB_OFFSET, HOST_PRO_CMD_R_REG_TAG, HOST_PRO_CMD_W_CFG_TAG, HOST_PRO_CMD_W_REG_TAG, HOST_PRO_INT_CMD_TAG, HOST_PRO_INT_DEV_TAG, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, fxls8962_acceldataUser_t::selftest, SENSOR_ERROR_NONE, shieldString, st_on, st_sample, status, STREAMING_HEADER_LEN, and streamingPacket1.
Referenced by main().
volatile bool bFxls8962DataReady = false |
Definition at line 197 of file fxls8962_demo.c.
Referenced by fxls8962_int_data_ready_callback(), and main().
volatile bool bFxls8962Ready = false |
Definition at line 197 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
char boardString[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 195 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
volatile bool bStreamingEnabled = false |
Definition at line 197 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
const registerwritelist_t cFxls896216G[] |
Definition at line 127 of file fxls8962_demo.c.
const registerwritelist_t cFxls8962ConfigNormal[] |
Register settings for Interrupt (non buffered) mode.
Definition at line 91 of file fxls8962_demo.c.
const registerwritelist_t cFxls8962ConfigNormal2[] |
Register settings for Interrupt (non buffered) mode.
Definition at line 114 of file fxls8962_demo.c.
const registerreadlist_t cFxls8962OutputNormal[] |
Address of Raw Accel Data in Normal Mode.
Definition at line 189 of file fxls8962_demo.c.
const registerwritelist_t cFxls8962STXN[] |
Register settings for Self-Test in X Axis (Negative polarity).
Definition at line 149 of file fxls8962_demo.c.
const registerwritelist_t cFxls8962STXP[] |
Register settings for Self-Test in X Axis (Positive polarity).
Definition at line 141 of file fxls8962_demo.c.
const registerwritelist_t cFxls8962STYN[] |
Register settings for Self-Test in Y Axis (Negative polarity).
Definition at line 165 of file fxls8962_demo.c.
const registerwritelist_t cFxls8962STYP[] |
Register settings for Self-Test in Y Axis (Positive polarity).
Definition at line 157 of file fxls8962_demo.c.
const registerwritelist_t cFxls8962STZN[] |
Register settings for Self-Test in Z Axis (Negative polarity).
Definition at line 181 of file fxls8962_demo.c.
const registerwritelist_t cFxls8962STZP[] |
Register settings for Self-Test in Z Axis (Positive polarity).
Definition at line 173 of file fxls8962_demo.c.
uint8_t data[FXLS8962_DATA_SIZE] |
Definition at line 200 of file fxls8962_demo.c.
Referenced by CONTROL_UART_IRQHandler(), JSON_BlockDataRead_BlockingCall(), main(), WIRED_UART_IRQHandler(), WIRED_USART_IRQHandler(), WIRELESS_UART_IRQHandler(), and zeroArray().
char embAppName[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 196 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
float fsr_scale |
Definition at line 206 of file fxls8962_demo.c.
Referenced by process_host_command().
fxls8962_i2c_sensorhandle_t fxls8962Driver |
Definition at line 202 of file fxls8962_demo.c.
Referenced by main().
uint8_t gStreamID |
Definition at line 198 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
int32_t gSystick |
Definition at line 203 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
GENERIC_DRIVER_GPIO* pGpioDriver = &Driver_GPIO_KSDK |
Definition at line 199 of file fxls8962_demo.c.
fxls8962_acceldataUser_t rawData = {.timestamp = 0} |
Definition at line 201 of file fxls8962_demo.c.
Referenced by main().
char shieldString[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 195 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
int16_t st_dx |
Definition at line 205 of file fxls8962_demo.c.
int16_t st_dy |
Definition at line 205 of file fxls8962_demo.c.
int st_on =0 |
Definition at line 204 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
int st_sample =0 |
Definition at line 204 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().
int16_t st_xn |
Definition at line 205 of file fxls8962_demo.c.
Referenced by main().
int16_t st_xp |
Definition at line 205 of file fxls8962_demo.c.
Referenced by main().
int16_t st_yn |
Definition at line 205 of file fxls8962_demo.c.
Referenced by main().
int16_t st_yp |
Definition at line 205 of file fxls8962_demo.c.
Referenced by main().
int16_t st_zn |
Definition at line 205 of file fxls8962_demo.c.
Referenced by main().
int16_t st_zp |
Definition at line 205 of file fxls8962_demo.c.
Referenced by main().
int32_t status |
Definition at line 203 of file fxls8962_demo.c.
Referenced by ADS_DeInitI2CBuses(), ADS_DeInitSPIBus(), ADS_DetectFRDM(), ADS_DetectLPC(), ADS_DetectQN(), ADS_DetectShield(), ADS_DIFF_PQuery(), ADS_FlashCompare(), ADS_FXLC95000Query(), ADS_FXLS8471Query(), ADS_FXLS8962Query(), ADS_InitI2CBuses(), ADS_InitSPIBus(), ADS_MMA9553Query(), BOARD_RunADS(), DIFF_P_I2C_Configure(), DIFF_P_I2C_DeInit(), DIFF_P_I2C_Initialize(), DIFF_P_I2C_ReadData(), DIFF_P_SPI_Configure(), DIFF_P_SPI_DeInit(), DIFF_P_SPI_Initialize(), DIFF_P_SPI_ReadData(), FXAS21002_I2C_Configure(), FXAS21002_I2C_Deinit(), FXAS21002_I2C_Initialize(), FXAS21002_I2C_ReadData(), FXAS21002_SPI_Configure(), FXAS21002_SPI_Deinit(), FXAS21002_SPI_Initialize(), FXAS21002_SPI_ReadData(), fxlc95000_enSensor(), FXLC95000_I2C_CheckRomMode(), FXLC95000_I2C_CommandResponse(), FXLC95000_I2C_FlashCommands(), FXLC95000_I2C_FlashPayload(), FXLC95000_I2C_Initialize(), FXLC95000_SPI_CommandResponse(), FXLC95000_SPI_Initialize(), FXLS8471Q_Idle(), FXLS8471Q_Init(), FXLS8471Q_Read(), FXLS8471Q_SPI_Configure(), FXLS8471Q_SPI_Initialize(), FXLS8471Q_SPI_ReadData(), FXLS8962_I2C_Configure(), FXLS8962_I2C_DeInit(), FXLS8962_I2C_Initialize(), FXLS8962_I2C_ReadData(), FXLS8962_SPI_Configure(), FXLS8962_SPI_Deinit(), FXLS8962_SPI_Initialize(), FXLS8962_SPI_ReadData(), FXOS8700_I2C_Configure(), FXOS8700_I2C_Initialize(), FXOS8700_I2C_ReadData(), FXOS8700_Idle(), FXOS8700_Init(), FXOS8700_ReadMagData(), FXOS8700_SPI_Configure(), FXOS8700_SPI_Initialize(), FXOS8700_SPI_ReadData(), FXPQ3115_I2C_Configure(), FXPQ3115_I2C_DeInit(), FXPQ3115_I2C_Initialize(), FXPQ3115_I2C_ReadData(), HOST_Configure(), HOST_Initialize(), Host_IO_Receive(), HOST_Receive(), HOST_Send(), initializeFusionEngine(), initializeSensors(), MAG3110_I2C_Configure(), MAG3110_I2C_DeInit(), MAG3110_I2C_Initialize(), MAG3110_I2C_ReadData(), MAG3110_Idle(), MAG3110_Init(), MAG3110_Read(), main(), MMA845x_I2C_Configure(), MMA845x_I2C_Initialize(), MMA845x_I2C_ReadData(), MMA8491Q_I2C_Initialize(), MMA8491Q_I2C_ReadData(), MMA865x_I2C_Configure(), MMA865x_I2C_DeInit(), MMA865x_I2C_Initialize(), MMA865x_I2C_ReadData(), MMA9553_I2C_CommandResponse(), MMA9553_I2C_Configure(), MMA9553_I2C_DeInit(), MMA9553_I2C_Initialize(), MMA9553_SPI_CommandResponse(), MMA9553_SPI_Configure(), MMA9553_SPI_DeInit(), MMA9553_SPI_Initialize(), MPL3115_I2C_Configure(), MPL3115_I2C_DeInit(), MPL3115_I2C_Initialize(), MPL3115_I2C_ReadData(), process_host_command(), readSensors(), Register_I2C_BlockWrite(), Register_I2C_Read(), Register_I2C_Write(), Register_SPI_BlockWrite(), Register_SPI_Read(), Register_SPI_Write(), Sensor_I2C_BlockWrite(), Sensor_I2C_Read(), Sensor_I2C_Write(), Sensor_SPI_BlockWrite(), Sensor_SPI_Read(), Sensor_SPI_Write(), ssQueueStatus(), ssSetStatus(), and ssSetStatusNow().
uint8_t streamingPacket[STREAMING_HEADER_LEN+FXLS8962_STREAM_DATA_SIZE] |
Definition at line 200 of file fxls8962_demo.c.
Referenced by main().
uint8_t streamingPacket1[STREAMING_HEADER_LEN+FXLS8962_STREAM_SELF_TEST_SIZE] |
Definition at line 200 of file fxls8962_demo.c.
Referenced by main(), and process_host_command().