-
Notifications
You must be signed in to change notification settings - Fork 0
/
S2LP__Qi_8c_source.html
106 lines (104 loc) · 34.2 KB
/
S2LP__Qi_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
<!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_Qi.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_Qi.c</div> </div>
</div><!--header-->
<div class="contents">
<a href="S2LP__Qi_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__Qi_8h.html">S2LP_Qi.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> </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="l00067"></a><span class="lineno"> 67</span> <span class="preprocessor">#define IS_RSSI_MODE(MODE) (MODE<=3)</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor">#define IS_RSSI_DBM(VAL) ((VAL>=-146) && (VAL<=-2))</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="preprocessor">#define IS_RSSI_FLT(VAL) (VAL<=15)</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="preprocessor">#define IS_PQI_LVL_CHECK(VAL) (VAL<=15)</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="preprocessor">#define S2LPRadioRegToRssidBm(VAL) (VAL - 146)</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor">#define S2LPRadioRssidBmToReg(VAL) (uint8_t)(VAL+146)</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="group__Qi__Private__Functions.html#gaa6d912f05fc08e174a4247c493ef452b"> 109</a></span> int32_t <a class="code" href="group__Qi__Private__Functions.html#gaa6d912f05fc08e174a4247c493ef452b">S2LPRadioGetRssidBm</a>(<span class="keywordtype">void</span>)</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>  uint8_t tmp;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a063ea3f4d3a5c9e95e88826e8e150057">RSSI_LEVEL_ADDR</a>, 1, &tmp); </div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">return</span> S2LPRadioRegToRssidBm((int32_t)tmp);</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> }</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="group__Qi__Private__Functions.html#ga8cbb71ca146e70bcb0251adc225cfa11"> 121</a></span> int32_t <a class="code" href="group__Qi__Private__Functions.html#ga8cbb71ca146e70bcb0251adc225cfa11">S2LPRadioGetRssidBmRun</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> {</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  uint8_t tmpBuffer[2];</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  </div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="comment">/*The first value is the previous one, so the first read operation clear this value, </span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment"> than it is read the actual during RX. */</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a15bc285c31f5e1cfdba372b542971695">RSSI_LEVEL_RUN_ADDR</a>, 2, tmpBuffer); </div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  </div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordflow">return</span> S2LPRadioRegToRssidBm((int32_t)tmpBuffer[1]);</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> </div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> </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="group__Qi__Private__Functions.html#ga6b40acf0de02405d6bb0fc4dbc60a32d"> 139</a></span> <span class="keywordtype">void</span> <a class="code" href="group__Qi__Private__Functions.html#ga6b40acf0de02405d6bb0fc4dbc60a32d">S2LPRadioSetRssiThreshdBm</a>(int32_t wRssiThrehsold)</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> {</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  uint8_t tmp;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  s_assert_param(IS_RSSI_DBM(wRssiThrehsold));</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>  tmp = S2LPRadioRssidBmToReg(wRssiThrehsold);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a4fba052a617be99edec66f798bb4c63c">RSSI_TH_ADDR</a>, 1, &tmp); </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> }</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> </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="group__Qi__Private__Functions.html#ga7be7305e2a2935930fca9ae1165ba0e7"> 155</a></span> <span class="keywordtype">void</span> <a class="code" href="group__Qi__Private__Functions.html#ga7be7305e2a2935930fca9ae1165ba0e7">S2LPRadioRssiInit</a>(<a class="code" href="structSRssiInit.html">SRssiInit</a>* xSRssiInit)</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  uint8_t tmpBuffer[2];</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>  s_assert_param(IS_RSSI_MODE(xSRssiInit-><a class="code" href="structSRssiInit.html#a1904b4b9f13249d617d008e3686d1e92">xRssiMode</a>));</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  s_assert_param(IS_RSSI_DBM(xSRssiInit-><a class="code" href="structSRssiInit.html#a0d8751902aeaed6da80e6dd7243bd24a">cRssiThreshdBm</a>));</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  s_assert_param(IS_RSSI_FLT(xSRssiInit-><a class="code" href="structSRssiInit.html#a1bff565831a200c306760bc40b65a137">cRssiFlt</a>));</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">/* Reads the PCKT_FLT_OPTIONS rrgister */</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a091995be2324d7dab365e4cebdd34fb4">RSSI_FLT_ADDR</a>, 1, &tmpBuffer[0]);</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  </div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="comment">/* Enables or disables filtering on my address */</span></div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  tmpBuffer[0] &= ~(RSSI_FLT_REGMASK | CS_MODE_REGMASK);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  tmpBuffer[0] |= (xSRssiInit-><a class="code" href="structSRssiInit.html#a1bff565831a200c306760bc40b65a137">cRssiFlt</a><<4);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  tmpBuffer[0] |= (xSRssiInit-><a class="code" href="structSRssiInit.html#a1904b4b9f13249d617d008e3686d1e92">xRssiMode</a><<2);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  </div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  tmpBuffer[1] = S2LPRadioRssidBmToReg(xSRssiInit-><a class="code" href="structSRssiInit.html#a0d8751902aeaed6da80e6dd7243bd24a">cRssiThreshdBm</a>);</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  </div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a091995be2324d7dab365e4cebdd34fb4">RSSI_FLT_ADDR</a>, 2, tmpBuffer);</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> </div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> </div><div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="group__Qi__Private__Functions.html#ga3513597e5baa6472e714f5167f7bc02d"> 183</a></span> <span class="keywordtype">void</span> <a class="code" href="group__Qi__Private__Functions.html#ga3513597e5baa6472e714f5167f7bc02d">S2LPRadioGetRssiInfo</a>(<a class="code" href="structSRssiInit.html">SRssiInit</a>* xSRssiInit)</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span> {</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  uint8_t tmpBuffer[2];</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>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a091995be2324d7dab365e4cebdd34fb4">RSSI_FLT_ADDR</a>, 2, tmpBuffer);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  </div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  xSRssiInit-><a class="code" href="structSRssiInit.html#a1904b4b9f13249d617d008e3686d1e92">xRssiMode</a> = (<a class="code" href="group__Qi__Exported__Types.html#ga83fd1be7372e5799e902635e1cc84179">SRssiMode</a>)((tmpBuffer[0]&CS_MODE_REGMASK)>>2);</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  xSRssiInit-><a class="code" href="structSRssiInit.html#a1bff565831a200c306760bc40b65a137">cRssiFlt</a> = (tmpBuffer[0]&RSSI_FLT_REGMASK)>>4;</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  xSRssiInit-><a class="code" href="structSRssiInit.html#a0d8751902aeaed6da80e6dd7243bd24a">cRssiThreshdBm</a> = S2LPRadioRegToRssidBm(tmpBuffer[1]);</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> }</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> </div><div class="line"><a name="l00201"></a><span class="lineno"><a class="line" href="group__Qi__Private__Functions.html#ga9546e33b44da1a78d81f585ab57ed133"> 201</a></span> <span class="keywordtype">void</span> <a class="code" href="group__Qi__Private__Functions.html#ga9546e33b44da1a78d81f585ab57ed133">S2LPRadioCsBlanking</a>(<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a> xCsBlank)</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>  uint8_t tmp;</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  </div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  s_assert_param(IS_SFUNCTIONAL_STATE(xCsBlank));</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  </div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#ae77ec9d377a4c840efd71d4557fb7020">ANT_SELECT_CONF_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  </div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">if</span>(xCsBlank == S_ENABLE) {</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  tmp |= CS_BLANKING_REGMASK;</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  tmp &= ~CS_BLANKING_REGMASK;</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  }</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#ae77ec9d377a4c840efd71d4557fb7020">ANT_SELECT_CONF_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  </div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span> }</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> </div><div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="group__Qi__Private__Functions.html#ga7dc7e45a4d8225cdcc161900c5868a4d"> 224</a></span> <span class="keywordtype">void</span> <a class="code" href="group__Qi__Private__Functions.html#ga7dc7e45a4d8225cdcc161900c5868a4d">S2LPRadioAntennaSwitching</a>(<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a> xAntennaSwitch)</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> {</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  uint8_t tmp;</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>  s_assert_param(IS_SFUNCTIONAL_STATE(xAntennaSwitch));</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  </div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#ae77ec9d377a4c840efd71d4557fb7020">ANT_SELECT_CONF_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  </div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">if</span>(xAntennaSwitch == S_ENABLE) {</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  tmp |= AS_ENABLE_REGMASK;</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  tmp &= ~AS_ENABLE_REGMASK;</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>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#ae77ec9d377a4c840efd71d4557fb7020">ANT_SELECT_CONF_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  </div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span> }</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> </div><div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="group__Qi__Private__Functions.html#ga63cc4b0a5c59774269596114fe3f7454"> 247</a></span> <span class="keywordtype">void</span> <a class="code" href="group__Qi__Private__Functions.html#ga63cc4b0a5c59774269596114fe3f7454">S2LPRadioSetPqiCheck</a>(uint8_t cPqiLevel)</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span> {</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  uint8_t tmp;</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  s_assert_param(IS_PQI_LVL_CHECK(cPqiLevel));</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span> </div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a5447b3f74b4c49d9ad2a7e2e673fd019">QI_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  tmp &= ~PQI_TH_REGMASK;</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  tmp |= (((uint8_t)cPqiLevel)<<1);</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#a5447b3f74b4c49d9ad2a7e2e673fd019">QI_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  </div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span> }</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> </div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span> </div><div class="line"><a name="l00265"></a><span class="lineno"><a class="line" href="group__Qi__Private__Functions.html#gab9bafd024580a2594170fabb94c283ed"> 265</a></span> <a class="code" href="group__Types__Exported__Types.html#gad62879632ee8b65fd9116ac8006e9767">SFlagStatus</a> <a class="code" href="group__Qi__Private__Functions.html#gab9bafd024580a2594170fabb94c283ed">S2LPQiGetCs</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span> {</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  uint8_t tmp;</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span> </div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a582400ec5b6e9f2701ba92af0a807860">LINK_QUALIF1_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  tmp = (tmp&CS_REGMASK)>>7;</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</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="l00272"></a><span class="lineno"> 272</span> }</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span> </div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span> </div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span> </div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span> <span class="comment">/******************* (C) COPYRIGHT 2016 STMicroelectronics *****END OF FILE****/</span></div><div class="ttc" id="group__Qi__Private__Functions_html_ga6b40acf0de02405d6bb0fc4dbc60a32d"><div class="ttname"><a href="group__Qi__Private__Functions.html#ga6b40acf0de02405d6bb0fc4dbc60a32d">S2LPRadioSetRssiThreshdBm</a></div><div class="ttdeci">void S2LPRadioSetRssiThreshdBm(int32_t wRssiThrehsold)</div><div class="ttdoc">Set the RSSI threshold in dBm.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00139">S2LP_Qi.c:139</a></div></div>
<div class="ttc" id="structSRssiInit_html"><div class="ttname"><a href="structSRssiInit.html">SRssiInit</a></div><div class="ttdoc">S2LP RSSI Init structure definition.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8h_source.html#l00096">S2LP_Qi.h:96</a></div></div>
<div class="ttc" id="group__Qi__Private__Functions_html_ga7dc7e45a4d8225cdcc161900c5868a4d"><div class="ttname"><a href="group__Qi__Private__Functions.html#ga7dc7e45a4d8225cdcc161900c5868a4d">S2LPRadioAntennaSwitching</a></div><div class="ttdeci">void S2LPRadioAntennaSwitching(SFunctionalState xAntennaSwitch)</div><div class="ttdoc">Enable or Disable the antenna switching.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00224">S2LP_Qi.c:224</a></div></div>
<div class="ttc" id="group__Qi__Private__Functions_html_gab9bafd024580a2594170fabb94c283ed"><div class="ttname"><a href="group__Qi__Private__Functions.html#gab9bafd024580a2594170fabb94c283ed">S2LPQiGetCs</a></div><div class="ttdeci">SFlagStatus S2LPQiGetCs(void)</div><div class="ttdoc">Return the CS (carrier sense) indication.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00265">S2LP_Qi.c:265</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__Qi__Private__Functions_html_ga63cc4b0a5c59774269596114fe3f7454"><div class="ttname"><a href="group__Qi__Private__Functions.html#ga63cc4b0a5c59774269596114fe3f7454">S2LPRadioSetPqiCheck</a></div><div class="ttdeci">void S2LPRadioSetPqiCheck(uint8_t cPqiLevel)</div><div class="ttdoc">Set the PQI check.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00247">S2LP_Qi.c:247</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a091995be2324d7dab365e4cebdd34fb4"><div class="ttname"><a href="S2LP__Regs_8h.html#a091995be2324d7dab365e4cebdd34fb4">RSSI_FLT_ADDR</a></div><div class="ttdeci">#define RSSI_FLT_ADDR</div><div class="ttdoc">RSSI_FLT register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00355">S2LP_Regs.h:355</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a063ea3f4d3a5c9e95e88826e8e150057"><div class="ttname"><a href="S2LP__Regs_8h.html#a063ea3f4d3a5c9e95e88826e8e150057">RSSI_LEVEL_ADDR</a></div><div class="ttdeci">#define RSSI_LEVEL_ADDR</div><div class="ttdoc">RSSI_LEVEL register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01656">S2LP_Regs.h:1656</a></div></div>
<div class="ttc" id="structSRssiInit_html_a1bff565831a200c306760bc40b65a137"><div class="ttname"><a href="structSRssiInit.html#a1bff565831a200c306760bc40b65a137">SRssiInit::cRssiFlt</a></div><div class="ttdeci">uint8_t cRssiFlt</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8h_source.html#l00097">S2LP_Qi.h:97</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="S2LP__Qi_8h_html"><div class="ttname"><a href="S2LP__Qi_8h.html">S2LP_Qi.h</a></div><div class="ttdoc">Configuration and management of S2LP QI.</div></div>
<div class="ttc" id="group__Qi__Private__Functions_html_ga8cbb71ca146e70bcb0251adc225cfa11"><div class="ttname"><a href="group__Qi__Private__Functions.html#ga8cbb71ca146e70bcb0251adc225cfa11">S2LPRadioGetRssidBmRun</a></div><div class="ttdeci">int32_t S2LPRadioGetRssidBmRun(void)</div><div class="ttdoc">Returns the RSSI value from a current RX mode.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00121">S2LP_Qi.c:121</a></div></div>
<div class="ttc" id="group__Qi__Private__Functions_html_ga3513597e5baa6472e714f5167f7bc02d"><div class="ttname"><a href="group__Qi__Private__Functions.html#ga3513597e5baa6472e714f5167f7bc02d">S2LPRadioGetRssiInfo</a></div><div class="ttdeci">void S2LPRadioGetRssiInfo(SRssiInit *xSRssiInit)</div><div class="ttdoc">Return the RSSI measurements information to be filled with the information.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00183">S2LP_Qi.c:183</a></div></div>
<div class="ttc" id="group__Qi__Private__Functions_html_ga7be7305e2a2935930fca9ae1165ba0e7"><div class="ttname"><a href="group__Qi__Private__Functions.html#ga7be7305e2a2935930fca9ae1165ba0e7">S2LPRadioRssiInit</a></div><div class="ttdeci">void S2LPRadioRssiInit(SRssiInit *xSRssiInit)</div><div class="ttdoc">Initialize the RSSI measurement.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00155">S2LP_Qi.c:155</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a5447b3f74b4c49d9ad2a7e2e673fd019"><div class="ttname"><a href="S2LP__Regs_8h.html#a5447b3f74b4c49d9ad2a7e2e673fd019">QI_ADDR</a></div><div class="ttdeci">#define QI_ADDR</div><div class="ttdoc">QI register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00627">S2LP_Regs.h:627</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="group__Qi__Exported__Types_html_ga83fd1be7372e5799e902635e1cc84179"><div class="ttname"><a href="group__Qi__Exported__Types.html#ga83fd1be7372e5799e902635e1cc84179">SRssiMode</a></div><div class="ttdeci">SRssiMode</div><div class="ttdoc">S2LP RSSI mode enumeration.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8h_source.html#l00085">S2LP_Qi.h:85</a></div></div>
<div class="ttc" id="group__Qi__Private__Functions_html_ga9546e33b44da1a78d81f585ab57ed133"><div class="ttname"><a href="group__Qi__Private__Functions.html#ga9546e33b44da1a78d81f585ab57ed133">S2LPRadioCsBlanking</a></div><div class="ttdeci">void S2LPRadioCsBlanking(SFunctionalState xCsBlank)</div><div class="ttdoc">Enable or disables the CS blanking.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00201">S2LP_Qi.c:201</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_ae77ec9d377a4c840efd71d4557fb7020"><div class="ttname"><a href="S2LP__Regs_8h.html#ae77ec9d377a4c840efd71d4557fb7020">ANT_SELECT_CONF_ADDR</a></div><div class="ttdeci">#define ANT_SELECT_CONF_ADDR</div><div class="ttdoc">ANT_SELECT_CONF register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00386">S2LP_Regs.h:386</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a4fba052a617be99edec66f798bb4c63c"><div class="ttname"><a href="S2LP__Regs_8h.html#a4fba052a617be99edec66f798bb4c63c">RSSI_TH_ADDR</a></div><div class="ttdeci">#define RSSI_TH_ADDR</div><div class="ttdoc">RSSI_TH register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l00369">S2LP_Regs.h:369</a></div></div>
<div class="ttc" id="structSRssiInit_html_a0d8751902aeaed6da80e6dd7243bd24a"><div class="ttname"><a href="structSRssiInit.html#a0d8751902aeaed6da80e6dd7243bd24a">SRssiInit::cRssiThreshdBm</a></div><div class="ttdeci">int32_t cRssiThreshdBm</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8h_source.html#l00099">S2LP_Qi.h:99</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_a582400ec5b6e9f2701ba92af0a807860"><div class="ttname"><a href="S2LP__Regs_8h.html#a582400ec5b6e9f2701ba92af0a807860">LINK_QUALIF1_ADDR</a></div><div class="ttdeci">#define LINK_QUALIF1_ADDR</div><div class="ttdoc">LINK_QUALIF1 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01642">S2LP_Regs.h:1642</a></div></div>
<div class="ttc" id="group__Qi__Private__Functions_html_gaa6d912f05fc08e174a4247c493ef452b"><div class="ttname"><a href="group__Qi__Private__Functions.html#gaa6d912f05fc08e174a4247c493ef452b">S2LPRadioGetRssidBm</a></div><div class="ttdeci">int32_t S2LPRadioGetRssidBm(void)</div><div class="ttdoc">Returns the RSSI value.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8c_source.html#l00109">S2LP_Qi.c:109</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a15bc285c31f5e1cfdba372b542971695"><div class="ttname"><a href="S2LP__Regs_8h.html#a15bc285c31f5e1cfdba372b542971695">RSSI_LEVEL_RUN_ADDR</a></div><div class="ttdeci">#define RSSI_LEVEL_RUN_ADDR</div><div class="ttdoc">RSSI_LEVEL_RUN register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01773">S2LP_Regs.h:1773</a></div></div>
<div class="ttc" id="structSRssiInit_html_a1904b4b9f13249d617d008e3686d1e92"><div class="ttname"><a href="structSRssiInit.html#a1904b4b9f13249d617d008e3686d1e92">SRssiInit::xRssiMode</a></div><div class="ttdeci">SRssiMode xRssiMode</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Qi_8h_source.html#l00098">S2LP_Qi.h:98</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>