![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
The fxls8471_demo.c file implements the ISSDK FXLS8471 sensor demo example demonstration with interrupt mode. More...
#include "board.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "Driver_SPI.h"
#include "Driver_USART.h"
#include "issdk_hal.h"
#include "gpio_driver.h"
#include "host_io_uart.h"
#include "systick_utils.h"
#include "fxls8471q_drv.h"
#include "auto_detection_service.h"
Go to the source code of this file.
Data Structures | |
struct | fxls8471q_acceldataUser_t |
Macros | |
#define | FXLS8471_STREAM_DATA_SIZE 11 |
#define | APPLICATION_NAME "FXLS8471 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... | |
Functions | |
void | fxls8471_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... | |
Variables | |
const registerwritelist_t | cFxls8471q_Config_Isr [] |
const registerreadlist_t | cFxls8471q_Output_Values [] |
const registerreadlist_t | cFxls8471q_int_src [] |
const registerreadlist_t | cFxls8471q_ffmt_src [] |
const registerreadlist_t | cFxls8471q_pl_status [] |
char | boardString [ADS_MAX_STRING_LENGTH] = {0} |
char | shieldString [ADS_MAX_STRING_LENGTH] = {0} |
char | embAppName [ADS_MAX_STRING_LENGTH] = {0} |
volatile bool | bStreamingEnabled = false |
volatile bool | bFxls8471DataReady = false |
volatile bool | bFxls8471Ready = false |
uint8_t | gStreamID |
int32_t | gSystick |
GENERIC_DRIVER_GPIO * | pGpioDriver = &Driver_GPIO_KSDK |
The fxls8471_demo.c file implements the ISSDK FXLS8471 sensor demo example demonstration with interrupt mode.
Definition in file fxls8471_demo.c.
#define APPLICATION_NAME "FXLS8471 Accelerometer Demo" |
Unique Name for this application which should match the target GUI pkg name.
Definition at line 69 of file fxls8471_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 71 of file fxls8471_demo.c.
Referenced by main().
#define FXLS8471_STREAM_DATA_SIZE 11 |
Definition at line 67 of file fxls8471_demo.c.
Referenced by main().
void fxls8471_int_data_ready_callback | ( | void * | pUserData | ) |
Set flag to indicate Sensor has signalled data ready.
Definition at line 164 of file fxls8471_demo.c.
References bFxls8471DataReady.
Referenced by main().
int main | ( | void | ) |
Main function.
Initialize the MCU hardware.
Initialize FXLS8471 pin used by FRDM board
Initialize RGB LED pin used by FRDM board
Initialize the SPI driver.
Set the SPI Power mode.
Set the SPI Slave speed.
Initialize the UART driver.
Set the UART Power mode.
Set UART Baud Rate.
Initialize FXLS8471 sensor driver.
Set the task to be executed while waiting for SPI transactions to complete.
Configure the FXLS8471 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 FXLS8471.
Convert the raw sensor data to signed 16-bit container for display to the debug port.
Definition at line 253 of file fxls8471_demo.c.
References fxls8471q_acceldataUser_t::accel, ADS_MAX_STRING_LENGTH, APPLICATION_NAME, APPLICATION_VERSION, bFxls8471DataReady, bFxls8471Ready, BOARD_BootClockRUN, BOARD_DEBUG_UART_BAUDRATE, BOARD_RunADS(), BOARD_SystickElapsedTime_us(), BOARD_SystickEnable(), boardString, bStreamingEnabled, GENERIC_DRIVER_GPIO::clr_pin, data, fxls8471q_spi_sensorhandle_t::deviceInfo, embAppName, FXLS8471_INT1, fxls8471_int_data_ready_callback(), FXLS8471_SPI_CS, FXLS8471_STREAM_DATA_SIZE, FXLS8471Q_ACCEL_DATA_SIZE, FXLS8471Q_I2C_ADDRESS_SA0_0_SA1_0, FXLS8471Q_SPI_Configure(), FXLS8471Q_SPI_Initialize(), FXLS8471Q_SPI_ReadData(), FXLS8471Q_SPI_SetIdleTask(), FXLS8471Q_WHO_AM_I_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, int32_t(), fxls8471q_acceldataUser_t::intsrc, fxls8471q_spi_sensorhandle_t::pCommDrv, GENERIC_DRIVER_GPIO::pin_init, process_host_command(), rawData, SENSOR_ERROR_NONE, SHIELD_NAME, shieldString, fxls8471q_spi_sensorhandle_t::slaveParams, SMC, SMC_SetPowerModeWait(), SPI_S_BAUDRATE, SPI_S_DEVICE_INDEX, SPI_S_DRIVER, SPI_S_SIGNAL_EVENT, status, STREAMING_HEADER_LEN, streamingPacket, fxls8471q_acceldataUser_t::timestamp, 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 170 of file fxls8471_demo.c.
References bFxls8471Ready, BOARD_SystickStart(), boardString, bStreamingEnabled, GENERIC_DRIVER_GPIO::clr_pin, embAppName, GREEN_LED, gStreamID, gSystick, HOST_CMD_START, HOST_CMD_STOP, HOST_MSG_CMD_ACT_OFFSET, HOST_MSG_LEN_LSB_OFFSET, HOST_PRO_CMD_W_CFG_TAG, HOST_PRO_INT_CMD_TAG, HOST_PRO_INT_DEV_TAG, and shieldString.
Referenced by main().
volatile bool bFxls8471DataReady = false |
Definition at line 155 of file fxls8471_demo.c.
Referenced by fxls8471_int_data_ready_callback(), and main().
volatile bool bFxls8471Ready = false |
Definition at line 155 of file fxls8471_demo.c.
Referenced by main(), and process_host_command().
char boardString[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 153 of file fxls8471_demo.c.
Referenced by main(), and process_host_command().
volatile bool bStreamingEnabled = false |
Definition at line 155 of file fxls8471_demo.c.
Referenced by main(), and process_host_command().
const registerwritelist_t cFxls8471q_Config_Isr[] |
Prepare the register write list to configure FXLS8471Q in non-FIFO mode.
Definition at line 84 of file fxls8471_demo.c.
const registerreadlist_t cFxls8471q_ffmt_src[] |
Definition at line 144 of file fxls8471_demo.c.
const registerreadlist_t cFxls8471q_int_src[] |
Definition at line 141 of file fxls8471_demo.c.
const registerreadlist_t cFxls8471q_Output_Values[] |
Prepare the register read list to read the raw accel data from the FXLS8471Q.
Definition at line 138 of file fxls8471_demo.c.
const registerreadlist_t cFxls8471q_pl_status[] |
Definition at line 147 of file fxls8471_demo.c.
char embAppName[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 154 of file fxls8471_demo.c.
Referenced by main(), and process_host_command().
uint8_t gStreamID |
Definition at line 156 of file fxls8471_demo.c.
Referenced by main(), and process_host_command().
int32_t gSystick |
Definition at line 157 of file fxls8471_demo.c.
Referenced by main(), and process_host_command().
GENERIC_DRIVER_GPIO* pGpioDriver = &Driver_GPIO_KSDK |
Definition at line 158 of file fxls8471_demo.c.
char shieldString[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 153 of file fxls8471_demo.c.
Referenced by main(), and process_host_command().