-
Notifications
You must be signed in to change notification settings - Fork 0
/
S2LP__PktStack_8c_source.html
138 lines (136 loc) · 81.6 KB
/
S2LP__PktStack_8c_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Appiko: /home/prathik/workspace/appiko/nrf5x-firmware/application/rf_data_tx_rx/S2LP_Library/Src/S2LP_PktStack.c 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">Appiko
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</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_d75c23162a2652451dce46d2e7e8aead.html">application</a></li><li class="navelem"><a class="el" href="dir_eeae24ee2ae2430c5086d4802bed50ad.html">rf_data_tx_rx</a></li><li class="navelem"><a class="el" href="dir_457479e51678fc3cc84b7aa4a83c7b21.html">S2LP_Library</a></li><li class="navelem"><a class="el" href="dir_dd09dcd02d9dbd6734f102ee318ab155.html">Src</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">S2LP_PktStack.c</div> </div>
</div><!--header-->
<div class="contents">
<a href="S2LP__PktStack_8c.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="l00024"></a><span class="lineno"> 24</span> <span class="comment">/* Includes ------------------------------------------------------------------*/</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="S2LP__PktStack_8h.html">S2LP_PktStack.h</a>"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="MCU__Interface_8h.html">MCU_Interface.h</a>"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="S2LP__PktWMbus_8h.html">S2LP_PktWMbus.h</a>"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#define PKT_FORMAT_STACK_CODE (uint8_t)3</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="preprocessor">#define IS_STACK_PREAMBLE_LENGTH IS_PREAMBLE_LEN</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="preprocessor">#define IS_STACK_SYNC_LENGTH IS_SYNC_LEN</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor">#define IS_STACK_PKT_LEN_FIELD_WID IS_PKT_LEN_FIELD_WID</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor">#define IS_STACK_CRC_MODE IS_PKT_CRC_MODE</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#define IS_STACK_NMAX_RETX(NRETX) (NRETX<=15)</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preprocessor">#define IS_STACK_SEQNUM_RELOAD_VAL(VAL) (VAL<=3)</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga4d13027350cdfcc47faf96e19e934e4a"> 83</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#ga4d13027350cdfcc47faf96e19e934e4a">S2LPPktStackInit</a>(<a class="code" href="structPktStackInit.html">PktStackInit</a>* pxPktStackInit)</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> {</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  uint8_t tmpBuffer[6];</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="comment">/* Check the parameters */</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  s_assert_param(IS_STACK_PREAMBLE_LENGTH(pxPktStackInit-><a class="code" href="structPktStackInit.html#ae085d910f3886a49407d9414a6e40648">xPreambleLength</a>));</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  s_assert_param(IS_STACK_SYNC_LENGTH(pxPktStackInit-><a class="code" href="structPktStackInit.html#ab7ab060359154e3fd6ca1885b604ba25">xSyncLength</a>));</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  s_assert_param(IS_STACK_CRC_MODE(pxPktStackInit-><a class="code" href="structPktStackInit.html#a4315fe5b7fe60120448f9b0cb095de99">xCrcMode</a>));</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  s_assert_param(IS_SFUNCTIONAL_STATE(pxPktStackInit-><a class="code" href="structPktStackInit.html#af5c67283156d52d8478733afd6b0f071">cExtendedPktLenField</a>));</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  s_assert_param(IS_SFUNCTIONAL_STATE(pxPktStackInit-><a class="code" href="structPktStackInit.html#adcc4130b318c8107c0edc020512d268b">xFixVarLength</a>));</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  s_assert_param(IS_SFUNCTIONAL_STATE(pxPktStackInit-><a class="code" href="structPktStackInit.html#a83cfde38177289272796a38ac02ceb02">xFec</a>));</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  s_assert_param(IS_SFUNCTIONAL_STATE(pxPktStackInit-><a class="code" href="structPktStackInit.html#a28a090d1dff7932341638c0c6982f03e">xDataWhitening</a>));</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <a class="code" href="group__PktWMbus__Exported__Functions.html#ga64e1f2d6c265e9597d7cc27d4d5312f9">S2LPPktWMbusSetSubmode</a>(<a class="code" href="group__PktWMbus__Exported__Types.html#ggad308048c42a57b190919f1e151e226aca80d597d688aa88af1dfb6b9d3c891891">WMBUS_SUBMODE_NOT_CONFIGURED</a>);</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="comment">/* Always set the automatic packet filtering */</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a52940c0ecba2884ead739af87de5330a">PROTOCOL1_ADDR</a>, 1, &tmpBuffer[0]);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  tmpBuffer[0] |= AUTO_PCKT_FLT_REGMASK;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a52940c0ecba2884ead739af87de5330a">PROTOCOL1_ADDR</a>, 1, &tmpBuffer[0]);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  tmpBuffer[0] = ((pxPktStackInit-><a class="code" href="structPktStackInit.html#ab7ab060359154e3fd6ca1885b604ba25">xSyncLength</a>)<<2) | (uint8_t)((pxPktStackInit-><a class="code" href="structPktStackInit.html#ae085d910f3886a49407d9414a6e40648">xPreambleLength</a>)>>8);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  tmpBuffer[1] = (uint8_t)(pxPktStackInit-><a class="code" href="structPktStackInit.html#ae085d910f3886a49407d9414a6e40648">xPreambleLength</a>);</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  tmpBuffer[2] = ((uint8_t)pxPktStackInit-><a class="code" href="structPktStackInit.html#af5c67283156d52d8478733afd6b0f071">cExtendedPktLenField</a>)<<7 | ADDRESS_LEN_REGMASK;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  </div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#ac2d2aa6f9eb2e0c59d60ecddd4c6fc56">PCKTCTRL3_ADDR</a>, 1, &tmpBuffer[3]);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  tmpBuffer[3] &= ~(PCKT_FRMT_REGMASK | RX_MODE_REGMASK);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  tmpBuffer[3] |= PKT_FORMAT_STACK_CODE<<6;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  </div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a9651469641dbbabc53190d2dbb69d526">PCKTCTRL2_ADDR</a>, 2, &tmpBuffer[4]);</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  </div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">if</span>(pxPktStackInit-><a class="code" href="structPktStackInit.html#adcc4130b318c8107c0edc020512d268b">xFixVarLength</a> == S_ENABLE) {</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  tmpBuffer[4] |= FIX_VAR_LEN_REGMASK;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  }</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  tmpBuffer[4] &= ~FIX_VAR_LEN_REGMASK;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  }</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  tmpBuffer[4] &= ~(MANCHESTER_EN_REGMASK | MBUS_3OF6_EN_REGMASK);</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  </div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  tmpBuffer[5] &= ~(CRC_MODE_REGMASK | TXSOURCE_REGMASK);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  tmpBuffer[5] |= (uint8_t)pxPktStackInit-><a class="code" href="structPktStackInit.html#a4315fe5b7fe60120448f9b0cb095de99">xCrcMode</a>;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  </div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordflow">if</span>(pxPktStackInit-><a class="code" href="structPktStackInit.html#a28a090d1dff7932341638c0c6982f03e">xDataWhitening</a> == S_ENABLE) {</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  tmpBuffer[5] |= WHIT_EN_REGMASK;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  }</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  tmpBuffer[5] &= ~WHIT_EN_REGMASK;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  }</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> </div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">if</span>(pxPktStackInit-><a class="code" href="structPktStackInit.html#a83cfde38177289272796a38ac02ceb02">xFec</a> == S_ENABLE) {</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  tmpBuffer[5] |= FEC_EN_REGMASK;</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  }</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  tmpBuffer[5] &= ~FEC_EN_REGMASK;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  }</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  </div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a7e2f7127f4de96c63d3f0b8f1f37cc4a">PCKTCTRL6_ADDR</a>, 6, tmpBuffer); </div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> </div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="comment">/* SYNC word */</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">for</span>(uint8_t i=0 ; i<4 ; i++) {</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  tmpBuffer[i] = (uint8_t)(pxPktStackInit-><a class="code" href="structPktStackInit.html#af7f3fc307136ee41c32b6d1eba3677a5">lSyncWords</a>>>(8*i));</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  }</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#abf6ff84f41fb073f55ce95b6d6573f78">SYNC3_ADDR</a>, 4, tmpBuffer);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="comment">/* Sets CRC check bit */</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordflow">if</span>(pxPktStackInit-><a class="code" href="structPktStackInit.html#a4315fe5b7fe60120448f9b0cb095de99">xCrcMode</a> == <a class="code" href="group__PktCommon__Exported__Types.html#gga2592690ce789502289a5420e09f781d3a52340bba7c637cbbd44e273ba015f36b">PKT_NO_CRC</a>) {</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <a class="code" href="group__PktStack__Exported__Macros.html#gac9128e52ba04b4cb87f1f70cb4bc0015">S2LPPktStackFilterOnCrc</a>(S_DISABLE);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  }</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <a class="code" href="group__PktStack__Exported__Macros.html#gac9128e52ba04b4cb87f1f70cb4bc0015">S2LPPktStackFilterOnCrc</a>(S_ENABLE);</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  }</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="comment">/* Constellation map setting */</span></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a27e8d27b247880a5a8ada2f4921e1269">MOD1_ADDR</a>, 1, tmpBuffer);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  tmpBuffer[0] &= ~G4FSK_CONST_MAP_REGMASK;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a27e8d27b247880a5a8ada2f4921e1269">MOD1_ADDR</a>, 1, tmpBuffer); </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> </div><div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#gae882a1a7d8ac6964cf1fc0b722e957d3"> 166</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#gae882a1a7d8ac6964cf1fc0b722e957d3">S2LPPktStackGetInfo</a>(<a class="code" href="structPktStackInit.html">PktStackInit</a>* pxPktStackInit)</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span> {</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  uint8_t tmpBuffer[6];</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> </div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a7e2f7127f4de96c63d3f0b8f1f37cc4a">PCKTCTRL6_ADDR</a>, 6, tmpBuffer);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  </div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="comment">/* Sync length */</span></div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#ab7ab060359154e3fd6ca1885b604ba25">xSyncLength</a> = ((tmpBuffer[0] & SYNC_LEN_REGMASK)>>2);</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  </div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="comment">/* Preamble length */</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#ae085d910f3886a49407d9414a6e40648">xPreambleLength</a> = (((uint16_t)(tmpBuffer[0] & PREAMBLE_LEN_9_8_REGMASK))<<8) | ((uint16_t)tmpBuffer[1]);</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  </div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="comment">/* Length width */</span></div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#af5c67283156d52d8478733afd6b0f071">cExtendedPktLenField</a> = (<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a>)((tmpBuffer[2] & LEN_WID_REGMASK)>>7);</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> </div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="comment">/* FIX or VAR bit */</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#adcc4130b318c8107c0edc020512d268b">xFixVarLength</a> = (<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a>)(tmpBuffer[4] & FIX_VAR_LEN_REGMASK);</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span> </div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="comment">/* CRC mode */</span></div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#a4315fe5b7fe60120448f9b0cb095de99">xCrcMode</a> = (<a class="code" href="group__PktStack__Exported__Types.html#ga3c5ab967bac09c43118b61ceea9bcf80">StackCrcMode</a>)(tmpBuffer[5] & CRC_MODE_REGMASK);</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  </div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="comment">/* Whitening */</span></div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#a28a090d1dff7932341638c0c6982f03e">xDataWhitening</a> = (<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a>)((tmpBuffer[5] & WHIT_EN_REGMASK)>> 4);</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span> </div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="comment">/* FEC */</span></div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#a83cfde38177289272796a38ac02ceb02">xFec</a> = (<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a>)(tmpBuffer[5] & FEC_EN_REGMASK);</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  </div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#abf6ff84f41fb073f55ce95b6d6573f78">SYNC3_ADDR</a>, 4, tmpBuffer);</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  </div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="comment">/* SYNC word */</span></div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#af7f3fc307136ee41c32b6d1eba3677a5">lSyncWords</a> = 0;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keywordflow">for</span>(uint8_t i=0 ; i<4 ; i++) {</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  pxPktStackInit-><a class="code" href="structPktStackInit.html#af7f3fc307136ee41c32b6d1eba3677a5">lSyncWords</a> |= ((uint32_t)tmpBuffer[i])<<(8*i);</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  }</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  </div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> }</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> </div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span> </div><div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga6fad0e380cc818f90f6f27d6f8f6afd7"> 211</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#ga6fad0e380cc818f90f6f27d6f8f6afd7">S2LPPktStackAddressesInit</a>(<a class="code" href="structPktStackAddressesInit.html">PktStackAddressesInit</a>* pxPktStackAddresses)</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> {</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  uint8_t tmpBuffer[3];</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  s_assert_param(IS_SFUNCTIONAL_STATE(pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a936ab6c38707ae40f799631f36c3ceef">xFilterOnMyAddress</a>));</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  s_assert_param(IS_SFUNCTIONAL_STATE(pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#ae7851bd40b3079f1a49e537be3538f54">xFilterOnMulticastAddress</a>));</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  s_assert_param(IS_SFUNCTIONAL_STATE(pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#ae053a53e3480191368529587540b3b30">xFilterOnBroadcastAddress</a>));</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span> </div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="comment">/* Reads the PCKT_FLT_OPTIONS ragister */</span></div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#ae49cf4626ed318fa60ef3e8dbda4aefb">PCKT_FLT_OPTIONS_ADDR</a>, 1, &tmpBuffer[0]);</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  </div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="comment">/* Enables or disables filtering on my address */</span></div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordflow">if</span>(pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a936ab6c38707ae40f799631f36c3ceef">xFilterOnMyAddress</a> == S_ENABLE) {</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  tmpBuffer[0] |= DEST_VS_SOURCE_ADDR_REGMASK;</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  }</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  tmpBuffer[0] &= ~DEST_VS_SOURCE_ADDR_REGMASK;</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  }</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  </div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="comment">/* Enables or disables filtering on multicast address */</span></div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">if</span>(pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#ae7851bd40b3079f1a49e537be3538f54">xFilterOnMulticastAddress</a> == S_ENABLE) {</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  tmpBuffer[0] |= DEST_VS_MULTICAST_ADDR_REGMASK;</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  }</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  tmpBuffer[0] &= ~DEST_VS_MULTICAST_ADDR_REGMASK;</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  }</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>  <span class="comment">/* Enables or disables filtering on broadcast address */</span></div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="keywordflow">if</span>(pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#ae053a53e3480191368529587540b3b30">xFilterOnBroadcastAddress</a> == S_ENABLE) {</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  tmpBuffer[0] |= DEST_VS_BROADCAST_ADDR_REGMASK;</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  }</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  tmpBuffer[0] &= ~DEST_VS_BROADCAST_ADDR_REGMASK;</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  }</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  </div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#ae49cf4626ed318fa60ef3e8dbda4aefb">PCKT_FLT_OPTIONS_ADDR</a>, 1, &tmpBuffer[0]);</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  </div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="comment">/* Fills the array with the addresses passed in the structure */</span></div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  tmpBuffer[2] = pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a7c11433c88b69973a5ba5d70f5851446">cMyAddress</a>;</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  tmpBuffer[0] = pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a821b730ff0fef3aa0e089ab9f896405c">cBroadcastAddress</a>;</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  tmpBuffer[1] = pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a627ad261b79631fb685ed1a455619d46">cMulticastAddress</a>;</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a6a54fe327205e10c2d16deba3364214d">PCKT_FLT_GOALS2_ADDR</a>, 3, tmpBuffer);</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span> }</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span> </div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> </div><div class="line"><a name="l00262"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#gaaa6aebda4d949e411c6c8445bc99da5e"> 262</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#gaaa6aebda4d949e411c6c8445bc99da5e">S2LPPktStackGetAddressesInfo</a>(<a class="code" href="structPktStackAddressesInit.html">PktStackAddressesInit</a>* pxPktStackAddresses)</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span> {</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  uint8_t tmpBuffer[3];</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span> </div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a1303c5dc208bdf77da84d123b0d9559e">PCKT_FLT_GOALS3_ADDR</a>, 3, tmpBuffer);</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a7c11433c88b69973a5ba5d70f5851446">cMyAddress</a> = tmpBuffer[0];</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a821b730ff0fef3aa0e089ab9f896405c">cBroadcastAddress</a> = tmpBuffer[1];</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a627ad261b79631fb685ed1a455619d46">cMulticastAddress</a> = tmpBuffer[2];</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  </div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#ae49cf4626ed318fa60ef3e8dbda4aefb">PCKT_FLT_OPTIONS_ADDR</a>, 1, &tmpBuffer[0]);</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#ae053a53e3480191368529587540b3b30">xFilterOnBroadcastAddress</a> = (<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a>)((tmpBuffer[0] & DEST_VS_BROADCAST_ADDR_REGMASK) >> 3);</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#ae7851bd40b3079f1a49e537be3538f54">xFilterOnMulticastAddress</a> = (<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a>)((tmpBuffer[0] & DEST_VS_MULTICAST_ADDR_REGMASK) >> 2);</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  pxPktStackAddresses-><a class="code" href="structPktStackAddressesInit.html#a936ab6c38707ae40f799631f36c3ceef">xFilterOnMyAddress</a> = (<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a>)((tmpBuffer[0] & DEST_VS_SOURCE_ADDR_REGMASK) >> 1);</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> </div><div class="line"><a name="l00283"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga2a37439fcf8b374e315eccc291ec5f6b"> 283</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#ga2a37439fcf8b374e315eccc291ec5f6b">S2LPPktStackSetFormat</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span> {</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  uint8_t tmp;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  </div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#ac2d2aa6f9eb2e0c59d60ecddd4c6fc56">PCKTCTRL3_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  </div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  <span class="comment">/* Build the new value. Also set to 0 the direct RX mode bits */</span></div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  tmp &= ~(PCKT_FRMT_REGMASK | RX_MODE_REGMASK);</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  tmp |= PKT_FORMAT_STACK_CODE;</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#ac2d2aa6f9eb2e0c59d60ecddd4c6fc56">PCKTCTRL3_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span> </div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#adf6eba8796306b2ae2fdbf9ded43193b">PCKTCTRL1_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  </div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="comment">/* Set to 0 the direct TX mode bits */</span></div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  tmp &= ~TXSOURCE_REGMASK;</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#adf6eba8796306b2ae2fdbf9ded43193b">PCKTCTRL1_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span> </div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <a class="code" href="group__PktWMbus__Exported__Functions.html#ga64e1f2d6c265e9597d7cc27d4d5312f9">S2LPPktWMbusSetSubmode</a>(<a class="code" href="group__PktWMbus__Exported__Types.html#ggad308048c42a57b190919f1e151e226aca80d597d688aa88af1dfb6b9d3c891891">WMBUS_SUBMODE_NOT_CONFIGURED</a>);</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span> }</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span> </div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span> </div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span> </div><div class="line"><a name="l00314"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga49a758ddfded6879b28cab83df5632c3"> 314</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#ga49a758ddfded6879b28cab83df5632c3">S2LPPktStackSetPayloadLength</a>(uint16_t nPayloadLength)</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span> {</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  uint8_t tmpBuffer[2];</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span> </div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  nPayloadLength+=2;</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  tmpBuffer[0] = (uint8_t)(nPayloadLength>>8);</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  tmpBuffer[1] = (uint8_t)nPayloadLength;</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#aad6b4ee52f42bc877cfcc2df8826bfc9">PCKTLEN1_ADDR</a>, 2, tmpBuffer);</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span> }</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span> </div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span> </div><div class="line"><a name="l00334"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga7748f062b0a5f481b1ab77748ef95bab"> 334</a></span> uint16_t <a class="code" href="group__PktStack__Private__Functions.html#ga7748f062b0a5f481b1ab77748ef95bab">S2LPPktStackGetPayloadLength</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span> {</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  uint8_t tmpBuffer[2];</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  uint16_t nPayloadLength;</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span> </div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#aad6b4ee52f42bc877cfcc2df8826bfc9">PCKTLEN1_ADDR</a>, 2, tmpBuffer);</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  nPayloadLength = (((uint16_t)tmpBuffer[0])<<8) | ((uint16_t)tmpBuffer[1]);</div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  nPayloadLength-=2;</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span> </div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="keywordflow">return</span> nPayloadLength;</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span> }</div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span> </div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span> </div><div class="line"><a name="l00352"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#gab5cb26d0184f66bba15cb02dfc753ad5"> 352</a></span> uint16_t <a class="code" href="group__PktStack__Private__Functions.html#gab5cb26d0184f66bba15cb02dfc753ad5">S2LPPktStackGetReceivedPktLength</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span> {</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  uint8_t tmpBuffer[2];</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  uint16_t nPayloadLength;</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span> </div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a84d1b30718e0bea0fb3c753137395108">RX_PCKT_LEN1_ADDR</a>, 2, tmpBuffer);</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  nPayloadLength = (((uint16_t)tmpBuffer[0])<<8) | ((uint16_t)tmpBuffer[1]);</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  nPayloadLength--;</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span> </div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  <span class="keywordflow">return</span> nPayloadLength;</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span> }</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span> </div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span> </div><div class="line"><a name="l00370"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga73ca57660d836d2e61bfab2d0c68c5fc"> 370</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#ga73ca57660d836d2e61bfab2d0c68c5fc">S2LPPktStackAutoAck</a>(<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a> xNewState)</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span> {</div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  uint8_t tmp;</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  s_assert_param(IS_SFUNCTIONAL_STATE(xNewState));</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span> </div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a80cc63871ea002b949f15f1214e87751">PROTOCOL0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keywordflow">if</span>(xNewState == S_ENABLE) {</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  tmp |= AUTO_ACK_REGMASK;</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  }</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  tmp &= ~AUTO_ACK_REGMASK;</div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  }</div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a80cc63871ea002b949f15f1214e87751">PROTOCOL0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span> </div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span> }</div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span> </div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span> </div><div class="line"><a name="l00392"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga3936dffc49776a99e5dbb7987f7bd66a"> 392</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#ga3936dffc49776a99e5dbb7987f7bd66a">S2LPPktStackNRetx</a>(uint8_t nRetx)</div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span> {</div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  uint8_t tmp;</div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  s_assert_param(IS_STACK_NMAX_RETX(nRetx));</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  </div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a80cc63871ea002b949f15f1214e87751">PROTOCOL0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  tmp &= ~NMAX_RETX_REGMASK;</div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  tmp |= (nRetx<<4);</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a80cc63871ea002b949f15f1214e87751">PROTOCOL0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span> </div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span> }</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span> </div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span> </div><div class="line"><a name="l00410"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga288c2ae46e75f47ef7da08bad886a07c"> 410</a></span> <a class="code" href="group__Types__Exported__Types.html#gad62879632ee8b65fd9116ac8006e9767">SFlagStatus</a> <a class="code" href="group__PktStack__Private__Functions.html#ga288c2ae46e75f47ef7da08bad886a07c">S2LPPktStackGetTXAckRequest</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span> {</div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  uint8_t tmp;</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  </div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#ac5e34fd8baf0e3afa8390ad85a768d06">RX_PCKT_INFO_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  tmp &= NACK_RX_REGMASK;</div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  tmp >>= 2;</div><div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  <span class="keywordflow">return</span> (<a class="code" href="group__Types__Exported__Types.html#gad62879632ee8b65fd9116ac8006e9767">SFlagStatus</a>)tmp;</div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span> }</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span> </div><div class="line"><a name="l00426"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#gac158182005058142c4622032a49808f0"> 426</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#gac158182005058142c4622032a49808f0">S2LPPktStackAckRequest</a>(<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a> xNewState)</div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span> {</div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  uint8_t tmp;</div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  s_assert_param(IS_SFUNCTIONAL_STATE(xNewState));</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span> </div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a80cc63871ea002b949f15f1214e87751">PROTOCOL0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="keywordflow">if</span>(xNewState == S_ENABLE) {</div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  tmp &= ~NACK_TX_REGMASK;</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  }</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  tmp |= NACK_TX_REGMASK;</div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  }</div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a80cc63871ea002b949f15f1214e87751">PROTOCOL0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span> </div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span> }</div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span> </div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span> </div><div class="line"><a name="l00448"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#gabfc6d3e80116b4192cf34b9775b8bc8d"> 448</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#gabfc6d3e80116b4192cf34b9775b8bc8d">S2LPPktStackPiggybacking</a>(<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a> xNewState)</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span> {</div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  uint8_t tmp;</div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span>  s_assert_param(IS_SFUNCTIONAL_STATE(xNewState));</div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span> </div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a52940c0ecba2884ead739af87de5330a">PROTOCOL1_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  <span class="keywordflow">if</span>(xNewState == S_ENABLE) {</div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  tmp |= PIGGYBACKING_REGMASK;</div><div class="line"><a name="l00456"></a><span class="lineno"> 456</span>  }</div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  <span class="keywordflow">else</span> {</div><div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  tmp &= ~PIGGYBACKING_REGMASK;</div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  }</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a52940c0ecba2884ead739af87de5330a">PROTOCOL1_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00461"></a><span class="lineno"> 461</span> </div><div class="line"><a name="l00462"></a><span class="lineno"> 462</span> }</div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span> </div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span> </div><div class="line"><a name="l00471"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#ga21f0b6b2eb362a74a1bb2ffd1bf3b9ad"> 471</a></span> <span class="keywordtype">void</span> <a class="code" href="group__PktStack__Private__Functions.html#ga21f0b6b2eb362a74a1bb2ffd1bf3b9ad">S2LPPktStackSeqNumForReload</a>(uint8_t cReloadValue)</div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span> {</div><div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  uint8_t tmp;</div><div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  s_assert_param(IS_STACK_SEQNUM_RELOAD_VAL(cReloadValue));</div><div class="line"><a name="l00475"></a><span class="lineno"> 475</span>  </div><div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a815d99c5243a4dceffab61b324455f6b">PROTOCOL2_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00477"></a><span class="lineno"> 477</span>  tmp &= ~TX_SEQ_NUM_RELOAD_REGMASK;</div><div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  tmp |= (cReloadValue<<3);</div><div class="line"><a name="l00479"></a><span class="lineno"> 479</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a815d99c5243a4dceffab61b324455f6b">PROTOCOL2_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00480"></a><span class="lineno"> 480</span> }</div><div class="line"><a name="l00481"></a><span class="lineno"> 481</span> </div><div class="line"><a name="l00487"></a><span class="lineno"><a class="line" href="group__PktStack__Private__Functions.html#gaf00b8b11d940be9944962ea17d5810d7"> 487</a></span> uint8_t <a class="code" href="group__PktStack__Private__Functions.html#gaf00b8b11d940be9944962ea17d5810d7">S2LPPktStackGetNReTx</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00488"></a><span class="lineno"> 488</span> {</div><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  uint8_t tempRetValue;</div><div class="line"><a name="l00490"></a><span class="lineno"> 490</span> </div><div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  <span class="comment">/* Reads the TX_PCKT_INFO register value */</span></div><div class="line"><a name="l00492"></a><span class="lineno"> 492</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a78c4ea5f6db3f456ce054f0f77527fe6">TX_PCKT_INFO_ADDR</a>, 1, &tempRetValue);</div><div class="line"><a name="l00493"></a><span class="lineno"> 493</span> </div><div class="line"><a name="l00494"></a><span class="lineno"> 494</span>  <span class="comment">/* Obtains and returns the number of retransmission done */</span></div><div class="line"><a name="l00495"></a><span class="lineno"> 495</span>  <span class="keywordflow">return</span> (tempRetValue & 0x0F);</div><div class="line"><a name="l00496"></a><span class="lineno"> 496</span> </div><div class="line"><a name="l00497"></a><span class="lineno"> 497</span> }</div><div class="line"><a name="l00498"></a><span class="lineno"> 498</span> </div><div class="line"><a name="l00499"></a><span class="lineno"> 499</span> </div><div class="line"><a name="l00515"></a><span class="lineno"> 515</span> <span class="comment">/******************* (C) COPYRIGHT 2016 STMicroelectronics *****END OF FILE****/</span></div><div class="ttc" id="S2LP__Regs_8h_html_a78c4ea5f6db3f456ce054f0f77527fe6"><div class="ttname"><a href="S2LP__Regs_8h.html#a78c4ea5f6db3f456ce054f0f77527fe6">TX_PCKT_INFO_ADDR</a></div><div class="ttdeci">#define TX_PCKT_INFO_ADDR</div><div class="ttdoc">TX_PCKT_INFO register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01585">S2LP_Regs.h:1585</a></div></div>
<div class="ttc" id="structPktStackAddressesInit_html_ae7851bd40b3079f1a49e537be3538f54"><div class="ttname"><a href="structPktStackAddressesInit.html#ae7851bd40b3079f1a49e537be3538f54">PktStackAddressesInit::xFilterOnMulticastAddress</a></div><div class="ttdeci">SFunctionalState xFilterOnMulticastAddress</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00137">S2LP_PktStack.h:137</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga73ca57660d836d2e61bfab2d0c68c5fc"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga73ca57660d836d2e61bfab2d0c68c5fc">S2LPPktStackAutoAck</a></div><div class="ttdeci">void S2LPPktStackAutoAck(SFunctionalState xNewState)</div><div class="ttdoc">Se the AUTO_ACK bit on the receiver .</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00370">S2LP_PktStack.c:370</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a815d99c5243a4dceffab61b324455f6b"><div class="ttname"><a href="S2LP__Regs_8h.html#a815d99c5243a4dceffab61b324455f6b">PROTOCOL2_ADDR</a></div><div class="ttdeci">#define PROTOCOL2_ADDR</div><div class="ttdoc">PROTOCOL2 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00660">S2LP_Regs.h:660</a></div></div>
<div class="ttc" id="group__PktWMbus__Exported__Types_html_ggad308048c42a57b190919f1e151e226aca80d597d688aa88af1dfb6b9d3c891891"><div class="ttname"><a href="group__PktWMbus__Exported__Types.html#ggad308048c42a57b190919f1e151e226aca80d597d688aa88af1dfb6b9d3c891891">WMBUS_SUBMODE_NOT_CONFIGURED</a></div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktWMbus_8h_source.html#l00093">S2LP_PktWMbus.h:93</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a27e8d27b247880a5a8ada2f4921e1269"><div class="ttname"><a href="S2LP__Regs_8h.html#a27e8d27b247880a5a8ada2f4921e1269">MOD1_ADDR</a></div><div class="ttdeci">#define MOD1_ADDR</div><div class="ttdoc">MOD1 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00263">S2LP_Regs.h:263</a></div></div>
<div class="ttc" id="group__Types__Exported__Types_html_gaf4cbf41d3c8f611d12adae5d2c29c3c2"><div class="ttname"><a href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a></div><div class="ttdeci">SFunctionalState</div><div class="ttdoc">S2LP Functional state. Used to enable or disable a specific option.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Types_8h_source.html#l00067">S2LP_Types.h:67</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga4d13027350cdfcc47faf96e19e934e4a"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga4d13027350cdfcc47faf96e19e934e4a">S2LPPktStackInit</a></div><div class="ttdeci">void S2LPPktStackInit(PktStackInit *pxPktStackInit)</div><div class="ttdoc">Initialize the S2LP STack packet according to the specified parameters in the PktStackInit.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00083">S2LP_PktStack.c:83</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a52940c0ecba2884ead739af87de5330a"><div class="ttname"><a href="S2LP__Regs_8h.html#a52940c0ecba2884ead739af87de5330a">PROTOCOL1_ADDR</a></div><div class="ttdeci">#define PROTOCOL1_ADDR</div><div class="ttdoc">PROTOCOL1 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00685">S2LP_Regs.h:685</a></div></div>
<div class="ttc" id="structPktStackInit_html_a83cfde38177289272796a38ac02ceb02"><div class="ttname"><a href="structPktStackInit.html#a83cfde38177289272796a38ac02ceb02">PktStackInit::xFec</a></div><div class="ttdeci">SFunctionalState xFec</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00125">S2LP_PktStack.h:125</a></div></div>
<div class="ttc" id="group__PktCommon__Exported__Types_html_gga2592690ce789502289a5420e09f781d3a52340bba7c637cbbd44e273ba015f36b"><div class="ttname"><a href="group__PktCommon__Exported__Types.html#gga2592690ce789502289a5420e09f781d3a52340bba7c637cbbd44e273ba015f36b">PKT_NO_CRC</a></div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PacketHandler_8h_source.html#l00081">S2LP_PacketHandler.h:81</a></div></div>
<div class="ttc" id="structPktStackInit_html_a4315fe5b7fe60120448f9b0cb095de99"><div class="ttname"><a href="structPktStackInit.html#a4315fe5b7fe60120448f9b0cb095de99">PktStackInit::xCrcMode</a></div><div class="ttdeci">StackCrcMode xCrcMode</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00124">S2LP_PktStack.h:124</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a7e2f7127f4de96c63d3f0b8f1f37cc4a"><div class="ttname"><a href="S2LP__Regs_8h.html#a7e2f7127f4de96c63d3f0b8f1f37cc4a">PCKTCTRL6_ADDR</a></div><div class="ttdeci">#define PCKTCTRL6_ADDR</div><div class="ttdoc">PCKTCTRL6 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00437">S2LP_Regs.h:437</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_gabfc6d3e80116b4192cf34b9775b8bc8d"><div class="ttname"><a href="group__PktStack__Private__Functions.html#gabfc6d3e80116b4192cf34b9775b8bc8d">S2LPPktStackPiggybacking</a></div><div class="ttdeci">void S2LPPktStackPiggybacking(SFunctionalState xNewState)</div><div class="ttdoc">Enable or Disable the piggybacking.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00448">S2LP_PktStack.c:448</a></div></div>
<div class="ttc" id="structPktStackAddressesInit_html_a627ad261b79631fb685ed1a455619d46"><div class="ttname"><a href="structPktStackAddressesInit.html#a627ad261b79631fb685ed1a455619d46">PktStackAddressesInit::cMulticastAddress</a></div><div class="ttdeci">uint8_t cMulticastAddress</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00138">S2LP_PktStack.h:138</a></div></div>
<div class="ttc" id="group__PktStack__Exported__Macros_html_gac9128e52ba04b4cb87f1f70cb4bc0015"><div class="ttname"><a href="group__PktStack__Exported__Macros.html#gac9128e52ba04b4cb87f1f70cb4bc0015">S2LPPktStackFilterOnCrc</a></div><div class="ttdeci">#define S2LPPktStackFilterOnCrc(xNewState)</div><div class="ttdoc">Enables or Disables the CRC filtering.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00195">S2LP_PktStack.h:195</a></div></div>
<div class="ttc" id="group__Types__Exported__Types_html_gad62879632ee8b65fd9116ac8006e9767"><div class="ttname"><a href="group__Types__Exported__Types.html#gad62879632ee8b65fd9116ac8006e9767">SFlagStatus</a></div><div class="ttdeci">SFlagStatus</div><div class="ttdoc">S2LP Flag status. Used to control the state of a flag.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Types_8h_source.html#l00076">S2LP_Types.h:76</a></div></div>
<div class="ttc" id="structPktStackAddressesInit_html"><div class="ttname"><a href="structPktStackAddressesInit.html">PktStackAddressesInit</a></div><div class="ttdoc">S2LP STack packet address structure definition. This structure allows users to specify the node/multi...</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00134">S2LP_PktStack.h:134</a></div></div>
<div class="ttc" id="structPktStackAddressesInit_html_a7c11433c88b69973a5ba5d70f5851446"><div class="ttname"><a href="structPktStackAddressesInit.html#a7c11433c88b69973a5ba5d70f5851446">PktStackAddressesInit::cMyAddress</a></div><div class="ttdeci">uint8_t cMyAddress</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00136">S2LP_PktStack.h:136</a></div></div>
<div class="ttc" id="structPktStackAddressesInit_html_ae053a53e3480191368529587540b3b30"><div class="ttname"><a href="structPktStackAddressesInit.html#ae053a53e3480191368529587540b3b30">PktStackAddressesInit::xFilterOnBroadcastAddress</a></div><div class="ttdeci">SFunctionalState xFilterOnBroadcastAddress</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00139">S2LP_PktStack.h:139</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a9651469641dbbabc53190d2dbb69d526"><div class="ttname"><a href="S2LP__Regs_8h.html#a9651469641dbbabc53190d2dbb69d526">PCKTCTRL2_ADDR</a></div><div class="ttdeci">#define PCKTCTRL2_ADDR</div><div class="ttdoc">PCKTCTRL2 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00508">S2LP_Regs.h:508</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga21f0b6b2eb362a74a1bb2ffd1bf3b9ad"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga21f0b6b2eb362a74a1bb2ffd1bf3b9ad">S2LPPktStackSeqNumForReload</a></div><div class="ttdeci">void S2LPPktStackSeqNumForReload(uint8_t cReloadValue)</div><div class="ttdoc">Set the reload value of the sequence number.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00471">S2LP_PktStack.c:471</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_abf6ff84f41fb073f55ce95b6d6573f78"><div class="ttname"><a href="S2LP__Regs_8h.html#abf6ff84f41fb073f55ce95b6d6573f78">SYNC3_ADDR</a></div><div class="ttdeci">#define SYNC3_ADDR</div><div class="ttdoc">SYNC3 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00573">S2LP_Regs.h:573</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_gac158182005058142c4622032a49808f0"><div class="ttname"><a href="group__PktStack__Private__Functions.html#gac158182005058142c4622032a49808f0">S2LPPktStackAckRequest</a></div><div class="ttdeci">void S2LPPktStackAckRequest(SFunctionalState xNewState)</div><div class="ttdoc">This function will set the NO_ACK bit or reset it.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00426">S2LP_PktStack.c:426</a></div></div>
<div class="ttc" id="structPktStackAddressesInit_html_a936ab6c38707ae40f799631f36c3ceef"><div class="ttname"><a href="structPktStackAddressesInit.html#a936ab6c38707ae40f799631f36c3ceef">PktStackAddressesInit::xFilterOnMyAddress</a></div><div class="ttdeci">SFunctionalState xFilterOnMyAddress</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00135">S2LP_PktStack.h:135</a></div></div>
<div class="ttc" id="group__PktStack__Exported__Types_html_ga3c5ab967bac09c43118b61ceea9bcf80"><div class="ttname"><a href="group__PktStack__Exported__Types.html#ga3c5ab967bac09c43118b61ceea9bcf80">StackCrcMode</a></div><div class="ttdeci">PktCrcMode StackCrcMode</div><div class="ttdoc">CRC length in bytes enumeration.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00112">S2LP_PktStack.h:112</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga3936dffc49776a99e5dbb7987f7bd66a"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga3936dffc49776a99e5dbb7987f7bd66a">S2LPPktStackNRetx</a></div><div class="ttdeci">void S2LPPktStackNRetx(uint8_t nRetx)</div><div class="ttdoc">Set the number of retransmissions to be done in case of ACK loss.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00392">S2LP_PktStack.c:392</a></div></div>
<div class="ttc" id="S2LP__PktWMbus_8h_html"><div class="ttname"><a href="S2LP__PktWMbus_8h.html">S2LP_PktWMbus.h</a></div><div class="ttdoc">Configuration and management of S2-LP WMbus packets.</div></div>
<div class="ttc" id="structPktStackInit_html_af7f3fc307136ee41c32b6d1eba3677a5"><div class="ttname"><a href="structPktStackInit.html#af7f3fc307136ee41c32b6d1eba3677a5">PktStackInit::lSyncWords</a></div><div class="ttdeci">uint32_t lSyncWords</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00121">S2LP_PktStack.h:121</a></div></div>
<div class="ttc" id="structPktStackInit_html_ab7ab060359154e3fd6ca1885b604ba25"><div class="ttname"><a href="structPktStackInit.html#ab7ab060359154e3fd6ca1885b604ba25">PktStackInit::xSyncLength</a></div><div class="ttdeci">uint8_t xSyncLength</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00120">S2LP_PktStack.h:120</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga6fad0e380cc818f90f6f27d6f8f6afd7"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga6fad0e380cc818f90f6f27d6f8f6afd7">S2LPPktStackAddressesInit</a></div><div class="ttdeci">void S2LPPktStackAddressesInit(PktStackAddressesInit *pxPktStackAddresses)</div><div class="ttdoc">Initialize the S2LP STack packet addresses according to the specified parameters in the PktStackAddre...</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00211">S2LP_PktStack.c:211</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga2a37439fcf8b374e315eccc291ec5f6b"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga2a37439fcf8b374e315eccc291ec5f6b">S2LPPktStackSetFormat</a></div><div class="ttdeci">void S2LPPktStackSetFormat(void)</div><div class="ttdoc">Configure the STack packet format for S2LP.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00283">S2LP_PktStack.c:283</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_adf6eba8796306b2ae2fdbf9ded43193b"><div class="ttname"><a href="S2LP__Regs_8h.html#adf6eba8796306b2ae2fdbf9ded43193b">PCKTCTRL1_ADDR</a></div><div class="ttdeci">#define PCKTCTRL1_ADDR</div><div class="ttdoc">PCKTCTRL1 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00530">S2LP_Regs.h:530</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_aad6b4ee52f42bc877cfcc2df8826bfc9"><div class="ttname"><a href="S2LP__Regs_8h.html#aad6b4ee52f42bc877cfcc2df8826bfc9">PCKTLEN1_ADDR</a></div><div class="ttdeci">#define PCKTLEN1_ADDR</div><div class="ttdoc">PCKTLEN1 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00547">S2LP_Regs.h:547</a></div></div>
<div class="ttc" id="structPktStackAddressesInit_html_a821b730ff0fef3aa0e089ab9f896405c"><div class="ttname"><a href="structPktStackAddressesInit.html#a821b730ff0fef3aa0e089ab9f896405c">PktStackAddressesInit::cBroadcastAddress</a></div><div class="ttdeci">uint8_t cBroadcastAddress</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00140">S2LP_PktStack.h:140</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga288c2ae46e75f47ef7da08bad886a07c"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga288c2ae46e75f47ef7da08bad886a07c">S2LPPktStackGetTXAckRequest</a></div><div class="ttdeci">SFlagStatus S2LPPktStackGetTXAckRequest(void)</div><div class="ttdoc">Get the NO_ACK bit.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00410">S2LP_PktStack.c:410</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga7748f062b0a5f481b1ab77748ef95bab"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga7748f062b0a5f481b1ab77748ef95bab">S2LPPktStackGetPayloadLength</a></div><div class="ttdeci">uint16_t S2LPPktStackGetPayloadLength(void)</div><div class="ttdoc">Return the payload length for S2LP STack packets. Since the packet length depends from the address an...</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00334">S2LP_PktStack.c:334</a></div></div>
<div class="ttc" id="structPktStackInit_html_a28a090d1dff7932341638c0c6982f03e"><div class="ttname"><a href="structPktStackInit.html#a28a090d1dff7932341638c0c6982f03e">PktStackInit::xDataWhitening</a></div><div class="ttdeci">SFunctionalState xDataWhitening</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00126">S2LP_PktStack.h:126</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_gab5cb26d0184f66bba15cb02dfc753ad5"><div class="ttname"><a href="group__PktStack__Private__Functions.html#gab5cb26d0184f66bba15cb02dfc753ad5">S2LPPktStackGetReceivedPktLength</a></div><div class="ttdeci">uint16_t S2LPPktStackGetReceivedPktLength(void)</div><div class="ttdoc">Return the packet length field of the received packet.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00352">S2LP_PktStack.c:352</a></div></div>
<div class="ttc" id="group__PktWMbus__Exported__Functions_html_ga64e1f2d6c265e9597d7cc27d4d5312f9"><div class="ttname"><a href="group__PktWMbus__Exported__Functions.html#ga64e1f2d6c265e9597d7cc27d4d5312f9">S2LPPktWMbusSetSubmode</a></div><div class="ttdeci">void S2LPPktWMbusSetSubmode(WMbusSubmode xWMbusSubmode)</div><div class="ttdoc">Set the W-MBus submode.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktWMbus_8c_source.html#l00287">S2LP_PktWMbus.c:287</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a80cc63871ea002b949f15f1214e87751"><div class="ttname"><a href="S2LP__Regs_8h.html#a80cc63871ea002b949f15f1214e87751">PROTOCOL0_ADDR</a></div><div class="ttdeci">#define PROTOCOL0_ADDR</div><div class="ttdoc">PROTOCOL0 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00709">S2LP_Regs.h:709</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_ga49a758ddfded6879b28cab83df5632c3"><div class="ttname"><a href="group__PktStack__Private__Functions.html#ga49a758ddfded6879b28cab83df5632c3">S2LPPktStackSetPayloadLength</a></div><div class="ttdeci">void S2LPPktStackSetPayloadLength(uint16_t nPayloadLength)</div><div class="ttdoc">Set the payload length for S2LP STack packets. Since the packet length depends from the address (alwa...</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00314">S2LP_PktStack.c:314</a></div></div>
<div class="ttc" id="structPktStackInit_html_adcc4130b318c8107c0edc020512d268b"><div class="ttname"><a href="structPktStackInit.html#adcc4130b318c8107c0edc020512d268b">PktStackInit::xFixVarLength</a></div><div class="ttdeci">SFunctionalState xFixVarLength</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00122">S2LP_PktStack.h:122</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a84d1b30718e0bea0fb3c753137395108"><div class="ttname"><a href="S2LP__Regs_8h.html#a84d1b30718e0bea0fb3c753137395108">RX_PCKT_LEN1_ADDR</a></div><div class="ttdeci">#define RX_PCKT_LEN1_ADDR</div><div class="ttdoc">RX_PCKT_LEN1 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01669">S2LP_Regs.h:1669</a></div></div>
<div class="ttc" id="group__Types__Exported__Variables_html_gab5ab2dc69a49b1d46acd243849558706"><div class="ttname"><a href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a></div><div class="ttdeci">volatile S2LPStatus g_xStatus</div><div class="ttdoc">S2LP Status global variable. This global variable of S2LPStatus type is updated on every SPI transact...</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Types_8c_source.html#l00082">S2LP_Types.c:82</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_ac2d2aa6f9eb2e0c59d60ecddd4c6fc56"><div class="ttname"><a href="S2LP__Regs_8h.html#ac2d2aa6f9eb2e0c59d60ecddd4c6fc56">PCKTCTRL3_ADDR</a></div><div class="ttdeci">#define PCKTCTRL3_ADDR</div><div class="ttdoc">PCKTCTRL3 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00485">S2LP_Regs.h:485</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a1303c5dc208bdf77da84d123b0d9559e"><div class="ttname"><a href="S2LP__Regs_8h.html#a1303c5dc208bdf77da84d123b0d9559e">PCKT_FLT_GOALS3_ADDR</a></div><div class="ttdeci">#define PCKT_FLT_GOALS3_ADDR</div><div class="ttdoc">PCKT_FLT_GOALS3 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00819">S2LP_Regs.h:819</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a6a54fe327205e10c2d16deba3364214d"><div class="ttname"><a href="S2LP__Regs_8h.html#a6a54fe327205e10c2d16deba3364214d">PCKT_FLT_GOALS2_ADDR</a></div><div class="ttdeci">#define PCKT_FLT_GOALS2_ADDR</div><div class="ttdoc">PCKT_FLT_GOALS2 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00832">S2LP_Regs.h:832</a></div></div>
<div class="ttc" id="structPktStackInit_html_af5c67283156d52d8478733afd6b0f071"><div class="ttname"><a href="structPktStackInit.html#af5c67283156d52d8478733afd6b0f071">PktStackInit::cExtendedPktLenField</a></div><div class="ttdeci">SFunctionalState cExtendedPktLenField</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00123">S2LP_PktStack.h:123</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_gaaa6aebda4d949e411c6c8445bc99da5e"><div class="ttname"><a href="group__PktStack__Private__Functions.html#gaaa6aebda4d949e411c6c8445bc99da5e">S2LPPktStackGetAddressesInfo</a></div><div class="ttdeci">void S2LPPktStackGetAddressesInfo(PktStackAddressesInit *pxPktStackAddresses)</div><div class="ttdoc">Return the S2LP STack packet addresses structure according to the specified parameters in the registe...</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00262">S2LP_PktStack.c:262</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_ae49cf4626ed318fa60ef3e8dbda4aefb"><div class="ttname"><a href="S2LP__Regs_8h.html#ae49cf4626ed318fa60ef3e8dbda4aefb">PCKT_FLT_OPTIONS_ADDR</a></div><div class="ttdeci">#define PCKT_FLT_OPTIONS_ADDR</div><div class="ttdoc">PCKT_FLT_OPTIONS register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00788">S2LP_Regs.h:788</a></div></div>
<div class="ttc" id="MCU__Interface_8h_html"><div class="ttname"><a href="MCU__Interface_8h.html">MCU_Interface.h</a></div><div class="ttdoc">Header file for low level S2LP SPI driver.</div></div>
<div class="ttc" id="S2LP__Regs_8h_html_ac5e34fd8baf0e3afa8390ad85a768d06"><div class="ttname"><a href="S2LP__Regs_8h.html#ac5e34fd8baf0e3afa8390ad85a768d06">RX_PCKT_INFO_ADDR</a></div><div class="ttdeci">#define RX_PCKT_INFO_ADDR</div><div class="ttdoc">RX_PCKT_INFO register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01601">S2LP_Regs.h:1601</a></div></div>
<div class="ttc" id="structPktStackInit_html"><div class="ttname"><a href="structPktStackInit.html">PktStackInit</a></div><div class="ttdoc">S2LP STack Packet Init structure definition.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00118">S2LP_PktStack.h:118</a></div></div>
<div class="ttc" id="S2LP__PktStack_8h_html"><div class="ttname"><a href="S2LP__PktStack_8h.html">S2LP_PktStack.h</a></div><div class="ttdoc">Configuration and management of S2-LP STack packets.</div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_gaf00b8b11d940be9944962ea17d5810d7"><div class="ttname"><a href="group__PktStack__Private__Functions.html#gaf00b8b11d940be9944962ea17d5810d7">S2LPPktStackGetNReTx</a></div><div class="ttdeci">uint8_t S2LPPktStackGetNReTx(void)</div><div class="ttdoc">Returns the number of retransmission done on the transmitted packet.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00487">S2LP_PktStack.c:487</a></div></div>
<div class="ttc" id="group__PktStack__Private__Functions_html_gae882a1a7d8ac6964cf1fc0b722e957d3"><div class="ttname"><a href="group__PktStack__Private__Functions.html#gae882a1a7d8ac6964cf1fc0b722e957d3">S2LPPktStackGetInfo</a></div><div class="ttdeci">void S2LPPktStackGetInfo(PktStackInit *pxPktStackInit)</div><div class="ttdoc">Return the S2LP STack packet structure according to the specified parameters in the registers.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8c_source.html#l00166">S2LP_PktStack.c:166</a></div></div>
<div class="ttc" id="structPktStackInit_html_ae085d910f3886a49407d9414a6e40648"><div class="ttname"><a href="structPktStackInit.html#ae085d910f3886a49407d9414a6e40648">PktStackInit::xPreambleLength</a></div><div class="ttdeci">uint16_t xPreambleLength</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__PktStack_8h_source.html#l00119">S2LP_PktStack.h:119</a></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.15
</small></address>
</body>
</html>