-
Notifications
You must be signed in to change notification settings - Fork 0
/
S2LP__General_8c_source.html
94 lines (92 loc) · 18.8 KB
/
S2LP__General_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
<!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_General.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_General.c</div> </div>
</div><!--header-->
<div class="contents">
<a href="S2LP__General_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="l00023"></a><span class="lineno"> 23</span> <span class="comment">/* Includes ------------------------------------------------------------------*/</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "<a class="code" href="S2LP__General_8h.html">S2LP_General.h</a>"</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="MCU__Interface_8h.html">MCU_Interface.h</a>"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor">#define IS_MODE_EXT(MODE) (MODE == MODE_EXT_XO || \</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor"> MODE == MODE_EXT_XIN)</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="group__General__Private__Functions.html#ga245cbb2cc49e19dc472fc7a0d564fc8a"> 104</a></span> <span class="keywordtype">void</span> <a class="code" href="group__General__Private__Functions.html#ga245cbb2cc49e19dc472fc7a0d564fc8a">S2LPGeneralSetExtRef</a>(<a class="code" href="group__General__Exported__Types.html#ga87e2720bb24c37b4fe6bd2d79c7938a8">ModeExtRef</a> xExtMode)</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> {</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  uint8_t tmp;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  s_assert_param(IS_MODE_EXT(xExtMode));</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#addfd522aae24916f540e4dfd4a0f8d69">XO_RCO_CONF0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">if</span>(xExtMode == MODE_EXT_XO) {</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  tmp &= ~EXT_REF_REGMASK;</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">else</span> {</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  tmp |= EXT_REF_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>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#addfd522aae24916f540e4dfd4a0f8d69">XO_RCO_CONF0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </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> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="group__General__Private__Functions.html#ga526b1ae6aa37ac03bc07084f54307c3b"> 127</a></span> <a class="code" href="group__General__Exported__Types.html#ga87e2720bb24c37b4fe6bd2d79c7938a8">ModeExtRef</a> <a class="code" href="group__General__Private__Functions.html#ga526b1ae6aa37ac03bc07084f54307c3b">S2LPGeneralGetExtRef</a>(<span class="keywordtype">void</span>)</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>  uint8_t tmp;</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#addfd522aae24916f540e4dfd4a0f8d69">XO_RCO_CONF0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="keywordflow">return</span> (<a class="code" href="group__General__Exported__Types.html#ga87e2720bb24c37b4fe6bd2d79c7938a8">ModeExtRef</a>)(tmp & EXT_REF_REGMASK);</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="l00134"></a><span class="lineno"> 134</span> </div><div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="group__General__Private__Functions.html#gac7408aa8266fe08434d6cc3ee9d4117f"> 140</a></span> uint8_t <a class="code" href="group__General__Private__Functions.html#gac7408aa8266fe08434d6cc3ee9d4117f">S2LPGeneralGetDevicePN</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> {</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  uint8_t tmp;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a63a46eb0d4c4e08415c5cadcea52d904">DEVICE_INFO1_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordflow">return</span> tmp;</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> </div><div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="group__General__Private__Functions.html#ga7d6abf0334fb84855104154b286e6cb0"> 152</a></span> uint8_t <a class="code" href="group__General__Private__Functions.html#ga7d6abf0334fb84855104154b286e6cb0">S2LPGeneralGetVersion</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span> {</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  uint8_t tmp;</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#a6873f4ed812d48d63733ecf407bebea5">DEVICE_INFO0_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">return</span> tmp;</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__General__Private__Functions.html#ga0a0ff393b87490ace18b7f8f88250d22"> 166</a></span> <span class="keywordtype">void</span> <a class="code" href="group__General__Private__Functions.html#ga0a0ff393b87490ace18b7f8f88250d22">S2LPRadioSetExternalSmpsMode</a>(<a class="code" href="group__Types__Exported__Types.html#gaf4cbf41d3c8f611d12adae5d2c29c3c2">SFunctionalState</a> xNewState)</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 tmp;</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  s_assert_param(IS_SFUNCTIONAL_STATE(xNewState));</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>  S2LPSpiReadRegisters(<a class="code" href="S2LP__Regs_8h.html#abee5cabb213b04f65f3ecdd79ae59481">PM_CONF4_ADDR</a>, 1, &tmp);</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>  <span class="keywordflow">if</span>(xNewState == S_ENABLE) {</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  tmp |= EXT_SMPS_REGMASK;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  tmp &= ~EXT_SMPS_REGMASK;</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>  <a class="code" href="group__Types__Exported__Variables.html#gab5ab2dc69a49b1d46acd243849558706">g_xStatus</a> = S2LPSpiWriteRegisters(<a class="code" href="S2LP__Regs_8h.html#abee5cabb213b04f65f3ecdd79ae59481">PM_CONF4_ADDR</a>, 1, &tmp);</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> }</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> </div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span> <span class="comment">/******************* (C) COPYRIGHT 2016 STMicroelectronics *****END OF FILE****/</span></div><div class="ttc" id="group__General__Exported__Types_html_ga87e2720bb24c37b4fe6bd2d79c7938a8"><div class="ttname"><a href="group__General__Exported__Types.html#ga87e2720bb24c37b4fe6bd2d79c7938a8">ModeExtRef</a></div><div class="ttdeci">ModeExtRef</div><div class="ttdoc">S2LP version type enumeration.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__General_8h_source.html#l00062">S2LP_General.h:62</a></div></div>
<div class="ttc" id="S2LP__General_8h_html"><div class="ttname"><a href="S2LP__General_8h.html">S2LP_General.h</a></div><div class="ttdoc">Configuration and management of S2-LP General functionalities.</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__General__Private__Functions_html_ga0a0ff393b87490ace18b7f8f88250d22"><div class="ttname"><a href="group__General__Private__Functions.html#ga0a0ff393b87490ace18b7f8f88250d22">S2LPRadioSetExternalSmpsMode</a></div><div class="ttdeci">void S2LPRadioSetExternalSmpsMode(SFunctionalState xNewState)</div><div class="ttdoc">Disable or enable the internal SMPS.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__General_8c_source.html#l00166">S2LP_General.c:166</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_abee5cabb213b04f65f3ecdd79ae59481"><div class="ttname"><a href="S2LP__Regs_8h.html#abee5cabb213b04f65f3ecdd79ae59481">PM_CONF4_ADDR</a></div><div class="ttdeci">#define PM_CONF4_ADDR</div><div class="ttdoc">PM_CONF4 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01380">S2LP_Regs.h:1380</a></div></div>
<div class="ttc" id="group__General__Private__Functions_html_ga526b1ae6aa37ac03bc07084f54307c3b"><div class="ttname"><a href="group__General__Private__Functions.html#ga526b1ae6aa37ac03bc07084f54307c3b">S2LPGeneralGetExtRef</a></div><div class="ttdeci">ModeExtRef S2LPGeneralGetExtRef(void)</div><div class="ttdoc">Return External Reference.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__General_8c_source.html#l00127">S2LP_General.c:127</a></div></div>
<div class="ttc" id="group__General__Private__Functions_html_ga245cbb2cc49e19dc472fc7a0d564fc8a"><div class="ttname"><a href="group__General__Private__Functions.html#ga245cbb2cc49e19dc472fc7a0d564fc8a">S2LPGeneralSetExtRef</a></div><div class="ttdeci">void S2LPGeneralSetExtRef(ModeExtRef xExtMode)</div><div class="ttdoc">Set External Reference.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__General_8c_source.html#l00104">S2LP_General.c:104</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_a63a46eb0d4c4e08415c5cadcea52d904"><div class="ttname"><a href="S2LP__Regs_8h.html#a63a46eb0d4c4e08415c5cadcea52d904">DEVICE_INFO1_ADDR</a></div><div class="ttdeci">#define DEVICE_INFO1_ADDR</div><div class="ttdoc">DEVICE_INFO1 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01786">S2LP_Regs.h:1786</a></div></div>
<div class="ttc" id="group__General__Private__Functions_html_ga7d6abf0334fb84855104154b286e6cb0"><div class="ttname"><a href="group__General__Private__Functions.html#ga7d6abf0334fb84855104154b286e6cb0">S2LPGeneralGetVersion</a></div><div class="ttdeci">uint8_t S2LPGeneralGetVersion(void)</div><div class="ttdoc">Return S2LP version.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__General_8c_source.html#l00152">S2LP_General.c:152</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__General__Private__Functions_html_gac7408aa8266fe08434d6cc3ee9d4117f"><div class="ttname"><a href="group__General__Private__Functions.html#gac7408aa8266fe08434d6cc3ee9d4117f">S2LPGeneralGetDevicePN</a></div><div class="ttdeci">uint8_t S2LPGeneralGetDevicePN(void)</div><div class="ttdoc">Return device part number.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__General_8c_source.html#l00140">S2LP_General.c:140</a></div></div>
<div class="ttc" id="S2LP__Regs_8h_html_addfd522aae24916f540e4dfd4a0f8d69"><div class="ttname"><a href="S2LP__Regs_8h.html#addfd522aae24916f540e4dfd4a0f8d69">XO_RCO_CONF0_ADDR</a></div><div class="ttdeci">#define XO_RCO_CONF0_ADDR</div><div class="ttdoc">XO_RCO_CONF0 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01325">S2LP_Regs.h:1325</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_a6873f4ed812d48d63733ecf407bebea5"><div class="ttname"><a href="S2LP__Regs_8h.html#a6873f4ed812d48d63733ecf407bebea5">DEVICE_INFO0_ADDR</a></div><div class="ttdeci">#define DEVICE_INFO0_ADDR</div><div class="ttdoc">DEVICE_INFO0 register.</div><div class="ttdef"><b>Definition:</b> <a href="S2LP__Regs_8h_source.html#l01799">S2LP_Regs.h:1799</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>