1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 5<meta http-equiv="X-UA-Compatible" content="IE=9"/> 6<meta name="generator" content="Doxygen 1.8.13"/> 7<meta name="viewport" content="width=device-width, initial-scale=1"/> 8<title>ISSDK: driverexamples/mma8491q/mma8491q_example.c Source File</title> 9<link href="tabs.css" rel="stylesheet" type="text/css"/> 10<script type="text/javascript" src="jquery.js"></script> 11<script type="text/javascript" src="dynsections.js"></script> 12<link href="issdk_stylesheet.css" rel="stylesheet" type="text/css" /> 13</head> 14<body> 15<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 16<div id="titlearea"> 17<table cellspacing="0" cellpadding="0"> 18 <tbody> 19 <tr style="height: 56px;"> 20 <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td> 21 <td id="projectalign" style="padding-left: 0.5em;"> 22 <div id="projectname">ISSDK 23  <span id="projectnumber">1.8</span> 24 </div> 25 <div id="projectbrief">IoT Sensing Software Development Kit</div> 26 </td> 27 </tr> 28 </tbody> 29</table> 30</div> 31<!-- end header part --> 32<!-- Generated by Doxygen 1.8.13 --> 33<script type="text/javascript" src="menudata.js"></script> 34<script type="text/javascript" src="menu.js"></script> 35<script type="text/javascript"> 36$(function() { 37 initMenu('',false,false,'search.php','Search'); 38}); 39</script> 40<div id="main-nav"></div> 41<div id="nav-path" class="navpath"> 42 <ul> 43<li class="navelem"><a class="el" href="dir_63958a0a083234c4c5a126855d7f4594.html">driverexamples</a></li><li class="navelem"><a class="el" href="dir_7ac1f8421dc987d6f2922a5b833b6702.html">mma8491q</a></li> </ul> 44</div> 45</div><!-- top --> 46<div class="header"> 47 <div class="headertitle"> 48<div class="title">mma8491q_example.c</div> </div> 49</div><!--header--> 50<div class="contents"> 51<a href="a00281.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) 2016, Freescale Semiconductor, Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Copyright 2016-2017 NXP</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> */</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"></span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">/**</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * @file mma8491q_example.c</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * @brief The mma8491q_example.c file implements the ISSDK MMA8491Q sensor driver</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * example demonstration with Timers.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> */</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// SDK Includes</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "pin_mux.h"</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "clock_config.h"</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "board.h"</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "fsl_lptmr.h"</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "fsl_debug_console.h"</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">// CMSIS Includes</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "Driver_I2C.h"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">// ISSDK Includes</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include "issdk_hal.h"</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include "gpio_driver.h"</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "<a class="code" href="a00137.html">mma8491q_drv.h</a>"</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">// Macros</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">/* Timer timeout Callback. */</span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="a00281.html#a4b6ccf9d6a90f9753d4a1dfeba6630b9"> 40</a></span> <span class="preprocessor">#define mma8491q_en_callback LPTMR0_IRQHandler</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">/* Desired ODR rate in milli seconds (since the example uses LPTMR, this should be >= 10ms for reliable timing). */</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="a00281.html#af00945e410ebdbdaca94b8f09c1f532e"> 42</a></span> <span class="preprocessor">#define MMA8491Q_T_ODR_ms 100U</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">/* The LPTMR Timeout Correction in milliseconds. */</span></div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="a00281.html#a3c803ae5e7d9f22660f4af7f3611fcbb"> 44</a></span> <span class="preprocessor">#define LPTMR_T_CORRECTION_ms 2</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// Constants</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="comment">//-----------------------------------------------------------------------</span><span class="comment"></span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="comment">/*! @brief Address of Status Register. */</span></div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="a00281.html#a4e4e59a73d0c875da7df96389cc87fab"> 50</a></span> <span class="keyword">const</span> <a class="code" href="a03811.html">registerreadlist_t</a> <a class="code" href="a00281.html#a4e4e59a73d0c875da7df96389cc87fab">cMma8491qStatus</a>[] = {{.<a class="code" href="a03811.html#a5fe82375de174c0511ca301fec78e441">readFrom</a> = <a class="code" href="a00131.html#a540c98815fbf3a535e5c3474823ca58cab46c09db76e8ce3f7d5123edb45178ef">MMA8491Q_STATUS</a>, .numBytes = 1}, <a class="code" href="a00179.html#aebb58a1bb3df30b7df4f6f14d0f1a81d">__END_READ_DATA__</a>};</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="comment"></span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="comment">/*! @brief Address and size of Raw Acceleration Data. */</span></div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="a00281.html#a7ffd1be19eaef462ca1764c1218cc99f"> 53</a></span> <span class="keyword">const</span> <a class="code" href="a03811.html">registerreadlist_t</a> <a class="code" href="a00281.html#a7ffd1be19eaef462ca1764c1218cc99f">cMma8491qOutput</a>[] = {{.<a class="code" href="a03811.html#a5fe82375de174c0511ca301fec78e441">readFrom</a> = <a class="code" href="a00131.html#a540c98815fbf3a535e5c3474823ca58ca978da139ce3543b0914b043c1f25fae2">MMA8491Q_OUT_X_MSB</a>, .numBytes = <a class="code" href="a00137.html#a7c45ef0e9f84d3099d7635ee900b8771">MMA8491Q_DATA_SIZE</a>},</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <a class="code" href="a00179.html#aebb58a1bb3df30b7df4f6f14d0f1a81d">__END_READ_DATA__</a>};</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment">// Global Variables</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="a00281.html#a31ba8bcc3023e7a8767348a1adf99c1e"> 59</a></span> <span class="keyword">volatile</span> <span class="keywordtype">bool</span> <a class="code" href="a00281.html#a31ba8bcc3023e7a8767348a1adf99c1e">bMma849qDataReady</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="a00281.html#a7c8bf6f81b7b64d46e510c7d916b02e0"> 60</a></span> <a class="code" href="a03919.html">gpioConfigKSDK_t</a> <a class="code" href="a00281.html#a7c8bf6f81b7b64d46e510c7d916b02e0">gGpioConfigInPins</a> = <span class="comment">/* SDK GPIO Config for Tilt Pins. */</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  {</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  .<a class="code" href="a03919.html#a8d80002047482cef61fe6041cc9a52a1">pinConfig</a> = {kGPIO_DigitalInput, 0},</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  .interruptMode = kPORT_InterruptOrDMADisabled,</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  .portPinConfig = {0},</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  .portPinConfig.mux = kPORT_MuxAsGpio,</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> };</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="a00281.html#ac61bf859f26cd2541c3958bff34e2bda"> 67</a></span> <a class="code" href="a03903.html">GENERIC_DRIVER_GPIO</a> *<a class="code" href="a00281.html#ac61bf859f26cd2541c3958bff34e2bda">pGpioDriver</a> = &<a class="code" href="a04841.html#a2c39f234913855fad752a8f96f245b27">Driver_GPIO_KSDK</a>;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment">// Functions</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment">/* @brief Block for adding EN delay. */</span></div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="a00281.html#ae398426f48bb0524f7981632fe131c09"> 73</a></span> <span class="keywordtype">void</span> <a class="code" href="a00281.html#ae398426f48bb0524f7981632fe131c09">mma8491q_en_delay</a>()</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  uint32_t delay, count, systemCoreClock;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  systemCoreClock = CLOCK_GetCoreSysClkFreq();</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  delay = (int)(0.16*MSEC_TO_COUNT(<a class="code" href="a00131.html#af644279662323aeaf9f503f7c8dce4fc">MMA8491Q_T_ON_TYPICAL</a>, systemCoreClock));</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">for</span>(count=0;count<delay;count++)</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  {</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  __NOP();</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  }</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> }</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment">/* LPTMR based EN control Timer Callback function. */</span></div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="a00281.html#a9cf70921fd15fd9dca148a2ef51e53bb"> 86</a></span> <span class="keywordtype">void</span> <a class="code" href="a00281.html#a4b6ccf9d6a90f9753d4a1dfeba6630b9">mma8491q_en_callback</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> {</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  LPTMR_ClearStatusFlags(LPTMR0, kLPTMR_TimerCompareFlag);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <a class="code" href="a00281.html#a31ba8bcc3023e7a8767348a1adf99c1e">bMma849qDataReady</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> }</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="comment">/* Function for MMA8491Q specific initialization tasks. */</span></div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="a00281.html#af67820e4317cee0db9852c3a80274428"> 93</a></span> <span class="keywordtype">void</span> <a class="code" href="a00281.html#af67820e4317cee0db9852c3a80274428">mma8491q_timer_fwk_init</a>(uint32_t samplingInterval)</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> {</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  lptmr_config_t lptmrConfig;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment">/* Initialize ODR Timer. */</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  LPTMR_GetDefaultConfig(&lptmrConfig);</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  LPTMR_Init(LPTMR0, &lptmrConfig);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  LPTMR_EnableInterrupts(LPTMR0, kLPTMR_TimerInterruptEnable);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  EnableIRQ(LPTMR0_IRQn);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="comment">/* Put the Sensor into Active Mode to enable I2C communication. */</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  LPTMR_SetTimerPeriod(LPTMR0, MSEC_TO_COUNT((samplingInterval-<a class="code" href="a00281.html#a3c803ae5e7d9f22660f4af7f3611fcbb">LPTMR_T_CORRECTION_ms</a>), CLOCK_GetFreq(kCLOCK_LpoClk)));</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> }</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="comment"></span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="comment">/*!</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment"> * @brief Main function</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="comment"> */</span></div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="a00281.html#a840291bc02cba5474a4cb46a9b9566fe"> 109</a></span> <span class="keywordtype">int</span> <a class="code" href="a00281.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> {</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a>;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  uint8_t dataReady, <a class="code" href="a00428.html#a0155cf01983779a6f386fb8eac40d37c">data</a>[<a class="code" href="a00137.html#a7c45ef0e9f84d3099d7635ee900b8771">MMA8491Q_DATA_SIZE</a>];</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  </div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <a class="code" href="a03371.html">mma8491q_i2c_sensorhandle_t</a> mma8491qDriver;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <a class="code" href="a03375.html">mma8491q_acceldata_t</a> <a class="code" href="a00227.html#ad508addf55fd0c55016ce25fe85bbd3d">rawData</a> = {.<a class="code" href="a02751.html#ab20b0c7772544cf5d318507f34231fbe">timestamp</a> = 0};</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  ARM_DRIVER_I2C *pI2cDriver = &<a class="code" href="a04343.html#ad6a14737695a4218d07182b86b21f570">I2C_S_DRIVER</a>;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"></span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> /*! Initialize the MCU hardware. */</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <a class="code" href="a00959.html#ga2c9fe54b6b84723fbaa590a6f4576966">BOARD_InitPins</a>();</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <a class="code" href="a04292.html#a8d81431cbbc4b01da56afbff0f766379">BOARD_BootClockRUN</a>();</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <a class="code" href="a04109.html#a4c84ccb952cb083367d7040cf9de3db8">BOARD_InitDebugConsole</a>();</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  PRINTF(<span class="stringliteral">"\r\n ISSDK MMA8491Q sensor driver example demonstration with poll mode\r\n"</span>);</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="comment">/* Initialize Tilt Pin IDs. */</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  pGpioDriver-><a class="code" href="a03903.html#a0c1e5657ab29e57116a57c7b22f4c630">pin_init</a>(&<a class="code" href="a00545.html#a4e9a6685f31ff10953edfd9124895983">MMA8491_EN</a>, <a class="code" href="a00482.html#a631d09668ec8f40a64ff69613cdbbba5a869f710c2bafc06d7ef192861b8358ab">GPIO_DIRECTION_OUT</a>, NULL, NULL, NULL);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  pGpioDriver-><a class="code" href="a03903.html#a0c1e5657ab29e57116a57c7b22f4c630">pin_init</a>(&<a class="code" href="a04739.html#a92238e573b879bc2b1fefa7251ef3102">MMA8491_XOUT</a>, <a class="code" href="a00482.html#a631d09668ec8f40a64ff69613cdbbba5aea9c54895635603d054830602ba5fb4e">GPIO_DIRECTION_IN</a>, &gGpioConfigInPins, NULL, NULL);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  pGpioDriver-><a class="code" href="a03903.html#a0c1e5657ab29e57116a57c7b22f4c630">pin_init</a>(&<a class="code" href="a04739.html#af1cb610a03b9e91fecba9e93b2cd1130">MMA8491_YOUT</a>, <a class="code" href="a00482.html#a631d09668ec8f40a64ff69613cdbbba5aea9c54895635603d054830602ba5fb4e">GPIO_DIRECTION_IN</a>, &gGpioConfigInPins, NULL, NULL);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  pGpioDriver-><a class="code" href="a03903.html#a0c1e5657ab29e57116a57c7b22f4c630">pin_init</a>(&<a class="code" href="a04739.html#a3abf1424fe8d938b8d588888df09abd2">MMA8491_ZOUT</a>, <a class="code" href="a00482.html#a631d09668ec8f40a64ff69613cdbbba5aea9c54895635603d054830602ba5fb4e">GPIO_DIRECTION_IN</a>, &gGpioConfigInPins, NULL, NULL);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment"></span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment"> /*! Initialize GREEN LED pin used by FRDM board */</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  pGpioDriver-><a class="code" href="a03903.html#a0c1e5657ab29e57116a57c7b22f4c630">pin_init</a>(&<a class="code" href="a00575.html#a02a28175122c7e060eeb1411dc5ac171">GREEN_LED</a>, <a class="code" href="a00482.html#a631d09668ec8f40a64ff69613cdbbba5a869f710c2bafc06d7ef192861b8358ab">GPIO_DIRECTION_OUT</a>, NULL, NULL, NULL);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="comment"></span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="comment"> /*! Initialize the I2C driver. */</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  status = pI2cDriver->Initialize(<a class="code" href="a04343.html#a60ac2e3bb32ae33e2fd542f607a58ac4">I2C_S_SIGNAL_EVENT</a>);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">if</span> (ARM_DRIVER_OK != status)</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  {</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  PRINTF(<span class="stringliteral">"\r\n I2C Initialization Failed\r\n"</span>);</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  }</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="comment"></span></div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> <span class="comment"> /*! Set the I2C Power mode. */</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  status = pI2cDriver->PowerControl(ARM_POWER_FULL);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">if</span> (ARM_DRIVER_OK != status)</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  {</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  PRINTF(<span class="stringliteral">"\r\n I2C Power Mode setting Failed\r\n"</span>);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  }</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> <span class="comment"></span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="comment"> /*! Set the I2C bus speed. */</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  status = pI2cDriver->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">if</span> (ARM_DRIVER_OK != status)</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  {</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  PRINTF(<span class="stringliteral">"\r\n I2C Control Mode setting Failed\r\n"</span>);</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  }</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="comment">/* Set EN = 1 to enable I2C communication. */</span></div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  pGpioDriver-><a class="code" href="a03903.html#ac3e094122adb91dc940bc7c033b47baa">set_pin</a>(&<a class="code" href="a00545.html#a4e9a6685f31ff10953edfd9124895983">MMA8491_EN</a>);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <a class="code" href="a00281.html#ae398426f48bb0524f7981632fe131c09">mma8491q_en_delay</a>();</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">/* Initialize the Sensor Driver. */</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  status = <a class="code" href="a00134.html#a139416bfb5a05d907f47700d0dfa73bd">MMA8491Q_I2C_Initialize</a>(&mma8491qDriver, &<a class="code" href="a04343.html#ad6a14737695a4218d07182b86b21f570">I2C_S_DRIVER</a>, <a class="code" href="a04343.html#ab0c7969a7fffaabe78d43db2b12ad840">I2C_S_DEVICE_INDEX</a>, <a class="code" href="a00545.html#ab4127d4cd101273ad7c1a8dddf33815f">MMA8491_I2C_ADDR</a>);</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keywordflow">if</span> (<a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274">SENSOR_ERROR_NONE</a> != status)</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  {</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  PRINTF(<span class="stringliteral">"\r\n Sensor Initialization Failed\r\n"</span>);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  }</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  PRINTF(<span class="stringliteral">"\r\n Successfully Initiliazed Sensor\r\n"</span>);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="comment"></span></div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="comment"> /*! Set the task to be executed while waiting for I2C transactions to complete. */</span></div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <a class="code" href="a00134.html#a18f7cb777662c0ce9b0252c1a6ccb09c">MMA8491Q_I2C_SetIdleTask</a>(&mma8491qDriver, (<a class="code" href="a00179.html#a5deff6bd688b60b97b84fc7e78d3ea63">registeridlefunction_t</a>)<a class="code" href="a00638.html#a82cb114bb9a5ea2f235a0216709d70f8">SMC_SetPowerModeVlpr</a>, <a class="code" href="a00641.html#a6667e81e5b32250febd3d46511d9309d">SMC</a>);</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> <span class="comment"></span></div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> <span class="comment"> /*! Initialize MMA8491_ODR Timer framework. */</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="code" href="a00281.html#af67820e4317cee0db9852c3a80274428">mma8491q_timer_fwk_init</a>(<a class="code" href="a00281.html#af00945e410ebdbdaca94b8f09c1f532e">MMA8491Q_T_ODR_ms</a>);</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">for</span> (;;) <span class="comment">/* Forever loop */</span></div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  {<span class="comment"></span></div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> <span class="comment"> /*! Process packets on Data ready Timer Expiry */</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordflow">if</span> (<span class="keyword">false</span> == <a class="code" href="a00281.html#a31ba8bcc3023e7a8767348a1adf99c1e">bMma849qDataReady</a>)</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  {</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <a class="code" href="a00638.html#a5423cac017d1d1a8ac8bba8e91e80e29">SMC_SetPowerModeWait</a>(<a class="code" href="a00641.html#a6667e81e5b32250febd3d46511d9309d">SMC</a>); <span class="comment">/* Power save, wait if nothing to do. */</span></div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  {</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  pGpioDriver-><a class="code" href="a03903.html#a62607faa2025749cb36c8d7e379d45fc">toggle_pin</a>(&<a class="code" href="a00575.html#a02a28175122c7e060eeb1411dc5ac171">GREEN_LED</a>);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <a class="code" href="a00281.html#a31ba8bcc3023e7a8767348a1adf99c1e">bMma849qDataReady</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  }</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span> </div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="comment">/* Set EN = 1 to put the Sensor into Active Mode. */</span></div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  pGpioDriver-><a class="code" href="a03903.html#ac3e094122adb91dc940bc7c033b47baa">set_pin</a>(&<a class="code" href="a00545.html#a4e9a6685f31ff10953edfd9124895983">MMA8491_EN</a>);</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="a00281.html#ae398426f48bb0524f7981632fe131c09">mma8491q_en_delay</a>();</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">do</span></div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  { <span class="comment">/*! Process packets only when data ready is indicated by the MMA8491Q. */</span></div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="a00134.html#ab6916f6933917650277444810e237473">MMA8491Q_I2C_ReadData</a>(&mma8491qDriver, cMma8491qStatus, &dataReady);</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  } <span class="keywordflow">while</span> (0 == (dataReady & <a class="code" href="a00131.html#aec9c65b530516e5100f2125efb52a060">MMA8491Q_STATUS_ZYXDR_MASK</a>));</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span> <span class="comment"></span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="comment"> /*! Read the raw sensor data from the MMA8491Q. */</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  status = <a class="code" href="a00134.html#ab6916f6933917650277444810e237473">MMA8491Q_I2C_ReadData</a>(&mma8491qDriver, cMma8491qOutput, data);</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">if</span> (ARM_DRIVER_OK != status)</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  { <span class="comment">/* Loop, if sample read failed. */</span></div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  }</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="comment">/* Set EN = 0 to put the Sensor into Shutdown Mode. */</span></div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  pGpioDriver-><a class="code" href="a03903.html#aa59efe0989ad47737f368819d5dae141">clr_pin</a>(&<a class="code" href="a00545.html#a4e9a6685f31ff10953edfd9124895983">MMA8491_EN</a>);</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span> </div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="comment">/* Read Tilt Output */</span></div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  rawData.<a class="code" href="a03375.html#a4d5cb67f402c279ae3f10083c8a22fe1">tilt</a>[0] = pGpioDriver-><a class="code" href="a03903.html#ae5b6fdc661c7ce3253a767b4ab06436d">read_pin</a>(&<a class="code" href="a04739.html#a92238e573b879bc2b1fefa7251ef3102">MMA8491_XOUT</a>);</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  rawData.<a class="code" href="a03375.html#a4d5cb67f402c279ae3f10083c8a22fe1">tilt</a>[1] = pGpioDriver-><a class="code" href="a03903.html#ae5b6fdc661c7ce3253a767b4ab06436d">read_pin</a>(&<a class="code" href="a04739.html#af1cb610a03b9e91fecba9e93b2cd1130">MMA8491_YOUT</a>);</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  rawData.<a class="code" href="a03375.html#a4d5cb67f402c279ae3f10083c8a22fe1">tilt</a>[2] = pGpioDriver-><a class="code" href="a03903.html#ae5b6fdc661c7ce3253a767b4ab06436d">read_pin</a>(&<a class="code" href="a04739.html#a3abf1424fe8d938b8d588888df09abd2">MMA8491_ZOUT</a>);</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> <span class="comment"></span></div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> <span class="comment"> /*! Process the sample and convert the raw sensor data. */</span></div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[0] = ((int16_t)data[0] << 8) | (data[1]);</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[0] /= 4;</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[1] = ((int16_t)data[2] << 8) | (data[3]);</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[1] /= 4;</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[2] = ((int16_t)data[4] << 8) | (data[5]);</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[2] /= 4;</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  </div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  PRINTF(<span class="stringliteral">"\r\n Tilt : X = %d Y = %d Z = %d "</span>, rawData.<a class="code" href="a03375.html#a4d5cb67f402c279ae3f10083c8a22fe1">tilt</a>[0], rawData.<a class="code" href="a03375.html#a4d5cb67f402c279ae3f10083c8a22fe1">tilt</a>[1], rawData.<a class="code" href="a03375.html#a4d5cb67f402c279ae3f10083c8a22fe1">tilt</a>[2]);</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  PRINTF(<span class="stringliteral">"|| Accel : X = %5d Y = %5d Z = %5d \r\n"</span>, rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[0], rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[1], rawData.<a class="code" href="a03375.html#a661660001effc417fb684db96e973688">accel</a>[2]);</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <a class="code" href="a00578.html#a310a9c2b58f7f1751bd46553b0deef4f">ASK_USER_TO_RESUME</a>(100); <span class="comment">/* Ask for user input after processing 100 samples. */</span></div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  }</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> }</div><div class="ttc" id="a03903_html_ac3e094122adb91dc940bc7c033b47baa"><div class="ttname"><a href="a03903.html#ac3e094122adb91dc940bc7c033b47baa">GENERIC_DRIVER_GPIO::set_pin</a></div><div class="ttdeci">void(* set_pin)(pinID_t aPinId)</div><div class="ttdef"><b>Definition:</b> <a href="a00482_source.html#l00046">Driver_GPIO.h:46</a></div></div> 52<div class="ttc" id="a00281_html_a7ffd1be19eaef462ca1764c1218cc99f"><div class="ttname"><a href="a00281.html#a7ffd1be19eaef462ca1764c1218cc99f">cMma8491qOutput</a></div><div class="ttdeci">const registerreadlist_t cMma8491qOutput[]</div><div class="ttdoc">Address and size of Raw Acceleration Data. </div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00053">mma8491q_example.c:53</a></div></div> 53<div class="ttc" id="a00281_html_ae398426f48bb0524f7981632fe131c09"><div class="ttname"><a href="a00281.html#ae398426f48bb0524f7981632fe131c09">mma8491q_en_delay</a></div><div class="ttdeci">void mma8491q_en_delay()</div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00073">mma8491q_example.c:73</a></div></div> 54<div class="ttc" id="a03371_html"><div class="ttname"><a href="a03371.html">mma8491q_i2c_sensorhandle_t</a></div><div class="ttdoc">This defines the function pointers and sensor specific information. </div><div class="ttdef"><b>Definition:</b> <a href="a00137_source.html#l00029">mma8491q_drv.h:29</a></div></div> 55<div class="ttc" id="a03919_html"><div class="ttname"><a href="a03919.html">gpioConfigKSDK</a></div><div class="ttdoc">The GPIO Configuration KSDK. </div><div class="ttdef"><b>Definition:</b> <a href="a04871_source.html#l00039">gpio_driver.h:39</a></div></div> 56<div class="ttc" id="a00578_html_a310a9c2b58f7f1751bd46553b0deef4f"><div class="ttname"><a href="a00578.html#a310a9c2b58f7f1751bd46553b0deef4f">ASK_USER_TO_RESUME</a></div><div class="ttdeci">#define ASK_USER_TO_RESUME(x)</div><div class="ttdef"><b>Definition:</b> <a href="a00578_source.html#l00106">frdm_k64f.h:106</a></div></div> 57<div class="ttc" id="a00359_html_a369536ebfe385731562c0b55dd6f3a7c"><div class="ttname"><a href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a></div><div class="ttdeci">int32_t status</div><div class="ttdef"><b>Definition:</b> <a href="a00359_source.html#l00248">fxls896xaf_freemaster_demo.c:248</a></div></div> 58<div class="ttc" id="a00179_html_a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274"><div class="ttname"><a href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274">SENSOR_ERROR_NONE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00033">sensor_drv.h:33</a></div></div> 59<div class="ttc" id="a04343_html_a60ac2e3bb32ae33e2fd542f607a58ac4"><div class="ttname"><a href="a04343.html#a60ac2e3bb32ae33e2fd542f607a58ac4">I2C_S_SIGNAL_EVENT</a></div><div class="ttdeci">#define I2C_S_SIGNAL_EVENT</div><div class="ttdef"><b>Definition:</b> <a href="a04343_source.html#l00034">issdk_hal.h:34</a></div></div> 60<div class="ttc" id="a00638_html_a82cb114bb9a5ea2f235a0216709d70f8"><div class="ttname"><a href="a00638.html#a82cb114bb9a5ea2f235a0216709d70f8">SMC_SetPowerModeVlpr</a></div><div class="ttdeci">status_t SMC_SetPowerModeVlpr(void *arg)</div><div class="ttdoc">Configures the system to VLPR power mode. API name used from Kinetis family to maintain compatibility...</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00169">lpc54114.c:169</a></div></div> 61<div class="ttc" id="a03903_html_ae5b6fdc661c7ce3253a767b4ab06436d"><div class="ttname"><a href="a03903.html#ae5b6fdc661c7ce3253a767b4ab06436d">GENERIC_DRIVER_GPIO::read_pin</a></div><div class="ttdeci">uint32_t(* read_pin)(pinID_t aPinId)</div><div class="ttdef"><b>Definition:</b> <a href="a00482_source.html#l00050">Driver_GPIO.h:50</a></div></div> 62<div class="ttc" id="a00545_html_a4e9a6685f31ff10953edfd9124895983"><div class="ttname"><a href="a00545.html#a4e9a6685f31ff10953edfd9124895983">MMA8491_EN</a></div><div class="ttdeci">#define MMA8491_EN</div><div class="ttdef"><b>Definition:</b> <a href="a00545_source.html#l00077">auto_detection_shield.h:77</a></div></div> 63<div class="ttc" id="a04739_html_af1cb610a03b9e91fecba9e93b2cd1130"><div class="ttname"><a href="a04739.html#af1cb610a03b9e91fecba9e93b2cd1130">MMA8491_YOUT</a></div><div class="ttdeci">#define MMA8491_YOUT</div><div class="ttdef"><b>Definition:</b> <a href="a04739_source.html#l00024">frdm_stbc_a8491_shield.h:24</a></div></div> 64<div class="ttc" id="a04292_html_a8d81431cbbc4b01da56afbff0f766379"><div class="ttname"><a href="a04292.html#a8d81431cbbc4b01da56afbff0f766379">BOARD_BootClockRUN</a></div><div class="ttdeci">#define BOARD_BootClockRUN</div><div class="ttdef"><b>Definition:</b> <a href="a04292_source.html#l00019">clock_config.h:19</a></div></div> 65<div class="ttc" id="a02751_html_ab20b0c7772544cf5d318507f34231fbe"><div class="ttname"><a href="a02751.html#ab20b0c7772544cf5d318507f34231fbe">fxos8700_accelmagdata_t::timestamp</a></div><div class="ttdeci">uint32_t timestamp</div><div class="ttdef"><b>Definition:</b> <a href="a00086_source.html#l00055">fxos8700_drv.h:55</a></div></div> 66<div class="ttc" id="a03903_html"><div class="ttname"><a href="a03903.html">GENERIC_DRIVER_GPIO</a></div><div class="ttdoc">Access structure of the GPIO Driver. </div><div class="ttdef"><b>Definition:</b> <a href="a00482_source.html#l00038">Driver_GPIO.h:38</a></div></div> 67<div class="ttc" id="a00641_html_a6667e81e5b32250febd3d46511d9309d"><div class="ttname"><a href="a00641.html#a6667e81e5b32250febd3d46511d9309d">SMC</a></div><div class="ttdeci">#define SMC</div><div class="ttdef"><b>Definition:</b> <a href="a00641_source.html#l00118">lpc54114.h:118</a></div></div> 68<div class="ttc" id="a00545_html_ab4127d4cd101273ad7c1a8dddf33815f"><div class="ttname"><a href="a00545.html#ab4127d4cd101273ad7c1a8dddf33815f">MMA8491_I2C_ADDR</a></div><div class="ttdeci">#define MMA8491_I2C_ADDR</div><div class="ttdef"><b>Definition:</b> <a href="a00545_source.html#l00076">auto_detection_shield.h:76</a></div></div> 69<div class="ttc" id="a04739_html_a3abf1424fe8d938b8d588888df09abd2"><div class="ttname"><a href="a04739.html#a3abf1424fe8d938b8d588888df09abd2">MMA8491_ZOUT</a></div><div class="ttdeci">#define MMA8491_ZOUT</div><div class="ttdef"><b>Definition:</b> <a href="a04739_source.html#l00025">frdm_stbc_a8491_shield.h:25</a></div></div> 70<div class="ttc" id="a03903_html_aa59efe0989ad47737f368819d5dae141"><div class="ttname"><a href="a03903.html#aa59efe0989ad47737f368819d5dae141">GENERIC_DRIVER_GPIO::clr_pin</a></div><div class="ttdeci">void(* clr_pin)(pinID_t aPinId)</div><div class="ttdef"><b>Definition:</b> <a href="a00482_source.html#l00047">Driver_GPIO.h:47</a></div></div> 71<div class="ttc" id="a00521_html_a5d7069350a7d7e65686c77a8038f462f"><div class="ttname"><a href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a></div><div class="ttdeci">typedef int32_t(DATA_FORMAT_Append_t))(void *pData</div><div class="ttdoc">The interface function to append the data on the formated stream. </div></div> 72<div class="ttc" id="a00482_html_a631d09668ec8f40a64ff69613cdbbba5aea9c54895635603d054830602ba5fb4e"><div class="ttname"><a href="a00482.html#a631d09668ec8f40a64ff69613cdbbba5aea9c54895635603d054830602ba5fb4e">GPIO_DIRECTION_IN</a></div><div class="ttdef"><b>Definition:</b> <a href="a00482_source.html#l00023">Driver_GPIO.h:23</a></div></div> 73<div class="ttc" id="a04109_html_a4c84ccb952cb083367d7040cf9de3db8"><div class="ttname"><a href="a04109.html#a4c84ccb952cb083367d7040cf9de3db8">BOARD_InitDebugConsole</a></div><div class="ttdeci">void BOARD_InitDebugConsole(void)</div><div class="ttdef"><b>Definition:</b> <a href="a04109_source.html#l00015">board.c:15</a></div></div> 74<div class="ttc" id="a00281_html_a3c803ae5e7d9f22660f4af7f3611fcbb"><div class="ttname"><a href="a00281.html#a3c803ae5e7d9f22660f4af7f3611fcbb">LPTMR_T_CORRECTION_ms</a></div><div class="ttdeci">#define LPTMR_T_CORRECTION_ms</div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00044">mma8491q_example.c:44</a></div></div> 75<div class="ttc" id="a00134_html_a18f7cb777662c0ce9b0252c1a6ccb09c"><div class="ttname"><a href="a00134.html#a18f7cb777662c0ce9b0252c1a6ccb09c">MMA8491Q_I2C_SetIdleTask</a></div><div class="ttdeci">void MMA8491Q_I2C_SetIdleTask(mma8491q_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)</div><div class="ttdoc">: The interface function to set the I2C Idle Task. </div><div class="ttdef"><b>Definition:</b> <a href="a00134_source.html#l00056">mma8491q_drv.c:56</a></div></div> 76<div class="ttc" id="a03919_html_a8d80002047482cef61fe6041cc9a52a1"><div class="ttname"><a href="a03919.html#a8d80002047482cef61fe6041cc9a52a1">gpioConfigKSDK::pinConfig</a></div><div class="ttdeci">gpio_pin_config_t pinConfig</div><div class="ttdef"><b>Definition:</b> <a href="a04871_source.html#l00041">gpio_driver.h:41</a></div></div> 77<div class="ttc" id="a00179_html_a5deff6bd688b60b97b84fc7e78d3ea63"><div class="ttname"><a href="a00179.html#a5deff6bd688b60b97b84fc7e78d3ea63">registeridlefunction_t</a></div><div class="ttdeci">void(* registeridlefunction_t)(void *userParam)</div><div class="ttdoc">This is the register idle function type. </div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00097">sensor_drv.h:97</a></div></div> 78<div class="ttc" id="a00281_html_af00945e410ebdbdaca94b8f09c1f532e"><div class="ttname"><a href="a00281.html#af00945e410ebdbdaca94b8f09c1f532e">MMA8491Q_T_ODR_ms</a></div><div class="ttdeci">#define MMA8491Q_T_ODR_ms</div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00042">mma8491q_example.c:42</a></div></div> 79<div class="ttc" id="a00281_html_ac61bf859f26cd2541c3958bff34e2bda"><div class="ttname"><a href="a00281.html#ac61bf859f26cd2541c3958bff34e2bda">pGpioDriver</a></div><div class="ttdeci">GENERIC_DRIVER_GPIO * pGpioDriver</div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00067">mma8491q_example.c:67</a></div></div> 80<div class="ttc" id="a00131_html_af644279662323aeaf9f503f7c8dce4fc"><div class="ttname"><a href="a00131.html#af644279662323aeaf9f503f7c8dce4fc">MMA8491Q_T_ON_TYPICAL</a></div><div class="ttdeci">#define MMA8491Q_T_ON_TYPICAL</div><div class="ttdef"><b>Definition:</b> <a href="a00131_source.html#l00029">mma8491q.h:29</a></div></div> 81<div class="ttc" id="a03375_html"><div class="ttname"><a href="a03375.html">mma8491q_acceldata_t</a></div><div class="ttdoc">This structure defines the mma8491q data buffer. </div><div class="ttdef"><b>Definition:</b> <a href="a00137_source.html#l00038">mma8491q_drv.h:38</a></div></div> 82<div class="ttc" id="a00428_html_a0155cf01983779a6f386fb8eac40d37c"><div class="ttname"><a href="a00428.html#a0155cf01983779a6f386fb8eac40d37c">data</a></div><div class="ttdeci">uint8_t data[FXLS8962_DATA_SIZE]</div><div class="ttdef"><b>Definition:</b> <a href="a00428_source.html#l00174">fxls8962_demo.c:174</a></div></div> 83<div class="ttc" id="a00281_html_a4b6ccf9d6a90f9753d4a1dfeba6630b9"><div class="ttname"><a href="a00281.html#a4b6ccf9d6a90f9753d4a1dfeba6630b9">mma8491q_en_callback</a></div><div class="ttdeci">#define mma8491q_en_callback</div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00040">mma8491q_example.c:40</a></div></div> 84<div class="ttc" id="a00179_html_aebb58a1bb3df30b7df4f6f14d0f1a81d"><div class="ttname"><a href="a00179.html#aebb58a1bb3df30b7df4f6f14d0f1a81d">__END_READ_DATA__</a></div><div class="ttdeci">#define __END_READ_DATA__</div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00051">sensor_drv.h:51</a></div></div> 85<div class="ttc" id="a00134_html_ab6916f6933917650277444810e237473"><div class="ttname"><a href="a00134.html#ab6916f6933917650277444810e237473">MMA8491Q_I2C_ReadData</a></div><div class="ttdeci">int32_t MMA8491Q_I2C_ReadData(mma8491q_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)</div><div class="ttdoc">The interface function to read the sensor data. </div><div class="ttdef"><b>Definition:</b> <a href="a00134_source.html#l00064">mma8491q_drv.c:64</a></div></div> 86<div class="ttc" id="a00131_html_aec9c65b530516e5100f2125efb52a060"><div class="ttname"><a href="a00131.html#aec9c65b530516e5100f2125efb52a060">MMA8491Q_STATUS_ZYXDR_MASK</a></div><div class="ttdeci">#define MMA8491Q_STATUS_ZYXDR_MASK</div><div class="ttdef"><b>Definition:</b> <a href="a00131_source.html#l00067">mma8491q.h:67</a></div></div> 87<div class="ttc" id="a04343_html_ad6a14737695a4218d07182b86b21f570"><div class="ttname"><a href="a04343.html#ad6a14737695a4218d07182b86b21f570">I2C_S_DRIVER</a></div><div class="ttdeci">#define I2C_S_DRIVER</div><div class="ttdef"><b>Definition:</b> <a href="a04343_source.html#l00033">issdk_hal.h:33</a></div></div> 88<div class="ttc" id="a00281_html_a31ba8bcc3023e7a8767348a1adf99c1e"><div class="ttname"><a href="a00281.html#a31ba8bcc3023e7a8767348a1adf99c1e">bMma849qDataReady</a></div><div class="ttdeci">volatile bool bMma849qDataReady</div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00059">mma8491q_example.c:59</a></div></div> 89<div class="ttc" id="a00227_html_ad508addf55fd0c55016ce25fe85bbd3d"><div class="ttname"><a href="a00227.html#ad508addf55fd0c55016ce25fe85bbd3d">rawData</a></div><div class="ttdeci">fxos8700_accelmagdata_t rawData</div><div class="ttdef"><b>Definition:</b> <a href="a00227_source.html#l00218">fxos8700_freemaster_demo.c:218</a></div></div> 90<div class="ttc" id="a00137_html_a7c45ef0e9f84d3099d7635ee900b8771"><div class="ttname"><a href="a00137.html#a7c45ef0e9f84d3099d7635ee900b8771">MMA8491Q_DATA_SIZE</a></div><div class="ttdeci">#define MMA8491Q_DATA_SIZE</div><div class="ttdef"><b>Definition:</b> <a href="a00137_source.html#l00063">mma8491q_drv.h:63</a></div></div> 91<div class="ttc" id="a00131_html_a540c98815fbf3a535e5c3474823ca58cab46c09db76e8ce3f7d5123edb45178ef"><div class="ttname"><a href="a00131.html#a540c98815fbf3a535e5c3474823ca58cab46c09db76e8ce3f7d5123edb45178ef">MMA8491Q_STATUS</a></div><div class="ttdef"><b>Definition:</b> <a href="a00131_source.html#l00017">mma8491q.h:17</a></div></div> 92<div class="ttc" id="a00137_html"><div class="ttname"><a href="a00137.html">mma8491q_drv.h</a></div><div class="ttdoc">The mma8491q_drv.h file describes the MMA8491Q driver interface and structures. </div></div> 93<div class="ttc" id="a03811_html_a5fe82375de174c0511ca301fec78e441"><div class="ttname"><a href="a03811.html#a5fe82375de174c0511ca301fec78e441">registerreadlist_t::readFrom</a></div><div class="ttdeci">uint16_t readFrom</div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00080">sensor_drv.h:80</a></div></div> 94<div class="ttc" id="a00134_html_a139416bfb5a05d907f47700d0dfa73bd"><div class="ttname"><a href="a00134.html#a139416bfb5a05d907f47700d0dfa73bd">MMA8491Q_I2C_Initialize</a></div><div class="ttdeci">int32_t MMA8491Q_I2C_Initialize(mma8491q_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress)</div><div class="ttdoc">The interface function to initialize the sensor. </div><div class="ttdef"><b>Definition:</b> <a href="a00134_source.html#l00022">mma8491q_drv.c:22</a></div></div> 95<div class="ttc" id="a00281_html_a7c8bf6f81b7b64d46e510c7d916b02e0"><div class="ttname"><a href="a00281.html#a7c8bf6f81b7b64d46e510c7d916b02e0">gGpioConfigInPins</a></div><div class="ttdeci">gpioConfigKSDK_t gGpioConfigInPins</div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00060">mma8491q_example.c:60</a></div></div> 96<div class="ttc" id="a03903_html_a62607faa2025749cb36c8d7e379d45fc"><div class="ttname"><a href="a03903.html#a62607faa2025749cb36c8d7e379d45fc">GENERIC_DRIVER_GPIO::toggle_pin</a></div><div class="ttdeci">void(* toggle_pin)(pinID_t aPinId)</div><div class="ttdef"><b>Definition:</b> <a href="a00482_source.html#l00048">Driver_GPIO.h:48</a></div></div> 97<div class="ttc" id="a00638_html_a5423cac017d1d1a8ac8bba8e91e80e29"><div class="ttname"><a href="a00638.html#a5423cac017d1d1a8ac8bba8e91e80e29">SMC_SetPowerModeWait</a></div><div class="ttdeci">status_t SMC_SetPowerModeWait(void *arg)</div><div class="ttdoc">Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00155">lpc54114.c:155</a></div></div> 98<div class="ttc" id="a03903_html_a0c1e5657ab29e57116a57c7b22f4c630"><div class="ttname"><a href="a03903.html#a0c1e5657ab29e57116a57c7b22f4c630">GENERIC_DRIVER_GPIO::pin_init</a></div><div class="ttdeci">void(* pin_init)(pinID_t aPinId, gpio_direction_t dir, void *apPinConfig, gpio_isr_handler_t aIsrHandler, void *apUserData)</div><div class="ttdef"><b>Definition:</b> <a href="a00482_source.html#l00041">Driver_GPIO.h:41</a></div></div> 99<div class="ttc" id="a04841_html_a2c39f234913855fad752a8f96f245b27"><div class="ttname"><a href="a04841.html#a2c39f234913855fad752a8f96f245b27">Driver_GPIO_KSDK</a></div><div class="ttdeci">GENERIC_DRIVER_GPIO Driver_GPIO_KSDK</div><div class="ttdef"><b>Definition:</b> <a href="a04841_source.html#l00177">gpio_driver.c:177</a></div></div> 100<div class="ttc" id="a03811_html"><div class="ttname"><a href="a03811.html">registerreadlist_t</a></div><div class="ttdoc">This structure defines the Read command List. </div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00078">sensor_drv.h:78</a></div></div> 101<div class="ttc" id="a00281_html_a840291bc02cba5474a4cb46a9b9566fe"><div class="ttname"><a href="a00281.html#a840291bc02cba5474a4cb46a9b9566fe">main</a></div><div class="ttdeci">int main(void)</div><div class="ttdoc">Main function. </div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00109">mma8491q_example.c:109</a></div></div> 102<div class="ttc" id="a00575_html_a02a28175122c7e060eeb1411dc5ac171"><div class="ttname"><a href="a00575.html#a02a28175122c7e060eeb1411dc5ac171">GREEN_LED</a></div><div class="ttdeci">gpioHandleKSDK_t GREEN_LED</div><div class="ttdef"><b>Definition:</b> <a href="a00575_source.html#l00188">frdm_k64f.c:188</a></div></div> 103<div class="ttc" id="a00281_html_a4e4e59a73d0c875da7df96389cc87fab"><div class="ttname"><a href="a00281.html#a4e4e59a73d0c875da7df96389cc87fab">cMma8491qStatus</a></div><div class="ttdeci">const registerreadlist_t cMma8491qStatus[]</div><div class="ttdoc">Address of Status Register. </div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00050">mma8491q_example.c:50</a></div></div> 104<div class="ttc" id="a03375_html_a661660001effc417fb684db96e973688"><div class="ttname"><a href="a03375.html#a661660001effc417fb684db96e973688">mma8491q_acceldata_t::accel</a></div><div class="ttdeci">int16_t accel[3]</div><div class="ttdef"><b>Definition:</b> <a href="a00137_source.html#l00041">mma8491q_drv.h:41</a></div></div> 105<div class="ttc" id="a04343_html_ab0c7969a7fffaabe78d43db2b12ad840"><div class="ttname"><a href="a04343.html#ab0c7969a7fffaabe78d43db2b12ad840">I2C_S_DEVICE_INDEX</a></div><div class="ttdeci">#define I2C_S_DEVICE_INDEX</div><div class="ttdef"><b>Definition:</b> <a href="a04343_source.html#l00035">issdk_hal.h:35</a></div></div> 106<div class="ttc" id="a00482_html_a631d09668ec8f40a64ff69613cdbbba5a869f710c2bafc06d7ef192861b8358ab"><div class="ttname"><a href="a00482.html#a631d09668ec8f40a64ff69613cdbbba5a869f710c2bafc06d7ef192861b8358ab">GPIO_DIRECTION_OUT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00482_source.html#l00024">Driver_GPIO.h:24</a></div></div> 107<div class="ttc" id="a00959_html_ga2c9fe54b6b84723fbaa590a6f4576966"><div class="ttname"><a href="a00959.html#ga2c9fe54b6b84723fbaa590a6f4576966">BOARD_InitPins</a></div><div class="ttdeci">void BOARD_InitPins(void)</div><div class="ttdoc">Configures pin routing and optionally pin electrical features. </div><div class="ttdef"><b>Definition:</b> <a href="a04541_source.html#l00047">pin_mux.c:47</a></div></div> 108<div class="ttc" id="a00131_html_a540c98815fbf3a535e5c3474823ca58ca978da139ce3543b0914b043c1f25fae2"><div class="ttname"><a href="a00131.html#a540c98815fbf3a535e5c3474823ca58ca978da139ce3543b0914b043c1f25fae2">MMA8491Q_OUT_X_MSB</a></div><div class="ttdef"><b>Definition:</b> <a href="a00131_source.html#l00018">mma8491q.h:18</a></div></div> 109<div class="ttc" id="a04739_html_a92238e573b879bc2b1fefa7251ef3102"><div class="ttname"><a href="a04739.html#a92238e573b879bc2b1fefa7251ef3102">MMA8491_XOUT</a></div><div class="ttdeci">#define MMA8491_XOUT</div><div class="ttdef"><b>Definition:</b> <a href="a04739_source.html#l00023">frdm_stbc_a8491_shield.h:23</a></div></div> 110<div class="ttc" id="a03375_html_a4d5cb67f402c279ae3f10083c8a22fe1"><div class="ttname"><a href="a03375.html#a4d5cb67f402c279ae3f10083c8a22fe1">mma8491q_acceldata_t::tilt</a></div><div class="ttdeci">uint8_t tilt[3]</div><div class="ttdef"><b>Definition:</b> <a href="a00137_source.html#l00042">mma8491q_drv.h:42</a></div></div> 111<div class="ttc" id="a00281_html_af67820e4317cee0db9852c3a80274428"><div class="ttname"><a href="a00281.html#af67820e4317cee0db9852c3a80274428">mma8491q_timer_fwk_init</a></div><div class="ttdeci">void mma8491q_timer_fwk_init(uint32_t samplingInterval)</div><div class="ttdef"><b>Definition:</b> <a href="a00281_source.html#l00093">mma8491q_example.c:93</a></div></div> 112</div><!-- fragment --></div><!-- contents --> 113 114<hr class="footer"/><address class="footer"><small> 115© Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause 116</small></address> 117</body> 118</html> 119