-
Notifications
You must be signed in to change notification settings - Fork 13
/
CRC24Q_8h_source.html
169 lines (167 loc) · 18.2 KB
/
CRC24Q_8h_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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!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.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Paparazzi UAS: sw/airborne/modules/gps/librtcm3/CRC24Q.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.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="projectlogo"><img alt="Logo" src="penguin_icon.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Paparazzi UAS
 <span id="projectnumber">v6.1.0_stable</span>
</div>
<div id="projectbrief">Paparazzi is a free software Unmanned Aircraft System.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<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>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('CRC24Q_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="headertitle">
<div class="title">CRC24Q.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="CRC24Q_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"><a class="line" href="CRC24Q_8h.html#af382517e9b17cf274af241074fa9f7ff"> 1</a></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="CRC24Q_8h.html#af382517e9b17cf274af241074fa9f7ff">tbl_CRC24Q</a>[] = {</div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>  0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17,</div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>  0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E,</div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>  0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E,</div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>  0x64CFB0, 0xE2834B, 0xEE1ABD, 0x685646, 0xF72951, 0x7165AA, 0x7DFC5C, 0xFBB0A7,</div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>  0x0CD1E9, 0x8A9D12, 0x8604E4, 0x00481F, 0x9F3708, 0x197BF3, 0x15E205, 0x93AEFE,</div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>  0xAD50D0, 0x2B1C2B, 0x2785DD, 0xA1C926, 0x3EB631, 0xB8FACA, 0xB4633C, 0x322FC7,</div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>  0xC99F60, 0x4FD39B, 0x434A6D, 0xC50696, 0x5A7981, 0xDC357A, 0xD0AC8C, 0x56E077,</div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>  0x681E59, 0xEE52A2, 0xE2CB54, 0x6487AF, 0xFBF8B8, 0x7DB443, 0x712DB5, 0xF7614E,</div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>  0x19A3D2, 0x9FEF29, 0x9376DF, 0x153A24, 0x8A4533, 0x0C09C8, 0x00903E, 0x86DCC5,</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>  0xB822EB, 0x3E6E10, 0x32F7E6, 0xB4BB1D, 0x2BC40A, 0xAD88F1, 0xA11107, 0x275DFC,</div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>  0xDCED5B, 0x5AA1A0, 0x563856, 0xD074AD, 0x4F0BBA, 0xC94741, 0xC5DEB7, 0x43924C,</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  0x7D6C62, 0xFB2099, 0xF7B96F, 0x71F594, 0xEE8A83, 0x68C678, 0x645F8E, 0xE21375,</div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>  0x15723B, 0x933EC0, 0x9FA736, 0x19EBCD, 0x8694DA, 0x00D821, 0x0C41D7, 0x8A0D2C,</div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>  0xB4F302, 0x32BFF9, 0x3E260F, 0xB86AF4, 0x2715E3, 0xA15918, 0xADC0EE, 0x2B8C15,</div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  0xD03CB2, 0x567049, 0x5AE9BF, 0xDCA544, 0x43DA53, 0xC596A8, 0xC90F5E, 0x4F43A5,</div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  0x71BD8B, 0xF7F170, 0xFB6886, 0x7D247D, 0xE25B6A, 0x641791, 0x688E67, 0xEEC29C,</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  0x3347A4, 0xB50B5F, 0xB992A9, 0x3FDE52, 0xA0A145, 0x26EDBE, 0x2A7448, 0xAC38B3,</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  0x92C69D, 0x148A66, 0x181390, 0x9E5F6B, 0x01207C, 0x876C87, 0x8BF571, 0x0DB98A,</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  0xF6092D, 0x7045D6, 0x7CDC20, 0xFA90DB, 0x65EFCC, 0xE3A337, 0xEF3AC1, 0x69763A,</div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  0x578814, 0xD1C4EF, 0xDD5D19, 0x5B11E2, 0xC46EF5, 0x42220E, 0x4EBBF8, 0xC8F703,</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  0x3F964D, 0xB9DAB6, 0xB54340, 0x330FBB, 0xAC70AC, 0x2A3C57, 0x26A5A1, 0xA0E95A,</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  0x9E1774, 0x185B8F, 0x14C279, 0x928E82, 0x0DF195, 0x8BBD6E, 0x872498, 0x016863,</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  0xFAD8C4, 0x7C943F, 0x700DC9, 0xF64132, 0x693E25, 0xEF72DE, 0xE3EB28, 0x65A7D3,</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  0x5B59FD, 0xDD1506, 0xD18CF0, 0x57C00B, 0xC8BF1C, 0x4EF3E7, 0x426A11, 0xC426EA,</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  0x2AE476, 0xACA88D, 0xA0317B, 0x267D80, 0xB90297, 0x3F4E6C, 0x33D79A, 0xB59B61,</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  0x8B654F, 0x0D29B4, 0x01B042, 0x87FCB9, 0x1883AE, 0x9ECF55, 0x9256A3, 0x141A58,</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  0xEFAAFF, 0x69E604, 0x657FF2, 0xE33309, 0x7C4C1E, 0xFA00E5, 0xF69913, 0x70D5E8,</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  0x4E2BC6, 0xC8673D, 0xC4FECB, 0x42B230, 0xDDCD27, 0x5B81DC, 0x57182A, 0xD154D1,</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  0x26359F, 0xA07964, 0xACE092, 0x2AAC69, 0xB5D37E, 0x339F85, 0x3F0673, 0xB94A88,</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  0x87B4A6, 0x01F85D, 0x0D61AB, 0x8B2D50, 0x145247, 0x921EBC, 0x9E874A, 0x18CBB1,</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  0xE37B16, 0x6537ED, 0x69AE1B, 0xEFE2E0, 0x709DF7, 0xF6D10C, 0xFA48FA, 0x7C0401,</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> };</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">/* crc-24q parity --------------------------------------------------------------</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">* compute crc-24q parity for sbas, rtcm3</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">* args : unsigned char *buff I data</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">* int len I data length (bytes)</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">* return : crc-24Q parity</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">* notes : see reference [2] A.4.3.3 Parity</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">*-----------------------------------------------------------------------------*/</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">extern</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="CRC24Q_8h.html#a143f5fa72a5c2aa56901ad78710eb4c2">crc24q</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *<a class="code" href="high__speed__logger__direct__memory_8c.html#a8ec495ebdeeb9cb5d6a1df0d6e728b28">buff</a>, <span class="keywordtype">int</span> len);</div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="CRC24Q_8h.html#a143f5fa72a5c2aa56901ad78710eb4c2"> 44</a></span> <span class="keyword">extern</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="CRC24Q_8h.html#a143f5fa72a5c2aa56901ad78710eb4c2">crc24q</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *<a class="code" href="high__speed__logger__direct__memory_8c.html#a8ec495ebdeeb9cb5d6a1df0d6e728b28">buff</a>, <span class="keywordtype">int</span> len)</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> {</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="link__mcu__spi_8c.html#aa60093a9a5d5d17864cfda66c47733e3">crc</a> = 0;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordtype">int</span> i;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordflow">for</span> (i = 0; i < len; i++) { <a class="code" href="link__mcu__spi_8c.html#aa60093a9a5d5d17864cfda66c47733e3">crc</a> = ((<a class="code" href="link__mcu__spi_8c.html#aa60093a9a5d5d17864cfda66c47733e3">crc</a> << 8) & 0xFFFFFF)^<a class="code" href="CRC24Q_8h.html#af382517e9b17cf274af241074fa9f7ff">tbl_CRC24Q</a>[(<a class="code" href="link__mcu__spi_8c.html#aa60093a9a5d5d17864cfda66c47733e3">crc</a> >> 16)^<a class="code" href="high__speed__logger__direct__memory_8c.html#a8ec495ebdeeb9cb5d6a1df0d6e728b28">buff</a>[i]]; }</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordflow">return</span> <a class="code" href="link__mcu__spi_8c.html#aa60093a9a5d5d17864cfda66c47733e3">crc</a>;</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> }</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  </div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="preprocessor">#ifndef LIBRTCM3_RTCM3_H</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="CRC24Q_8h.html#a0852ca13d7774030a7df798732e2dcb4">RTCMgetbitu</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *<a class="code" href="high__speed__logger__direct__memory_8c.html#a8ec495ebdeeb9cb5d6a1df0d6e728b28">buff</a>, <span class="keywordtype">int</span> pos, <span class="keywordtype">int</span> lenb);</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="CRC24Q_8h.html#a0852ca13d7774030a7df798732e2dcb4"> 54</a></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="CRC24Q_8h.html#a0852ca13d7774030a7df798732e2dcb4">RTCMgetbitu</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *<a class="code" href="high__speed__logger__direct__memory_8c.html#a8ec495ebdeeb9cb5d6a1df0d6e728b28">buff</a>, <span class="keywordtype">int</span> pos, <span class="keywordtype">int</span> lenb)</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> {</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bits = 0;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordtype">int</span> i;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">for</span> (i = pos; i < pos + lenb; i++) { bits = (bits << 1) + ((<a class="code" href="high__speed__logger__direct__memory_8c.html#a8ec495ebdeeb9cb5d6a1df0d6e728b28">buff</a>[i / 8] >> (7 - i % 8)) & 1u); }</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">return</span> bits;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> }</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aCRC24Q_8h_html_a143f5fa72a5c2aa56901ad78710eb4c2"><div class="ttname"><a href="CRC24Q_8h.html#a143f5fa72a5c2aa56901ad78710eb4c2">crc24q</a></div><div class="ttdeci">unsigned int crc24q(const unsigned char *buff, int len)</div><div class="ttdef"><b>Definition:</b> <a href="CRC24Q_8h_source.html#l00044">CRC24Q.h:44</a></div></div>
<div class="ttc" id="aCRC24Q_8h_html_af382517e9b17cf274af241074fa9f7ff"><div class="ttname"><a href="CRC24Q_8h.html#af382517e9b17cf274af241074fa9f7ff">tbl_CRC24Q</a></div><div class="ttdeci">static const unsigned int tbl_CRC24Q[]</div><div class="ttdef"><b>Definition:</b> <a href="CRC24Q_8h_source.html#l00001">CRC24Q.h:1</a></div></div>
<div class="ttc" id="ahigh__speed__logger__direct__memory_8c_html_a8ec495ebdeeb9cb5d6a1df0d6e728b28"><div class="ttname"><a href="high__speed__logger__direct__memory_8c.html#a8ec495ebdeeb9cb5d6a1df0d6e728b28">buff</a></div><div class="ttdeci">uint8_t buff[25]</div><div class="ttdoc">Buffer used for general comunication over SPI (in buffer)</div><div class="ttdef"><b>Definition:</b> <a href="high__speed__logger__direct__memory_8c_source.html#l00130">high_speed_logger_direct_memory.c:130</a></div></div>
<div class="ttc" id="alink__mcu__spi_8c_html_aa60093a9a5d5d17864cfda66c47733e3"><div class="ttname"><a href="link__mcu__spi_8c.html#aa60093a9a5d5d17864cfda66c47733e3">crc</a></div><div class="ttdeci">static uint16_t crc</div><div class="ttdef"><b>Definition:</b> <a href="link__mcu__spi_8c_source.html#l00036">link_mcu_spi.c:36</a></div></div>
<div class="ttc" id="aCRC24Q_8h_html_a0852ca13d7774030a7df798732e2dcb4"><div class="ttname"><a href="CRC24Q_8h.html#a0852ca13d7774030a7df798732e2dcb4">RTCMgetbitu</a></div><div class="ttdeci">unsigned int RTCMgetbitu(unsigned char *buff, int pos, int lenb)</div><div class="ttdef"><b>Definition:</b> <a href="CRC24Q_8h_source.html#l00054">CRC24Q.h:54</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_01fcd3835fb4e7d9331b722d86291b65.html">sw</a></li><li class="navelem"><a class="el" href="dir_5e9153041680afc3c016fd52fa730b56.html">airborne</a></li><li class="navelem"><a class="el" href="dir_c2abcdd6ccb39c3582929c0e3f5651c2.html">modules</a></li><li class="navelem"><a class="el" href="dir_5e5c455c6cc9b4955752fc2ddd0b9fff.html">gps</a></li><li class="navelem"><a class="el" href="dir_96eaec2f1e522125fb961595a8f98941.html">librtcm3</a></li><li class="navelem"><a class="el" href="CRC24Q_8h.html">CRC24Q.h</a></li>
<li class="footer">Generated on Tue Feb 1 2022 13:08:45 for Paparazzi UAS by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>
</html>