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/register_io_i2c.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="#func-members">Functions</a>  </div>
49  <div class="headertitle">
50<div class="title">register_io_i2c.h File Reference</div>  </div>
51</div><!--header-->
52<div class="contents">
53
54<p>The <a class="el" href="a00170.html" title="The register_io_i2c.h file declares low-level interface functions for reading and writing sensor regi...">register_io_i2c.h</a> file declares low-level interface functions for reading and writing sensor registers.
55<a href="#details">More...</a></p>
56<div class="textblock"><code>#include &quot;<a class="el" href="a00179_source.html">sensor_drv.h</a>&quot;</code><br />
57<code>#include &quot;Driver_I2C.h&quot;</code><br />
58</div><div class="textblock"><div class="dynheader">
59Include dependency graph for register_io_i2c.h:</div>
60<div class="dyncontent">
61<div class="center"><img src="a00171.png" border="0" usemap="#sensors_2register__io__i2c_8h" alt=""/></div>
62<map name="sensors_2register__io__i2c_8h" id="sensors_2register__io__i2c_8h">
63<area shape="rect" id="node2" href="a00179.html" title="The sensor_drv.h file contains sensor state and error definitions. " alt="" coords="5,95,100,121"/>
64</map>
65</div>
66</div><div class="textblock"><div class="dynheader">
67This graph shows which files directly or indirectly include this file:</div>
68<div class="dyncontent">
69<div class="center"><img src="a00172.png" border="0" usemap="#sensors_2register__io__i2c_8hdep" alt=""/></div>
70<map name="sensors_2register__io__i2c_8hdep" id="sensors_2register__io__i2c_8hdep">
71<area shape="rect" id="node2" href="a00185.html" title="The sensor_io_i2c.h file declares low&#45;level interface functions for reading and writing sensor regist..." alt="" coords="1242,109,1405,136"/>
72<area shape="rect" id="node3" href="a00023.html" title="The dbap_drv.h file describes the DBAP driver interface and structures. " alt="" coords="5,199,140,225"/>
73<area shape="rect" id="node4" href="a00032.html" title="The fxas21002_drv.h file describes the fxas21002 driver interface and structures. ..." alt="" coords="165,199,330,225"/>
74<area shape="rect" id="node5" href="a00041.html" title="The fxlc95000_drv.h file describes the FXLC95000L driver interface and structures. " alt="" coords="355,199,516,225"/>
75<area shape="rect" id="node6" href="a00059.html" title="The fxls8962_drv.h file describes the FXLS8962AF driver interface and structures. ..." alt="" coords="541,199,695,225"/>
76<area shape="rect" id="node7" href="a00068.html" title="The fxls896x_drv.h file describes the FXLS8964/67AF driver interface and structures. " alt="" coords="719,199,874,225"/>
77<area shape="rect" id="node8" href="a00077.html" title="The fxls8974_drv.h file describes the FXLS8974CF driver interface and structures. ..." alt="" coords="898,199,1053,225"/>
78<area shape="rect" id="node9" href="a00086.html" title="The fxos8700_drv.h file describes the fxos8700 driver interface and structures. " alt="" coords="1077,199,1236,225"/>
79<area shape="rect" id="node10" href="a00095.html" title="The fxpq3115_drv.h file describes the fxpq3115 driver interface and structures. " alt="" coords="1260,199,1419,225"/>
80<area shape="rect" id="node11" href="a00110.html" title="The isl29023_drv.h file describes the ISL29023 driver interface and structures. " alt="" coords="1443,199,1598,225"/>
81<area shape="rect" id="node12" href="a00119.html" title="The mag3110_drv.h file describes the MAG3110 driver interface and structures. " alt="" coords="1623,199,1781,225"/>
82<area shape="rect" id="node13" href="a00128.html" title="The mma845x_drv.h file describes the MMA845x driver interface and structures. " alt="" coords="1806,199,1969,225"/>
83<area shape="rect" id="node14" href="a00137.html" title="The mma8491q_drv.h file describes the MMA8491Q driver interface and structures. " alt="" coords="1993,199,2163,225"/>
84<area shape="rect" id="node15" href="a00146.html" title="The mma865x_drv.h file describes the MMA865x driver interface and structures. " alt="" coords="2187,199,2350,225"/>
85<area shape="rect" id="node16" href="a00155.html" title="The mma9553_drv.h file describes the MMA9553L driver interface and structures. " alt="" coords="2374,199,2537,225"/>
86<area shape="rect" id="node17" href="a00164.html" title="The mpl3115_drv.h file describes the MPL3115 driver interface and structures. " alt="" coords="2561,199,2715,225"/>
87<area shape="rect" id="node18" href="a00098.html" title="The host_io_uart.c file contains definitions for UART based streaming interface for sending and resei..." alt="" coords="1834,109,1989,136"/>
88<area shape="rect" id="node19" href="a00167.html" title="The register_io_i2c.c file contains definitions for low&#45;level interface functions for reading and wri..." alt="" coords="2013,102,2145,143"/>
89<area shape="rect" id="node20" href="a00470.html" title="The orientaion_application_baremetal_agm01.c file implements the ISSDK baremetal orientation applicat..." alt="" coords="2169,95,2320,151"/>
90<area shape="rect" id="node21" href="a00473.html" title="The orientaion_application_baremetal_agm04.c file implements the ISSDK baremetal orientation applicat..." alt="" coords="2344,95,2495,151"/>
91<area shape="rect" id="node22" href="a00476.html" title="The orientaion_application_baremetal_agmp03.c file implements the ISSDK baremetal orientation applica..." alt="" coords="2519,95,2669,151"/>
92<area shape="rect" id="node23" href="a04823.html" title="drivers/ads/lpc/auto\l_detection_service.c" alt="" coords="2693,102,2833,143"/>
93<area shape="rect" id="node24" href="a04826.html" title="drivers/ads/kinetis\l/auto_detection_service.c" alt="" coords="2857,102,3027,143"/>
94<area shape="rect" id="node25" href="a00542.html" title="The auto detection service file implements auto detection sequence for discovery of FRDM&#45;KL25Z Board ..." alt="" coords="3051,95,3209,151"/>
95<area shape="rect" id="node26" href="a04829.html" title="drivers/ads/qn/auto\l_detection_service.c" alt="" coords="3233,102,3373,143"/>
96<area shape="rect" id="node27" href="a00860.html" title="FreeRTOS (two task) implementation of sensor fusion on FRDM&#45;K64F. " alt="" coords="3398,95,3598,151"/>
97<area shape="rect" id="node28" href="a00863.html" title="FreeRTOS (two task) implementation of sensor fusion on FRDM&#45;K64F/FRDM&#45;STBC&#45;AGM04 using MMA8652 (Accel..." alt="" coords="3622,95,3822,151"/>
98<area shape="rect" id="node29" href="a00866.html" title="FreeRTOS (two task) implementation of sensor fusion. " alt="" coords="3847,95,4053,151"/>
99<area shape="rect" id="node30" href="a00869.html" title="Bare metal implementation of sensor fusion on FRDM&#45;K64F. " alt="" coords="4078,102,4257,143"/>
100<area shape="rect" id="node31" href="a00872.html" title="Bare metal implementation of sensor fusion on FRDM&#45;K64F/FRDM&#45;STBC&#45;AGM04 using MMA8652 (Accel)..." alt="" coords="4281,95,4449,151"/>
101<area shape="rect" id="node32" href="a00875.html" title="Bare metal implementation of sensor fusion on FRDM&#45;K64F. " alt="" coords="4473,95,4641,151"/>
102<area shape="rect" id="node33" href="a00878.html" title="FreeRTOS (two task) implementation of sensor fusion on FRDM&#45;K64F/FRDM&#45;FXS&#45;AGM02. " alt="" coords="4665,95,4824,151"/>
103<area shape="rect" id="node34" href="a00881.html" title="FreeRTOS (two task) implementation of sensor fusion on FRDM&#45;K64F/FRDM&#45;FXS&#45;AGM02 with smart power&#45;cycl..." alt="" coords="4849,95,5017,151"/>
104<area shape="rect" id="node35" href="a00884.html" title="FreeRTOS (two task) implementation of sensor fusion on FRDM&#45;K64F. " alt="" coords="5041,95,5200,151"/>
105</map>
106</div>
107</div>
108<p><a href="a00170_source.html">Go to the source code of this file.</a></p>
109<table class="memberdecls">
110<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
111Functions</h2></td></tr>
112<tr class="memitem:ac5a66aa1b8d95d267c9d68cb475c9e01"><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="a00170.html#ac5a66aa1b8d95d267c9d68cb475c9e01">Register_I2C_BlockWrite</a> (ARM_DRIVER_I2C *pCommDrv, <a class="el" href="a03819.html">registerDeviceInfo_t</a> *devInfo, uint16_t slaveAddress, uint8_t offset, const uint8_t *pBuffer, uint8_t bytesToWrite)</td></tr>
113<tr class="memdesc:ac5a66aa1b8d95d267c9d68cb475c9e01"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to write a sensor register.  <a href="#ac5a66aa1b8d95d267c9d68cb475c9e01">More...</a><br /></td></tr>
114<tr class="separator:ac5a66aa1b8d95d267c9d68cb475c9e01"><td class="memSeparator" colspan="2">&#160;</td></tr>
115<tr class="memitem:ad08d2c7880bc5f09fd27eee247311448"><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="a00170.html#ad08d2c7880bc5f09fd27eee247311448">Register_I2C_Write</a> (ARM_DRIVER_I2C *pCommDrv, <a class="el" href="a03819.html">registerDeviceInfo_t</a> *devInfo, uint16_t slaveAddress, uint8_t offset, uint8_t value, uint8_t mask, bool repeatedStart)</td></tr>
116<tr class="memdesc:ad08d2c7880bc5f09fd27eee247311448"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to write a sensor register.  <a href="#ad08d2c7880bc5f09fd27eee247311448">More...</a><br /></td></tr>
117<tr class="separator:ad08d2c7880bc5f09fd27eee247311448"><td class="memSeparator" colspan="2">&#160;</td></tr>
118<tr class="memitem:ac8a60c799d9dbc84531b4680762eb8dc"><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="a00170.html#ac8a60c799d9dbc84531b4680762eb8dc">Register_I2C_Read</a> (ARM_DRIVER_I2C *pCommDrv, <a class="el" href="a03819.html">registerDeviceInfo_t</a> *devInfo, uint16_t slaveAddress, uint8_t offset, uint8_t length, uint8_t *pOutBuffer)</td></tr>
119<tr class="memdesc:ac8a60c799d9dbc84531b4680762eb8dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">The interface function to read a sensor register.  <a href="#ac8a60c799d9dbc84531b4680762eb8dc">More...</a><br /></td></tr>
120<tr class="separator:ac8a60c799d9dbc84531b4680762eb8dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
121</table>
122<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
123<div class="textblock"><p>The <a class="el" href="a00170.html" title="The register_io_i2c.h file declares low-level interface functions for reading and writing sensor regi...">register_io_i2c.h</a> file declares low-level interface functions for reading and writing sensor registers. </p>
124
125<p class="definition">Definition in file <a class="el" href="a00170_source.html">register_io_i2c.h</a>.</p>
126</div><h2 class="groupheader">Function Documentation</h2>
127<a id="ac5a66aa1b8d95d267c9d68cb475c9e01"></a>
128<h2 class="memtitle"><span class="permalink"><a href="#ac5a66aa1b8d95d267c9d68cb475c9e01">&#9670;&nbsp;</a></span>Register_I2C_BlockWrite()</h2>
129
130<div class="memitem">
131<div class="memproto">
132      <table class="memname">
133        <tr>
134          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> Register_I2C_BlockWrite </td>
135          <td>(</td>
136          <td class="paramtype">ARM_DRIVER_I2C *&#160;</td>
137          <td class="paramname"><em>pCommDrv</em>, </td>
138        </tr>
139        <tr>
140          <td class="paramkey"></td>
141          <td></td>
142          <td class="paramtype"><a class="el" href="a03819.html">registerDeviceInfo_t</a> *&#160;</td>
143          <td class="paramname"><em>devInfo</em>, </td>
144        </tr>
145        <tr>
146          <td class="paramkey"></td>
147          <td></td>
148          <td class="paramtype">uint16_t&#160;</td>
149          <td class="paramname"><em>slaveAddress</em>, </td>
150        </tr>
151        <tr>
152          <td class="paramkey"></td>
153          <td></td>
154          <td class="paramtype">uint8_t&#160;</td>
155          <td class="paramname"><em>offset</em>, </td>
156        </tr>
157        <tr>
158          <td class="paramkey"></td>
159          <td></td>
160          <td class="paramtype">const uint8_t *&#160;</td>
161          <td class="paramname"><em>pBuffer</em>, </td>
162        </tr>
163        <tr>
164          <td class="paramkey"></td>
165          <td></td>
166          <td class="paramtype">uint8_t&#160;</td>
167          <td class="paramname"><em>bytesToWrite</em>&#160;</td>
168        </tr>
169        <tr>
170          <td></td>
171          <td>)</td>
172          <td></td><td></td>
173        </tr>
174      </table>
175</div><div class="memdoc">
176
177<p>The interface function to write a sensor register. </p>
178<dl class="params"><dt>Parameters</dt><dd>
179  <table class="params">
180    <tr><td class="paramname">ARM_DRIVER_I2C</td><td>*pCommDrv - The I2C driver to use. </td></tr>
181    <tr><td class="paramname"><a class="el" href="a03819.html" title="This structure defines the device specific info required by register I/O. ">registerDeviceInfo_t</a></td><td>*devInfo - The I2C device number and idle function. </td></tr>
182    <tr><td class="paramname">uint16_t</td><td>slaveAddress - the sensor's I2C slave address. </td></tr>
183    <tr><td class="paramname">uint8_t</td><td>offset - The register/offset to write to. </td></tr>
184    <tr><td class="paramname">uint8_t</td><td>*pBuffer - The buffer containing bytes to write. </td></tr>
185    <tr><td class="paramname">uint8_t</td><td>bytesToWrite - A number of bytes to write.</td></tr>
186  </table>
187  </dd>
188</dl>
189<dl class="section return"><dt>Returns</dt><dd>ARM_DRIVER_OK if success or ARM_DRIVER_ERROR if error.</dd></dl>
190<p>The interface function to block write sensor registers. </p>
191
192<p class="definition">Definition at line <a class="el" href="a00167_source.html#l00149">149</a> of file <a class="el" href="a00167_source.html">register_io_i2c.c</a>.</p>
193
194<p class="reference">References <a class="el" href="a00167_source.html#l00031">b_I2C_CompletionFlag</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="a00167_source.html#l00032">g_I2C_ErrorEvent</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="a00179_source.html#l00042">SENSOR_MAX_REGISTER_COUNT</a>, and <a class="el" href="a00359_source.html#l00248">status</a>.</p>
195
196<p class="reference">Referenced by <a class="el" href="a00542_source.html#l00636">ADS_FXLC95000Query()</a>, <a class="el" href="a00542_source.html#l00665">ADS_MMA9553Query()</a>, <a class="el" href="a00038_source.html#l00190">FXLC95000_I2C_CheckRomMode()</a>, <a class="el" href="a00038_source.html#l00338">FXLC95000_I2C_Initialize()</a>, <a class="el" href="a00098_source.html#l00207">Host_IO_Receive()</a>, <a class="el" href="a00152_source.html#l00369">MMA9553_I2C_Initialize()</a>, and <a class="el" href="a00182_source.html#l00024">Sensor_I2C_BlockWrite()</a>.</p>
197<div class="dynheader">
198Here is the call graph for this function:</div>
199<div class="dyncontent">
200<div class="center"><img src="a00170_ac5a66aa1b8d95d267c9d68cb475c9e01_cgraph.png" border="0" usemap="#a00170_ac5a66aa1b8d95d267c9d68cb475c9e01_cgraph" alt=""/></div>
201<map name="a00170_ac5a66aa1b8d95d267c9d68cb475c9e01_cgraph" id="a00170_ac5a66aa1b8d95d267c9d68cb475c9e01_cgraph">
202<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="220,5,281,32"/>
203</map>
204</div>
205<div class="dynheader">
206Here is the caller graph for this function:</div>
207<div class="dyncontent">
208<div class="center"><img src="a00170_ac5a66aa1b8d95d267c9d68cb475c9e01_icgraph.png" border="0" usemap="#a00170_ac5a66aa1b8d95d267c9d68cb475c9e01_icgraph" alt=""/></div>
209<map name="a00170_ac5a66aa1b8d95d267c9d68cb475c9e01_icgraph" id="a00170_ac5a66aa1b8d95d267c9d68cb475c9e01_icgraph">
210<area shape="rect" id="node2" href="a00542.html#ad1db6927af79c26ca7b6447a93b42131" title="ADS_FXLC95000Query" alt="" coords="250,5,407,32"/>
211<area shape="rect" id="node3" href="a00542.html#a61f59d3254fb54c57b010f2f9f8a7499" title="ADS_MMA9553Query" alt="" coords="253,56,404,83"/>
212<area shape="rect" id="node4" href="a00041.html#ae354fc2aafbf7609f21ebc8cf2538db0" title="The interface function to check if the sensor is in ROM CI Mode. " alt="" coords="220,107,437,133"/>
213<area shape="rect" id="node5" href="a00041.html#a32b4c71a3c3cbef9999416fdb83dc054" title="The interface function to initialize the sensor. " alt="" coords="245,157,413,184"/>
214<area shape="rect" id="node6" href="a00101.html#a3924d21a0703878695ebdb68f720fff9" title="Host_IO_Receive" alt="" coords="268,208,389,235"/>
215<area shape="rect" id="node7" href="a00155.html#af91dd70fb511444f848db38d965c68c0" title="The interface function to initialize the sensor. " alt="" coords="485,284,647,311"/>
216<area shape="rect" id="node8" href="a00185.html#ad6c175b9a45aa936aa74abda223eeafe" title="Write commands to a sensor. " alt="" coords="249,309,409,336"/>
217</map>
218</div>
219
220</div>
221</div>
222<a id="ac8a60c799d9dbc84531b4680762eb8dc"></a>
223<h2 class="memtitle"><span class="permalink"><a href="#ac8a60c799d9dbc84531b4680762eb8dc">&#9670;&nbsp;</a></span>Register_I2C_Read()</h2>
224
225<div class="memitem">
226<div class="memproto">
227      <table class="memname">
228        <tr>
229          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> Register_I2C_Read </td>
230          <td>(</td>
231          <td class="paramtype">ARM_DRIVER_I2C *&#160;</td>
232          <td class="paramname"><em>pCommDrv</em>, </td>
233        </tr>
234        <tr>
235          <td class="paramkey"></td>
236          <td></td>
237          <td class="paramtype"><a class="el" href="a03819.html">registerDeviceInfo_t</a> *&#160;</td>
238          <td class="paramname"><em>devInfo</em>, </td>
239        </tr>
240        <tr>
241          <td class="paramkey"></td>
242          <td></td>
243          <td class="paramtype">uint16_t&#160;</td>
244          <td class="paramname"><em>slaveAddress</em>, </td>
245        </tr>
246        <tr>
247          <td class="paramkey"></td>
248          <td></td>
249          <td class="paramtype">uint8_t&#160;</td>
250          <td class="paramname"><em>offset</em>, </td>
251        </tr>
252        <tr>
253          <td class="paramkey"></td>
254          <td></td>
255          <td class="paramtype">uint8_t&#160;</td>
256          <td class="paramname"><em>length</em>, </td>
257        </tr>
258        <tr>
259          <td class="paramkey"></td>
260          <td></td>
261          <td class="paramtype">uint8_t *&#160;</td>
262          <td class="paramname"><em>pOutBuffer</em>&#160;</td>
263        </tr>
264        <tr>
265          <td></td>
266          <td>)</td>
267          <td></td><td></td>
268        </tr>
269      </table>
270</div><div class="memdoc">
271
272<p>The interface function to read a sensor register. </p>
273<dl class="params"><dt>Parameters</dt><dd>
274  <table class="params">
275    <tr><td class="paramname">ARM_DRIVER_I2C</td><td>*pCommDrv - The I2C driver to use. </td></tr>
276    <tr><td class="paramname"><a class="el" href="a03819.html" title="This structure defines the device specific info required by register I/O. ">registerDeviceInfo_t</a></td><td>*devInfo - The I2C device number and idle function. </td></tr>
277    <tr><td class="paramname">uint16_t</td><td>slaveAddress - the sensor's I2C slave address. </td></tr>
278    <tr><td class="paramname">uint8_t</td><td>offset - The register/offset to read from </td></tr>
279    <tr><td class="paramname">uint8_t</td><td>length - The number of bytes to read </td></tr>
280    <tr><td class="paramname">uint8_t</td><td>*pOutBuffer - The pointer to the buffer to store the register value read.</td></tr>
281  </table>
282  </dd>
283</dl>
284<dl class="section return"><dt>Returns</dt><dd>ARM_DRIVER_OK if success or ARM_DRIVER_ERROR if error.</dd></dl>
285<p>The interface function to read a sensor register. </p>
286<p>Read and update the value. </p>
287
288<p class="definition">Definition at line <a class="el" href="a00167_source.html#l00310">310</a> of file <a class="el" href="a00167_source.html">register_io_i2c.c</a>.</p>
289
290<p class="reference">References <a class="el" href="a00167_source.html#l00031">b_I2C_CompletionFlag</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="a00167_source.html#l00032">g_I2C_ErrorEvent</a>, <a class="el" href="a00179_source.html#l00104">registerDeviceInfo_t::idleFunction</a>, <a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t()</a>, and <a class="el" href="a00359_source.html#l00248">status</a>.</p>
291
292<p class="reference">Referenced by <a class="el" href="a00542_source.html#l00805">ADS_DetectShield()</a>, <a class="el" href="a00542_source.html#l00665">ADS_MMA9553Query()</a>, <a class="el" href="a00020_source.html#l00021">DBAP_I2C_Initialize()</a>, <a class="el" href="a00029_source.html#l00228">FXAS21002_I2C_Initialize()</a>, <a class="el" href="a00803_source.html#l00114">FXLS8471Q_Init()</a>, <a class="el" href="a00056_source.html#l00240">FXLS8962_I2C_Initialize()</a>, <a class="el" href="a00065_source.html#l00239">FXLS896x_I2C_Initialize()</a>, <a class="el" href="a00074_source.html#l00239">FXLS8974_I2C_Initialize()</a>, <a class="el" href="a00083_source.html#l00222">FXOS8700_I2C_Initialize()</a>, <a class="el" href="a00812_source.html#l00130">FXOS8700_Init()</a>, <a class="el" href="a00092_source.html#l00022">FXPQ3115_I2C_Initialize()</a>, <a class="el" href="a00098_source.html#l00207">Host_IO_Receive()</a>, <a class="el" href="a00107_source.html#l00021">ISL29023_I2C_Initialize()</a>, <a class="el" href="a00116_source.html#l00022">MAG3110_I2C_Initialize()</a>, <a class="el" href="a00821_source.html#l00082">MAG3110_Init()</a>, <a class="el" href="a00125_source.html#l00022">MMA845x_I2C_Initialize()</a>, <a class="el" href="a00134_source.html#l00022">MMA8491Q_I2C_Initialize()</a>, <a class="el" href="a00143_source.html#l00022">MMA865x_I2C_Initialize()</a>, <a class="el" href="a00152_source.html#l00422">MMA9553_I2C_Configure()</a>, <a class="el" href="a00152_source.html#l00369">MMA9553_I2C_Initialize()</a>, <a class="el" href="a00161_source.html#l00022">MPL3115_I2C_Initialize()</a>, <a class="el" href="a00182_source.html#l00024">Sensor_I2C_BlockWrite()</a>, and <a class="el" href="a00182_source.html#l00105">Sensor_I2C_Read()</a>.</p>
293<div class="dynheader">
294Here is the call graph for this function:</div>
295<div class="dyncontent">
296<div class="center"><img src="a00170_ac8a60c799d9dbc84531b4680762eb8dc_cgraph.png" border="0" usemap="#a00170_ac8a60c799d9dbc84531b4680762eb8dc_cgraph" alt=""/></div>
297<map name="a00170_ac8a60c799d9dbc84531b4680762eb8dc_cgraph" id="a00170_ac8a60c799d9dbc84531b4680762eb8dc_cgraph">
298<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="187,5,248,32"/>
299</map>
300</div>
301<div class="dynheader">
302Here is the caller graph for this function:</div>
303<div class="dyncontent">
304<div class="center"><img src="a00170_ac8a60c799d9dbc84531b4680762eb8dc_icgraph.png" border="0" usemap="#a00170_ac8a60c799d9dbc84531b4680762eb8dc_icgraph" alt=""/></div>
305<map name="a00170_ac8a60c799d9dbc84531b4680762eb8dc_icgraph" id="a00170_ac8a60c799d9dbc84531b4680762eb8dc_icgraph">
306<area shape="rect" id="node2" href="a00542.html#a01f30c94c49eadb65cc176f79209e84c" title="ADS_DetectShield" alt="" coords="424,31,555,57"/>
307<area shape="rect" id="node3" href="a00542.html#a61f59d3254fb54c57b010f2f9f8a7499" title="ADS_MMA9553Query" alt="" coords="197,5,347,32"/>
308<area shape="rect" id="node4" href="a00023.html#a323da7d733afd26537b253eb88b03ddd" title="The interface function to initialize the sensor. " alt="" coords="203,107,341,133"/>
309<area shape="rect" id="node5" href="a00032.html#a7f37a7feae5b901922063add1aba3bff" title="The interface function to initialize the sensor. " alt="" coords="187,157,357,184"/>
310<area shape="rect" id="node6" href="a00842.html#a7c8424e014e2bdbb1dd61fcb4731857b" title="FXLS8471Q_Init" alt="" coords="215,208,329,235"/>
311<area shape="rect" id="node7" href="a00059.html#a91b0ee8a68669c81867a70743423e892" title="The interface function to initialize the sensor. " alt="" coords="191,259,353,285"/>
312<area shape="rect" id="node8" href="a00068.html#a4f4c50e9d863b2ad44f381a89107f315" title="The interface function to initialize the sensor. " alt="" coords="191,309,353,336"/>
313<area shape="rect" id="node9" href="a00077.html#add0ade6f75e1162aa5e475d3af7dd50b" title="The interface function to initialize the sensor. " alt="" coords="191,360,353,387"/>
314<area shape="rect" id="node10" href="a00086.html#a17953ccee62fbd698318197b109b9e9f" title="The interface function to initialize the sensor. " alt="" coords="190,411,354,437"/>
315<area shape="rect" id="node11" href="a00842.html#ac61bf451efc3a4eab179dbc59268b3e7" title="FXOS8700_Init" alt="" coords="435,689,543,716"/>
316<area shape="rect" id="node12" href="a00095.html#adc40ddb8a9c7c0a986035679f04541c7" title="The interface function to initialize the sensor. " alt="" coords="190,512,354,539"/>
317<area shape="rect" id="node13" href="a00101.html#a3924d21a0703878695ebdb68f720fff9" title="Host_IO_Receive" alt="" coords="211,563,333,589"/>
318<area shape="rect" id="node14" href="a00110.html#a0a00346af6811d0cc28de254c2d5db93" title="The interface function to initialize the sensor. " alt="" coords="194,613,350,640"/>
319<area shape="rect" id="node15" href="a00119.html#a578b46ebf521f9d389bdc8f68904ed2e" title="The interface function to initialize the sensor. " alt="" coords="192,664,352,691"/>
320<area shape="rect" id="node16" href="a00842.html#a20b118514f14ce008825433f72527ecd" title="MAG3110_Init" alt="" coords="220,715,324,741"/>
321<area shape="rect" id="node17" href="a00128.html#ab20ae3194496799d223410bf45bc210b" title="The interface function to initialize the sensor. " alt="" coords="191,765,353,792"/>
322<area shape="rect" id="node18" href="a00137.html#a139416bfb5a05d907f47700d0dfa73bd" title="The interface function to initialize the sensor. " alt="" coords="187,816,357,843"/>
323<area shape="rect" id="node19" href="a00146.html#a088d55c83170dc62e31a430bbeac84fe" title="The interface function to initialize the sensor. " alt="" coords="191,867,353,893"/>
324<area shape="rect" id="node20" href="a00155.html#a98085b8d1389e48df874d4115f7ee2ac" title="The interface function to configure he sensor. " alt="" coords="405,1007,573,1033"/>
325<area shape="rect" id="node21" href="a00155.html#af91dd70fb511444f848db38d965c68c0" title="The interface function to initialize the sensor. " alt="" coords="409,1095,570,1121"/>
326<area shape="rect" id="node22" href="a00164.html#ae2d3772491a3b10c71ff529382d9a2d2" title="The interface function to initialize the sensor. " alt="" coords="193,1019,351,1045"/>
327<area shape="rect" id="node23" href="a00185.html#ad6c175b9a45aa936aa74abda223eeafe" title="Write commands to a sensor. " alt="" coords="192,1069,352,1096"/>
328<area shape="rect" id="node24" href="a00185.html#aa75349faed7c77807cb88d9224aa2636" title="Read register data from a sensor. " alt="" coords="209,461,335,488"/>
329</map>
330</div>
331
332</div>
333</div>
334<a id="ad08d2c7880bc5f09fd27eee247311448"></a>
335<h2 class="memtitle"><span class="permalink"><a href="#ad08d2c7880bc5f09fd27eee247311448">&#9670;&nbsp;</a></span>Register_I2C_Write()</h2>
336
337<div class="memitem">
338<div class="memproto">
339      <table class="memname">
340        <tr>
341          <td class="memname"><a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> Register_I2C_Write </td>
342          <td>(</td>
343          <td class="paramtype">ARM_DRIVER_I2C *&#160;</td>
344          <td class="paramname"><em>pCommDrv</em>, </td>
345        </tr>
346        <tr>
347          <td class="paramkey"></td>
348          <td></td>
349          <td class="paramtype"><a class="el" href="a03819.html">registerDeviceInfo_t</a> *&#160;</td>
350          <td class="paramname"><em>devInfo</em>, </td>
351        </tr>
352        <tr>
353          <td class="paramkey"></td>
354          <td></td>
355          <td class="paramtype">uint16_t&#160;</td>
356          <td class="paramname"><em>slaveAddress</em>, </td>
357        </tr>
358        <tr>
359          <td class="paramkey"></td>
360          <td></td>
361          <td class="paramtype">uint8_t&#160;</td>
362          <td class="paramname"><em>offset</em>, </td>
363        </tr>
364        <tr>
365          <td class="paramkey"></td>
366          <td></td>
367          <td class="paramtype">uint8_t&#160;</td>
368          <td class="paramname"><em>value</em>, </td>
369        </tr>
370        <tr>
371          <td class="paramkey"></td>
372          <td></td>
373          <td class="paramtype">uint8_t&#160;</td>
374          <td class="paramname"><em>mask</em>, </td>
375        </tr>
376        <tr>
377          <td class="paramkey"></td>
378          <td></td>
379          <td class="paramtype">bool&#160;</td>
380          <td class="paramname"><em>repeatedStart</em>&#160;</td>
381        </tr>
382        <tr>
383          <td></td>
384          <td>)</td>
385          <td></td><td></td>
386        </tr>
387      </table>
388</div><div class="memdoc">
389
390<p>The interface function to write a sensor register. </p>
391<dl class="params"><dt>Parameters</dt><dd>
392  <table class="params">
393    <tr><td class="paramname">ARM_DRIVER_I2C</td><td>*pCommDrv - The I2C driver to use. </td></tr>
394    <tr><td class="paramname"><a class="el" href="a03819.html" title="This structure defines the device specific info required by register I/O. ">registerDeviceInfo_t</a></td><td>*devInfo - The I2C device number and idle function. </td></tr>
395    <tr><td class="paramname">uint16_t</td><td>slaveAddress - the sensor's I2C slave address. </td></tr>
396    <tr><td class="paramname">uint8_t</td><td>offset - The register/offset to write to </td></tr>
397    <tr><td class="paramname">uint8_t</td><td>value - The value to write to the register </td></tr>
398    <tr><td class="paramname">uint8_t</td><td>mask - A mask value to use when writing. A non-zero mask indicates that a read-modify-write operation should be used. where only the bits set in the mask will be updated according to the value param. </td></tr>
399    <tr><td class="paramname">bool</td><td>repeatedStart - Indicates whether to send STOP or REPEATED_START bit after the write</td></tr>
400  </table>
401  </dd>
402</dl>
403<dl class="section return"><dt>Returns</dt><dd>ARM_DRIVER_OK if success or ARM_DRIVER_ERROR if error.</dd></dl>
404<p>The interface function to write a sensor register. </p>
405<p>Set the register based on the values in the register value pair configuration.</p>
406<p>Send the register address to read from.</p>
407<p>Read the value.</p>
408<p>'OR' in the requested values to the current contents of the register</p>
409<p>Overwrite the register with specified value.</p>
410<p>Write the updated value. </p>
411
412<p class="definition">Definition at line <a class="el" href="a00167_source.html#l00193">193</a> of file <a class="el" href="a00167_source.html">register_io_i2c.c</a>.</p>
413
414<p class="reference">References <a class="el" href="a00167_source.html#l00031">b_I2C_CompletionFlag</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="a00167_source.html#l00032">g_I2C_ErrorEvent</a>, <a class="el" href="a00179_source.html#l00104">registerDeviceInfo_t::idleFunction</a>, <a class="el" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t()</a>, and <a class="el" href="a00359_source.html#l00248">status</a>.</p>
415
416<p class="reference">Referenced by <a class="el" href="a00029_source.html#l00267">FXAS21002_I2C_Configure()</a>, <a class="el" href="a00029_source.html#l00341">FXAS21002_I2C_Deinit()</a>, <a class="el" href="a00056_source.html#l00286">FXLS8962_I2C_Configure()</a>, <a class="el" href="a00056_source.html#l00360">FXLS8962_I2C_DeInit()</a>, <a class="el" href="a00065_source.html#l00285">FXLS896x_I2C_Configure()</a>, <a class="el" href="a00065_source.html#l00359">FXLS896x_I2C_DeInit()</a>, <a class="el" href="a00074_source.html#l00285">FXLS8974_I2C_Configure()</a>, <a class="el" href="a00074_source.html#l00359">FXLS8974_I2C_DeInit()</a>, <a class="el" href="a00083_source.html#l00260">FXOS8700_I2C_Configure()</a>, <a class="el" href="a00083_source.html#l00334">FXOS8700_I2C_Deinit()</a>, <a class="el" href="a00092_source.html#l00061">FXPQ3115_I2C_Configure()</a>, <a class="el" href="a00092_source.html#l00135">FXPQ3115_I2C_DeInit()</a>, <a class="el" href="a00107_source.html#l00116">ISL29023_I2C_DeInit()</a>, <a class="el" href="a00116_source.html#l00061">MAG3110_I2C_Configure()</a>, <a class="el" href="a00116_source.html#l00133">MAG3110_I2C_DeInit()</a>, <a class="el" href="a00428_source.html#l00378">main()</a>, <a class="el" href="a00125_source.html#l00061">MMA845x_I2C_Configure()</a>, <a class="el" href="a00125_source.html#l00133">MMA845x_I2C_Deinit()</a>, <a class="el" href="a00143_source.html#l00061">MMA865x_I2C_Configure()</a>, <a class="el" href="a00143_source.html#l00135">MMA865x_I2C_DeInit()</a>, <a class="el" href="a00161_source.html#l00061">MPL3115_I2C_Configure()</a>, <a class="el" href="a00161_source.html#l00133">MPL3115_I2C_DeInit()</a>, <a class="el" href="a00338_source.html#l00911">perform_selftest()</a>, and <a class="el" href="a00182_source.html#l00071">Sensor_I2C_Write()</a>.</p>
417<div class="dynheader">
418Here is the call graph for this function:</div>
419<div class="dyncontent">
420<div class="center"><img src="a00170_ad08d2c7880bc5f09fd27eee247311448_cgraph.png" border="0" usemap="#a00170_ad08d2c7880bc5f09fd27eee247311448_cgraph" alt=""/></div>
421<map name="a00170_ad08d2c7880bc5f09fd27eee247311448_cgraph" id="a00170_ad08d2c7880bc5f09fd27eee247311448_cgraph">
422<area shape="rect" id="node2" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f" title="The interface function to append the data on the formated stream. " alt="" coords="188,5,249,32"/>
423</map>
424</div>
425<div class="dynheader">
426Here is the caller graph for this function:</div>
427<div class="dyncontent">
428<div class="center"><img src="a00170_ad08d2c7880bc5f09fd27eee247311448_icgraph.png" border="0" usemap="#a00170_ad08d2c7880bc5f09fd27eee247311448_icgraph" alt=""/></div>
429<map name="a00170_ad08d2c7880bc5f09fd27eee247311448_icgraph" id="a00170_ad08d2c7880bc5f09fd27eee247311448_icgraph">
430<area shape="rect" id="node2" href="a00032.html#abef3b2c3849b49331142f7a6266fde9a" title="The interface function to configure he sensor. " alt="" coords="392,112,569,139"/>
431<area shape="rect" id="node3" href="a00032.html#a8a1d6a2e0e6f3b38de621553409faeab" title="The interface function to De Initialize sensor.. " alt="" coords="188,617,344,644"/>
432<area shape="rect" id="node4" href="a00059.html#a1b62cba67669ae79f5f3c2e5f846a6c7" title="The interface function to configure he sensor. " alt="" coords="397,60,565,87"/>
433<area shape="rect" id="node5" href="a00338.html#adc709b747f2b14694b4fac4fd080f75c" title="Function to perform FXLS896x self test. " alt="" coords="617,35,732,61"/>
434<area shape="rect" id="node6" href="a00059.html#a13160308eebd2dce90198d9f1388ad27" title="The interface function to De Initialize sensor.. " alt="" coords="193,668,339,695"/>
435<area shape="rect" id="node7" href="a00068.html#adc8ae229a44c0a20d100948b37627f55" title="The interface function to configure he sensor. " alt="" coords="397,165,565,192"/>
436<area shape="rect" id="node8" href="a00068.html#a49e7f7cd7bfced26acd32836bfd8e2a9" title="The interface function to De Initialize sensor.. " alt="" coords="193,719,339,745"/>
437<area shape="rect" id="node9" href="a00077.html#a2b3b8d1e5ee7b6431002c387999ed8b9" title="The interface function to configure he sensor. " alt="" coords="397,223,565,249"/>
438<area shape="rect" id="node10" href="a00077.html#af8bfcdd9fde5faa5f85101c4f9fc5d48" title="The interface function to De Initialize sensor.. " alt="" coords="193,769,339,796"/>
439<area shape="rect" id="node11" href="a00086.html#adcb4dbaa31a6b4ccd6031ee6cc97bb66" title="The interface function to configure he sensor. " alt="" coords="395,285,566,312"/>
440<area shape="rect" id="node12" href="a00086.html#a896c2090120ad89a351b7f80c876f4c3" title="The interface function to De Initialize sensor.. " alt="" coords="191,820,341,847"/>
441<area shape="rect" id="node13" href="a00095.html#a02cdde2f932058060c53dc8314e8d03f" title="The interface function to configure he sensor. " alt="" coords="395,361,566,388"/>
442<area shape="rect" id="node14" href="a00095.html#ab898c401d995d37ccbc8be97131e0097" title="The interface function to De Initialize sensor.. " alt="" coords="191,871,341,897"/>
443<area shape="rect" id="node15" href="a00110.html#a0f976578dc6fcb91186ecbbae243681c" title="The interface function to De Initialize sensor.. " alt="" coords="195,921,337,948"/>
444<area shape="rect" id="node16" href="a00119.html#a2de85bf13cfe26dbc0ca9be7f4625cba" title="The interface function to configure he sensor. " alt="" coords="397,413,564,440"/>
445<area shape="rect" id="node17" href="a00119.html#af4f06a390266db7f33a22ee8a04e510a" title="The interface function to De Initialize sensor.. " alt="" coords="193,972,339,999"/>
446<area shape="rect" id="node18" href="a00428.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. " alt="" coords="241,1023,291,1049"/>
447<area shape="rect" id="node19" href="a00128.html#a6c537b63c09b23480c1a3d6ef6e29fef" title="The interface function to configure he sensor. " alt="" coords="397,465,565,492"/>
448<area shape="rect" id="node20" href="a00128.html#aa6e01fe35fe4ec4f9795338bb2f127e9" title="The interface function to De Initialize sensor.. " alt="" coords="193,1073,339,1100"/>
449<area shape="rect" id="node21" href="a00146.html#a5944d87d922a1bdbbf5f2574acc1e143" title="The interface function to configure he sensor. " alt="" coords="397,516,565,543"/>
450<area shape="rect" id="node22" href="a00146.html#a4deef976b1d013420ddec7c627fb43ce" title="The interface function to De Initialize sensor.. " alt="" coords="193,1124,339,1151"/>
451<area shape="rect" id="node23" href="a00164.html#a8dce7c0e6c9d7ef6cf9c6c2fd3c093ae" title="The interface function to configure he sensor. " alt="" coords="399,567,563,593"/>
452<area shape="rect" id="node24" href="a00164.html#a57d98d2cdcc4e6ca85b6efc8f863ce9f" title="The interface function to De Initialize sensor.. " alt="" coords="195,1175,337,1201"/>
453<area shape="rect" id="node25" href="a00185.html#aaac4c4f34b4dd37d3f202a1dbb4b000b" title="Write register data to a sensor. " alt="" coords="203,313,329,340"/>
454</map>
455</div>
456
457</div>
458</div>
459</div><!-- contents -->
460
461<hr class="footer"/><address class="footer"><small>
462&copy; Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause
463</small></address>
464</body>
465</html>
466