![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
#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 |
#define APPLICATION_NAME "FXLS8471 Accelerometer Demo" |
Unique Name for this application which should match the target GUI pkg name.
Definition at line 43 of file fxls8471_demo_kl25z.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 45 of file fxls8471_demo_kl25z.c.
Referenced by main().
#define FXLS8471_STREAM_DATA_SIZE 11 |
Definition at line 41 of file fxls8471_demo_kl25z.c.
Referenced by main().
void fxls8471_int_data_ready_callback | ( | void * | pUserData | ) |
Set flag to indicate Sensor has signalled data ready.
Definition at line 138 of file fxls8471_demo_kl25z.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 227 of file fxls8471_demo_kl25z.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_SetPowerModeVlpr(), 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, fxos8700_accelmagdata_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 144 of file fxls8471_demo_kl25z.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 129 of file fxls8471_demo_kl25z.c.
Referenced by fxls8471_int_data_ready_callback(), and main().
volatile bool bFxls8471Ready = false |
Definition at line 129 of file fxls8471_demo_kl25z.c.
Referenced by main(), and process_host_command().
char boardString[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 127 of file fxls8471_demo_kl25z.c.
Referenced by main(), and process_host_command().
volatile bool bStreamingEnabled = false |
Definition at line 129 of file fxls8471_demo_kl25z.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 58 of file fxls8471_demo_kl25z.c.
const registerreadlist_t cFxls8471q_ffmt_src[] |
Definition at line 118 of file fxls8471_demo_kl25z.c.
const registerreadlist_t cFxls8471q_int_src[] |
Definition at line 115 of file fxls8471_demo_kl25z.c.
const registerreadlist_t cFxls8471q_Output_Values[] |
Prepare the register read list to read the raw accel data from the FXLS8471Q.
Definition at line 112 of file fxls8471_demo_kl25z.c.
const registerreadlist_t cFxls8471q_pl_status[] |
Definition at line 121 of file fxls8471_demo_kl25z.c.
char embAppName[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 128 of file fxls8471_demo_kl25z.c.
Referenced by main(), and process_host_command().
uint8_t gStreamID |
Definition at line 130 of file fxls8471_demo_kl25z.c.
Referenced by main(), and process_host_command().
int32_t gSystick |
Definition at line 131 of file fxls8471_demo_kl25z.c.
Referenced by main(), and process_host_command().
GENERIC_DRIVER_GPIO* pGpioDriver = &Driver_GPIO_KSDK |
Definition at line 132 of file fxls8471_demo_kl25z.c.
char shieldString[ADS_MAX_STRING_LENGTH] = {0} |
Definition at line 127 of file fxls8471_demo_kl25z.c.
Referenced by main(), and process_host_command().