ISSDK  1.7
IoT Sensing Software Development Kit
fxls8471_demo.c
Go to the documentation of this file.
1 /*
2  * The Clear BSD License
3  * Copyright (c) 2016, Freescale Semiconductor, Inc.
4  * Copyright 2016-2017 NXP
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,
8  * are permitted (subject to the limitations in the disclaimer below) provided
9  * that the following conditions are met:
10  *
11  * o Redistributions of source code must retain the above copyright notice, this list
12  * of conditions and the following disclaimer.
13  *
14  * o Redistributions in binary form must reproduce the above copyright notice, this
15  * list of conditions and the following disclaimer in the documentation and/or
16  * other materials provided with the distribution.
17  *
18  * o Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 /**
36  * @file fxls8471_demo.c
37  * @brief The fxls8471_demo.c file implements the ISSDK FXLS8471 sensor
38  * demo example demonstration with interrupt mode.
39  */
40 
41 //-----------------------------------------------------------------------
42 // SDK Includes
43 //-----------------------------------------------------------------------
44 #include "board.h"
45 #include "pin_mux.h"
46 #include "clock_config.h"
47 
48 //-----------------------------------------------------------------------
49 // CMSIS Includes
50 //-----------------------------------------------------------------------
51 #include "Driver_SPI.h"
52 #include "Driver_USART.h"
53 
54 //-----------------------------------------------------------------------
55 // ISSDK Includes
56 //-----------------------------------------------------------------------
57 #include "issdk_hal.h"
58 #include "gpio_driver.h"
59 #include "host_io_uart.h"
60 #include "systick_utils.h"
61 #include "fxls8471q_drv.h"
62 #include "auto_detection_service.h"
63 
64 //-----------------------------------------------------------------------
65 // Macros
66 //-----------------------------------------------------------------------
67 #define FXLS8471_STREAM_DATA_SIZE 11
68 /*! @brief Unique Name for this application which should match the target GUI pkg name. */
69 #define APPLICATION_NAME "FXLS8471 Accelerometer Demo"
70 /*! @brief Version to distinguish between instances the same application based on target Shield and updates. */
71 #define APPLICATION_VERSION "2.5"
72 
73 typedef struct
74 {
75  uint32_t timestamp; /*! The time, this sample was recorded. */
76  int16_t accel[3]; /*!< The accel data */
77  uint8_t intsrc;
79 
80 //-----------------------------------------------------------------------
81 // Constants
82 //-----------------------------------------------------------------------
83 /*! Prepare the register write list to configure FXLS8471Q in non-FIFO mode. */
85  /*! Clear F_SETUP. */
86  {FXLS8471Q_F_SETUP, 0x00, 0x00},
87  /*! Set FS Range 2G. */
89  /*! Configure CTRL_REG1 register to put FXLS8471Q to 100Hz sampling rate. */
91  /*! Configure CTRL_REG2 register to put FXLS8471Q to High Resolution mode. */
93  /*! Configure settings for interrupt notification. */
94  /*! Active High, Push-Pull */
98  FXLS8471Q_CTRL_REG4_INT_EN_DRDY_MASK}, /*! Data Ready Event. */
100  {FXLS8471Q_CTRL_REG4,255,0x00},
101 
102  //PL registers
105  {FXLS8471Q_PL_COUNT, 0x40, 0x00},//FF
108  {FXLS8471Q_PL_THS_REG,132,0x00},
109 
110 
111  //Freefall registers
118  //{FXLS8471Q_A_FFMT_THS,FXLS8471Q_A_FFMT_THS_DBCNTM_CLR,FXLS8471Q_A_FFMT_THS_THS_MASK},
119  {FXLS8471Q_A_FFMT_COUNT,6,0x00},//2
120 
121  //Pulse registers
122  {FXLS8471Q_PULSE_CFG,21,0x00},
123  {FXLS8471Q_PULSE_TMLT,80,0x00},//48
124  {FXLS8471Q_PULSE_LTCY,240,0x00},
125  {FXLS8471Q_PULSE_THSX,55,0x00},
126  {FXLS8471Q_PULSE_THSY,55,0x00},
127  {FXLS8471Q_PULSE_THSZ,82,0x00},
128 
129  //VECM
130  { FXLS8471Q_A_VECM_CNT,15,0x00},
131  { FXLS8471Q_A_VECM_THS_LSB,88,0x00},
132  { FXLS8471Q_A_VECM_CFG,72,0x00},
136 
137 /*! Prepare the register read list to read the raw accel data from the FXLS8471Q. */
140 
142  {.readFrom = FXLS8471Q_INT_SOURCE, .numBytes = 1}, __END_READ_DATA__};
143 
145  {.readFrom = FXLS8471Q_A_FFMT_SRC , .numBytes = 1}, __END_READ_DATA__};
146 
148  {.readFrom = FXLS8471Q_PL_STATUS, .numBytes = 1}, __END_READ_DATA__};
149 
150 //-----------------------------------------------------------------------
151 // Global Variables
152 //-----------------------------------------------------------------------
155 volatile bool bStreamingEnabled = false, bFxls8471DataReady = false, bFxls8471Ready = false;
156 uint8_t gStreamID; /* The auto assigned Stream ID. */
159 
160 //-----------------------------------------------------------------------
161 // Functions
162 //-----------------------------------------------------------------------
163 /* This is the Sensor Data Ready ISR implementation.*/
164 void fxls8471_int_data_ready_callback(void *pUserData)
165 { /*! @brief Set flag to indicate Sensor has signalled data ready. */
166  bFxls8471DataReady = true;
167 }
168 
169 /* Handler for Device Info and Streaming Control Commands. */
171  uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
172 {
173  bool success = false;
174 
175  /* If it is Host requesting Device Info, send Board Name and Shield Name. */
176  if (tag == HOST_PRO_INT_DEV_TAG)
177  { /* Byte 1 : Payload - Length of APPLICATION_NAME (b)
178  * Bytes=b : Payload Application Name
179  * Byte b+1 : Payload - Length of BOARD_NAME (s)
180  * Bytes=s : Payload Board Name
181  * Byte b+s+2 : Payload - Length of SHIELD_NAME (v)
182  * Bytes=v : Payload Shield Name */
183 
184  size_t appNameLen = strlen(embAppName);
185  size_t boardNameLen = strlen(boardString);
186  size_t shieldNameLen = strlen(shieldString);
187 
188  if (respBufferSize >= boardNameLen + shieldNameLen + appNameLen + 3)
189  { /* We have sufficient buffer. */
190  *hostMsgSize = 0;
191  }
192  else
193  {
194  return false;
195  }
196 
197  hostResponse[*hostMsgSize] = appNameLen;
198  *hostMsgSize += 1;
199 
200  memcpy(hostResponse + *hostMsgSize, embAppName, appNameLen);
201  *hostMsgSize += appNameLen;
202 
203  hostResponse[*hostMsgSize] = boardNameLen;
204  *hostMsgSize += 1;
205 
206  memcpy(hostResponse + *hostMsgSize, boardString, boardNameLen);
207  *hostMsgSize += boardNameLen;
208 
209  hostResponse[*hostMsgSize] = shieldNameLen;
210  *hostMsgSize += 1;
211 
212  memcpy(hostResponse + *hostMsgSize, shieldString, shieldNameLen);
213  *hostMsgSize += shieldNameLen;
214 
215  return true;
216  }
217 
218  /* If it is Host sending Streaming Commands, take necessary actions. */
219  if ((tag == (HOST_PRO_INT_CMD_TAG | HOST_PRO_CMD_W_CFG_TAG)) &&
221  { /* Byte 1 : Payload - Operation Code (Start/Stop Operation Code)
222  * Byte 2 : Payload - Stream ID (Target Stream for carrying out operation) */
223  switch (hostCommand[0]) /* Execute desired operation (Start/Stop) on the requested Stream. */
224  {
225  case HOST_CMD_START:
226  if (hostCommand[1] == gStreamID && bFxls8471Ready && bStreamingEnabled == false)
227  {
229  bStreamingEnabled = true;
230  success = true;
231  }
232  break;
233  case HOST_CMD_STOP:
234  if (hostCommand[1] == gStreamID && bFxls8471Ready && bStreamingEnabled == true)
235  {
236  pGpioDriver->clr_pin(&GREEN_LED);
237  bStreamingEnabled = false;
238  success = true;
239  }
240  break;
241  default:
242  break;
243  }
244  *hostMsgSize = 0; /* Zero payload in response. */
245  }
246 
247  return success;
248 }
249 
250 /*!
251  * @brief Main function
252  */
253 int main(void)
254 {
255  int32_t status;
257  fxls8471q_spi_sensorhandle_t fxls8471Driver;
259 
260  ARM_DRIVER_SPI *pSPIdriver = &SPI_S_DRIVER;
261  ARM_DRIVER_USART *pUartDriver = &HOST_S_DRIVER;
262 
263  /*! Initialize the MCU hardware. */
266 
267  /* Create the Short Application Name String for ADS. */
268  sprintf(embAppName, "%s:%s", APPLICATION_NAME, APPLICATION_VERSION);
269 
270  /* Run ADS. */
272 
273  /* Create the Full Application Name String for Device Info Response. */
275 
276  /*! Initialize FXLS8471 pin used by FRDM board */
278 
279  /*! Initialize RGB LED pin used by FRDM board */
280  pGpioDriver->pin_init(&GREEN_LED, GPIO_DIRECTION_OUT, NULL, NULL, NULL);
281 
282  /*! Initialize the SPI driver. */
283  status = pSPIdriver->Initialize(SPI_S_SIGNAL_EVENT);
284  if (ARM_DRIVER_OK != status)
285  {
286  return -1;
287  }
288 
289  /*! Set the SPI Power mode. */
290  status = pSPIdriver->PowerControl(ARM_POWER_FULL);
291  if (ARM_DRIVER_OK != status)
292  {
293  return -1;
294  }
295 
296  /*! Set the SPI Slave speed. */
297  status = pSPIdriver->Control(ARM_SPI_MODE_MASTER | ARM_SPI_CPOL0_CPHA0, SPI_S_BAUDRATE);
298  if (ARM_DRIVER_OK != status)
299  {
300  return -1;
301  }
302 
303  /*! Initialize the UART driver. */
304  status = pUartDriver->Initialize(HOST_S_SIGNAL_EVENT);
305  if (ARM_DRIVER_OK != status)
306  {
307  return -1;
308  }
309 
310  /*! Set the UART Power mode. */
311  status = pUartDriver->PowerControl(ARM_POWER_FULL);
312  if (ARM_DRIVER_OK != status)
313  {
314  return -1;
315  }
316 
317  /*! Set UART Baud Rate. */
318  status = pUartDriver->Control(ARM_USART_MODE_ASYNCHRONOUS, BOARD_DEBUG_UART_BAUDRATE);
319  if (ARM_DRIVER_OK != status)
320  {
321  return -1;
322  }
323 
324  /*! Initialize FXLS8471 sensor driver. */
327  if (SENSOR_ERROR_NONE == status)
328  {
329  /*! Set the task to be executed while waiting for SPI transactions to complete. */
331 
332  /*! Configure the FXLS8471 sensor. */
333  status = FXLS8471Q_SPI_Configure(&fxls8471Driver, cFxls8471q_Config_Isr);
334  if (SENSOR_ERROR_NONE == status)
335  {
336  bFxls8471Ready = true;
337  }
338  }
339 
340  /*! Initialize streaming and assign a Stream ID. */
341  gStreamID = Host_IO_Init(pUartDriver, (void *)fxls8471Driver.pCommDrv, &fxls8471Driver.deviceInfo,
343  /* Confirm if a valid Stream ID has been allocated for this stream. */
344  if (0 == gStreamID)
345  {
346  bFxls8471Ready = false;
347  }
348  else
349  {
350  /*! Populate streaming header. */
352  pGpioDriver->clr_pin(&GREEN_LED);
353  }
354 
355  for (;;) /* Forever loop */
356  { /* Call UART Non-Blocking Receive. */
358 
359  /* Process packets only if streaming has been enabled by Host and ISR is available.
360  * In ISR Mode we do not need to check Data Ready Register.
361  * The receipt of interrupt will indicate data is ready. */
362  if (false == bStreamingEnabled || false == bFxls8471DataReady)
363  {
364  SMC_SetPowerModeWait(SMC); /* Power save, wait if nothing to do. */
365  continue;
366  }
367  else
368  { /*! Clear the data ready flag, it will be set again by the ISR. */
369  bFxls8471DataReady = false;
370  pGpioDriver->toggle_pin(&GREEN_LED);
371  }
372 
373  /*! Read new raw sensor data from the FXLS8471. */
374  status = FXLS8471Q_SPI_ReadData(&fxls8471Driver, cFxls8471q_Output_Values, data);
375  if (ARM_DRIVER_OK != status)
376  { /* Loop, if sample read failed. */
377  continue;
378  }
379 
380  /* Update timestamp from Systick framework. */
382 
383  /*! Convert the raw sensor data to signed 16-bit container for display to the debug port. */
384  rawData.accel[0] = ((int16_t)data[0] << 8) | (int16_t)data[1];
385  rawData.accel[0] /= 4;
386  rawData.accel[1] = ((int16_t)data[2] << 8) | (int16_t)data[3];
387  rawData.accel[1] /= 4;
388  rawData.accel[2] = ((int16_t)data[4] << 8) | (int16_t)data[5];
389  rawData.accel[2] /= 4;
390 
391  status = FXLS8471Q_SPI_ReadData(&fxls8471Driver, cFxls8471q_int_src, &regdata);
392 
393  // The following condition checks for multiple interrupts occurring at the same time and sends only one out as per occurrence order.
394  // Check for Free-fall interrupt
395  if((regdata & 0x04) == 0x04)
396  {
397  rawData.intsrc = 0x04;
398  }
399  // Check for Vector Magnitude change interrupt
400  else if((regdata & 0x02) == 0x02)
401  {
402  rawData.intsrc = 0x02;
403  }
404  // Else send other interrupts
405  else
406  {
407  rawData.intsrc = regdata;
408  }
409 
410  // read FFMT/PL/interrupt source registers to clear flags
411  status = FXLS8471Q_SPI_ReadData(&fxls8471Driver, cFxls8471q_int_src, &regdata);
412  status = FXLS8471Q_SPI_ReadData(&fxls8471Driver, cFxls8471q_ffmt_src, &regdata);
413  status = FXLS8471Q_SPI_ReadData(&fxls8471Driver, cFxls8471q_pl_status, &regdata);
414 
415  /* Copy Raw samples to Streaming Buffer. */
416  memcpy(streamingPacket + STREAMING_HEADER_LEN, &rawData, FXLS8471_STREAM_DATA_SIZE);
417  /* Send streaming packet to Host. */
418  Host_IO_Send(streamingPacket, sizeof(streamingPacket), HOST_FORMAT_HDLC);
419  }
420 }
uint32_t BOARD_SystickElapsedTime_us(int32_t *pStart)
Function to compute the Elapsed Time.
Definition: systick_utils.c:99
#define FXLS8471Q_PL_BF_ZCOMP_BKFR_MASK
Definition: fxls8471q.h:783
#define FXLS8471Q_A_FFMT_CFG_XEFE_ENABLED
Definition: fxls8471q.h:911
#define __END_WRITE_DATA__
Definition: sensor_drv.h:71
#define HOST_PRO_CMD_W_CFG_TAG
Definition: host_io_uart.h:89
void fxls8471_int_data_ready_callback(void *pUserData)
volatile bool bFxls8471Ready
#define HOST_S_SIGNAL_EVENT
Definition: frdm_k64f.h:120
#define FXLS8471Q_A_FFMT_CFG_XEFE_MASK
Definition: fxls8471q.h:891
The fxls8471q_drv.h file describes the fxls8471q driver interface and structures. ...
void Host_IO_Receive(host_cmd_proc_fn_t process_host_command, uint8_t encoding)
Definition: host_io_uart.c:233
void(* pin_init)(pinID_t aPinId, gpio_direction_t dir, void *apPinConfig, gpio_isr_handler_t aIsrHandler, void *apUserData)
Definition: Driver_GPIO.h:67
#define BOARD_BootClockRUN
Definition: clock_config.h:45
#define FXLS8471Q_A_FFMT_CFG_ELE_ENABLED
Definition: fxls8471q.h:922
uint8_t gStreamID
#define FXLS8471Q_PL_CFG_DBCNTM_MASK
Definition: fxls8471q.h:716
const registerreadlist_t cFxls8471q_pl_status[]
int32_t FXLS8471Q_SPI_Initialize(fxls8471q_spi_sensorhandle_t *pSensorHandle, ARM_DRIVER_SPI *pBus, uint8_t index, void *pSlaveSelect, uint8_t whoAmi)
The interface function to initialize the sensor for I2C.
Definition: fxls8471q_drv.c:93
#define FXLS8471Q_A_FFMT_CFG_ZEFE_ENABLED
Definition: fxls8471q.h:917
uint8_t data[FXLS8962_DATA_SIZE]
#define FXLS8471Q_PL_BF_ZCOMP_ZLOCK_MASK
Definition: fxls8471q.h:780
#define FXLS8471Q_CTRL_REG3_PP_OD_MASK
Definition: fxls8471q.h:1802
#define FXLS8471Q_CTRL_REG5_INT_CFG_DRDY_INT1
Definition: fxls8471q.h:2001
#define FXLS8471Q_A_FFMT_CFG_OAE_FREEFALL
Definition: fxls8471q.h:919
int32_t status
void(* toggle_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:74
#define SHIELD_NAME
registerDeviceInfo_t deviceInfo
Definition: fxls8471q_drv.h:59
#define FXLS8471Q_A_FFMT_CFG_ELE_MASK
Definition: fxls8471q.h:903
#define FXLS8471Q_A_FFMT_CFG_YEFE_ENABLED
Definition: fxls8471q.h:914
#define ADS_MAX_STRING_LENGTH
#define FXLS8471Q_CTRL_REG1_DR_MASK
Definition: fxls8471q.h:1674
#define FXLS8471Q_XYZ_DATA_CFG_FS_MASK
Definition: fxls8471q.h:562
#define FXLS8471Q_WHO_AM_I_WHOAMI_VALUE
Definition: fxls8471q.h:538
#define HOST_PRO_INT_DEV_TAG
Definition: host_io_uart.h:85
uint8_t streamingPacket[STREAMING_HEADER_LEN+FXLS8962_STREAM_DATA_SIZE]
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
Definition: sensor_drv.h:123
#define HOST_PRO_INT_CMD_TAG
Bit aligned values for Host Protocol Interface IDs (Bits 5-6).
Definition: host_io_uart.h:83
char shieldString[ADS_MAX_STRING_LENGTH]
const registerwritelist_t cFxls8471q_Config_Isr[]
Definition: fxls8471_demo.c:84
#define FXLS8471Q_CTRL_REG4_INT_EN_DRDY_MASK
Definition: fxls8471q.h:1890
GENERIC_DRIVER_GPIO * pGpioDriver
#define FXLS8471Q_PL_CFG_DBCNTM_CLR
Definition: fxls8471q.h:727
#define FXLS8471Q_A_VECM_THS_MSB_A_VECM_DBCNTM_MASK
Definition: fxls8471q.h:2189
#define FXLS8471Q_CTRL_REG2_MODS_HIGHRES
Definition: fxls8471q.h:1754
#define FXLS8471Q_A_VECM_THS_MSB_A_VECM_THS_MASK
Definition: fxls8471q.h:2186
volatile bool bFxls8471DataReady
#define __END_READ_DATA__
Definition: sensor_drv.h:77
const registerreadlist_t cFxls8471q_ffmt_src[]
#define FXLS8471_INT1
void FXLS8471Q_SPI_SetIdleTask(fxls8471q_spi_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the SPI Idle Task.
#define FXLS8471Q_A_FFMT_THS_THS_MASK
Definition: fxls8471q.h:1021
#define FXLS8471Q_A_FFMT_CFG_YEFE_MASK
Definition: fxls8471q.h:894
gpioHandleKSDK_t GREEN_LED
Definition: frdm_k64f.c:214
spiSlaveSpecificParams_t slaveParams
Definition: fxls8471q_drv.h:62
volatile bool bStreamingEnabled
#define FXLS8471Q_A_FFMT_CFG_ZEFE_MASK
Definition: fxls8471q.h:897
int32_t FXLS8471Q_SPI_ReadData(fxls8471q_spi_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
#define FXLS8471Q_CTRL_REG3_IPOL_MASK
Definition: fxls8471q.h:1805
#define SPI_S_DEVICE_INDEX
Definition: frdm_k64f.h:115
void Host_IO_Add_ISO_Header(uint8_t streamID, uint8_t *pStreamingPacket, size_t sizePayload)
Definition: host_io_uart.c:112
void Host_IO_Send(uint8_t *pMsg, size_t size, uint8_t encoding)
Definition: host_io_uart.c:162
#define FXLS8471Q_CTRL_REG2_MODS_MASK
Definition: fxls8471q.h:1733
#define FXLS8471Q_CTRL_REG3_PP_OD_PUSHPULL
Definition: fxls8471q.h:1830
void(* clr_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:73
#define FXLS8471Q_PL_CFG_PL_EN_MASK
Definition: fxls8471q.h:713
#define FXLS8471Q_CTRL_REG5_INT_CFG_DRDY_MASK
Definition: fxls8471q.h:1972
void BOARD_SystickEnable(void)
Function to enable systicks framework.
Definition: systick_utils.c:70
#define FXLS8471Q_XYZ_DATA_CFG_FS_FS_RANGE_2G
Definition: fxls8471q.h:572
char boardString[ADS_MAX_STRING_LENGTH]
#define FXLS8471Q_PL_CFG_PL_EN_ENABLED
Definition: fxls8471q.h:724
#define APPLICATION_NAME
Unique Name for this application which should match the target GUI pkg name.
Definition: fxls8471_demo.c:69
GENERIC_DRIVER_GPIO Driver_GPIO_KSDK
Definition: gpio_driver.c:203
#define FXLS8471Q_ACCEL_DATA_SIZE
The size of the FXLS8471Q accel data.
Definition: fxls8471q_drv.h:74
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
#define FXLS8471_SPI_CS
#define BOARD_DEBUG_UART_BAUDRATE
Definition: board.h:57
This defines the sensor specific information for SPI.
Definition: fxls8471q_drv.h:57
int32_t FXLS8471Q_SPI_Configure(fxls8471q_spi_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
Access structure of the GPIO Driver.
Definition: Driver_GPIO.h:64
#define APPLICATION_VERSION
Version to distinguish between instances the same application based on target Shield and updates...
Definition: fxls8471_demo.c:71
void BOARD_SystickStart(int32_t *pStart)
Function to Record the Start systick.
Definition: systick_utils.c:79
#define FXLS8471Q_I2C_ADDRESS_SA0_0_SA1_0
Definition: fxls8471q.h:46
ARM Systick Utilities.
void BOARD_RunADS(const char *appName, char *boardString, char *shieldString, size_t bufferLength)
The function to register Application Name and initialte ADS.
#define SPI_S_BAUDRATE
Transfer baudrate - 500k.
Definition: frdm_k64f.h:114
fxls8962_acceldataUser_t rawData
int main(void)
Main function.
int32_t gSystick
uint8_t Host_IO_Init(ARM_DRIVER_USART *pDrv, void *pBus, void *pDevInfo, void *spiSlaveParams, uint16_t slaveAddress)
Definition: host_io_uart.c:126
#define SPI_S_SIGNAL_EVENT
Definition: frdm_k64f.h:116
This structure defines the Write command List.
Definition: sensor_drv.h:94
This structure defines the Read command List.
Definition: sensor_drv.h:104
#define SMC
Definition: lpc54114.h:144
The host_io_uart.h file contains the Host Protocol interface definitions and configuration.
#define STREAMING_HEADER_LEN
Definition: host_io_uart.h:51
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
Definition: lpc54114.c:181
#define FXLS8471Q_CTRL_REG3_IPOL_HIGH
Definition: fxls8471q.h:1833
bool process_host_command(uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
#define FXLS8471Q_A_FFMT_CFG_OAE_MASK
Definition: fxls8471q.h:900
#define FXLS8471Q_CTRL_REG1_DR_100HZ
Definition: fxls8471q.h:1693
const registerreadlist_t cFxls8471q_int_src[]
#define HOST_S_DRIVER
Definition: frdm_k64f.h:119
char embAppName[ADS_MAX_STRING_LENGTH]
#define FXLS8471Q_CTRL_REG4_INT_EN_DRDY_ENABLED
Definition: fxls8471q.h:1919
const registerreadlist_t cFxls8471q_Output_Values[]
#define FXLS8471_STREAM_DATA_SIZE
Definition: fxls8471_demo.c:67
#define SPI_S_DRIVER
Definition: frdm_k64f.h:113