forked from ZhuYanzhen1/miniFOC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem_8h.html
343 lines (306 loc) · 16.5 KB
/
system_8h.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
<!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=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>miniFOC: system/system.h File Reference</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="projectlogo"><img alt="Logo" src="Acme_LOGO.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">miniFOC<span id="projectnumber"> 1.0.2</span>
</div>
<div id="projectbrief">This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(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_262ef3e34820216e073ea116856421e0.html">system</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">system.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>system basic function header file
<a href="#details">More...</a></p>
<p><a href="system_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a35f0081c3632bdd1851b3b0180812224"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="system_8h.html#a35f0081c3632bdd1851b3b0180812224">systick_config</a> (void)</td></tr>
<tr class="memdesc:a35f0081c3632bdd1851b3b0180812224"><td class="mdescLeft"> </td><td class="mdescRight">initialize systick timer to implementation delay function <a href="system_8h.html#a35f0081c3632bdd1851b3b0180812224">More...</a><br /></td></tr>
<tr class="separator:a35f0081c3632bdd1851b3b0180812224"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a837b6e9a8c812f0964f71e37ac853bff"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="system_8h.html#a837b6e9a8c812f0964f71e37ac853bff">delayms</a> (unsigned long count)</td></tr>
<tr class="memdesc:a837b6e9a8c812f0964f71e37ac853bff"><td class="mdescLeft"> </td><td class="mdescRight">millisecond delay function, any time time. <a href="system_8h.html#a837b6e9a8c812f0964f71e37ac853bff">More...</a><br /></td></tr>
<tr class="separator:a837b6e9a8c812f0964f71e37ac853bff"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a713199ab95f480628d6658708ed8de8b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="system_8h.html#a713199ab95f480628d6658708ed8de8b">delay_decrement</a> (void)</td></tr>
<tr class="memdesc:a713199ab95f480628d6658708ed8de8b"><td class="mdescLeft"> </td><td class="mdescRight">delay counter decrement function, called by systick handler <a href="system_8h.html#a713199ab95f480628d6658708ed8de8b">More...</a><br /></td></tr>
<tr class="separator:a713199ab95f480628d6658708ed8de8b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7e7cece1b30ef67968b244698f999b0e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="system_8h.html#a7e7cece1b30ef67968b244698f999b0e">user_memset</a> (void *buf, unsigned char data, unsigned char num)</td></tr>
<tr class="memdesc:a7e7cece1b30ef67968b244698f999b0e"><td class="mdescLeft"> </td><td class="mdescRight">format buffer array to fixed value, replace memset function <a href="system_8h.html#a7e7cece1b30ef67968b244698f999b0e">More...</a><br /></td></tr>
<tr class="separator:a7e7cece1b30ef67968b244698f999b0e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7bee5a9ca4038926b7fd4c38976d1481"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="system_8h.html#a7bee5a9ca4038926b7fd4c38976d1481">float_to_int32</a> (float data0)</td></tr>
<tr class="memdesc:a7bee5a9ca4038926b7fd4c38976d1481"><td class="mdescLeft"> </td><td class="mdescRight">convert floating point numbers to int32 type data <a href="system_8h.html#a7bee5a9ca4038926b7fd4c38976d1481">More...</a><br /></td></tr>
<tr class="separator:a7bee5a9ca4038926b7fd4c38976d1481"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ade748eddd7c60c3bf4c67bce9c463545"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="system_8h.html#ade748eddd7c60c3bf4c67bce9c463545">int32_to_float</a> (unsigned int data0)</td></tr>
<tr class="memdesc:ade748eddd7c60c3bf4c67bce9c463545"><td class="mdescLeft"> </td><td class="mdescRight">convert int32 to floating point numbers type data <a href="system_8h.html#ade748eddd7c60c3bf4c67bce9c463545">More...</a><br /></td></tr>
<tr class="separator:ade748eddd7c60c3bf4c67bce9c463545"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >system basic function header file </p>
<dl class="section author"><dt>Author</dt><dd>Lao·Zhu </dd></dl>
<dl class="section version"><dt>Version</dt><dd>V1.0.1 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>9. October 2021 </dd></dl>
<p class="definition">Definition in file <a class="el" href="system_8h_source.html">system.h</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a713199ab95f480628d6658708ed8de8b" name="a713199ab95f480628d6658708ed8de8b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a713199ab95f480628d6658708ed8de8b">◆ </a></span>delay_decrement()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void delay_decrement </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>delay counter decrement function, called by systick handler </p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="system_8c_source.html#l00042">42</a> of file <a class="el" href="system_8c_source.html">system.c</a>.</p>
<p class="reference">References <a class="el" href="system_8c_source.html#l00016">delayms_counter</a>.</p>
<p class="reference">Referenced by <a class="el" href="gd32f1x0__it_8c_source.html#l00086">SysTick_Handler()</a>.</p>
</div>
</div>
<a id="a837b6e9a8c812f0964f71e37ac853bff" name="a837b6e9a8c812f0964f71e37ac853bff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a837b6e9a8c812f0964f71e37ac853bff">◆ </a></span>delayms()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void delayms </td>
<td>(</td>
<td class="paramtype">unsigned long </td>
<td class="paramname"><em>count</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>millisecond delay function, any time time. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">count</td><td>time to delay (in milliseconds) </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="system_8c_source.html#l00033">33</a> of file <a class="el" href="system_8c_source.html">system.c</a>.</p>
<p class="reference">References <a class="el" href="system_8c_source.html#l00016">delayms_counter</a>.</p>
<p class="reference">Referenced by <a class="el" href="encoder_8c_source.html#l00122">encoder_zeroing()</a>, <a class="el" href="foc_8c_source.html#l00030">foc_calibrate_phase()</a>, <a class="el" href="main_8c_source.html#l00133">main()</a>, and <a class="el" href="report_8c_source.html#l00016">report_local_variable()</a>.</p>
</div>
</div>
<a id="a7bee5a9ca4038926b7fd4c38976d1481" name="a7bee5a9ca4038926b7fd4c38976d1481"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7bee5a9ca4038926b7fd4c38976d1481">◆ </a></span>float_to_int32()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned int float_to_int32 </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"><em>data0</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>convert floating point numbers to int32 type data </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">data0</td><td>floating point type data to be converted </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">converted</td><td>int32 type data </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="system_8c_source.html#l00065">65</a> of file <a class="el" href="system_8c_source.html">system.c</a>.</p>
<p class="reference">Referenced by <a class="el" href="flash_8c_source.html#l00017">flash_write_parameters()</a>, <a class="el" href="report_8c_source.html#l00070">report_angle_speed()</a>, and <a class="el" href="report_8c_source.html#l00016">report_local_variable()</a>.</p>
</div>
</div>
<a id="ade748eddd7c60c3bf4c67bce9c463545" name="ade748eddd7c60c3bf4c67bce9c463545"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade748eddd7c60c3bf4c67bce9c463545">◆ </a></span>int32_to_float()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float int32_to_float </td>
<td>(</td>
<td class="paramtype">unsigned int </td>
<td class="paramname"><em>data0</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>convert int32 to floating point numbers type data </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">data0</td><td>int32 type data to be converted </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">converted</td><td>floating point type data </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="system_8c_source.html#l00075">75</a> of file <a class="el" href="system_8c_source.html">system.c</a>.</p>
<p class="reference">Referenced by <a class="el" href="flash_8c_source.html#l00037">flash_read_parameters()</a>, and <a class="el" href="main_8c_source.html#l00029">mdtp_callback_handler()</a>.</p>
</div>
</div>
<a id="a35f0081c3632bdd1851b3b0180812224" name="a35f0081c3632bdd1851b3b0180812224"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35f0081c3632bdd1851b3b0180812224">◆ </a></span>systick_config()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void systick_config </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>initialize systick timer to implementation delay function </p>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="system_8c_source.html#l00022">22</a> of file <a class="el" href="system_8c_source.html">system.c</a>.</p>
<p class="reference">Referenced by <a class="el" href="main_8c_source.html#l00133">main()</a>.</p>
</div>
</div>
<a id="a7e7cece1b30ef67968b244698f999b0e" name="a7e7cece1b30ef67968b244698f999b0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e7cece1b30ef67968b244698f999b0e">◆ </a></span>user_memset()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void user_memset </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char </td>
<td class="paramname"><em>num</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>format buffer array to fixed value, replace memset function </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">buf</td><td>array to format </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>value to be formatted as </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>number of elements to format </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">none</td><td></td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="system_8c_source.html#l00054">54</a> of file <a class="el" href="system_8c_source.html">system.c</a>.</p>
<p class="reference">Referenced by <a class="el" href="filter_8c_source.html#l00029">filter_coefficient_config()</a>, <a class="el" href="uart_8c_source.html#l00037">mdtp_receive_handler()</a>, and <a class="el" href="pid_8c_source.html#l00034">pid_config()</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>