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: sensors/mma8491q_drv.h File Reference</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   &#160;<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_c77a8e2546a9c75bbba96be2ef542c8e.html">sensors</a></li>  </ul>
44</div>
45</div><!-- top -->
46<div class="header">
47  <div class="summary">
48<a href="#nested-classes">Data Structures</a> &#124;
49<a href="#define-members">Macros</a> &#124;
50<a href="#enum-members">Enumerations</a> &#124;
51<a href="#func-members">Functions</a>  </div>
52  <div class="headertitle">
53<div class="title">mma8491q_drv.h File Reference</div>  </div>
54</div><!--header-->
55<div class="contents">
56
57<p>The <a class="el" href="a00137.html" title="The mma8491q_drv.h file describes the MMA8491Q driver interface and structures. ">mma8491q_drv.h</a> file describes the MMA8491Q driver interface and structures.
58<a href="#details">More...</a></p>
59<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
60<code>#include &quot;<a class="el" href="a00131_source.html">mma8491q.h</a>&quot;</code><br />
61<code>#include &quot;<a class="el" href="a00185_source.html">sensor_io_i2c.h</a>&quot;</code><br />
62<code>#include &quot;<a class="el" href="a00170_source.html">register_io_i2c.h</a>&quot;</code><br />
63</div><div class="textblock"><div class="dynheader">
64Include dependency graph for mma8491q_drv.h:</div>
65<div class="dyncontent">
66<div class="center"><img src="a00138.png" border="0" usemap="#sensors_2mma8491q__drv_8h" alt=""/></div>
67<map name="sensors_2mma8491q__drv_8h" id="sensors_2mma8491q__drv_8h">
68<area shape="rect" id="node3" href="a00131.html" title="mma8491q.h" alt="" coords="27,80,124,107"/>
69<area shape="rect" id="node4" href="a00185.html" title="The sensor_io_i2c.h file declares low&#45;level interface functions for reading and writing sensor regist..." alt="" coords="148,80,261,107"/>
70<area shape="rect" id="node5" href="a00170.html" title="The register_io_i2c.h file declares low&#45;level interface functions for reading and writing sensor regi..." alt="" coords="193,155,310,181"/>
71</map>
72</div>
73</div><div class="textblock"><div class="dynheader">
74This graph shows which files directly or indirectly include this file:</div>
75<div class="dyncontent">
76<div class="center"><img src="a00139.png" border="0" usemap="#sensors_2mma8491q__drv_8hdep" alt=""/></div>
77<map name="sensors_2mma8491q__drv_8hdep" id="sensors_2mma8491q__drv_8hdep">
78<area shape="rect" id="node2" href="a00134.html" title="The mma8491q_drv.c file implements the MMA8491 sensor driver interfaces. " alt="" coords="5,87,176,114"/>
79<area shape="rect" id="node3" href="a00281.html" title="The mma8491q_example.c file implements the ISSDK MMA8491Q sensor driver example demonstration with Ti..." alt="" coords="200,80,376,121"/>
80<area shape="rect" id="node4" href="a00452.html" title="The mma8491q_demo.c file implements the ISSDK MMA8491Q sensor driver demo demonstration with polling ..." alt="" coords="401,80,551,121"/>
81</map>
82</div>
83</div>
84<p><a href="a00137_source.html">Go to the source code of this file.</a></p>
85<table class="memberdecls">
86<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
87Data Structures</h2></td></tr>
88<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03371.html">mma8491q_i2c_sensorhandle_t</a></td></tr>
89<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This defines the function pointers and sensor specific information.  <a href="a03371.html#details">More...</a><br /></td></tr>
90<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
91<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03375.html">mma8491q_acceldata_t</a></td></tr>
92<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This structure defines the mma8491q data buffer.  <a href="a03375.html#details">More...</a><br /></td></tr>
93<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
94<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a03379.html">mma8491q_context_t</a></td></tr>
95<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This structure stores the Sensor's context parameters.  <a href="a03379.html#details">More...</a><br /></td></tr>
96<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
97</table><table class="memberdecls">
98<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
99Macros</h2></td></tr>
100<tr class="memitem:a7c45ef0e9f84d3099d7635ee900b8771"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00137.html#a7c45ef0e9f84d3099d7635ee900b8771">MMA8491Q_DATA_SIZE</a>&#160;&#160;&#160;(6) /* 2 <a class="el" href="a00914.html#a0c8186d9b9b7880309c27230bbb5e69d">byte</a> X,Y,Z Axis Data each. */</td></tr>
101<tr class="separator:a7c45ef0e9f84d3099d7635ee900b8771"><td class="memSeparator" colspan="2">&#160;</td></tr>
102</table><table class="memberdecls">
103<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
104Enumerations</h2></td></tr>
105<tr class="memitem:aca66878d7430c9c83a4dd358effa7087"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom">{ <a class="el" href="a00137.html#aca66878d7430c9c83a4dd358effa7087ab6217fa4ba5a62ff60bd78defd7495b4">SENSOR_MODE_SHUTDOWN</a>,
106<a class="el" href="a00137.html#aca66878d7430c9c83a4dd358effa7087ab4f1c6092a1ace7ba85e99273f3ae078">SENSOR_MODE_ACTIVE</a>,
107<a class="el" href="a00137.html#aca66878d7430c9c83a4dd358effa7087acf56bdab52bb241edc3693b6d4aac567">SENSOR_MODE_STANDBY</a>
108 }<tr class="memdesc:aca66878d7430c9c83a4dd358effa7087"><td class="mdescLeft">&#160;</td><td class="mdescRight">This enum lists the MMA8491Q operating Modes.  <a href="a00137.html#aca66878d7430c9c83a4dd358effa7087">More...</a><br /></td></tr>
109</td></tr>
110<tr class="separator:aca66878d7430c9c83a4dd358effa7087"><td class="memSeparator" colspan="2">&#160;</td></tr>
111</table><table class="memberdecls">
112<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
113Functions</h2></td></tr>
114<tr class="memitem:a139416bfb5a05d907f47700d0dfa73bd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00137.html#a139416bfb5a05d907f47700d0dfa73bd">MMA8491Q_I2C_Initialize</a> (<a class="el" href="a03371.html">mma8491q_i2c_sensorhandle_t</a> *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress)</td></tr>
115<tr class="memdesc:a139416bfb5a05d907f47700d0dfa73bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to initialize the sensor.  <a href="#a139416bfb5a05d907f47700d0dfa73bd">More...</a><br /></td></tr>
116<tr class="separator:a139416bfb5a05d907f47700d0dfa73bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
117<tr class="memitem:a18f7cb777662c0ce9b0252c1a6ccb09c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00137.html#a18f7cb777662c0ce9b0252c1a6ccb09c">MMA8491Q_I2C_SetIdleTask</a> (<a class="el" href="a03371.html">mma8491q_i2c_sensorhandle_t</a> *pSensorHandle, <a class="el" href="a00179.html#a5deff6bd688b60b97b84fc7e78d3ea63">registeridlefunction_t</a> idleTask, void *userParam)</td></tr>
118<tr class="memdesc:a18f7cb777662c0ce9b0252c1a6ccb09c"><td class="mdescLeft">&#160;</td><td class="mdescRight">: The interface function to set the I2C Idle Task.  <a href="#a18f7cb777662c0ce9b0252c1a6ccb09c">More...</a><br /></td></tr>
119<tr class="separator:a18f7cb777662c0ce9b0252c1a6ccb09c"><td class="memSeparator" colspan="2">&#160;</td></tr>
120<tr class="memitem:ab6916f6933917650277444810e237473"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00137.html#ab6916f6933917650277444810e237473">MMA8491Q_I2C_ReadData</a> (<a class="el" href="a03371.html">mma8491q_i2c_sensorhandle_t</a> *pSensorHandle, const <a class="el" href="a03811.html">registerreadlist_t</a> *pReadList, uint8_t *pBuffer)</td></tr>
121<tr class="memdesc:ab6916f6933917650277444810e237473"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to read the sensor data.  <a href="#ab6916f6933917650277444810e237473">More...</a><br /></td></tr>
122<tr class="separator:ab6916f6933917650277444810e237473"><td class="memSeparator" colspan="2">&#160;</td></tr>
123</table>
124<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
125<div class="textblock"><p>The <a class="el" href="a00137.html" title="The mma8491q_drv.h file describes the MMA8491Q driver interface and structures. ">mma8491q_drv.h</a> file describes the MMA8491Q driver interface and structures. </p>
126
127<p class="definition">Definition in file <a class="el" href="a00137_source.html">mma8491q_drv.h</a>.</p>
128</div><h2 class="groupheader">Macro Definition Documentation</h2>
129<a id="a7c45ef0e9f84d3099d7635ee900b8771"></a>
130<h2 class="memtitle"><span class="permalink"><a href="#a7c45ef0e9f84d3099d7635ee900b8771">&#9670;&nbsp;</a></span>MMA8491Q_DATA_SIZE</h2>
131
132<div class="memitem">
133<div class="memproto">
134      <table class="memname">
135        <tr>
136          <td class="memname">#define MMA8491Q_DATA_SIZE&#160;&#160;&#160;(6) /* 2 <a class="el" href="a00914.html#a0c8186d9b9b7880309c27230bbb5e69d">byte</a> X,Y,Z Axis Data each. */</td>
137        </tr>
138      </table>
139</div><div class="memdoc">
140
141<p class="definition">Definition at line <a class="el" href="a00137_source.html#l00063">63</a> of file <a class="el" href="a00137_source.html">mma8491q_drv.h</a>.</p>
142
143<p class="reference">Referenced by <a class="el" href="a00452_source.html#l00204">main()</a>.</p>
144
145</div>
146</div>
147<h2 class="groupheader">Enumeration Type Documentation</h2>
148<a id="aca66878d7430c9c83a4dd358effa7087"></a>
149<h2 class="memtitle"><span class="permalink"><a href="#aca66878d7430c9c83a4dd358effa7087">&#9670;&nbsp;</a></span>anonymous enum</h2>
150
151<div class="memitem">
152<div class="memproto">
153      <table class="memname">
154        <tr>
155          <td class="memname">anonymous enum</td>
156        </tr>
157      </table>
158</div><div class="memdoc">
159
160<p>This enum lists the MMA8491Q operating Modes. </p>
161<table class="fieldtable">
162<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aca66878d7430c9c83a4dd358effa7087ab6217fa4ba5a62ff60bd78defd7495b4"></a>SENSOR_MODE_SHUTDOWN&#160;</td><td class="fielddoc"></td></tr>
163<tr><td class="fieldname"><a id="aca66878d7430c9c83a4dd358effa7087ab4f1c6092a1ace7ba85e99273f3ae078"></a>SENSOR_MODE_ACTIVE&#160;</td><td class="fielddoc"></td></tr>
164<tr><td class="fieldname"><a id="aca66878d7430c9c83a4dd358effa7087acf56bdab52bb241edc3693b6d4aac567"></a>SENSOR_MODE_STANDBY&#160;</td><td class="fielddoc"></td></tr>
165</table>
166
167<p class="definition">Definition at line <a class="el" href="a00137_source.html#l00056">56</a> of file <a class="el" href="a00137_source.html">mma8491q_drv.h</a>.</p>
168
169</div>
170</div>
171<h2 class="groupheader">Function Documentation</h2>
172<a id="a139416bfb5a05d907f47700d0dfa73bd"></a>
173<h2 class="memtitle"><span class="permalink"><a href="#a139416bfb5a05d907f47700d0dfa73bd">&#9670;&nbsp;</a></span>MMA8491Q_I2C_Initialize()</h2>
174
175<div class="memitem">
176<div class="memproto">
177      <table class="memname">
178        <tr>
179          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> MMA8491Q_I2C_Initialize </td>
180          <td>(</td>
181          <td class="paramtype"><a class="el" href="a03371.html">mma8491q_i2c_sensorhandle_t</a> *&#160;</td>
182          <td class="paramname"><em>pSensorHandle</em>, </td>
183        </tr>
184        <tr>
185          <td class="paramkey"></td>
186          <td></td>
187          <td class="paramtype">ARM_DRIVER_I2C *&#160;</td>
188          <td class="paramname"><em>pBus</em>, </td>
189        </tr>
190        <tr>
191          <td class="paramkey"></td>
192          <td></td>
193          <td class="paramtype">uint8_t&#160;</td>
194          <td class="paramname"><em>index</em>, </td>
195        </tr>
196        <tr>
197          <td class="paramkey"></td>
198          <td></td>
199          <td class="paramtype">uint16_t&#160;</td>
200          <td class="paramname"><em>sAddress</em>&#160;</td>
201        </tr>
202        <tr>
203          <td></td>
204          <td>)</td>
205          <td></td><td></td>
206        </tr>
207      </table>
208</div><div class="memdoc">
209
210<p>The interface function to initialize the sensor. </p>
211<p>This function initialize the sensor and sensor handle. </p><dl class="params"><dt>Parameters</dt><dd>
212  <table class="params">
213    <tr><td class="paramdir">[in]</td><td class="paramname">pSensorHandle</td><td>handle to the sensor. </td></tr>
214    <tr><td class="paramdir">[in]</td><td class="paramname">pBus</td><td>pointer to the CMSIS API compatible I2C bus object. </td></tr>
215    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>the I2C device number. </td></tr>
216    <tr><td class="paramdir">[in]</td><td class="paramname">sAddress</td><td>slave address of the device on the bus. </td></tr>
217    <tr><td class="paramdir">[in]</td><td class="paramname">whoami</td><td>WHO_AM_I value of the device. </td></tr>
218  </table>
219  </dd>
220</dl>
221<dl class="section user"><dt>Constraints:</dt><dd>This should be the first API to be called. Application has to ensure that previous instances of these APIs have exited before invocation.  No </dd></dl>
222<dl class="section return"><dt>Returns</dt><dd><a class="el" href="a00137.html#a139416bfb5a05d907f47700d0dfa73bd" title="The interface function to initialize the sensor. ">MMA8491Q_I2C_Initialize()</a> returns the status. </dd></dl>
223<p>Check the input parameters.</p>
224<p>Initialize the sensor handle. </p>
225
226<p class="definition">Definition at line <a class="el" href="a00134_source.html#l00022">22</a> of file <a class="el" href="a00134_source.html">mma8491q_drv.c</a>.</p>
227
228<p class="reference">References <a class="el" href="a00137_source.html#l00031">mma8491q_i2c_sensorhandle_t::deviceInfo</a>, <a class="el" href="a00179_source.html#l00106">registerDeviceInfo_t::deviceInstance</a>, <a class="el" href="a00179_source.html#l00105">registerDeviceInfo_t::functionParam</a>, <a class="el" href="a00179_source.html#l00104">registerDeviceInfo_t::idleFunction</a>, <a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t()</a>, <a class="el" href="a00137_source.html#l00033">mma8491q_i2c_sensorhandle_t::isInitialized</a>, <a class="el" href="a00131_source.html#l00017">MMA8491Q_STATUS</a>, <a class="el" href="a00131_source.html#l00070">MMA8491Q_STATUS_RESERVED_MASK</a>, <a class="el" href="a00131_source.html#l00089">MMA8491Q_STATUS_RESERVED_ZERO</a>, <a class="el" href="a00137_source.html#l00032">mma8491q_i2c_sensorhandle_t::pCommDrv</a>, <a class="el" href="a00167_source.html#l00310">Register_I2C_Read()</a>, <a class="el" href="a00179_source.html#l00036">SENSOR_ERROR_INIT</a>, <a class="el" href="a00179_source.html#l00034">SENSOR_ERROR_INVALID_PARAM</a>, <a class="el" href="a00179_source.html#l00033">SENSOR_ERROR_NONE</a>, <a class="el" href="a00137_source.html#l00034">mma8491q_i2c_sensorhandle_t::slaveAddress</a>, <a class="el" href="a00359_source.html#l00248">status</a>, and <a class="el" href="a00131_source.html#l00052">MMA8491Q_STATUS_t::w</a>.</p>
229
230<p class="reference">Referenced by <a class="el" href="a00452_source.html#l00204">main()</a>.</p>
231<div class="dynheader">
232Here is the call graph for this function:</div>
233<div class="dyncontent">
234<div class="center"><img src="a00137_a139416bfb5a05d907f47700d0dfa73bd_cgraph.png" border="0" usemap="#a00137_a139416bfb5a05d907f47700d0dfa73bd_cgraph" alt=""/></div>
235<map name="a00137_a139416bfb5a05d907f47700d0dfa73bd_cgraph" id="a00137_a139416bfb5a05d907f47700d0dfa73bd_cgraph">
236<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="405,5,467,32"/>
237<area shape="rect" id="node3" href="a00167.html#ac8a60c799d9dbc84531b4680762eb8dc" title="The interface function to read a sensor register. " alt="" coords="224,31,357,57"/>
238</map>
239</div>
240<div class="dynheader">
241Here is the caller graph for this function:</div>
242<div class="dyncontent">
243<div class="center"><img src="a00137_a139416bfb5a05d907f47700d0dfa73bd_icgraph.png" border="0" usemap="#a00137_a139416bfb5a05d907f47700d0dfa73bd_icgraph" alt=""/></div>
244<map name="a00137_a139416bfb5a05d907f47700d0dfa73bd_icgraph" id="a00137_a139416bfb5a05d907f47700d0dfa73bd_icgraph">
245<area shape="rect" id="node2" href="a00452.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. " alt="" coords="224,5,275,32"/>
246</map>
247</div>
248
249</div>
250</div>
251<a id="ab6916f6933917650277444810e237473"></a>
252<h2 class="memtitle"><span class="permalink"><a href="#ab6916f6933917650277444810e237473">&#9670;&nbsp;</a></span>MMA8491Q_I2C_ReadData()</h2>
253
254<div class="memitem">
255<div class="memproto">
256      <table class="memname">
257        <tr>
258          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> MMA8491Q_I2C_ReadData </td>
259          <td>(</td>
260          <td class="paramtype"><a class="el" href="a03371.html">mma8491q_i2c_sensorhandle_t</a> *&#160;</td>
261          <td class="paramname"><em>pSensorHandle</em>, </td>
262        </tr>
263        <tr>
264          <td class="paramkey"></td>
265          <td></td>
266          <td class="paramtype">const <a class="el" href="a03811.html">registerreadlist_t</a> *&#160;</td>
267          <td class="paramname"><em>pReadList</em>, </td>
268        </tr>
269        <tr>
270          <td class="paramkey"></td>
271          <td></td>
272          <td class="paramtype">uint8_t *&#160;</td>
273          <td class="paramname"><em>pBuffer</em>&#160;</td>
274        </tr>
275        <tr>
276          <td></td>
277          <td>)</td>
278          <td></td><td></td>
279        </tr>
280      </table>
281</div><div class="memdoc">
282
283<p>The interface function to read the sensor data. </p>
284<p>This function read the sensor data out from the device and returns raw data in a byte stream. </p><dl class="params"><dt>Parameters</dt><dd>
285  <table class="params">
286    <tr><td class="paramdir">[in]</td><td class="paramname">pSensorHandle</td><td>handle to the sensor. </td></tr>
287    <tr><td class="paramdir">[in]</td><td class="paramname">pReadList</td><td>pointer to the list of device registers and values to read. </td></tr>
288    <tr><td class="paramdir">[out]</td><td class="paramname">pBuffer</td><td>buffer which holds raw sensor data.This buffer may be back to back databuffer based command read in the list. </td></tr>
289  </table>
290  </dd>
291</dl>
292<dl class="section user"><dt>Constraints:</dt><dd>This can be called any number of times only after <a class="el" href="a00137.html#a139416bfb5a05d907f47700d0dfa73bd" title="The interface function to initialize the sensor. ">MMA8491Q_I2C_Initialize()</a>. Application has to ensure that previous instances of these APIs have exited before invocation.  No </dd></dl>
293<dl class="section return"><dt>Returns</dt><dd><a class="el" href="a00137.html#ab6916f6933917650277444810e237473" title="The interface function to read the sensor data. ">MMA8491Q_I2C_ReadData()</a> returns the status . </dd></dl>
294<p>Validate for the correct handle and register read list.</p>
295<p>Check whether sensor handle is initialized before reading sensor data.</p>
296<p>Parse through the read list and read the data one by one. </p>
297
298<p class="definition">Definition at line <a class="el" href="a00134_source.html#l00064">64</a> of file <a class="el" href="a00134_source.html">mma8491q_drv.c</a>.</p>
299
300<p class="reference">References <a class="el" href="a00137_source.html#l00031">mma8491q_i2c_sensorhandle_t::deviceInfo</a>, <a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t()</a>, <a class="el" href="a00137_source.html#l00033">mma8491q_i2c_sensorhandle_t::isInitialized</a>, <a class="el" href="a00137_source.html#l00032">mma8491q_i2c_sensorhandle_t::pCommDrv</a>, <a class="el" href="a00179_source.html#l00036">SENSOR_ERROR_INIT</a>, <a class="el" href="a00179_source.html#l00034">SENSOR_ERROR_INVALID_PARAM</a>, <a class="el" href="a00179_source.html#l00033">SENSOR_ERROR_NONE</a>, <a class="el" href="a00179_source.html#l00038">SENSOR_ERROR_READ</a>, <a class="el" href="a00182_source.html#l00105">Sensor_I2C_Read()</a>, <a class="el" href="a00137_source.html#l00034">mma8491q_i2c_sensorhandle_t::slaveAddress</a>, and <a class="el" href="a00359_source.html#l00248">status</a>.</p>
301
302<p class="reference">Referenced by <a class="el" href="a00452_source.html#l00204">main()</a>.</p>
303<div class="dynheader">
304Here is the call graph for this function:</div>
305<div class="dyncontent">
306<div class="center"><img src="a00137_ab6916f6933917650277444810e237473_cgraph.png" border="0" usemap="#a00137_ab6916f6933917650277444810e237473_cgraph" alt=""/></div>
307<map name="a00137_ab6916f6933917650277444810e237473_cgraph" id="a00137_ab6916f6933917650277444810e237473_cgraph">
308<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="409,5,471,32"/>
309<area shape="rect" id="node3" href="a00182.html#aa75349faed7c77807cb88d9224aa2636" title="Read register data from a sensor. " alt="" coords="235,31,361,57"/>
310</map>
311</div>
312<div class="dynheader">
313Here is the caller graph for this function:</div>
314<div class="dyncontent">
315<div class="center"><img src="a00137_ab6916f6933917650277444810e237473_icgraph.png" border="0" usemap="#a00137_ab6916f6933917650277444810e237473_icgraph" alt=""/></div>
316<map name="a00137_ab6916f6933917650277444810e237473_icgraph" id="a00137_ab6916f6933917650277444810e237473_icgraph">
317<area shape="rect" id="node2" href="a00452.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. " alt="" coords="235,5,285,32"/>
318</map>
319</div>
320
321</div>
322</div>
323<a id="a18f7cb777662c0ce9b0252c1a6ccb09c"></a>
324<h2 class="memtitle"><span class="permalink"><a href="#a18f7cb777662c0ce9b0252c1a6ccb09c">&#9670;&nbsp;</a></span>MMA8491Q_I2C_SetIdleTask()</h2>
325
326<div class="memitem">
327<div class="memproto">
328      <table class="memname">
329        <tr>
330          <td class="memname">void MMA8491Q_I2C_SetIdleTask </td>
331          <td>(</td>
332          <td class="paramtype"><a class="el" href="a03371.html">mma8491q_i2c_sensorhandle_t</a> *&#160;</td>
333          <td class="paramname"><em>pSensorHandle</em>, </td>
334        </tr>
335        <tr>
336          <td class="paramkey"></td>
337          <td></td>
338          <td class="paramtype"><a class="el" href="a00179.html#a5deff6bd688b60b97b84fc7e78d3ea63">registeridlefunction_t</a>&#160;</td>
339          <td class="paramname"><em>idleTask</em>, </td>
340        </tr>
341        <tr>
342          <td class="paramkey"></td>
343          <td></td>
344          <td class="paramtype">void *&#160;</td>
345          <td class="paramname"><em>userParam</em>&#160;</td>
346        </tr>
347        <tr>
348          <td></td>
349          <td>)</td>
350          <td></td><td></td>
351        </tr>
352      </table>
353</div><div class="memdoc">
354
355<p>: The interface function to set the I2C Idle Task. </p>
356<dl class="params"><dt>Parameters</dt><dd>
357  <table class="params">
358    <tr><td class="paramdir">[in]</td><td class="paramname"></td><td><a class="el" href="a03371.html" title="This defines the function pointers and sensor specific information. ">mma8491q_i2c_sensorhandle_t</a> *pSensorHandle, handle to the sensor handle. </td></tr>
359    <tr><td class="paramdir">[in]</td><td class="paramname"></td><td>registeridlefunction_t idleTask, function pointer to the function to execute on I2C Idle Time. </td></tr>
360    <tr><td class="paramdir">[in]</td><td class="paramname"></td><td>void *userParam, the pointer to the user idle ftask parameters. </td></tr>
361  </table>
362  </dd>
363</dl>
364<dl class="section return"><dt>Returns</dt><dd>void. </dd></dl>
365<dl class="section user"><dt>Constraints:</dt><dd>This can be called any number of times only after <a class="el" href="a00137.html#a139416bfb5a05d907f47700d0dfa73bd" title="The interface function to initialize the sensor. ">MMA8491Q_I2C_Initialize()</a>. Application has to ensure that previous instances of these APIs have exited before invocation.  No </dd></dl>
366
367<p class="definition">Definition at line <a class="el" href="a00134_source.html#l00056">56</a> of file <a class="el" href="a00134_source.html">mma8491q_drv.c</a>.</p>
368
369<p class="reference">References <a class="el" href="a00137_source.html#l00031">mma8491q_i2c_sensorhandle_t::deviceInfo</a>, <a class="el" href="a00179_source.html#l00105">registerDeviceInfo_t::functionParam</a>, and <a class="el" href="a00179_source.html#l00104">registerDeviceInfo_t::idleFunction</a>.</p>
370
371<p class="reference">Referenced by <a class="el" href="a00452_source.html#l00204">main()</a>.</p>
372<div class="dynheader">
373Here is the caller graph for this function:</div>
374<div class="dyncontent">
375<div class="center"><img src="a00137_a18f7cb777662c0ce9b0252c1a6ccb09c_icgraph.png" border="0" usemap="#a00137_a18f7cb777662c0ce9b0252c1a6ccb09c_icgraph" alt=""/></div>
376<map name="a00137_a18f7cb777662c0ce9b0252c1a6ccb09c_icgraph" id="a00137_a18f7cb777662c0ce9b0252c1a6ccb09c_icgraph">
377<area shape="rect" id="node2" href="a00452.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. " alt="" coords="245,5,296,32"/>
378</map>
379</div>
380
381</div>
382</div>
383</div><!-- contents -->
384
385<hr class="footer"/><address class="footer"><small>
386&copy; Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause
387</small></address>
388</body>
389</html>
390