ISSDK  1.7
IoT Sensing Software Development Kit
fxlc95000_flash_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: fxlc95000_flash_demo.c
37  * @brief The fxlc95000_flash_demo.c file implements the ISSDK FXLC95000L sensor driver
38  * example demonstration for FLASH programming and Streaming for I2C Mode using Host I/O.
39  */
40 
41 //-----------------------------------------------------------------------
42 // SDK Includes
43 //-----------------------------------------------------------------------
44 #include "board.h"
45 #include "pin_mux.h"
46 #include "fsl_lptmr.h"
47 #include "clock_config.h"
48 
49 //-----------------------------------------------------------------------
50 // CMSIS Includes
51 //-----------------------------------------------------------------------
52 #include "Driver_I2C.h"
53 #include "Driver_USART.h"
54 
55 //-----------------------------------------------------------------------
56 // ISSDK Includes
57 //-----------------------------------------------------------------------
58 #include "issdk_hal.h"
59 #include "gpio_driver.h"
60 #include "host_io_uart.h"
61 #include "systick_utils.h"
62 #include "fxlc95000_drv.h"
63 #include "auto_detection_service.h"
64 
65 //-----------------------------------------------------------------------
66 // Macros
67 //-----------------------------------------------------------------------
68 #define fxlc95000_odrCallback LPTMR0_IRQHandler /* Timer timeout Callback. */
69 #define SAMPLING_RATE_ms 100 /* Timeout for the ODR Timer in ms. */
70 #define FXLC95000_SAMPLE_SIZE 10 /* 4-Byte timestamp and 2-Byte X,Y,Z Data each. */
71 
72 /*! @brief Unique Name for this application which should match the target GUI pkg name. */
73 #define APPLICATION_NAME "FXLC95000 Accelerometer Demo"
74 /*! @brief Version to distinguish between instances the same application based on target Shield and updates. */
75 #define APPLICATION_VERSION "2.5"
76 
77 //-----------------------------------------------------------------------
78 // Constants
79 //-----------------------------------------------------------------------
80 /*! Create commands for setting FXLC95000L desired configuration. */
81 const uint8_t cFxlc95000_SetODR_Cmd[] = {FXLC95000_SET_ODR_CMD_HDR, /* ODR equal to Sampling Rate. */
83 const uint8_t cFxlc95000_SetResolution_Cmd[] = {FXLC95000_SET_RESOLUTION_CMD_HDR, /* Resolution 14-bits. */
85 const uint8_t cFxlc95000_SetRange_Cmd[] = {FXLC95000_SET_RANGE_CMD_HDR, /* FS Range 2G. */
87 
88 /*! Prepare the register write list to initialize FXLC95000L with desired MBox Settings. */
90  {QuickReadInterruptDisable, 0, sizeof(QuickReadInterruptDisable)}, /* Disable QR INT. */
91  {ConfigureMBoxCmd, 0, sizeof(ConfigureMBoxCmd)}, /* Configure MBox 16 to 25 with 10 byte Sample. */
92  __END_WRITE_CMD__ /* Ref. Table 3-7 of ISF1P195K_SW_REFERENCE_RM. */
93 };
94 
95 /*! Prepare the register write list to configure FXLC95000L with desired Sampling Settings. */
97  {StopDataCmd, 0, sizeof(StopDataCmd)}, /* Stop Data before (re)configuration. */
98  {cFxlc95000_SetODR_Cmd, 0, sizeof(cFxlc95000_SetODR_Cmd)}, /* Set Sensor Sampling Rate. */
99  {cFxlc95000_SetRange_Cmd, 0, sizeof(cFxlc95000_SetRange_Cmd)}, /* Set FS Range. */
100  {cFxlc95000_SetResolution_Cmd, 0, sizeof(cFxlc95000_SetResolution_Cmd)}, /* Set Resolution */
101  {StartDataCmd, 0, sizeof(StartDataCmd)}, /* Start Data after (re)configuration. */
103 
104 /*! Prepare the register write list with Flash Preprocess Commands. */
106  {UnprotectFlash, 0, sizeof(UnprotectFlash)}, /* Unprotect Flash Banks to enable Writing. */
107  {EraseMainFlashArray, 0, sizeof(EraseMainFlashArray)}, /* Erase Flash completely before writing new Data. */
108  __END_WRITE_CMD__ /* Ref. Section 16.5 of FXLC95000CLHWRM. */
109 };
110 
111 /*! Prepare the register write list with Flash Postprocess Commands. */
113  {ProtectFlash, 0, sizeof(ProtectFlash)}, /* Protect Flash Banks after Writing to enable booting to Flash. */
114  __END_WRITE_CMD__ /* Ref. Section 16.5 of FXLC95000CLHWRM. */
115 };
116 
117 /*! Prepare the register read list to read the Timestamp and Accel data from FXLC95000. */
120 
121 //-----------------------------------------------------------------------
122 // Global Variables
123 //-----------------------------------------------------------------------
126 volatile bool bStreamingEnabled = false, bFxlc95000DataReady = false, bFxlc95000Ready = false, bFxlc95000Boot = false,
129  {.deviceInfo = {.deviceInstance = I2C_S_DEVICE_INDEX, .idleFunction = NULL}};
130 uint8_t gStreamID; /* The auto assigned Stream ID. */
132 
133 //-----------------------------------------------------------------------
134 // Functions
135 //-----------------------------------------------------------------------
136 /* LPTMR based ODR Callback function. */
138 {
139  LPTMR_ClearStatusFlags(LPTMR0, kLPTMR_TimerCompareFlag);
140  bFxlc95000DataReady = true;
141 }
142 
143 /* Sequence of commands for booting up FXLC95000 to Flash and enabling reading of samples. */
145 {
146  int32_t status;
147 
148  /*! Initialize the FXLC95000 sensor driver. */
151  if (SENSOR_ERROR_NONE != status)
152  {
153  return -1;
154  }
155 
156  /*! Set the task to be executed while waiting for I2C transactions to complete. */
158 
159  /*! Configure the FXLC95000 with MBox settings. */
160  status = FXLC95000_I2C_CommandResponse(pSensorHandle, cFxlc95000ConfigMBox, NULL, NULL);
161  if (SENSOR_ERROR_NONE != status)
162  {
163  return -1;
164  }
165  /*! Configure the FXLC95000 with Sampling settings. */
166  status = FXLC95000_I2C_CommandResponse(pSensorHandle, cFxlc95000ConfigSensor, NULL, NULL);
167  if (SENSOR_ERROR_NONE != status)
168  {
169  return -1;
170  }
171 
172  LPTMR_StartTimer(LPTMR0);
173  bFxlc95000Boot = true;
174  pGpioDriver->set_pin(&RED_LED); /* Clear RED LED to indicate sensor boot process is complete. */
175  pGpioDriver->clr_pin(&GREEN_LED); /* Set GREEN LED to indicate application is ready. */
176  return 0;
177 }
178 
179 /* Handler for Flash Write, Device Info and Streaming Control Commands. */
181  uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
182 {
183  static uint8_t toggle_led = 0;
184  bool success = false;
185  size_t rxMsgSize = *hostMsgSize; /* Capture Rx Command Size. */
186  *hostMsgSize = 0; /* Set Tx Response payload size to '0' as default and update if required. */
187 
188  /* If it is Host requesting Device Info, send Board Name and Shield Name. */
189  if (tag == HOST_PRO_INT_DEV_TAG)
190  { /* Byte 1 : Payload - Length of APPLICATION_NAME (b)
191  * Bytes=b : Payload Application Name
192  * Byte b+1 : Payload - Length of BOARD_NAME (s)
193  * Bytes=s : Payload Board Name
194  * Byte b+s+2 : Payload - Length of SHIELD_NAME (v)
195  * Bytes=v : Payload Shield Name */
196 
197  size_t appNameLen = strlen(embAppName);
198  size_t boardNameLen = strlen(boardString);
199  size_t shieldNameLen = strlen(shieldString);
200 
201  if (respBufferSize >= boardNameLen + shieldNameLen + appNameLen + 3)
202  { /* We have sufficient buffer. */
203  *hostMsgSize = 0;
204  }
205  else
206  {
207  return false;
208  }
209 
210  hostResponse[*hostMsgSize] = appNameLen;
211  *hostMsgSize += 1;
212 
213  memcpy(hostResponse + *hostMsgSize, embAppName, appNameLen);
214  *hostMsgSize += appNameLen;
215 
216  hostResponse[*hostMsgSize] = boardNameLen;
217  *hostMsgSize += 1;
218 
219  memcpy(hostResponse + *hostMsgSize, boardString, boardNameLen);
220  *hostMsgSize += boardNameLen;
221 
222  hostResponse[*hostMsgSize] = shieldNameLen;
223  *hostMsgSize += 1;
224 
225  memcpy(hostResponse + *hostMsgSize, shieldString, shieldNameLen);
226  *hostMsgSize += shieldNameLen;
227 
228  if (false == bFxlc95000Boot) /* Bringup FXLC95000 if not already done. */
229  {
230  if (fxlc95000_enSensor(&fxlc95000Driver))
231  {
232  bFxlc95000Boot = false;
233  }
234  }
235 
236  return true;
237  }
238 
239  /* If it is Host sending Streaming Commands, take necessary actions. */
240  if ((tag == (HOST_PRO_INT_CMD_TAG | HOST_PRO_CMD_W_CFG_TAG)) &&
242  { /* Byte 1 : Payload - Operation Code (Start/Stop Operation Code)
243  * Byte 2 : Payload - Stream ID (Target Stream for carrying out operation) */
244  switch (hostCommand[0]) /* Execute desired operation (Start/Stop) on the requested Stream. */
245  {
246  case HOST_CMD_START:
247  if (hostCommand[1] == gStreamID && bStreamingEnabled == false)
248  {
249  if (false == bFxlc95000Boot) /* Bringup FXLC95000 if not already done. */
250  {
251  if (fxlc95000_enSensor(&fxlc95000Driver))
252  {
253  break;
254  }
255  }
256  bStreamingEnabled = true;
257  success = true;
258  }
259  break;
260  case HOST_CMD_STOP:
261  if (hostCommand[1] == gStreamID && bStreamingEnabled == true)
262  {
263  pGpioDriver->clr_pin(&GREEN_LED);
264  bStreamingEnabled = false;
265  success = true;
266  }
267  break;
268  default:
269  break;
270  }
271  }
272 
273  /* If it is Host sending Flash Commands, take necessary actions. */
274  if ((tag == (HOST_PRO_INT_CMD_TAG | HOST_PRO_CMD_W_CFG_TAG)) &&
276  { /* Byte 1 : Payload - Operation Code (Start/Bytes/Stop Operation Code)
277  * Byte 2 : Payload - Slave ID (The Sensor's I2C Slave Address)
278  * Byte 3+ : Payload - (Only for Flash Bytes) The Flash Payload to be Written. */
279  switch (hostCommand[0]) /* Execute desired operation on the requested Sensor. */
280  {
282  /* Confirm Flashing is not active and Sensor is in ROM Mode. */
283  if ((hostCommand[1] == FXLC95000_I2C_ADDR && false == bFxlc95000Flashing) &&
285  { /*! Write Flash Preprocess Commands. */
287  FXLC95000_I2C_ADDR, cFxlc95000FlashPreprocess))
288  {
289  bFxlc95000Flashing = true;
290  success = true;
291  }
292  pGpioDriver->set_pin(&RED_LED); /* Indicate Flash Processing is active. */
293  }
294  break;
296  /* Confirm Flashing is active. */
297  if ((hostCommand[1] == FXLC95000_I2C_ADDR) && (true == bFxlc95000Flashing))
298  { /*! Write Flash Data Bytes. */
300  FXLC95000_I2C_ADDR, hostCommand + 2,
301  rxMsgSize - 2))
302  {
303  success = true;
304  }
305  if (toggle_led++ % 32 == 0 ? true : false)
306  {
307  pGpioDriver->toggle_pin(&RED_LED); /* Indicate Flash Processing is active. */
308  }
309  }
310  break;
311  case HOST_CMD_FLASH_STOP:
312  /* Confirm Flashing is active. */
313  if ((hostCommand[1] == FXLC95000_I2C_ADDR) && (true == bFxlc95000Flashing))
314  { /*! Write Flash Postprocess Commands. */
317  cFxlc95000FlashPostprocess))
318  {
319  bFxlc95000Flashing = false;
320  success = true;
321  }
322  pGpioDriver->clr_pin(&RED_LED); /* Indicate Flash Processing is complete. */
323  }
324  break;
325  default:
326  break;
327  }
328  }
329 
330  return success;
331 }
332 
333 /*!
334  * @brief Main function
335  */
336 int main(void)
337 {
338  int32_t status;
340  lptmr_config_t lptmrConfig;
341 
342  ARM_DRIVER_I2C *I2Cdrv = &I2C_S_DRIVER;
343  ARM_DRIVER_USART *pUartDriver = &HOST_S_DRIVER;
344 
345  /*! Initialize the MCU hardware. */
348 
349  /* Create the Short Application Name String for ADS. */
350  sprintf(embAppName, "%s:%s", APPLICATION_NAME, APPLICATION_VERSION);
351 
352  /* Run ADS. */
354 
355  /* Create the Full Application Name String for Device Info Response. */
357 
358  /* Initialize ODR Timer. */
359  LPTMR_GetDefaultConfig(&lptmrConfig);
360  LPTMR_Init(LPTMR0, &lptmrConfig);
361  LPTMR_EnableInterrupts(LPTMR0, kLPTMR_TimerInterruptEnable);
362  LPTMR_SetTimerPeriod(LPTMR0, MSEC_TO_COUNT(SAMPLING_RATE_ms, CLOCK_GetFreq(kCLOCK_LpoClk)));
363  EnableIRQ(LPTMR0_IRQn);
364 
365  /*! Initialize RED LED pin used by FRDM board */
366  pGpioDriver->pin_init(&RED_LED, GPIO_DIRECTION_OUT, NULL, NULL, NULL);
367  pGpioDriver->set_pin(&RED_LED);
368 
369  /*! Initialize GREEN LED pin used by FRDM board */
370  pGpioDriver->pin_init(&GREEN_LED, GPIO_DIRECTION_OUT, NULL, NULL, NULL);
371  pGpioDriver->set_pin(&GREEN_LED);
372 
373  /*! Initialize the I2C driver. */
374  status = I2Cdrv->Initialize(I2C_S_SIGNAL_EVENT);
375  if (ARM_DRIVER_OK != status)
376  {
377  return -1;
378  }
379 
380  /*! Set the I2C Power mode. */
381  status = I2Cdrv->PowerControl(ARM_POWER_FULL);
382  if (ARM_DRIVER_OK != status)
383  {
384  return -1;
385  }
386 
387  /*! Set the I2C bus speed. */
388  status = I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
389  if (ARM_DRIVER_OK != status)
390  {
391  return -1;
392  }
393 
394  /*! Initialize the UART driver. */
395  status = pUartDriver->Initialize(HOST_S_SIGNAL_EVENT);
396  if (ARM_DRIVER_OK != status)
397  {
398  return -1;
399  }
400 
401  /*! Set the UART Power mode. */
402  status = pUartDriver->PowerControl(ARM_POWER_FULL);
403  if (ARM_DRIVER_OK != status)
404  {
405  return -1;
406  }
407 
408  /*! Set UART Baud Rate. */
409  status = pUartDriver->Control(ARM_USART_MODE_ASYNCHRONOUS, BOARD_DEBUG_UART_BAUDRATE);
410  if (ARM_DRIVER_OK != status)
411  {
412  return -1;
413  }
414 
415  /*! Register with Host I/O Service and get a Stream ID. */
416  gStreamID = Host_IO_Init(pUartDriver, (void *)&I2C_S_DRIVER, &fxlc95000Driver.deviceInfo, NULL, FXLC95000_I2C_ADDR);
417  /* Confirm if a valid Stream ID has been allocated for this stream. */
418  if (0 == gStreamID)
419  {
420  return -1;
421  }
422 
423  /*! Populate streaming header. */
425  pGpioDriver->clr_pin(&RED_LED); /* Set the RED LED to indicate that Boot proccess has not been done.*/
426 
427  for (;;) /* Forever loop */
428  { /* Call UART Non-Blocking Receive to check for Commands from Host. */
430 
431  if (false == bStreamingEnabled || false == bFxlc95000DataReady)
432  {
433  SMC_SetPowerModeWait(SMC); /* Power save, wait if nothing to do. */
434  continue;
435  }
436  else
437  { /*! Clear the data ready flag, it will be set again by the ISR. */
438  bFxlc95000DataReady = false;
439  pGpioDriver->toggle_pin(&GREEN_LED);
440  }
441 
442  /*! Read raw sensor data from the FXLC95000. */
443  status = FXLC95000_I2C_CommandResponse(&fxlc95000Driver, NULL, cFxlc95000ReadSample,
444  streamingPacket + STREAMING_HEADER_LEN);
445  if (ARM_DRIVER_OK != status)
446  { /* Loop, if sample read failed. */
447  continue;
448  }
449 
450  /* Send streaming packet to Host. */
451  Host_IO_Send(streamingPacket, sizeof(streamingPacket), HOST_FORMAT_HDLC);
452  }
453 }
#define FXLC95000_SET_RESOLUTION_CMD_HDR
The FXLC95000 Set Resolution Command Header Bytes.
Definition: fxlc95000.h:46
const uint8_t cFxlc95000_SetResolution_Cmd[]
const registercommandlist_t cFxlc95000ConfigMBox[]
#define FXLC95000_I2C_ADDR
#define HOST_PRO_CMD_W_CFG_TAG
Definition: host_io_uart.h:89
int32_t FXLC95000_I2C_CheckRomMode(ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress)
The interface function to check if the sensor is in ROM CI Mode.
const uint8_t cFxlc95000_SetRange_Cmd[]
#define HOST_S_SIGNAL_EVENT
Definition: frdm_k64f.h:120
#define FXLC95000_ACCEL_RANGE_2G
The FXLC95000 FS Range 2G.
Definition: fxlc95000.h:55
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
char shieldString[ADS_MAX_STRING_LENGTH]
uint8_t gStreamID
int32_t status
registerDeviceInfo_t deviceInfo
Definition: fxlc95000_drv.h:72
char embAppName[ADS_MAX_STRING_LENGTH]
void(* toggle_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:74
#define SHIELD_NAME
int fxlc95000_enSensor(fxlc95000_i2c_sensorhandle_t *pSensorHandle)
#define ADS_MAX_STRING_LENGTH
#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
const uint8_t cFxlc95000_SetODR_Cmd[]
#define __END_READ_DATA__
Definition: sensor_drv.h:77
GENERIC_DRIVER_GPIO * pGpioDriver
volatile bool bFxlc95000Boot
#define APPLICATION_VERSION
Version to distinguish between instances the same application based on target Shield and updates...
const registercommandlist_t cFxlc95000ConfigSensor[]
#define FXLC95000_SET_RANGE_CMD_HDR
The FXLC95000 Set Range Command Header Bytes.
Definition: fxlc95000.h:49
const registercommandlist_t cFxlc95000FlashPostprocess[]
The fxlc95000_drv.h file describes the FXLC95000L driver interface and structures.
gpioHandleKSDK_t GREEN_LED
Definition: frdm_k64f.c:214
volatile bool bFxlc95000Ready
volatile bool bStreamingEnabled
int32_t FXLC95000_I2C_FlashPayload(ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t *pFlashBytes, uint8_t numBytes)
The interface function to write ROM CI Data Payload.
int32_t FXLC95000_I2C_FlashCommands(ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, const registercommandlist_t *pCommandList)
The interface function to write ROM CI Commands.
#define fxlc95000_odrCallback
#define FXLC95000_SAMPLE_OFFSET
Time stamp and XYZ Data Register Offset.
Definition: fxlc95000.h:16
#define __END_WRITE_CMD__
Definition: sensor_drv.h:83
void Host_IO_Add_ISO_Header(uint8_t streamID, uint8_t *pStreamingPacket, size_t sizePayload)
Definition: host_io_uart.c:112
#define APPLICATION_NAME
Unique Name for this application which should match the target GUI pkg name.
void Host_IO_Send(uint8_t *pMsg, size_t size, uint8_t encoding)
Definition: host_io_uart.c:162
void(* set_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:72
void(* clr_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:73
void FXLC95000_I2C_SetIdleTask(fxlc95000_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
void BOARD_SystickEnable(void)
Function to enable systicks framework.
Definition: systick_utils.c:70
int32_t FXLC95000_I2C_CommandResponse(fxlc95000_i2c_sensorhandle_t *pSensorHandle, const registercommandlist_t *pCommandList, const registerreadlist_t *pResponseList, uint8_t *pBuffer)
The interface function to read the sensor data.
#define I2C_S_DEVICE_INDEX
Definition: issdk_hal.h:61
#define FXLC95000_SET_ODR_CMD_HDR
The FXLC95000 Set Report Rate Command Header Bytes.
Definition: fxlc95000.h:43
fxlc95000_i2c_sensorhandle_t fxlc95000Driver
volatile bool bFxlc95000DataReady
#define I2C_S_DRIVER
Definition: issdk_hal.h:59
#define FXLC95000_SAMPLE_SIZE
char boardString[ADS_MAX_STRING_LENGTH]
GENERIC_DRIVER_GPIO Driver_GPIO_KSDK
Definition: gpio_driver.c:203
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
volatile bool bFxlc95000Flashing
#define BOARD_DEBUG_UART_BAUDRATE
Definition: board.h:57
gpioHandleKSDK_t RED_LED
Definition: frdm_k64f.c:207
Access structure of the GPIO Driver.
Definition: Driver_GPIO.h:64
int32_t FXLC95000_I2C_Initialize(fxlc95000_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint16_t buildId)
The interface function to initialize the sensor.
bool process_host_command(uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
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.
const registercommandlist_t cFxlc95000FlashPreprocess[]
#define FXLC95000_BUILD_ID
The FXLC95000 BCD encoded ISF1.1_95k_Build_ID.
Definition: fxlc95000.h:25
uint8_t Host_IO_Init(ARM_DRIVER_USART *pDrv, void *pBus, void *pDevInfo, void *spiSlaveParams, uint16_t slaveAddress)
Definition: host_io_uart.c:126
int main(void)
Main function.
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
const registerreadlist_t cFxlc95000ReadSample[]
This defines the sensor specific information for I2C.
Definition: fxlc95000_drv.h:70
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
This structure defines the Block command List.
Definition: sensor_drv.h:113
#define FXLC95000_SST_ODR_PAYLOAD(x)
The FXLC95000 Set Report Rate Payload Bytes.
Definition: fxlc95000.h:52
#define I2C_S_SIGNAL_EVENT
Definition: issdk_hal.h:60
#define HOST_S_DRIVER
Definition: frdm_k64f.h:119
#define SAMPLING_RATE_ms
#define FXLC95000_ACCEL_RESOLUTION_14_BIT
The FXLC95000 Resoultion 14-Bit.
Definition: fxlc95000.h:70