mirror of
https://github.com/SMFSW/cI2C
synced 2024-11-22 09:54:23 +01:00
8790fed763
Commit: b9babcdde0
138 lines
50 KiB
HTML
138 lines
50 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.13"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Arduino Hardware I2C for AVR MCUs (plain c): src/ci2c.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Arduino Hardware I2C for AVR MCUs (plain c)
|
|
 <span id="projectnumber">1.3</span>
|
|
</div>
|
|
<div id="projectbrief">Arduino Hardware I2C for AVR MCUs (plain c) documentation</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.13 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">ci2c.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="ci2c_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">/****************************************************************/</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#ifndef __CI2C_H__</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor"> #define __CI2C_H__</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">/****************************************************************/</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#if defined(DOXY)</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  <span class="comment">// Define gcc __attribute__ as void when Doxygen runs</span></div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362"> 14</a></span> <span class="preprocessor"> #define __attribute__(a) </span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#if (ARDUINO >= 100)</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor"> #include <Arduino.h></span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor"> #include <WProgram.h></span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include <inttypes.h></span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <stdbool.h></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a5f24fbfb40599863dc8233731f781c4f"> 31</a></span> <span class="preprocessor">#define DEF_CI2C_NB_RETRIES 3 </span></div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a1289567006bc93ef027a578d840c1e0d"> 32</a></span> <span class="preprocessor">#define DEF_CI2C_TIMEOUT 100 </span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor"></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173"> 39</a></span> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__packed__)) <a class="code" href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173">enI2C_RW</a> {</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173adbf6337ed546b3c21fd08c397a346bb2"> 40</a></span>  <a class="code" href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173adbf6337ed546b3c21fd08c397a346bb2">I2C_WRITE</a> = 0, </div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173a30040082a257338fe25e5bd5136bc9a8"> 41</a></span>  <a class="code" href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173a30040082a257338fe25e5bd5136bc9a8">I2C_READ</a> </div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> } <a class="code" href="ci2c_8h.html#aa06111accc71a55517b8810727523574">I2C_RW</a>;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67"> 49</a></span> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__packed__)) <a class="code" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67">enI2C_SPEED</a> {</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67acf556067cbb57aaf5f6c71e64fa46cb6"> 50</a></span>  <a class="code" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67acf556067cbb57aaf5f6c71e64fa46cb6">I2C_STD</a> = 100, </div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67ad87a75087baf689cf3a240a769d2b558"> 51</a></span>  <a class="code" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67ad87a75087baf689cf3a240a769d2b558">I2C_FM</a> = 400, </div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67acab280b484ea06a499900154515f3005"> 52</a></span>  <a class="code" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67acab280b484ea06a499900154515f3005">I2C_FMP</a> = 1000, </div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67a6595b5891728545ae73b56eecaedeae6"> 53</a></span>  <a class="code" href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67a6595b5891728545ae73b56eecaedeae6">I2C_HS</a> = 3400 </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> } <a class="code" href="ci2c_8h.html#a19bff3ea64e8558c14de3fc951ba6bad">I2C_SPEED</a>;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> </div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743"> 61</a></span> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__packed__)) <a class="code" href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743">enI2C_STATUS</a> {</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743aeceba296bdda2b90e8835c431fe7a72a"> 62</a></span>  <a class="code" href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743aeceba296bdda2b90e8835c431fe7a72a">I2C_OK</a> = 0x00, </div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743a49e65f3960437d80b8328e7898cc90de"> 63</a></span>  <a class="code" href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743a49e65f3960437d80b8328e7898cc90de">I2C_BUSY</a>, </div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743ae869b289c6b9b73b95dd1b40cbc9d651"> 64</a></span>  <a class="code" href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743ae869b289c6b9b73b95dd1b40cbc9d651">I2C_NACK</a> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> } <a class="code" href="ci2c_8h.html#a489c20161e94a87325ca7e240032686b">I2C_STATUS</a>;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513"> 71</a></span> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__packed__)) <a class="code" href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513">enI2C_INT_SIZE</a> {</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513a32d90f6214c5b494454666979a87b595"> 72</a></span>  <a class="code" href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513a32d90f6214c5b494454666979a87b595">I2C_NO_REG</a> = 0x00, </div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513a61e2f99ae5ece961b270ed978f43ffca"> 73</a></span>  <a class="code" href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513a61e2f99ae5ece961b270ed978f43ffca">I2C_8B_REG</a>, </div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513af7da1353d311749981b6ad185fa4d2d9"> 74</a></span>  <a class="code" href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513af7da1353d311749981b6ad185fa4d2d9">I2C_16B_REG</a> </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> } <a class="code" href="ci2c_8h.html#a9dadf50a895a9c06f7fb2968166b316a">I2C_INT_SIZE</a>;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> </div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="ci2c_8h.html#af9c7e60b84174c9a42c0883f4c4a9b97"> 78</a></span> <span class="keyword">typedef</span> bool (*<a class="code" href="ci2c_8h.html#af9c7e60b84174c9a42c0883f4c4a9b97">ci2c_fct_ptr</a>) (<span class="keywordtype">void</span>*, <span class="keyword">const</span> uint16_t, uint8_t*, <span class="keyword">const</span> uint16_t); </div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="struct_struct_i2_c_slave.html"> 85</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__packed__)) <a class="code" href="struct_struct_i2_c_slave.html">StructI2CSlave</a> {</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keyword">struct </span>{</div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="struct_struct_i2_c_slave.html#a3d3e5a1700d2e82c94fde663bc9dd846"> 90</a></span>  uint8_t <a class="code" href="struct_struct_i2_c_slave.html#a3d3e5a1700d2e82c94fde663bc9dd846">addr</a>; </div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="struct_struct_i2_c_slave.html#a028efd71ef1b338ff734d2d330baa422"> 91</a></span>  I2C_INT_SIZE <a class="code" href="struct_struct_i2_c_slave.html#a028efd71ef1b338ff734d2d330baa422">reg_size</a>; </div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="struct_struct_i2_c_slave.html#a2c58ac88c9796097b0f4388d751622d5"> 92</a></span>  <a class="code" href="ci2c_8h.html#af9c7e60b84174c9a42c0883f4c4a9b97">ci2c_fct_ptr</a> <a class="code" href="struct_struct_i2_c_slave.html#a2c58ac88c9796097b0f4388d751622d5">wr</a>; </div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="struct_struct_i2_c_slave.html#a105b8255b0afd005126ef5ce8ee79eee"> 93</a></span>  <a class="code" href="ci2c_8h.html#af9c7e60b84174c9a42c0883f4c4a9b97">ci2c_fct_ptr</a> <a class="code" href="struct_struct_i2_c_slave.html#a105b8255b0afd005126ef5ce8ee79eee">rd</a>; </div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  } <a class="code" href="ci2c_8c.html#a2de58c0b9a826052097f9623f4d95608">cfg</a>;</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="struct_struct_i2_c_slave.html#a0cf6f22dd2f68f43d63c377065f75237"> 95</a></span>  uint16_t <a class="code" href="struct_struct_i2_c_slave.html#a0cf6f22dd2f68f43d63c377065f75237">reg_addr</a>; </div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="struct_struct_i2_c_slave.html#a5535a5ae60da0c21c6a739f4280c63a6"> 96</a></span>  I2C_STATUS <a class="code" href="struct_struct_i2_c_slave.html#a5535a5ae60da0c21c6a739f4280c63a6">status</a>; </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> } <a class="code" href="ci2c_8h.html#a916f30ff94044ecc9f8a177446da485a">I2C_SLAVE</a>;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment">/***************************/</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment">/*** I2C SLAVE FUNCTIONS ***/</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="comment">/***************************/</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="keywordtype">void</span> <a class="code" href="ci2c_8h.html#af93c2e35e06edcea492607b628d5ae1f">I2C_slave_init</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, <span class="keyword">const</span> uint8_t sl_addr, <span class="keyword">const</span> I2C_INT_SIZE reg_sz);</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="keywordtype">void</span> <a class="code" href="ci2c_8h.html#a8d88530833d3685d52ea5486b1316427">I2C_slave_set_rw_func</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, <span class="keyword">const</span> <a class="code" href="ci2c_8h.html#af9c7e60b84174c9a42c0883f4c4a9b97">ci2c_fct_ptr</a> func, <span class="keyword">const</span> I2C_RW rw);</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="keywordtype">bool</span> <a class="code" href="ci2c_8h.html#ad0eed3132d3284d6f921d13488721226">I2C_slave_set_addr</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, <span class="keyword">const</span> uint8_t sl_addr);</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="keywordtype">bool</span> <a class="code" href="ci2c_8h.html#a47d121773459b24568e5df4f81fbf905">I2C_slave_set_reg_size</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, <span class="keyword">const</span> I2C_INT_SIZE reg_sz);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span> </div><div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a061eb7b1f0b2fe0203d7947d01437042"> 139</a></span> <span class="keyword">inline</span> uint8_t <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__always_inline__)) <a class="code" href="ci2c_8h.html#a061eb7b1f0b2fe0203d7947d01437042">I2C_slave_get_addr</a>(<span class="keyword">const</span> <a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave) {</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keywordflow">return</span> slave-><a class="code" href="struct_struct_i2_c_slave.html#a5406b3a910596e79c699ebde2a3c54f0">cfg</a>.<a class="code" href="struct_struct_i2_c_slave.html#a3d3e5a1700d2e82c94fde663bc9dd846">addr</a>; }</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> </div><div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="ci2c_8h.html#acbece630e3277827b1a0351d0bdad74a"> 147</a></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__always_inline__)) <a class="code" href="ci2c_8h.html#acbece630e3277827b1a0351d0bdad74a">I2C_slave_get_reg_size</a>(<span class="keyword">const</span> <a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave) {</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordflow">return</span> slave-><a class="code" href="struct_struct_i2_c_slave.html#a5406b3a910596e79c699ebde2a3c54f0">cfg</a>.<a class="code" href="struct_struct_i2_c_slave.html#a028efd71ef1b338ff734d2d330baa422">reg_size</a>; }</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="ci2c_8h.html#a41be982659cb049fcdf88a18e3e4c4e0"> 155</a></span> <span class="keyword">inline</span> uint16_t <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__always_inline__)) <a class="code" href="ci2c_8h.html#a41be982659cb049fcdf88a18e3e4c4e0">I2C_slave_get_reg_addr</a>(<span class="keyword">const</span> <a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave) {</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">return</span> slave-><a class="code" href="struct_struct_i2_c_slave.html#a0cf6f22dd2f68f43d63c377065f75237">reg_addr</a>; }</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span> </div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="comment">/*************************/</span></div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="comment">/*** I2C BUS FUNCTIONS ***/</span></div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <span class="comment">/*************************/</span></div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="keywordtype">void</span> <a class="code" href="ci2c_8h.html#a99283d800332d700deed19f5a37e61d8">I2C_init</a>(<span class="keyword">const</span> uint16_t <a class="code" href="ci2c_8c.html#a182293bc8273b099986183c0959e77da">speed</a>);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> </div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> <span class="keywordtype">void</span> <a class="code" href="ci2c_8h.html#a74e1381b536811b202d087471723fb9e">I2C_uninit</a>();</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> </div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> uint16_t <a class="code" href="ci2c_8h.html#a7c5b1857ae28ade8959a8a06f500ecde">I2C_set_speed</a>(<span class="keyword">const</span> uint16_t speed);</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> </div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> uint16_t <a class="code" href="ci2c_8h.html#acd209174a3b5ab213131a93633c19a38">I2C_set_timeout</a>(<span class="keyword">const</span> uint16_t <a class="code" href="ci2c_8c.html#a7f1ad43d3bf79b40bc39dbb5a6c3a5ae">timeout</a>);</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span> </div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span> uint8_t <a class="code" href="ci2c_8h.html#ad74e31ebd08a9ddef57f571783f37cc7">I2C_set_retries</a>(<span class="keyword">const</span> uint8_t <a class="code" href="ci2c_8c.html#a458ee314eb40ab7e0c913a036333cc0d">retries</a>);</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span> </div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span> <span class="keywordtype">bool</span> <a class="code" href="ci2c_8h.html#ac370df06df51c68217eafcee96e5a3e0">I2C_is_busy</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> </div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span> I2C_STATUS <a class="code" href="ci2c_8h.html#a83adef951ffd9fb5105216f6ee464bb9">I2C_write</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, <span class="keyword">const</span> uint16_t reg_addr, uint8_t * data, <span class="keyword">const</span> uint16_t bytes);</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span> </div><div class="line"><a name="l00214"></a><span class="lineno"><a class="line" href="ci2c_8h.html#add4eec772922da692bdbb84c354a3fa0"> 214</a></span> <span class="keyword">inline</span> I2C_STATUS <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__always_inline__)) <a class="code" href="ci2c_8h.html#add4eec772922da692bdbb84c354a3fa0">I2C_write_next</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, uint8_t * data, <span class="keyword">const</span> uint16_t bytes) {</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">return</span> <a class="code" href="ci2c_8h.html#a83adef951ffd9fb5105216f6ee464bb9">I2C_write</a>(slave, slave-><a class="code" href="struct_struct_i2_c_slave.html#a0cf6f22dd2f68f43d63c377065f75237">reg_addr</a>, data, bytes); }</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span> </div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> I2C_STATUS <a class="code" href="ci2c_8h.html#ad5e4a006f6cea5844a810fab30b40f87">I2C_read</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, <span class="keyword">const</span> uint16_t reg_addr, uint8_t * data, <span class="keyword">const</span> uint16_t bytes);</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span> </div><div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="ci2c_8h.html#afc15fc625892e1e50e831d7934073299"> 234</a></span> <span class="keyword">inline</span> I2C_STATUS <a class="code" href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a>((__always_inline__)) <a class="code" href="ci2c_8h.html#afc15fc625892e1e50e831d7934073299">I2C_read_next</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, uint8_t * data, <span class="keyword">const</span> uint16_t bytes) {</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordflow">return</span> <a class="code" href="ci2c_8h.html#ad5e4a006f6cea5844a810fab30b40f87">I2C_read</a>(slave, slave-><a class="code" href="struct_struct_i2_c_slave.html#a0cf6f22dd2f68f43d63c377065f75237">reg_addr</a>, data, bytes); }</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span> </div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> </div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> <span class="comment">/***********************************/</span></div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span> <span class="comment">/*** cI2C LOW LEVEL FUNCTIONS ***/</span></div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> <span class="comment">/*** THAT MAY BE USEFUL FOR DVPT ***/</span></div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span> <span class="comment">/***********************************/</span></div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span> <span class="keywordtype">void</span> <a class="code" href="ci2c_8h.html#a2c25bc5fdf909b7d45d722970eb04d82">I2C_reset</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span> </div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span> <span class="keywordtype">bool</span> <a class="code" href="ci2c_8h.html#aaadadbb29f315f2030223665f1988188">I2C_start</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span> </div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span> <span class="keywordtype">bool</span> <a class="code" href="ci2c_8h.html#a53eb804c24e8e86717f7aaebdab1aa53">I2C_stop</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span> </div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span> <span class="keywordtype">bool</span> <a class="code" href="ci2c_8h.html#ab20db75dfa22dc47df506cab3bd11c60">I2C_wr8</a>(<span class="keyword">const</span> uint8_t dat);</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span> </div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span> uint8_t <a class="code" href="ci2c_8h.html#a8d6d7eb118ea1505df039075a00c267b">I2C_rd8</a>(<span class="keyword">const</span> <span class="keywordtype">bool</span> ack);</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span> </div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span> <span class="keywordtype">bool</span> <a class="code" href="ci2c_8h.html#aae536cceb33d07e71af9d459a2fc6dc8">I2C_sndAddr</a>(<a class="code" href="struct_struct_i2_c_slave.html">I2C_SLAVE</a> * slave, <span class="keyword">const</span> I2C_RW rw);</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span> </div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span> </div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span> }</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span> </div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span> <span class="preprocessor">#endif</span></div><div class="ttc" id="ci2c_8c_html_a2de58c0b9a826052097f9623f4d95608"><div class="ttname"><a href="ci2c_8c.html#a2de58c0b9a826052097f9623f4d95608">cfg</a></div><div class="ttdeci">struct @0::@1 cfg</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a903c1d6745f8a43b91ff42c6aaa3d362"><div class="ttname"><a href="ci2c_8h.html#a903c1d6745f8a43b91ff42c6aaa3d362">__attribute__</a></div><div class="ttdeci">#define __attribute__(a)</div><div class="ttdoc">GCC attribute (ignored by Doxygen) </div><div class="ttdef"><b>Definition:</b> ci2c.h:14</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a19bff3ea64e8558c14de3fc951ba6bad"><div class="ttname"><a href="ci2c_8h.html#a19bff3ea64e8558c14de3fc951ba6bad">I2C_SPEED</a></div><div class="ttdeci">enum enI2C_SPEED I2C_SPEED</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_acbece630e3277827b1a0351d0bdad74a"><div class="ttname"><a href="ci2c_8h.html#acbece630e3277827b1a0351d0bdad74a">I2C_slave_get_reg_size</a></div><div class="ttdeci">bool I2C_slave_get_reg_size(const I2C_SLAVE *slave)</div><div class="ttdoc">Get I2C register map size (for access) </div><div class="ttdef"><b>Definition:</b> ci2c.h:147</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a72ff1cee208396b40ebb555f1ed83743aeceba296bdda2b90e8835c431fe7a72a"><div class="ttname"><a href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743aeceba296bdda2b90e8835c431fe7a72a">I2C_OK</a></div><div class="ttdoc">I2C OK. </div><div class="ttdef"><b>Definition:</b> ci2c.h:62</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_af93c2e35e06edcea492607b628d5ae1f"><div class="ttname"><a href="ci2c_8h.html#af93c2e35e06edcea492607b628d5ae1f">I2C_slave_init</a></div><div class="ttdeci">void I2C_slave_init(I2C_SLAVE *slave, const uint8_t sl_addr, const I2C_INT_SIZE reg_sz)</div><div class="ttdoc">Init an I2C slave structure for cMI2C communication. </div><div class="ttdef"><b>Definition:</b> ci2c.c:61</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a916f30ff94044ecc9f8a177446da485a"><div class="ttname"><a href="ci2c_8h.html#a916f30ff94044ecc9f8a177446da485a">I2C_SLAVE</a></div><div class="ttdeci">struct StructI2CSlave I2C_SLAVE</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a061eb7b1f0b2fe0203d7947d01437042"><div class="ttname"><a href="ci2c_8h.html#a061eb7b1f0b2fe0203d7947d01437042">I2C_slave_get_addr</a></div><div class="ttdeci">uint8_t I2C_slave_get_addr(const I2C_SLAVE *slave)</div><div class="ttdoc">Get I2C slave address. </div><div class="ttdef"><b>Definition:</b> ci2c.h:139</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a41be982659cb049fcdf88a18e3e4c4e0"><div class="ttname"><a href="ci2c_8h.html#a41be982659cb049fcdf88a18e3e4c4e0">I2C_slave_get_reg_addr</a></div><div class="ttdeci">uint16_t I2C_slave_get_reg_addr(const I2C_SLAVE *slave)</div><div class="ttdoc">Get I2C current register address (addr may passed this way in procedures if contigous accesses) ...</div><div class="ttdef"><b>Definition:</b> ci2c.h:155</div></div>
|
|
<div class="ttc" id="struct_struct_i2_c_slave_html_a3d3e5a1700d2e82c94fde663bc9dd846"><div class="ttname"><a href="struct_struct_i2_c_slave.html#a3d3e5a1700d2e82c94fde663bc9dd846">StructI2CSlave::addr</a></div><div class="ttdeci">uint8_t addr</div><div class="ttdoc">Slave address. </div><div class="ttdef"><b>Definition:</b> ci2c.h:90</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a72ff1cee208396b40ebb555f1ed83743a49e65f3960437d80b8328e7898cc90de"><div class="ttname"><a href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743a49e65f3960437d80b8328e7898cc90de">I2C_BUSY</a></div><div class="ttdoc">I2C Bus busy. </div><div class="ttdef"><b>Definition:</b> ci2c.h:63</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a938af1642c47503bcefa8c8de11d7173adbf6337ed546b3c21fd08c397a346bb2"><div class="ttname"><a href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173adbf6337ed546b3c21fd08c397a346bb2">I2C_WRITE</a></div><div class="ttdoc">I2C rw bit (write) </div><div class="ttdef"><b>Definition:</b> ci2c.h:40</div></div>
|
|
<div class="ttc" id="struct_struct_i2_c_slave_html_a0cf6f22dd2f68f43d63c377065f75237"><div class="ttname"><a href="struct_struct_i2_c_slave.html#a0cf6f22dd2f68f43d63c377065f75237">StructI2CSlave::reg_addr</a></div><div class="ttdeci">uint16_t reg_addr</div><div class="ttdoc">Internal current register address. </div><div class="ttdef"><b>Definition:</b> ci2c.h:95</div></div>
|
|
<div class="ttc" id="struct_struct_i2_c_slave_html_a105b8255b0afd005126ef5ce8ee79eee"><div class="ttname"><a href="struct_struct_i2_c_slave.html#a105b8255b0afd005126ef5ce8ee79eee">StructI2CSlave::rd</a></div><div class="ttdeci">ci2c_fct_ptr rd</div><div class="ttdoc">Slave read function pointer. </div><div class="ttdef"><b>Definition:</b> ci2c.h:93</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a6572c289eb10e3543e42d34e710f5b67acf556067cbb57aaf5f6c71e64fa46cb6"><div class="ttname"><a href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67acf556067cbb57aaf5f6c71e64fa46cb6">I2C_STD</a></div><div class="ttdoc">I2C Standard (100KHz) </div><div class="ttdef"><b>Definition:</b> ci2c.h:50</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a47d121773459b24568e5df4f81fbf905"><div class="ttname"><a href="ci2c_8h.html#a47d121773459b24568e5df4f81fbf905">I2C_slave_set_reg_size</a></div><div class="ttdeci">bool I2C_slave_set_reg_size(I2C_SLAVE *slave, const I2C_INT_SIZE reg_sz)</div><div class="ttdoc">Change I2C registers map size (for access) </div><div class="ttdef"><b>Definition:</b> ci2c.c:100</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a98a8ae8df4864bb7d9a8b4509d863513a61e2f99ae5ece961b270ed978f43ffca"><div class="ttname"><a href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513a61e2f99ae5ece961b270ed978f43ffca">I2C_8B_REG</a></div><div class="ttdoc">Slave internal address registers space is 8bits wide. </div><div class="ttdef"><b>Definition:</b> ci2c.h:73</div></div>
|
|
<div class="ttc" id="struct_struct_i2_c_slave_html_a5406b3a910596e79c699ebde2a3c54f0"><div class="ttname"><a href="struct_struct_i2_c_slave.html#a5406b3a910596e79c699ebde2a3c54f0">StructI2CSlave::cfg</a></div><div class="ttdeci">struct StructI2CSlave::@2 cfg</div></div>
|
|
<div class="ttc" id="ci2c_8c_html_a7f1ad43d3bf79b40bc39dbb5a6c3a5ae"><div class="ttname"><a href="ci2c_8c.html#a7f1ad43d3bf79b40bc39dbb5a6c3a5ae">timeout</a></div><div class="ttdeci">uint16_t timeout</div><div class="ttdoc">i2c timeout (ms) </div><div class="ttdef"><b>Definition:</b> ci2c.c:43</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_aaadadbb29f315f2030223665f1988188"><div class="ttname"><a href="ci2c_8h.html#aaadadbb29f315f2030223665f1988188">I2C_start</a></div><div class="ttdeci">bool I2C_start(void)</div><div class="ttdoc">Send start condition. </div><div class="ttdef"><b>Definition:</b> ci2c.c:283</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a938af1642c47503bcefa8c8de11d7173a30040082a257338fe25e5bd5136bc9a8"><div class="ttname"><a href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173a30040082a257338fe25e5bd5136bc9a8">I2C_READ</a></div><div class="ttdoc">I2C rw bit (read) </div><div class="ttdef"><b>Definition:</b> ci2c.h:41</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_ad5e4a006f6cea5844a810fab30b40f87"><div class="ttname"><a href="ci2c_8h.html#ad5e4a006f6cea5844a810fab30b40f87">I2C_read</a></div><div class="ttdeci">I2C_STATUS I2C_read(I2C_SLAVE *slave, const uint16_t reg_addr, uint8_t *data, const uint16_t bytes)</div><div class="ttdoc">This function reads data from the address specified and stores this data in the area provided by the ...</div><div class="ttdef"><b>Definition:</b> ci2c.c:262</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a72ff1cee208396b40ebb555f1ed83743"><div class="ttname"><a href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743">enI2C_STATUS</a></div><div class="ttdeci">enI2C_STATUS</div><div class="ttdoc">I2C slave status. </div><div class="ttdef"><b>Definition:</b> ci2c.h:61</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a6572c289eb10e3543e42d34e710f5b67"><div class="ttname"><a href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67">enI2C_SPEED</a></div><div class="ttdeci">enI2C_SPEED</div><div class="ttdoc">I2C bus speed. </div><div class="ttdef"><b>Definition:</b> ci2c.h:49</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a489c20161e94a87325ca7e240032686b"><div class="ttname"><a href="ci2c_8h.html#a489c20161e94a87325ca7e240032686b">I2C_STATUS</a></div><div class="ttdeci">enum enI2C_STATUS I2C_STATUS</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a8d6d7eb118ea1505df039075a00c267b"><div class="ttname"><a href="ci2c_8h.html#a8d6d7eb118ea1505df039075a00c267b">I2C_rd8</a></div><div class="ttdeci">uint8_t I2C_rd8(const bool ack)</div><div class="ttdoc">Receive byte from bus. </div><div class="ttdef"><b>Definition:</b> ci2c.c:340</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a7c5b1857ae28ade8959a8a06f500ecde"><div class="ttname"><a href="ci2c_8h.html#a7c5b1857ae28ade8959a8a06f500ecde">I2C_set_speed</a></div><div class="ttdeci">uint16_t I2C_set_speed(const uint16_t speed)</div><div class="ttdoc">Change I2C frequency. </div><div class="ttdef"><b>Definition:</b> ci2c.c:168</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_ad74e31ebd08a9ddef57f571783f37cc7"><div class="ttname"><a href="ci2c_8h.html#ad74e31ebd08a9ddef57f571783f37cc7">I2C_set_retries</a></div><div class="ttdeci">uint8_t I2C_set_retries(const uint8_t retries)</div><div class="ttdoc">Change I2C message retries (in case of failure) </div><div class="ttdef"><b>Definition:</b> ci2c.c:199</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a98a8ae8df4864bb7d9a8b4509d863513a32d90f6214c5b494454666979a87b595"><div class="ttname"><a href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513a32d90f6214c5b494454666979a87b595">I2C_NO_REG</a></div><div class="ttdoc">Internal address registers not applicable for slave. </div><div class="ttdef"><b>Definition:</b> ci2c.h:72</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a99283d800332d700deed19f5a37e61d8"><div class="ttname"><a href="ci2c_8h.html#a99283d800332d700deed19f5a37e61d8">I2C_init</a></div><div class="ttdeci">void I2C_init(const uint16_t speed)</div><div class="ttdoc">Enable I2c module on arduino board (including pull-ups, enabling of ACK, and setting clock frequency)...</div><div class="ttdef"><b>Definition:</b> ci2c.c:122</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_afc15fc625892e1e50e831d7934073299"><div class="ttname"><a href="ci2c_8h.html#afc15fc625892e1e50e831d7934073299">I2C_read_next</a></div><div class="ttdeci">I2C_STATUS I2C_read_next(I2C_SLAVE *slave, uint8_t *data, const uint16_t bytes)</div><div class="ttdoc">This inline is a wrapper to I2C_read in case of contigous operations. </div><div class="ttdef"><b>Definition:</b> ci2c.h:234</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_acd209174a3b5ab213131a93633c19a38"><div class="ttname"><a href="ci2c_8h.html#acd209174a3b5ab213131a93633c19a38">I2C_set_timeout</a></div><div class="ttdeci">uint16_t I2C_set_timeout(const uint16_t timeout)</div><div class="ttdoc">Change I2C ack timeout. </div><div class="ttdef"><b>Definition:</b> ci2c.c:188</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a8d88530833d3685d52ea5486b1316427"><div class="ttname"><a href="ci2c_8h.html#a8d88530833d3685d52ea5486b1316427">I2C_slave_set_rw_func</a></div><div class="ttdeci">void I2C_slave_set_rw_func(I2C_SLAVE *slave, const ci2c_fct_ptr func, const I2C_RW rw)</div><div class="ttdoc">Redirect slave I2C read/write function (if needed for advanced use) </div><div class="ttdef"><b>Definition:</b> ci2c.c:77</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_af9c7e60b84174c9a42c0883f4c4a9b97"><div class="ttname"><a href="ci2c_8h.html#af9c7e60b84174c9a42c0883f4c4a9b97">ci2c_fct_ptr</a></div><div class="ttdeci">bool(* ci2c_fct_ptr)(void *, const uint16_t, uint8_t *, const uint16_t)</div><div class="ttdoc">i2c read/write function pointer typedef </div><div class="ttdef"><b>Definition:</b> ci2c.h:78</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_add4eec772922da692bdbb84c354a3fa0"><div class="ttname"><a href="ci2c_8h.html#add4eec772922da692bdbb84c354a3fa0">I2C_write_next</a></div><div class="ttdeci">I2C_STATUS I2C_write_next(I2C_SLAVE *slave, uint8_t *data, const uint16_t bytes)</div><div class="ttdoc">This inline is a wrapper to I2C_write in case of contigous operations. </div><div class="ttdef"><b>Definition:</b> ci2c.h:214</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_aae536cceb33d07e71af9d459a2fc6dc8"><div class="ttname"><a href="ci2c_8h.html#aae536cceb33d07e71af9d459a2fc6dc8">I2C_sndAddr</a></div><div class="ttdeci">bool I2C_sndAddr(I2C_SLAVE *slave, const I2C_RW rw)</div><div class="ttdoc">Send I2C address. </div><div class="ttdef"><b>Definition:</b> ci2c.c:360</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a74e1381b536811b202d087471723fb9e"><div class="ttname"><a href="ci2c_8h.html#a74e1381b536811b202d087471723fb9e">I2C_uninit</a></div><div class="ttdeci">void I2C_uninit()</div><div class="ttdoc">Disable I2c module on arduino board (releasing pull-ups, and TWI control) </div><div class="ttdef"><b>Definition:</b> ci2c.c:139</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a72ff1cee208396b40ebb555f1ed83743ae869b289c6b9b73b95dd1b40cbc9d651"><div class="ttname"><a href="ci2c_8h.html#a72ff1cee208396b40ebb555f1ed83743ae869b289c6b9b73b95dd1b40cbc9d651">I2C_NACK</a></div><div class="ttdoc">I2C Not Acknowledge. </div><div class="ttdef"><b>Definition:</b> ci2c.h:64</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_aa06111accc71a55517b8810727523574"><div class="ttname"><a href="ci2c_8h.html#aa06111accc71a55517b8810727523574">I2C_RW</a></div><div class="ttdeci">enum enI2C_RW I2C_RW</div></div>
|
|
<div class="ttc" id="struct_struct_i2_c_slave_html"><div class="ttname"><a href="struct_struct_i2_c_slave.html">StructI2CSlave</a></div><div class="ttdoc">ci2c slave config and control parameters </div><div class="ttdef"><b>Definition:</b> ci2c.h:85</div></div>
|
|
<div class="ttc" id="struct_struct_i2_c_slave_html_a5535a5ae60da0c21c6a739f4280c63a6"><div class="ttname"><a href="struct_struct_i2_c_slave.html#a5535a5ae60da0c21c6a739f4280c63a6">StructI2CSlave::status</a></div><div class="ttdeci">I2C_STATUS status</div><div class="ttdoc">Status of the last communications. </div><div class="ttdef"><b>Definition:</b> ci2c.h:96</div></div>
|
|
<div class="ttc" id="struct_struct_i2_c_slave_html_a028efd71ef1b338ff734d2d330baa422"><div class="ttname"><a href="struct_struct_i2_c_slave.html#a028efd71ef1b338ff734d2d330baa422">StructI2CSlave::reg_size</a></div><div class="ttdeci">I2C_INT_SIZE reg_size</div><div class="ttdoc">Slave internal registers size. </div><div class="ttdef"><b>Definition:</b> ci2c.h:91</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a53eb804c24e8e86717f7aaebdab1aa53"><div class="ttname"><a href="ci2c_8h.html#a53eb804c24e8e86717f7aaebdab1aa53">I2C_stop</a></div><div class="ttdeci">bool I2C_stop(void)</div><div class="ttdoc">Send stop condition. </div><div class="ttdef"><b>Definition:</b> ci2c.c:301</div></div>
|
|
<div class="ttc" id="struct_struct_i2_c_slave_html_a2c58ac88c9796097b0f4388d751622d5"><div class="ttname"><a href="struct_struct_i2_c_slave.html#a2c58ac88c9796097b0f4388d751622d5">StructI2CSlave::wr</a></div><div class="ttdeci">ci2c_fct_ptr wr</div><div class="ttdoc">Slave write function pointer. </div><div class="ttdef"><b>Definition:</b> ci2c.h:92</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a9dadf50a895a9c06f7fb2968166b316a"><div class="ttname"><a href="ci2c_8h.html#a9dadf50a895a9c06f7fb2968166b316a">I2C_INT_SIZE</a></div><div class="ttdeci">enum enI2C_INT_SIZE I2C_INT_SIZE</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a6572c289eb10e3543e42d34e710f5b67a6595b5891728545ae73b56eecaedeae6"><div class="ttname"><a href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67a6595b5891728545ae73b56eecaedeae6">I2C_HS</a></div><div class="ttdoc">I2C High Speed (3.4MHz): will set speed to Fast Mode (up to 400KHz on avr) </div><div class="ttdef"><b>Definition:</b> ci2c.h:53</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a2c25bc5fdf909b7d45d722970eb04d82"><div class="ttname"><a href="ci2c_8h.html#a2c25bc5fdf909b7d45d722970eb04d82">I2C_reset</a></div><div class="ttdeci">void I2C_reset(void)</div><div class="ttdoc">I2C bus reset (Release SCL and SDA lines and re-enable module) </div><div class="ttdef"><b>Definition:</b> ci2c.c:157</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a6572c289eb10e3543e42d34e710f5b67acab280b484ea06a499900154515f3005"><div class="ttname"><a href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67acab280b484ea06a499900154515f3005">I2C_FMP</a></div><div class="ttdoc">I2C Fast mode + (1MHz): will set speed to Fast Mode (up to 400KHz on avr) </div><div class="ttdef"><b>Definition:</b> ci2c.h:52</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a6572c289eb10e3543e42d34e710f5b67ad87a75087baf689cf3a240a769d2b558"><div class="ttname"><a href="ci2c_8h.html#a6572c289eb10e3543e42d34e710f5b67ad87a75087baf689cf3a240a769d2b558">I2C_FM</a></div><div class="ttdoc">I2C Fast Mode (400KHz) </div><div class="ttdef"><b>Definition:</b> ci2c.h:51</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_ac370df06df51c68217eafcee96e5a3e0"><div class="ttname"><a href="ci2c_8h.html#ac370df06df51c68217eafcee96e5a3e0">I2C_is_busy</a></div><div class="ttdeci">bool I2C_is_busy(void)</div><div class="ttdoc">Get I2C busy status. </div><div class="ttdef"><b>Definition:</b> ci2c.c:209</div></div>
|
|
<div class="ttc" id="ci2c_8c_html_a182293bc8273b099986183c0959e77da"><div class="ttname"><a href="ci2c_8c.html#a182293bc8273b099986183c0959e77da">speed</a></div><div class="ttdeci">I2C_SPEED speed</div><div class="ttdoc">i2c bus speed </div><div class="ttdef"><b>Definition:</b> ci2c.c:41</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_ab20db75dfa22dc47df506cab3bd11c60"><div class="ttname"><a href="ci2c_8h.html#ab20db75dfa22dc47df506cab3bd11c60">I2C_wr8</a></div><div class="ttdeci">bool I2C_wr8(const uint8_t dat)</div><div class="ttdoc">Send byte on bus. </div><div class="ttdef"><b>Definition:</b> ci2c.c:317</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a98a8ae8df4864bb7d9a8b4509d863513af7da1353d311749981b6ad185fa4d2d9"><div class="ttname"><a href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513af7da1353d311749981b6ad185fa4d2d9">I2C_16B_REG</a></div><div class="ttdoc">Slave internal address registers space is 16bits wide. </div><div class="ttdef"><b>Definition:</b> ci2c.h:74</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a938af1642c47503bcefa8c8de11d7173"><div class="ttname"><a href="ci2c_8h.html#a938af1642c47503bcefa8c8de11d7173">enI2C_RW</a></div><div class="ttdeci">enI2C_RW</div><div class="ttdoc">I2C RW bit enumeration. </div><div class="ttdef"><b>Definition:</b> ci2c.h:39</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a98a8ae8df4864bb7d9a8b4509d863513"><div class="ttname"><a href="ci2c_8h.html#a98a8ae8df4864bb7d9a8b4509d863513">enI2C_INT_SIZE</a></div><div class="ttdeci">enI2C_INT_SIZE</div><div class="ttdoc">I2C slave internal address registers size. </div><div class="ttdef"><b>Definition:</b> ci2c.h:71</div></div>
|
|
<div class="ttc" id="ci2c_8c_html_a458ee314eb40ab7e0c913a036333cc0d"><div class="ttname"><a href="ci2c_8c.html#a458ee314eb40ab7e0c913a036333cc0d">retries</a></div><div class="ttdeci">uint8_t retries</div><div class="ttdoc">i2c message retries when fail </div><div class="ttdef"><b>Definition:</b> ci2c.c:42</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_ad0eed3132d3284d6f921d13488721226"><div class="ttname"><a href="ci2c_8h.html#ad0eed3132d3284d6f921d13488721226">I2C_slave_set_addr</a></div><div class="ttdeci">bool I2C_slave_set_addr(I2C_SLAVE *slave, const uint8_t sl_addr)</div><div class="ttdoc">Change I2C slave address. </div><div class="ttdef"><b>Definition:</b> ci2c.c:88</div></div>
|
|
<div class="ttc" id="ci2c_8h_html_a83adef951ffd9fb5105216f6ee464bb9"><div class="ttname"><a href="ci2c_8h.html#a83adef951ffd9fb5105216f6ee464bb9">I2C_write</a></div><div class="ttdeci">I2C_STATUS I2C_write(I2C_SLAVE *slave, const uint16_t reg_addr, uint8_t *data, const uint16_t bytes)</div><div class="ttdoc">This function writes the provided data to the address specified. </div><div class="ttdef"><b>Definition:</b> ci2c.c:251</div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.13
|
|
</small></address>
|
|
</body>
|
|
</html>
|