ISSDK  1.7
IoT Sensing Software Development Kit
fxos8700_demo.c
Go to the documentation of this file.
1 /*
2  * The Clear BSD License
3  * Copyright (c) 2015 - 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 fxos8700_demo.c
37  * @brief The fxos8700_demo.c file implements the ISSDK FXOS8700 sensor
38  * driver 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_I2C.h"
52 #include "Driver_USART.h"
53 
54 //-----------------------------------------------------------------------
55 // ISSDK Includes
56 //-----------------------------------------------------------------------
57 #include "issdk_hal.h"
58 #include "gpio_driver.h"
59 #include "fxos8700_drv.h"
60 #include "host_io_uart.h"
61 #include "systick_utils.h"
62 #include "auto_detection_service.h"
63 
64 //-----------------------------------------------------------------------
65 // Macros
66 //-----------------------------------------------------------------------
67 #define RAW_ACCEL_MAG_DATA_SIZE 12
68 #define FXOS8700_STREAM_DATA_SIZE 17
69 
70 /*! @brief Unique Name for this application which should match the target GUI pkg name. */
71 #define APPLICATION_NAME "FXOS8700 6-axis (Accel, Mag) Demo"
72 /*! @brief Version to distinguish between instances the same application based on target Shield and updates. */
73 #define APPLICATION_VERSION "2.5"
74 
75 /*! @brief This structure defines the fxos8700 raw data buffer.*/
76 typedef struct
77 {
78  uint32_t timestamp; /*! The time, this sample was recorded. */
79  int16_t accel[3]; /*!< The accel data */
80  int16_t mag[3]; /*!< The mag data */
81  uint8_t intsrc;
83 
84 //-----------------------------------------------------------------------
85 // Constants
86 //-----------------------------------------------------------------------
87 /*! Prepare the register write list to configure FXOS8700 in non-FIFO mode. */
89  /*! Clear F_SETUP. */
90  {FXOS8700_F_SETUP, 0x00, 0x00},
91  /*! Set FS 2G Mode. */
93  /*! Configure the FXOS8700 to 100Hz sampling rate. */
95  /*! Configure the FXOS8700 to Set High Resolution Mode. */
98  FXOS8700_CTRL_REG3_IPOL_MASK | FXOS8700_CTRL_REG3_PP_OD_MASK}, /*! Active High, Push-Pull */
104  {FXOS8700_CTRL_REG5,0x7E,0x00},
105  {FXOS8700_CTRL_REG4,255,0x00},
106 
107  //PL registers
110  {FXOS8700_PL_COUNT, 0x40, 0x00},//ff
113  {FXOS8700_PL_THS_REG,132,0x00},
114 
115  //Freefall registers
121  {FXOS8700_A_FFMT_COUNT,6,0x00},
122 
123  //Pulse registers
124  {FXOS8700_PULSE_CFG,21,0x00},
125  {FXOS8700_PULSE_TMLT,80,0x00},
126  {FXOS8700_PULSE_LTCY,240,0x00},
127  {FXOS8700_PULSE_THSX,55,0x00},
128  {FXOS8700_PULSE_THSY,55,0x00},
129  {FXOS8700_PULSE_THSZ,82,0x00},
130 
131  //VECM
132  { FXOS8700_A_VECM_CNT,15,0x00},
133  { FXOS8700_A_VECM_THS_LSB,88,0x00},
134  { FXOS8700_A_VECM_CFG,72,0x00},
137 
139 
140 /*! Command definition to read the Accel+Mag Data */
143 
145  {.readFrom = FXOS8700_INT_SOURCE, .numBytes = 1}, __END_READ_DATA__};
146 
148  {.readFrom = FXOS8700_A_FFMT_SRC , .numBytes = 1}, __END_READ_DATA__};
149 
151  {.readFrom = FXOS8700_PL_STATUS, .numBytes = 1}, __END_READ_DATA__};
152 
153 //-----------------------------------------------------------------------
154 // Global Variables
155 //-----------------------------------------------------------------------
158 volatile bool bStreamingEnabled = false, bFxos8700DataReady = false, bFxos8700Ready = false;
159 uint8_t gStreamID; /* The auto assigned Stream ID. */
162 
163 //-----------------------------------------------------------------------
164 // Functions
165 //-----------------------------------------------------------------------
166 /* This is the Sensor Data Ready ISR implementation.*/
167 void fxos8700_isr_callback(void *pUserData)
168 { /*! @brief Set flag to indicate Sensor has signalled data ready. */
169  bFxos8700DataReady = true;
170 }
171 
172 /* Handler for Device Info and Streaming Control Commands. */
174  uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
175 {
176  bool success = false;
177 
178  /* If it is Host requesting Device Info, send Board Name and Shield Name. */
179  if (tag == HOST_PRO_INT_DEV_TAG)
180  { /* Byte 1 : Payload - Length of APPLICATION_NAME (b)
181  * Bytes=b : Payload Application Name
182  * Byte b+1 : Payload - Length of BOARD_NAME (s)
183  * Bytes=s : Payload Board Name
184  * Byte b+s+2 : Payload - Length of SHIELD_NAME (v)
185  * Bytes=v : Payload Shield Name */
186 
187  size_t appNameLen = strlen(embAppName);
188  size_t boardNameLen = strlen(boardString);
189  size_t shieldNameLen = strlen(shieldString);
190 
191  if (respBufferSize >= boardNameLen + shieldNameLen + appNameLen + 3)
192  { /* We have sufficient buffer. */
193  *hostMsgSize = 0;
194  }
195  else
196  {
197  return false;
198  }
199 
200  hostResponse[*hostMsgSize] = appNameLen;
201  *hostMsgSize += 1;
202 
203  memcpy(hostResponse + *hostMsgSize, embAppName, appNameLen);
204  *hostMsgSize += appNameLen;
205 
206  hostResponse[*hostMsgSize] = boardNameLen;
207  *hostMsgSize += 1;
208 
209  memcpy(hostResponse + *hostMsgSize, boardString, boardNameLen);
210  *hostMsgSize += boardNameLen;
211 
212  hostResponse[*hostMsgSize] = shieldNameLen;
213  *hostMsgSize += 1;
214 
215  memcpy(hostResponse + *hostMsgSize, shieldString, shieldNameLen);
216  *hostMsgSize += shieldNameLen;
217 
218  return true;
219  }
220 
221  /* If it is Host sending Streaming Commands, take necessary actions. */
222  if ((tag == (HOST_PRO_INT_CMD_TAG | HOST_PRO_CMD_W_CFG_TAG)) &&
224  { /* Byte 1 : Payload - Operation Code (Start/Stop Operation Code)
225  * Byte 2 : Payload - Stream ID (Target Stream for carrying out operation) */
226  switch (hostCommand[0]) /* Execute desired operation (Start/Stop) on the requested Stream. */
227  {
228  case HOST_CMD_START:
229  if (hostCommand[1] == gStreamID && bFxos8700Ready && bStreamingEnabled == false)
230  {
232  bStreamingEnabled = true;
233  success = true;
234  }
235  break;
236  case HOST_CMD_STOP:
237  if (hostCommand[1] == gStreamID && bFxos8700Ready && bStreamingEnabled == true)
238  {
239  pGpioDriver->clr_pin(&GREEN_LED);
240  bStreamingEnabled = false;
241  success = true;
242  }
243  break;
244  default:
245  break;
246  }
247  *hostMsgSize = 0; /* Zero payload in response. */
248  }
249 
250  return success;
251 }
252 
253 /*!
254  * @brief Main function
255  */
256 int main(void)
257 {
258  int32_t status;
260 
261  fxos8700_i2c_sensorhandle_t fxos8700Driver;
263 
264  ARM_DRIVER_I2C *I2Cdrv = &I2C_S_DRIVER;
265  ARM_DRIVER_USART *pUartDriver = &HOST_S_DRIVER;
266 
267  /*! Initialize the MCU hardware. */
270 
271  /* Create the Short Application Name String for ADS. */
272  sprintf(embAppName, "%s:%s", APPLICATION_NAME, APPLICATION_VERSION);
273 
274  /* Run ADS. */
276 
277  /* Create the Full Application Name String for Device Info Response. */
279 
280  /*! Initialize INT1_FXAS21002 pin used by FRDM board */
281  pGpioDriver->pin_init(&FXOS8700_INT2, GPIO_DIRECTION_IN, NULL, &fxos8700_isr_callback, NULL);
282 
283  /*! Initialize RGB LED pin used by FRDM board */
284  pGpioDriver->pin_init(&GREEN_LED, GPIO_DIRECTION_OUT, NULL, NULL, NULL);
285 
286  /*! Initialize the I2C driver. */
287  status = I2Cdrv->Initialize(I2C_S_SIGNAL_EVENT);
288  if (ARM_DRIVER_OK != status)
289  {
290  return -1;
291  }
292 
293  /*! Set the I2C Power mode. */
294  status = I2Cdrv->PowerControl(ARM_POWER_FULL);
295  if (ARM_DRIVER_OK != status)
296  {
297  return -1;
298  }
299 
300  /*! Set the I2C bus speed. */
301  status = I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
302  if (ARM_DRIVER_OK != status)
303  {
304  return -1;
305  }
306 
307  /*! Initialize the UART driver. */
308  status = pUartDriver->Initialize(HOST_S_SIGNAL_EVENT);
309  if (ARM_DRIVER_OK != status)
310  {
311  return -1;
312  }
313 
314  /*! Set the UART Power mode. */
315  status = pUartDriver->PowerControl(ARM_POWER_FULL);
316  if (ARM_DRIVER_OK != status)
317  {
318  return -1;
319  }
320 
321  /*! Set UART Baud Rate. */
322  status = pUartDriver->Control(ARM_USART_MODE_ASYNCHRONOUS, BOARD_DEBUG_UART_BAUDRATE);
323  if (ARM_DRIVER_OK != status)
324  {
325  return -1;
326  }
327 
328  /*! Initialize the FXOS8700 sensor driver. */
331  if (SENSOR_ERROR_NONE == status)
332  {
333  /*! Set the task to be executed while waiting for I2C transactions to complete. */
335 
336  /*! Configure the fxos8700 sensor driver. */
337  status = FXOS8700_I2C_Configure(&fxos8700Driver, fxos8700_Config_InterruptHybrid);
338  if (SENSOR_ERROR_NONE == status)
339  {
340  bFxos8700Ready = true;
341  }
342  }
343 
344  /*! Initialize streaming and assign a Stream ID. */
345  gStreamID =
346  Host_IO_Init(pUartDriver, (void *)fxos8700Driver.pCommDrv, &fxos8700Driver.deviceInfo, NULL, FXOS8700_I2C_ADDR);
347  /* Confirm if a valid Stream ID has been allocated for this stream. */
348  if (0 == gStreamID)
349  {
350  bFxos8700Ready = false;
351  }
352  else
353  {
354  /*! Populate streaming header. */
356  pGpioDriver->clr_pin(&GREEN_LED);
357  }
358 
359  for (;;) /* Forever loop */
360  { /* Call UART Non-Blocking Receive. */
362 
363  /* Process packets only if streaming has been enabled by Host and ISR is available.
364  * In ISR Mode we do not need to check Data Ready Register.
365  * The receipt of interrupt will indicate data is ready. */
366  if (false == bStreamingEnabled || false == bFxos8700DataReady)
367  {
368  SMC_SetPowerModeWait(SMC); /* Power save, wait if nothing to do. */
369  continue;
370  }
371  else
372  { /*! Clear the data ready flag, it will be set again by the ISR. */
373  bFxos8700DataReady = false;
374  pGpioDriver->toggle_pin(&GREEN_LED);
375  }
376 
377  /*! Read the raw sensor data from the fxos8700. */
378  status = FXOS8700_I2C_ReadData(&fxos8700Driver, FXOS8700_ACCEL_READ, data);
379  if (ARM_DRIVER_OK != status)
380  { /* Loop, if sample read failed. */
381  continue;
382  }
383 
384  /* Update timestamp from Systick framework. */
386 
387  /*! Convert the raw sensor data to signed 16-bit container for display to the debug port. */
388  rawData.accel[0] = ((int16_t)data[0] << 8) | data[1];
389  rawData.accel[0] /= 4;
390  rawData.accel[1] = ((int16_t)data[2] << 8) | data[3];
391  rawData.accel[1] /= 4;
392  rawData.accel[2] = ((int16_t)data[4] << 8) | data[5];
393  rawData.accel[2] /= 4;
394  rawData.mag[0] = ((int16_t)data[6] << 8) | data[7];
395  rawData.mag[1] = ((int16_t)data[8] << 8) | data[9];
396  rawData.mag[2] = ((int16_t)data[10] << 8) | data[11];
397 
398  status = FXOS8700_I2C_ReadData(&fxos8700Driver, cFXOS8700_int_src, &regdata);
399 
400  // The following condition checks for multiple interrupts occuring at the same time and sends only one out as per order below.
401  // Check for Freefall interrupt
402  if((regdata & 0x04) == 0x04)
403  {
404  rawData.intsrc = 0x04;
405  }
406  // Check for Vector Magnitude change interrupt
407  else if((regdata & 0x02) == 0x02)
408  {
409  rawData.intsrc = 0x02;
410  }
411  // Else send other interrupts
412  else
413  {
414  rawData.intsrc = regdata;
415  }
416 
417  // read FFMT interrupt source register to clear flags
418  status = FXOS8700_I2C_ReadData(&fxos8700Driver, cFXOS8700_int_src, &regdata);
419  status = FXOS8700_I2C_ReadData(&fxos8700Driver, cFXOS8700_ffmt_src, &regdata);
420  status = FXOS8700_I2C_ReadData(&fxos8700Driver, cFXOS8700_pl_status, &regdata);
421 
422  /* Copy Raw samples to Streaming Buffer. */
423  memcpy(streamingPacket + STREAMING_HEADER_LEN, &rawData, FXOS8700_STREAM_DATA_SIZE);
424  /* Send streaming packet to Host. */
425  Host_IO_Send(streamingPacket, sizeof(streamingPacket), HOST_FORMAT_HDLC);
426  }
427 }
#define FXOS8700_M_CTRL_REG1_M_HMS_MASK
Definition: fxos8700.h:2573
uint32_t BOARD_SystickElapsedTime_us(int32_t *pStart)
Function to compute the Elapsed Time.
Definition: systick_utils.c:99
#define FXOS8700_PL_CFG_DBCNTM_MASK
Definition: fxos8700.h:796
#define FXOS8700_M_CTRL_REG1_M_ACAL_EN
Definition: fxos8700.h:2592
#define FXOS8700_PL_CFG_DBCNTM_CLEAR_MODE
Definition: fxos8700.h:805
#define __END_WRITE_DATA__
Definition: sensor_drv.h:71
The fxos8700_drv.h file describes the fxos8700 driver interface and structures.
#define HOST_PRO_CMD_W_CFG_TAG
Definition: host_io_uart.h:89
void FXOS8700_I2C_SetIdleTask(fxos8700_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
Definition: fxos8700_drv.c:278
#define FXOS8700_CTRL_REG2_MODS_HIGH_RES
Definition: fxos8700.h:1625
#define HOST_S_SIGNAL_EVENT
Definition: frdm_k64f.h:120
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 FXOS8700_CTRL_REG4_INT_EN_DRDY_EN
Definition: fxos8700.h:1781
#define FXOS8700_PL_CFG_PL_EN_ENABLE
Definition: fxos8700.h:808
#define FXOS8700_A_FFMT_CFG_ZEFE_RAISE_EVENT
Definition: fxos8700.h:979
int32_t gSystick
uint8_t data[FXLS8962_DATA_SIZE]
#define FXOS8700_A_VECM_THS_MSB_A_VBECM_THS_MASK
Definition: fxos8700.h:2853
int32_t status
This structure defines the fxos8700 raw data buffer.
Definition: fxos8700_demo.c:76
void(* toggle_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:74
#define SHIELD_NAME
#define FXOS8700_XYZ_DATA_CFG_FS_2G_0P244
Definition: fxos8700.h:686
ARM_DRIVER_I2C * pCommDrv
Definition: fxos8700_drv.h:73
#define FXOS8700_A_FFMT_CFG_OAE_FREEFALL
Definition: fxos8700.h:976
#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
This defines the sensor specific information for I2C.
Definition: fxos8700_drv.h:70
#define HOST_PRO_INT_CMD_TAG
Bit aligned values for Host Protocol Interface IDs (Bits 5-6).
Definition: host_io_uart.h:83
#define FXOS8700_CTRL_REG3_IPOL_ACTIVE_HIGH
Definition: fxos8700.h:1706
#define __END_READ_DATA__
Definition: sensor_drv.h:77
const registerwritelist_t fxos8700_Config_InterruptHybrid[]
Definition: fxos8700_demo.c:88
#define FXOS8700_A_VECM_THS_MSB_A_VBECM_DBCNTM_MASK
Definition: fxos8700.h:2856
#define FXOS8700_CTRL_REG4_INT_EN_DRDY_MASK
Definition: fxos8700.h:1737
#define FXOS8700_CTRL_REG2_MODS_MASK
Definition: fxos8700.h:1594
#define FXOS8700_WHO_AM_I_PROD_VALUE
Definition: fxos8700.h:172
const registerreadlist_t FXOS8700_ACCEL_READ[]
#define FXOS8700_STREAM_DATA_SIZE
Definition: fxos8700_demo.c:68
#define FXOS8700_A_FFMT_CFG_ZEFE_MASK
Definition: fxos8700.h:961
#define FXOS8700_CTRL_REG3_PP_OD_PUSH_PULL
Definition: fxos8700.h:1707
gpioHandleKSDK_t GREEN_LED
Definition: frdm_k64f.c:214
const registerreadlist_t cFXOS8700_ffmt_src[]
#define FXOS8700_INT2
#define FXOS8700_M_CTRL_REG2_M_AUTOINC_MASK
Definition: fxos8700.h:2660
#define FXOS8700_M_CTRL_REG1_M_ACAL_MASK
Definition: fxos8700.h:2585
#define FXOS8700_CTRL_REG1_DR_HYBRID_100_HZ
Definition: fxos8700.h:1554
#define FXOS8700_A_FFMT_CFG_XEFE_MASK
Definition: fxos8700.h:955
bool process_host_command(uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
#define APPLICATION_VERSION
Version to distinguish between instances the same application based on target Shield and updates...
Definition: fxos8700_demo.c:73
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 FXOS8700_CTRL_REG5_INT_CFG_DRDY_INT2
Definition: fxos8700.h:1852
void(* clr_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:73
int32_t FXOS8700_I2C_Initialize(fxos8700_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t whoAmi)
The interface function to initialize the sensor.
Definition: fxos8700_drv.c:248
char shieldString[ADS_MAX_STRING_LENGTH]
void BOARD_SystickEnable(void)
Function to enable systicks framework.
Definition: systick_utils.c:70
int32_t FXOS8700_I2C_ReadData(fxos8700_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
Definition: fxos8700_drv.c:331
registerDeviceInfo_t deviceInfo
Definition: fxos8700_drv.h:72
#define APPLICATION_NAME
Unique Name for this application which should match the target GUI pkg name.
Definition: fxos8700_demo.c:71
#define FXOS8700_M_CTRL_REG2_M_AUTOINC_HYBRID_MODE
Definition: fxos8700.h:2667
volatile bool bStreamingEnabled
#define I2C_S_DEVICE_INDEX
Definition: issdk_hal.h:61
volatile bool bFxos8700DataReady
#define FXOS8700_A_FFMT_CFG_YEFE_RAISE_EVENT
Definition: fxos8700.h:982
#define RAW_ACCEL_MAG_DATA_SIZE
Definition: fxos8700_demo.c:67
#define FXOS8700_PL_BF_ZCOMP_ZLOCK_MASK
Definition: fxos8700.h:857
#define FXOS8700_M_CTRL_REG1_M_OS_MASK
Definition: fxos8700.h:2576
#define FXOS8700_CTRL_REG5_INT_CFG_DRDY_MASK
Definition: fxos8700.h:1810
#define FXOS8700_A_FFMT_THS_THS_MASK
Definition: fxos8700.h:1059
#define I2C_S_DRIVER
Definition: issdk_hal.h:59
#define FXOS8700_A_FFMT_CFG_YEFE_MASK
Definition: fxos8700.h:958
GENERIC_DRIVER_GPIO Driver_GPIO_KSDK
Definition: gpio_driver.c:203
int32_t FXOS8700_I2C_Configure(fxos8700_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
Definition: fxos8700_drv.c:286
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
GENERIC_DRIVER_GPIO * pGpioDriver
#define BOARD_DEBUG_UART_BAUDRATE
Definition: board.h:57
#define FXOS8700_CTRL_REG1_DR_MASK
Definition: fxos8700.h:1530
#define FXOS8700_XYZ_DATA_CFG_FS_MASK
Definition: fxos8700.h:673
Access structure of the GPIO Driver.
Definition: Driver_GPIO.h:64
void BOARD_SystickStart(int32_t *pStart)
Function to Record the Start systick.
Definition: systick_utils.c:79
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.
fxls8962_acceldataUser_t rawData
volatile bool bFxos8700Ready
uint8_t Host_IO_Init(ARM_DRIVER_USART *pDrv, void *pBus, void *pDevInfo, void *spiSlaveParams, uint16_t slaveAddress)
Definition: host_io_uart.c:126
char embAppName[ADS_MAX_STRING_LENGTH]
const registerreadlist_t cFXOS8700_int_src[]
#define FXOS8700_A_FFMT_CFG_OAE_MASK
Definition: fxos8700.h:964
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
#define FXOS8700_M_CTRL_REG1_M_OS_OSR0
Definition: fxos8700.h:2603
The host_io_uart.h file contains the Host Protocol interface definitions and configuration.
#define STREAMING_HEADER_LEN
Definition: host_io_uart.h:51
#define FXOS8700_PL_CFG_PL_EN_MASK
Definition: fxos8700.h:793
#define FXOS8700_PL_BF_ZCOMP_BKFR_MASK
Definition: fxos8700.h:860
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
char boardString[ADS_MAX_STRING_LENGTH]
#define FXOS8700_CTRL_REG3_IPOL_MASK
Definition: fxos8700.h:1658
const registerreadlist_t cFXOS8700_pl_status[]
#define FXOS8700_A_FFMT_CFG_XEFE_RAISE_EVENT
Definition: fxos8700.h:985
void fxos8700_isr_callback(void *pUserData)
#define FXOS8700_I2C_ADDR
#define FXOS8700_M_CTRL_REG1_M_HMS_HYBRID_MODE
Definition: fxos8700.h:2621
#define FXOS8700_CTRL_REG3_PP_OD_MASK
Definition: fxos8700.h:1655
int main(void)
Main function.
#define I2C_S_SIGNAL_EVENT
Definition: issdk_hal.h:60
#define HOST_S_DRIVER
Definition: frdm_k64f.h:119
uint8_t gStreamID