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/mpl3115_drv.c 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="#func-members">Functions</a>  </div>
49  <div class="headertitle">
50<div class="title">mpl3115_drv.c File Reference</div>  </div>
51</div><!--header-->
52<div class="contents">
53
54<p>The <a class="el" href="a00161.html" title="The mpl3115_drv.c file implements the mpl3115 functional interface. ">mpl3115_drv.c</a> file implements the mpl3115 functional interface.
55<a href="#details">More...</a></p>
56<div class="textblock"><code>#include &quot;<a class="el" href="a00164_source.html">mpl3115_drv.h</a>&quot;</code><br />
57</div><div class="textblock"><div class="dynheader">
58Include dependency graph for mpl3115_drv.c:</div>
59<div class="dyncontent">
60<div class="center"><img src="a00162.png" border="0" usemap="#sensors_2mpl3115__drv_8c" alt=""/></div>
61<map name="sensors_2mpl3115__drv_8c" id="sensors_2mpl3115__drv_8c">
62<area shape="rect" id="node2" href="a00164.html" title="The mpl3115_drv.h file describes the MPL3115 driver interface and structures. " alt="" coords="30,80,135,107"/>
63</map>
64</div>
65</div>
66<p><a href="a00161_source.html">Go to the source code of this file.</a></p>
67<table class="memberdecls">
68<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
69Functions</h2></td></tr>
70<tr class="memitem:ae2d3772491a3b10c71ff529382d9a2d2"><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="a00161.html#ae2d3772491a3b10c71ff529382d9a2d2">MPL3115_I2C_Initialize</a> (<a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t whoAmi)</td></tr>
71<tr class="memdesc:ae2d3772491a3b10c71ff529382d9a2d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to initialize the sensor.  <a href="#ae2d3772491a3b10c71ff529382d9a2d2">More...</a><br /></td></tr>
72<tr class="separator:ae2d3772491a3b10c71ff529382d9a2d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
73<tr class="memitem:a1744cb8d032f2df40470591ad644c0d2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00161.html#a1744cb8d032f2df40470591ad644c0d2">MPL3115_I2C_SetIdleTask</a> (<a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *pSensorHandle, <a class="el" href="a00179.html#a5deff6bd688b60b97b84fc7e78d3ea63">registeridlefunction_t</a> idleTask, void *userParam)</td></tr>
74<tr class="memdesc:a1744cb8d032f2df40470591ad644c0d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">: The interface function to set the I2C Idle Task.  <a href="#a1744cb8d032f2df40470591ad644c0d2">More...</a><br /></td></tr>
75<tr class="separator:a1744cb8d032f2df40470591ad644c0d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
76<tr class="memitem:a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae"><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="a00161.html#a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae">MPL3115_I2C_Configure</a> (<a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *pSensorHandle, const <a class="el" href="a03807.html">registerwritelist_t</a> *pRegWriteList)</td></tr>
77<tr class="memdesc:a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to configure he sensor.  <a href="#a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae">More...</a><br /></td></tr>
78<tr class="separator:a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
79<tr class="memitem:a3ac7e30ac09a6557eebe24bb0c00e16f"><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="a00161.html#a3ac7e30ac09a6557eebe24bb0c00e16f">MPL3115_I2C_ReadData</a> (<a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *pSensorHandle, const <a class="el" href="a03811.html">registerreadlist_t</a> *pReadList, uint8_t *pBuffer)</td></tr>
80<tr class="memdesc:a3ac7e30ac09a6557eebe24bb0c00e16f"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to read the sensor data.  <a href="#a3ac7e30ac09a6557eebe24bb0c00e16f">More...</a><br /></td></tr>
81<tr class="separator:a3ac7e30ac09a6557eebe24bb0c00e16f"><td class="memSeparator" colspan="2">&#160;</td></tr>
82<tr class="memitem:a57d98d2cdcc4e6ca85b6efc8f863ce9f"><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="a00161.html#a57d98d2cdcc4e6ca85b6efc8f863ce9f">MPL3115_I2C_DeInit</a> (<a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *pSensorHandle)</td></tr>
83<tr class="memdesc:a57d98d2cdcc4e6ca85b6efc8f863ce9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to De Initialize sensor..  <a href="#a57d98d2cdcc4e6ca85b6efc8f863ce9f">More...</a><br /></td></tr>
84<tr class="separator:a57d98d2cdcc4e6ca85b6efc8f863ce9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
85</table>
86<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
87<div class="textblock"><p>The <a class="el" href="a00161.html" title="The mpl3115_drv.c file implements the mpl3115 functional interface. ">mpl3115_drv.c</a> file implements the mpl3115 functional interface. </p>
88
89<p class="definition">Definition in file <a class="el" href="a00161_source.html">mpl3115_drv.c</a>.</p>
90</div><h2 class="groupheader">Function Documentation</h2>
91<a id="a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae"></a>
92<h2 class="memtitle"><span class="permalink"><a href="#a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae">&#9670;&nbsp;</a></span>MPL3115_I2C_Configure()</h2>
93
94<div class="memitem">
95<div class="memproto">
96      <table class="memname">
97        <tr>
98          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> MPL3115_I2C_Configure </td>
99          <td>(</td>
100          <td class="paramtype"><a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *&#160;</td>
101          <td class="paramname"><em>pSensorHandle</em>, </td>
102        </tr>
103        <tr>
104          <td class="paramkey"></td>
105          <td></td>
106          <td class="paramtype">const <a class="el" href="a03807.html">registerwritelist_t</a> *&#160;</td>
107          <td class="paramname"><em>pRegWriteList</em>&#160;</td>
108        </tr>
109        <tr>
110          <td></td>
111          <td>)</td>
112          <td></td><td></td>
113        </tr>
114      </table>
115</div><div class="memdoc">
116
117<p>The interface function to configure he sensor. </p>
118<p>This function configure the sensor with requested ODR, Range and registers in the regsiter pair array. </p><dl class="params"><dt>Parameters</dt><dd>
119  <table class="params">
120    <tr><td class="paramdir">[in]</td><td class="paramname">pSensorHandle</td><td>handle to the sensor. </td></tr>
121    <tr><td class="paramdir">[in]</td><td class="paramname">pRegWriteList</td><td>pointer to the register list. </td></tr>
122  </table>
123  </dd>
124</dl>
125<dl class="section user"><dt>Constraints:</dt><dd>This can be called any number of times only after <a class="el" href="a00164.html#ae2d3772491a3b10c71ff529382d9a2d2" title="The interface function to initialize the sensor. ">MPL3115_I2C_Initialize()</a>. Application has to ensure that previous instances of these APIs have exited before invocation.  No </dd></dl>
126<dl class="section return"><dt>Returns</dt><dd><a class="el" href="a00164.html#a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae" title="The interface function to configure he sensor. ">MPL3115_I2C_Configure()</a> returns the status. </dd></dl>
127<p>Validate for the correct handle and register write list.</p>
128<p>Check whether sensor handle is initialized before applying configuration.</p>
129<p>Put the device into standby mode so that configuration can be applied.</p>
130<p>Apply the Sensor Configuration based on the Register Write List</p>
131<p>Put the device into active mode and ready for reading data. </p>
132
133<p class="definition">Definition at line <a class="el" href="a00161_source.html#l00061">61</a> of file <a class="el" href="a00161_source.html">mpl3115_drv.c</a>.</p>
134
135<p class="reference">References <a class="el" href="a00164_source.html#l00038">mpl3115_i2c_sensorhandle_t::deviceInfo</a>, <a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t()</a>, <a class="el" href="a00164_source.html#l00040">mpl3115_i2c_sensorhandle_t::isInitialized</a>, <a class="el" href="a00158_source.html#l00054">MPL3115_CTRL_REG1</a>, <a class="el" href="a00158_source.html#l00869">MPL3115_CTRL_REG1_SBYB_ACTIVE</a>, <a class="el" href="a00158_source.html#l00846">MPL3115_CTRL_REG1_SBYB_MASK</a>, <a class="el" href="a00158_source.html#l00868">MPL3115_CTRL_REG1_SBYB_STANDBY</a>, <a class="el" href="a00164_source.html#l00039">mpl3115_i2c_sensorhandle_t::pCommDrv</a>, <a class="el" href="a00167_source.html#l00193">Register_I2C_Write()</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#l00037">SENSOR_ERROR_WRITE</a>, <a class="el" href="a00182_source.html#l00071">Sensor_I2C_Write()</a>, <a class="el" href="a00164_source.html#l00041">mpl3115_i2c_sensorhandle_t::slaveAddress</a>, and <a class="el" href="a00359_source.html#l00248">status</a>.</p>
136
137<p class="reference">Referenced by <a class="el" href="a04799_source.html#l00070">main()</a>.</p>
138<div class="dynheader">
139Here is the call graph for this function:</div>
140<div class="dyncontent">
141<div class="center"><img src="a00161_a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae_cgraph.png" border="0" usemap="#a00161_a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae_cgraph" alt=""/></div>
142<map name="a00161_a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae_cgraph" id="a00161_a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae_cgraph">
143<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="575,29,636,55"/>
144<area shape="rect" id="node3" href="a00167.html#ad08d2c7880bc5f09fd27eee247311448" title="The interface function to write a sensor register. " alt="" coords="392,29,527,55"/>
145<area shape="rect" id="node4" href="a00182.html#aaac4c4f34b4dd37d3f202a1dbb4b000b" title="Write register data to a sensor. " alt="" coords="217,79,344,106"/>
146</map>
147</div>
148<div class="dynheader">
149Here is the caller graph for this function:</div>
150<div class="dyncontent">
151<div class="center"><img src="a00161_a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae_icgraph.png" border="0" usemap="#a00161_a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae_icgraph" alt=""/></div>
152<map name="a00161_a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae_icgraph" id="a00161_a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae_icgraph">
153<area shape="rect" id="node2" href="a04799.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. " alt="" coords="217,5,268,32"/>
154</map>
155</div>
156
157</div>
158</div>
159<a id="a57d98d2cdcc4e6ca85b6efc8f863ce9f"></a>
160<h2 class="memtitle"><span class="permalink"><a href="#a57d98d2cdcc4e6ca85b6efc8f863ce9f">&#9670;&nbsp;</a></span>MPL3115_I2C_DeInit()</h2>
161
162<div class="memitem">
163<div class="memproto">
164      <table class="memname">
165        <tr>
166          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> MPL3115_I2C_DeInit </td>
167          <td>(</td>
168          <td class="paramtype"><a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *&#160;</td>
169          <td class="paramname"><em>pSensorHandle</em></td><td>)</td>
170          <td></td>
171        </tr>
172      </table>
173</div><div class="memdoc">
174
175<p>The interface function to De Initialize sensor.. </p>
176<p>This function made sensor in a power safe state and de initialize its handle. </p><dl class="params"><dt>Parameters</dt><dd>
177  <table class="params">
178    <tr><td class="paramdir">[in]</td><td class="paramname">pSensorHandle</td><td>handle to the sensor. </td></tr>
179  </table>
180  </dd>
181</dl>
182<dl class="section user"><dt>Constraints:</dt><dd>This can be called only after <a class="el" href="a00164.html#ae2d3772491a3b10c71ff529382d9a2d2" title="The interface function to initialize the sensor. ">MPL3115_I2C_Initialize()</a> has been called. Application has to ensure that previous instances of these APIs have exited before invocation.  No </dd></dl>
183<dl class="section return"><dt>Returns</dt><dd><a class="el" href="a00164.html#a57d98d2cdcc4e6ca85b6efc8f863ce9f" title="The interface function to De Initialize sensor.. ">MPL3115_I2C_DeInit()</a> returns the status. </dd></dl>
184<p>Check whether sensor handle is initialized before triggering sensor reset.</p>
185<p>Trigger sensor device reset.</p>
186<p>De-initialize sensor handle. </p>
187
188<p class="definition">Definition at line <a class="el" href="a00161_source.html#l00133">133</a> of file <a class="el" href="a00161_source.html">mpl3115_drv.c</a>.</p>
189
190<p class="reference">References <a class="el" href="a00164_source.html#l00038">mpl3115_i2c_sensorhandle_t::deviceInfo</a>, <a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t()</a>, <a class="el" href="a00164_source.html#l00040">mpl3115_i2c_sensorhandle_t::isInitialized</a>, <a class="el" href="a00158_source.html#l00054">MPL3115_CTRL_REG1</a>, <a class="el" href="a00158_source.html#l00873">MPL3115_CTRL_REG1_RST_EN</a>, <a class="el" href="a00158_source.html#l00852">MPL3115_CTRL_REG1_RST_MASK</a>, <a class="el" href="a00164_source.html#l00039">mpl3115_i2c_sensorhandle_t::pCommDrv</a>, <a class="el" href="a00167_source.html#l00193">Register_I2C_Write()</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#l00037">SENSOR_ERROR_WRITE</a>, <a class="el" href="a00164_source.html#l00041">mpl3115_i2c_sensorhandle_t::slaveAddress</a>, and <a class="el" href="a00359_source.html#l00248">status</a>.</p>
191<div class="dynheader">
192Here is the call graph for this function:</div>
193<div class="dyncontent">
194<div class="center"><img src="a00161_a57d98d2cdcc4e6ca85b6efc8f863ce9f_cgraph.png" border="0" usemap="#a00161_a57d98d2cdcc4e6ca85b6efc8f863ce9f_cgraph" alt=""/></div>
195<map name="a00161_a57d98d2cdcc4e6ca85b6efc8f863ce9f_cgraph" id="a00161_a57d98d2cdcc4e6ca85b6efc8f863ce9f_cgraph">
196<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="379,5,440,32"/>
197<area shape="rect" id="node3" href="a00167.html#ad08d2c7880bc5f09fd27eee247311448" title="The interface function to write a sensor register. " alt="" coords="196,31,331,57"/>
198</map>
199</div>
200
201</div>
202</div>
203<a id="ae2d3772491a3b10c71ff529382d9a2d2"></a>
204<h2 class="memtitle"><span class="permalink"><a href="#ae2d3772491a3b10c71ff529382d9a2d2">&#9670;&nbsp;</a></span>MPL3115_I2C_Initialize()</h2>
205
206<div class="memitem">
207<div class="memproto">
208      <table class="memname">
209        <tr>
210          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> MPL3115_I2C_Initialize </td>
211          <td>(</td>
212          <td class="paramtype"><a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *&#160;</td>
213          <td class="paramname"><em>pSensorHandle</em>, </td>
214        </tr>
215        <tr>
216          <td class="paramkey"></td>
217          <td></td>
218          <td class="paramtype">ARM_DRIVER_I2C *&#160;</td>
219          <td class="paramname"><em>pBus</em>, </td>
220        </tr>
221        <tr>
222          <td class="paramkey"></td>
223          <td></td>
224          <td class="paramtype">uint8_t&#160;</td>
225          <td class="paramname"><em>index</em>, </td>
226        </tr>
227        <tr>
228          <td class="paramkey"></td>
229          <td></td>
230          <td class="paramtype">uint16_t&#160;</td>
231          <td class="paramname"><em>sAddress</em>, </td>
232        </tr>
233        <tr>
234          <td class="paramkey"></td>
235          <td></td>
236          <td class="paramtype">uint8_t&#160;</td>
237          <td class="paramname"><em>whoAmi</em>&#160;</td>
238        </tr>
239        <tr>
240          <td></td>
241          <td>)</td>
242          <td></td><td></td>
243        </tr>
244      </table>
245</div><div class="memdoc">
246
247<p>The interface function to initialize the sensor. </p>
248<p>This function initialize the sensor and sensor handle. </p><dl class="params"><dt>Parameters</dt><dd>
249  <table class="params">
250    <tr><td class="paramdir">[in]</td><td class="paramname">pSensorHandle</td><td>handle to the sensor. </td></tr>
251    <tr><td class="paramdir">[in]</td><td class="paramname">pBus</td><td>pointer to the CMSIS API compatible I2C bus object. </td></tr>
252    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>the I2C device number. </td></tr>
253    <tr><td class="paramdir">[in]</td><td class="paramname">sAddress</td><td>slave address of the device on the bus. </td></tr>
254    <tr><td class="paramdir">[in]</td><td class="paramname">whoami</td><td>WHO_AM_I value of the device. </td></tr>
255  </table>
256  </dd>
257</dl>
258<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>
259<dl class="section return"><dt>Returns</dt><dd><a class="el" href="a00164.html#ae2d3772491a3b10c71ff529382d9a2d2" title="The interface function to initialize the sensor. ">MPL3115_I2C_Initialize()</a> returns the status. </dd></dl>
260<p>Check the input parameters.</p>
261<p>Read and store the device's WHO_AM_I.</p>
262<p>Initialize the sensor handle. </p>
263
264<p class="definition">Definition at line <a class="el" href="a00161_source.html#l00022">22</a> of file <a class="el" href="a00161_source.html">mpl3115_drv.c</a>.</p>
265
266<p class="reference">References <a class="el" href="a00164_source.html#l00038">mpl3115_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="a00164_source.html#l00040">mpl3115_i2c_sensorhandle_t::isInitialized</a>, <a class="el" href="a00158_source.html#l00028">MPL3115_WHO_AM_I</a>, <a class="el" href="a00164_source.html#l00039">mpl3115_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="a00164_source.html#l00041">mpl3115_i2c_sensorhandle_t::slaveAddress</a>, and <a class="el" href="a00359_source.html#l00248">status</a>.</p>
267
268<p class="reference">Referenced by <a class="el" href="a00401_source.html#l00227">main()</a>.</p>
269<div class="dynheader">
270Here is the call graph for this function:</div>
271<div class="dyncontent">
272<div class="center"><img src="a00161_ae2d3772491a3b10c71ff529382d9a2d2_cgraph.png" border="0" usemap="#a00161_ae2d3772491a3b10c71ff529382d9a2d2_cgraph" alt=""/></div>
273<map name="a00161_ae2d3772491a3b10c71ff529382d9a2d2_cgraph" id="a00161_ae2d3772491a3b10c71ff529382d9a2d2_cgraph">
274<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="392,5,453,32"/>
275<area shape="rect" id="node3" href="a00167.html#ac8a60c799d9dbc84531b4680762eb8dc" title="The interface function to read a sensor register. " alt="" coords="211,31,344,57"/>
276</map>
277</div>
278<div class="dynheader">
279Here is the caller graph for this function:</div>
280<div class="dyncontent">
281<div class="center"><img src="a00161_ae2d3772491a3b10c71ff529382d9a2d2_icgraph.png" border="0" usemap="#a00161_ae2d3772491a3b10c71ff529382d9a2d2_icgraph" alt=""/></div>
282<map name="a00161_ae2d3772491a3b10c71ff529382d9a2d2_icgraph" id="a00161_ae2d3772491a3b10c71ff529382d9a2d2_icgraph">
283<area shape="rect" id="node2" href="a00401.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. " alt="" coords="211,5,261,32"/>
284</map>
285</div>
286
287</div>
288</div>
289<a id="a3ac7e30ac09a6557eebe24bb0c00e16f"></a>
290<h2 class="memtitle"><span class="permalink"><a href="#a3ac7e30ac09a6557eebe24bb0c00e16f">&#9670;&nbsp;</a></span>MPL3115_I2C_ReadData()</h2>
291
292<div class="memitem">
293<div class="memproto">
294      <table class="memname">
295        <tr>
296          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> MPL3115_I2C_ReadData </td>
297          <td>(</td>
298          <td class="paramtype"><a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *&#160;</td>
299          <td class="paramname"><em>pSensorHandle</em>, </td>
300        </tr>
301        <tr>
302          <td class="paramkey"></td>
303          <td></td>
304          <td class="paramtype">const <a class="el" href="a03811.html">registerreadlist_t</a> *&#160;</td>
305          <td class="paramname"><em>pReadList</em>, </td>
306        </tr>
307        <tr>
308          <td class="paramkey"></td>
309          <td></td>
310          <td class="paramtype">uint8_t *&#160;</td>
311          <td class="paramname"><em>pBuffer</em>&#160;</td>
312        </tr>
313        <tr>
314          <td></td>
315          <td>)</td>
316          <td></td><td></td>
317        </tr>
318      </table>
319</div><div class="memdoc">
320
321<p>The interface function to read the sensor data. </p>
322<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>
323  <table class="params">
324    <tr><td class="paramdir">[in]</td><td class="paramname">pSensorHandle</td><td>handle to the sensor. </td></tr>
325    <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>
326    <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>
327  </table>
328  </dd>
329</dl>
330<dl class="section user"><dt>Constraints:</dt><dd>This can be called only after <a class="el" href="a00164.html#ae2d3772491a3b10c71ff529382d9a2d2" title="The interface function to initialize the sensor. ">MPL3115_I2C_Initialize()</a>. Application has to ensure that previous instances of these APIs have exited before invocation.  No </dd></dl>
331<dl class="section return"><dt>Returns</dt><dd><a class="el" href="a00164.html#a3ac7e30ac09a6557eebe24bb0c00e16f" title="The interface function to read the sensor data. ">MPL3115_I2C_ReadData()</a> returns the status . </dd></dl>
332<p>Validate for the correct handle and register read list.</p>
333<p>Check whether sensor handle is initialized before reading sensor data.</p>
334<p>Parse through the read list and read the data one by one. </p>
335
336<p class="definition">Definition at line <a class="el" href="a00161_source.html#l00104">104</a> of file <a class="el" href="a00161_source.html">mpl3115_drv.c</a>.</p>
337
338<p class="reference">References <a class="el" href="a00164_source.html#l00038">mpl3115_i2c_sensorhandle_t::deviceInfo</a>, <a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t()</a>, <a class="el" href="a00164_source.html#l00040">mpl3115_i2c_sensorhandle_t::isInitialized</a>, <a class="el" href="a00164_source.html#l00039">mpl3115_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="a00164_source.html#l00041">mpl3115_i2c_sensorhandle_t::slaveAddress</a>, and <a class="el" href="a00359_source.html#l00248">status</a>.</p>
339
340<p class="reference">Referenced by <a class="el" href="a00401_source.html#l00227">main()</a>.</p>
341<div class="dynheader">
342Here is the call graph for this function:</div>
343<div class="dyncontent">
344<div class="center"><img src="a00161_a3ac7e30ac09a6557eebe24bb0c00e16f_cgraph.png" border="0" usemap="#a00161_a3ac7e30ac09a6557eebe24bb0c00e16f_cgraph" alt=""/></div>
345<map name="a00161_a3ac7e30ac09a6557eebe24bb0c00e16f_cgraph" id="a00161_a3ac7e30ac09a6557eebe24bb0c00e16f_cgraph">
346<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="395,5,456,32"/>
347<area shape="rect" id="node3" href="a00182.html#aa75349faed7c77807cb88d9224aa2636" title="Read register data from a sensor. " alt="" coords="220,31,347,57"/>
348</map>
349</div>
350<div class="dynheader">
351Here is the caller graph for this function:</div>
352<div class="dyncontent">
353<div class="center"><img src="a00161_a3ac7e30ac09a6557eebe24bb0c00e16f_icgraph.png" border="0" usemap="#a00161_a3ac7e30ac09a6557eebe24bb0c00e16f_icgraph" alt=""/></div>
354<map name="a00161_a3ac7e30ac09a6557eebe24bb0c00e16f_icgraph" id="a00161_a3ac7e30ac09a6557eebe24bb0c00e16f_icgraph">
355<area shape="rect" id="node2" href="a00401.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. " alt="" coords="220,5,271,32"/>
356</map>
357</div>
358
359</div>
360</div>
361<a id="a1744cb8d032f2df40470591ad644c0d2"></a>
362<h2 class="memtitle"><span class="permalink"><a href="#a1744cb8d032f2df40470591ad644c0d2">&#9670;&nbsp;</a></span>MPL3115_I2C_SetIdleTask()</h2>
363
364<div class="memitem">
365<div class="memproto">
366      <table class="memname">
367        <tr>
368          <td class="memname">void MPL3115_I2C_SetIdleTask </td>
369          <td>(</td>
370          <td class="paramtype"><a class="el" href="a03783.html">mpl3115_i2c_sensorhandle_t</a> *&#160;</td>
371          <td class="paramname"><em>pSensorHandle</em>, </td>
372        </tr>
373        <tr>
374          <td class="paramkey"></td>
375          <td></td>
376          <td class="paramtype"><a class="el" href="a00179.html#a5deff6bd688b60b97b84fc7e78d3ea63">registeridlefunction_t</a>&#160;</td>
377          <td class="paramname"><em>idleTask</em>, </td>
378        </tr>
379        <tr>
380          <td class="paramkey"></td>
381          <td></td>
382          <td class="paramtype">void *&#160;</td>
383          <td class="paramname"><em>userParam</em>&#160;</td>
384        </tr>
385        <tr>
386          <td></td>
387          <td>)</td>
388          <td></td><td></td>
389        </tr>
390      </table>
391</div><div class="memdoc">
392
393<p>: The interface function to set the I2C Idle Task. </p>
394<dl class="params"><dt>Parameters</dt><dd>
395  <table class="params">
396    <tr><td class="paramdir">[in]</td><td class="paramname"></td><td><a class="el" href="a03783.html" title="This defines the sensor specific information. ">mpl3115_i2c_sensorhandle_t</a> *pSensorHandle, handle to the sensor handle. </td></tr>
397    <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>
398    <tr><td class="paramdir">[in]</td><td class="paramname"></td><td>void *userParam, the pointer to the user idle ftask parameters. </td></tr>
399  </table>
400  </dd>
401</dl>
402<dl class="section return"><dt>Returns</dt><dd>void. </dd></dl>
403<dl class="section user"><dt>Constraints:</dt><dd>This can be called any number of times only after <a class="el" href="a00164.html#ae2d3772491a3b10c71ff529382d9a2d2" title="The interface function to initialize the sensor. ">MPL3115_I2C_Initialize()</a>. Application has to ensure that previous instances of these APIs have exited before invocation.  No </dd></dl>
404
405<p class="definition">Definition at line <a class="el" href="a00161_source.html#l00053">53</a> of file <a class="el" href="a00161_source.html">mpl3115_drv.c</a>.</p>
406
407<p class="reference">References <a class="el" href="a00164_source.html#l00038">mpl3115_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>
408
409<p class="reference">Referenced by <a class="el" href="a00401_source.html#l00227">main()</a>.</p>
410<div class="dynheader">
411Here is the caller graph for this function:</div>
412<div class="dyncontent">
413<div class="center"><img src="a00161_a1744cb8d032f2df40470591ad644c0d2_icgraph.png" border="0" usemap="#a00161_a1744cb8d032f2df40470591ad644c0d2_icgraph" alt=""/></div>
414<map name="a00161_a1744cb8d032f2df40470591ad644c0d2_icgraph" id="a00161_a1744cb8d032f2df40470591ad644c0d2_icgraph">
415<area shape="rect" id="node2" href="a00401.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. " alt="" coords="232,5,283,32"/>
416</map>
417</div>
418
419</div>
420</div>
421</div><!-- contents -->
422
423<hr class="footer"/><address class="footer"><small>
424&copy; Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause
425</small></address>
426</body>
427</html>
428