ISSDK  1.7
IoT Sensing Software Development Kit
mma845x_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 mma845x_demo.c
37  * @brief The mma845x_demo.c file implements the ISSDK MMA845x 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_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 "mma845x_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 MMA845x_STREAM_DATA_SIZE 11 /* 6+1 byte Data */
68 
69 /*! @brief Unique Name for this application which should match the target GUI pkg name. */
70 #define APPLICATION_NAME "MMA845x Accelerometer Demo"
71 /*! @brief Version to distinguish between instances the same application based on target Shield and updates. */
72 #define APPLICATION_VERSION "2.5"
73 
74 typedef struct
75 {
76  uint32_t timestamp; /*!< Time stamp value in micro-seconds. */
77  int16_t accel[3]; /*!< The accel data */
78  uint8_t intsrc;
80 
81 //-----------------------------------------------------------------------
82 // Constants
83 //-----------------------------------------------------------------------
84 /*! Prepare the register write list to configure MMA845x in non-FIFO and ISR mode. */
86  /*! Configure the MMA845x to disable FIFO */
87  {MMA845x_F_SETUP, 0x00, 0},
88  /*! Configure the MMA845x XYZ_DATA_CFG to set FS Range 2G. */
90  /*! Configure the MMA845x CTRL_REG1 to set ODR to 100Hz. */
92  /*! Configure the MMA845x CTRL_REG2 to set the Oversampling mode to High Resolution. */
94  /*! Configure the MMA845x CTRL_REG3 to set the Interrupt polarity to ACTIVE high. */
96  /*! Configure the MMA845x CTRL_REG4 to enable the data ready interrupt. */
97  /*! Configure the MMA845x to set interrupt polarity as Active High. */
99  /*! Configure the MMA845x to set interrupt polarity as Active High. */
100  {MMA845x_PL_COUNT, 0xFF, 0},
101  /*! Configure the MMA845x to set interrupt polarity as Active High. */
103  /*! Configure the MMA845x to set interrupt polarity as Active High. */
104  {MMA845x_FF_MT_COUNT, 0x02, 0},
105  /*! Configure the MMA845x to set interrupt polarity as Active High. */
107  /*! Configure the MMA845x to set interrupt polarity as Active High. */
109  /*! Configure the MMA845x to set interrupt polarity as Active High. */
111  /*! Configure the MMA845x to set interrupt polarity as Active High. */
112  {MMA845x_TRANSIENT_COUNT, 0x0C, 0},
113  /*! Configure the MMA845x to set interrupt polarity as Active High. */
115  /*! Configure the MMA845x to set interrupt polarity as Active High. */
116  {MMA845x_PULSE_THSX, 0x37, 0},
117  /*! Configure the MMA845x to set interrupt polarity as Active High. */
118  {MMA845x_PULSE_THSY, 0x37, 0},
119  /*! Configure the MMA845x to set interrupt polarity as Active High. */
120  {MMA845x_PULSE_THSZ, 0x52, 0},
121  /*! Configure the MMA845x to set interrupt polarity as Active High. */
122  {MMA845x_PULSE_TMLT, 0x30, 0},
123  /*! Configure the MMA845x to set interrupt polarity as Active High. */
124  {MMA845x_PULSE_LTCY, 0xF0, 0},
125  /*! Configure the MMA845x to set interrupt polarity as Active High. */
126  {MMA845x_PULSE_WIND, 0x3C, 0},
127  /*! Configure the MMA845x to enable Interrupts for Data Ready. */
129  /*! Configure the MMA845x CTRL_REG5 to route Interrupt to INT1 pin. */
132 
133 /*! Prepare the register read list to read the raw Accel data from MMA845x. */
136 /*! Prepare the register read for Status Register. */
138  {.readFrom = MMA845x_INT_SOURCE, .numBytes = 1}, __END_READ_DATA__};
140  {.readFrom = MMA845x_PL_STATUS, .numBytes = 1}, __END_READ_DATA__};
141 
142 //-----------------------------------------------------------------------
143 // Global Variables
144 //-----------------------------------------------------------------------
147 volatile bool bStreamingEnabled = false, bMma845xDataReady = false, bMma845xReady = false;
148 uint8_t gStreamID; /* The auto assigned Stream ID. */
151 
152 //-----------------------------------------------------------------------
153 // Functions
154 //-----------------------------------------------------------------------
155 /* This is the Sensor Data Ready ISR implementation.*/
156 void mma845x_int_data_ready_callback(void *pUserData)
157 { /*! @brief Set flag to indicate Sensor has signalled data ready. */
158  bMma845xDataReady = true;
159 }
160 
161 /* Handler for Device Info and Streaming Control Commands. */
163  uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
164 {
165  bool success = false;
166 
167  /* If it is Host requesting Device Info, send Board Name and Shield Name. */
168  if (tag == HOST_PRO_INT_DEV_TAG)
169  { /* Byte 1 : Payload - Length of APPLICATION_NAME (b)
170  * Bytes=b : Payload Application Name
171  * Byte b+1 : Payload - Length of BOARD_NAME (s)
172  * Bytes=s : Payload Board Name
173  * Byte b+s+2 : Payload - Length of SHIELD_NAME (v)
174  * Bytes=v : Payload Shield Name */
175 
176  size_t appNameLen = strlen(embAppName);
177  size_t boardNameLen = strlen(boardString);
178  size_t shieldNameLen = strlen(shieldString);
179 
180  if (respBufferSize >= boardNameLen + shieldNameLen + appNameLen + 3)
181  { /* We have sufficient buffer. */
182  *hostMsgSize = 0;
183  }
184  else
185  {
186  return false;
187  }
188 
189  hostResponse[*hostMsgSize] = appNameLen;
190  *hostMsgSize += 1;
191 
192  memcpy(hostResponse + *hostMsgSize, embAppName, appNameLen);
193  *hostMsgSize += appNameLen;
194 
195  hostResponse[*hostMsgSize] = boardNameLen;
196  *hostMsgSize += 1;
197 
198  memcpy(hostResponse + *hostMsgSize, boardString, boardNameLen);
199  *hostMsgSize += boardNameLen;
200 
201  hostResponse[*hostMsgSize] = shieldNameLen;
202  *hostMsgSize += 1;
203 
204  memcpy(hostResponse + *hostMsgSize, shieldString, shieldNameLen);
205  *hostMsgSize += shieldNameLen;
206 
207  return true;
208  }
209 
210  /* If it is Host sending Streaming Commands, take necessary actions. */
211  if ((tag == (HOST_PRO_INT_CMD_TAG | HOST_PRO_CMD_W_CFG_TAG)) &&
213  { /* Byte 1 : Payload - Operation Code (Start/Stop Operation Code)
214  * Byte 2 : Payload - Stream ID (Target Stream for carrying out operation) */
215  switch (hostCommand[0]) /* Execute desired operation (Start/Stop) on the requested Stream. */
216  {
217  case HOST_CMD_START:
218  if (hostCommand[1] == gStreamID && bMma845xReady && bStreamingEnabled == false)
219  {
221  bStreamingEnabled = true;
222  success = true;
223  }
224  break;
225  case HOST_CMD_STOP:
226  if (hostCommand[1] == gStreamID && bMma845xReady && bStreamingEnabled == true)
227  {
228  pGpioDriver->clr_pin(&GREEN_LED);
229  bStreamingEnabled = false;
230  success = true;
231  }
232  break;
233  default:
234  break;
235  }
236  *hostMsgSize = 0; /* Zero payload in response. */
237  }
238 
239  return success;
240 }
241 
242 /*!
243  * @brief Main function
244  */
245 int main(void)
246 {
247  int32_t status;
249 
250  mma845x_i2c_sensorhandle_t mma845xDriver;
252 
253  ARM_DRIVER_I2C *pI2cDriver = &I2C_S_DRIVER;
254  ARM_DRIVER_USART *pUartDriver = &HOST_S_DRIVER;
255 
256  /*! Initialize the MCU hardware. */
259 
260  /* Create the Short Application Name String for ADS. */
261  sprintf(embAppName, "%s:%s", APPLICATION_NAME, APPLICATION_VERSION);
262 
263  /* Run ADS. */
265 
266  /* Create the Full Application Name String for Device Info Response. */
268 
269  /*! Initialize INT1 MMA845x pin used by FRDM board */
271 
272  /*! Initialize GREEN LED pin used by FRDM board */
273  pGpioDriver->pin_init(&GREEN_LED, GPIO_DIRECTION_OUT, NULL, NULL, NULL);
274 
275  /*! Initialize the I2C driver. */
276  status = pI2cDriver->Initialize(I2C_S_SIGNAL_EVENT);
277  if (ARM_DRIVER_OK != status)
278  {
279  return -1;
280  }
281 
282  /*! Set the I2C Power mode. */
283  status = pI2cDriver->PowerControl(ARM_POWER_FULL);
284  if (ARM_DRIVER_OK != status)
285  {
286  return -1;
287  }
288 
289  /*! Set the I2C bus speed. */
290  status = pI2cDriver->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
291  if (ARM_DRIVER_OK != status)
292  {
293  return -1;
294  }
295 
296  /*! Initialize the UART driver. */
297  status = pUartDriver->Initialize(HOST_S_SIGNAL_EVENT);
298  if (ARM_DRIVER_OK != status)
299  {
300  return -1;
301  }
302 
303  /*! Set the UART Power mode. */
304  status = pUartDriver->PowerControl(ARM_POWER_FULL);
305  if (ARM_DRIVER_OK != status)
306  {
307  return -1;
308  }
309 
310  /*! Set UART Baud Rate. */
311  status = pUartDriver->Control(ARM_USART_MODE_ASYNCHRONOUS, BOARD_DEBUG_UART_BAUDRATE);
312  if (ARM_DRIVER_OK != status)
313  {
314  return -1;
315  }
316 
317  /*! Initialize the MMA845x sensor driver. */
320  if (SENSOR_ERROR_NONE == status)
321  {
322  /*! Set the task to be executed while waiting for I2C transactions to complete. */
324 
325  /*! Configure the MMA845x sensor driver. */
326  status = MMA845x_I2C_Configure(&mma845xDriver, mma845x_Config_Isr);
327  if (SENSOR_ERROR_NONE == status)
328  {
329  bMma845xReady = true;
330  }
331  }
332 
333  /*! Initialize streaming and assign a Stream ID. */
334  gStreamID =
335  Host_IO_Init(pUartDriver, (void *)mma845xDriver.pCommDrv, &mma845xDriver.deviceInfo, NULL, MMA845x_I2C_ADDR);
336  /* Confirm if a valid Stream ID has been allocated for this stream. */
337  if (0 == gStreamID)
338  {
339  bMma845xReady = false;
340  }
341  else
342  {
343  /*! Populate streaming header. */
345  pGpioDriver->clr_pin(&GREEN_LED); /* Set LED to indicate application is ready. */
346  }
347 
348  for (;;) /* Forever loop */
349  { /* Call UART Non-Blocking Receive. */
351 
352  /* Process packets only if streaming has been enabled by Host and ISR is available.
353  * In ISR Mode we do not need to check Data Ready Register.
354  * The receipt of interrupt will indicate data is ready. */
355  if (false == bStreamingEnabled || false == bMma845xDataReady)
356  {
357  SMC_SetPowerModeWait(SMC); /* Power save, wait if nothing to do. */
358  continue;
359  }
360  else
361  { /*! Clear the data ready flag, it will be set again by the ISR. */
362  bMma845xDataReady = false;
363  pGpioDriver->toggle_pin(&GREEN_LED);
364  }
365 
366  /*! Read raw sensor data from the MMA845x. */
367  status = MMA845x_I2C_ReadData(&mma845xDriver, mma845x_Output_Values, data);
368  if (ARM_DRIVER_OK != status)
369  { /* Loop, if sample read failed. */
370  continue;
371  }
372 
373  /* Update timestamp from Systick framework. */
375 
376  /*! Convert the raw sensor data to signed 32-bit and 16-bit containers for display to the debug port. */
377  rawData.accel[0] = ((int16_t)data[0] << 8) | data[1];
378  rawData.accel[0] /= 4;
379  rawData.accel[1] = ((int16_t)data[2] << 8) | data[3];
380  rawData.accel[1] /= 4;
381  rawData.accel[2] = ((int16_t)data[4] << 8) | data[5];
382  rawData.accel[2] /= 4;
383 
384  /*! Read INT_SRC 0x0C from MMA845x. */
385  status = MMA845x_I2C_ReadData(&mma845xDriver, cMma845xqStatus, &intsrcdata);
386  status = MMA845x_I2C_ReadData(&mma845xDriver, cMma845xqPLStatus, &PLstatusdata);
387  /* Send INTSRC */
388  rawData.intsrc = intsrcdata;
389 
390  /* Copy Raw samples to Streaming Buffer. */
391  memcpy(streamingPacket + STREAMING_HEADER_LEN, &rawData, MMA845x_STREAM_DATA_SIZE);
392  /* Send streaming packet to Host. */
393  Host_IO_Send(streamingPacket, sizeof(streamingPacket), HOST_FORMAT_HDLC);
394  }
395 }
uint32_t BOARD_SystickElapsedTime_us(int32_t *pStart)
Function to compute the Elapsed Time.
Definition: systick_utils.c:99
const registerwritelist_t mma845x_Config_Isr[]
Definition: mma845x_demo.c:85
volatile bool bMma845xReady
Definition: mma845x_demo.c:147
#define MMA845x_FF_MT_CFG_ZEFE_ENABLED
Definition: mma845x.h:864
#define MMA845x_CTRL_REG5_INT_CFG_DRDY_INT1
Definition: mma845x.h:1921
#define __END_WRITE_DATA__
Definition: sensor_drv.h:71
ARM_DRIVER_I2C * pCommDrv
Definition: mma845x_drv.h:58
int main(void)
Main function.
Definition: mma845x_demo.c:245
#define MMA845x_CTRL_REG1_DR_100HZ
Definition: mma845x.h:1634
#define HOST_PRO_CMD_W_CFG_TAG
Definition: host_io_uart.h:89
const registerreadlist_t cMma845xqStatus[]
Definition: mma845x_demo.c:137
#define HOST_S_SIGNAL_EVENT
Definition: frdm_k64f.h:120
This defines the sensor specific information.
Definition: mma845x_drv.h:55
bool process_host_command(uint8_t tag, uint8_t *hostCommand, uint8_t *hostResponse, size_t *hostMsgSize, size_t respBufferSize)
Definition: mma845x_demo.c:162
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
char embAppName[ADS_MAX_STRING_LENGTH]
Definition: mma845x_demo.c:146
#define BOARD_BootClockRUN
Definition: clock_config.h:45
#define MMA845x_CTRL_REG3_IPOL_HIGH
Definition: mma845x.h:1770
#define MMA845x_PULSE_CFG_YSPEFE_ENABLED
Definition: mma845x.h:1285
#define MMA845x_TRANSIENT_CFG_ZTEFE_ENABLED
Definition: mma845x.h:1074
uint8_t data[FXLS8962_DATA_SIZE]
int32_t status
void(* toggle_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:74
#define SHIELD_NAME
#define MMA845x_CTRL_REG4_INT_EN_LNDPRT_ENABLED
Definition: mma845x.h:1853
#define MMA845x_FF_MT_CFG_YEFE_ENABLED
Definition: mma845x.h:861
#define MMA845x_PL_CFG_DBCNTM_CLR
Definition: mma845x.h:700
#define MMA845x_PL_CFG_PL_EN_ENABLED
Definition: mma845x.h:697
#define ADS_MAX_STRING_LENGTH
#define MMA845x_TRANSIENT_THS_DBCNTM_CLR
Definition: mma845x.h:1189
#define MMA845x_CTRL_REG4_INT_EN_PULSE_ENABLED
Definition: mma845x.h:1850
#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 MMA845x_PULSE_CFG_XSPEFE_ENABLED
Definition: mma845x.h:1281
#define HOST_PRO_INT_CMD_TAG
Bit aligned values for Host Protocol Interface IDs (Bits 5-6).
Definition: host_io_uart.h:83
int32_t MMA845x_I2C_Initialize(mma845x_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: mma845x_drv.c:48
#define __END_READ_DATA__
Definition: sensor_drv.h:77
#define MMA845x_PULSE_CFG_ZSPEFE_ENABLED
Definition: mma845x.h:1289
#define MMA845x_CTRL_REG2_MODS_HIGHRES
Definition: mma845x.h:1695
#define MMA845x_FF_MT_THS_DBCNTM_CLR
Definition: mma845x.h:979
gpioHandleKSDK_t GREEN_LED
Definition: frdm_k64f.c:214
#define MMA845x_FF_MT_CFG_XEFE_ENABLED
Definition: mma845x.h:858
#define MMA845x_CTRL_REG4_INT_EN_DRDY_ENABLED
Definition: mma845x.h:1846
#define MMA845x_FF_MT_CFG_OAE_FREEFALL
Definition: mma845x.h:866
volatile bool bStreamingEnabled
Definition: mma845x_demo.c:147
void Host_IO_Add_ISO_Header(uint8_t streamID, uint8_t *pStreamingPacket, size_t sizePayload)
Definition: host_io_uart.c:112
const registerreadlist_t cMma845xqPLStatus[]
Definition: mma845x_demo.c:139
void Host_IO_Send(uint8_t *pMsg, size_t size, uint8_t encoding)
Definition: host_io_uart.c:162
char shieldString[ADS_MAX_STRING_LENGTH]
Definition: mma845x_demo.c:145
GENERIC_DRIVER_GPIO * pGpioDriver
Definition: mma845x_demo.c:150
void(* clr_pin)(pinID_t aPinId)
Definition: Driver_GPIO.h:73
void BOARD_SystickEnable(void)
Function to enable systicks framework.
Definition: systick_utils.c:70
#define MMA845x_CTRL_REG4_INT_EN_TRANS_ENABLED
Definition: mma845x.h:1855
#define MMA845x_STREAM_DATA_SIZE
Definition: mma845x_demo.c:67
#define MMA845x_I2C_ADDR
Definition: frdm_kl25z.h:128
#define I2C_S_DEVICE_INDEX
Definition: issdk_hal.h:61
int32_t MMA845x_I2C_ReadData(mma845x_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
Definition: mma845x_drv.c:130
#define MMA845x_XYZ_DATA_CFG_FS_MASK
Definition: mma845x.h:536
#define I2C_S_DRIVER
Definition: issdk_hal.h:59
volatile bool bMma845xDataReady
Definition: mma845x_demo.c:147
#define MMA845x_TRANSIENT_CFG_YTEFE_ENABLED
Definition: mma845x.h:1071
int32_t gSystick
Definition: mma845x_demo.c:149
GENERIC_DRIVER_GPIO Driver_GPIO_KSDK
Definition: gpio_driver.c:203
#define APPLICATION_NAME
Unique Name for this application which should match the target GUI pkg name.
Definition: mma845x_demo.c:70
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
#define MMA845x_INT1
Definition: frdm_kl25z.h:129
#define BOARD_DEBUG_UART_BAUDRATE
Definition: board.h:57
registerDeviceInfo_t deviceInfo
Definition: mma845x_drv.h:57
int32_t MMA845x_I2C_Configure(mma845x_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
Definition: mma845x_drv.c:87
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
#define MMA845x_CTRL_REG4_INT_EN_FF_MT_ENABLED
Definition: mma845x.h:1848
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
void mma845x_int_data_ready_callback(void *pUserData)
Definition: mma845x_demo.c:156
#define APPLICATION_VERSION
Version to distinguish between instances the same application based on target Shield and updates...
Definition: mma845x_demo.c:72
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 MMA845x_XYZ_DATA_CFG_FS_FS_RANGE_2G
Definition: mma845x.h:546
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
void MMA845x_I2C_SetIdleTask(mma845x_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
Definition: mma845x_drv.c:79
#define MMA845x_ACCEL_DATA_SIZE
The size of the MMA845x accel data.
Definition: mma845x_drv.h:73
#define MMA845x_TRANSIENT_CFG_XTEFE_ENABLED
Definition: mma845x.h:1068
char boardString[ADS_MAX_STRING_LENGTH]
Definition: mma845x_demo.c:145
#define MMA845x_CTRL_REG1_DR_MASK
Definition: mma845x.h:1615
#define I2C_S_SIGNAL_EVENT
Definition: issdk_hal.h:60
const registerreadlist_t mma845x_Output_Values[]
Definition: mma845x_demo.c:134
#define MMA8451_WHO_AM_I_WHOAMI_VALUE
Definition: mma845x.h:508
#define HOST_S_DRIVER
Definition: frdm_k64f.h:119
The mma845x_drv.h file describes the MMA845x driver interface and structures.
uint8_t gStreamID
Definition: mma845x_demo.c:148