forked from ZhuYanzhen1/miniFOC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_8c.html
214 lines (194 loc) · 12.9 KB
/
main_8c.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
<!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.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>miniFOC: main.c 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 id="projectrow">
<td id="projectlogo"><img alt="Logo" src="Acme_LOGO.png"/></td>
<td id="projectalign">
<div id="projectname">miniFOC<span id="projectnumber"> 1.0.3</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.4 -->
<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><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> |
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">main.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>miniFOC main source file, The relevant operations and main function after unpacking of medium capacity transmission protocol are implemented in this document.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include "<a class="el" href="main_8h_source.html">main.h</a>"</code><br />
</div>
<p><a href="main_8c_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:a6d278b36110f5f0e56b59e058b867b65"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a6d278b36110f5f0e56b59e058b867b65">mdtp_callback_handler</a> (unsigned char pid, const unsigned char *data)</td></tr>
<tr class="memdesc:a6d278b36110f5f0e56b59e058b867b65"><td class="mdescLeft"> </td><td class="mdescRight">user callback function for unpacking completion of medium capacity transport protocol <a href="main_8c.html#a6d278b36110f5f0e56b59e058b867b65">More...</a><br /></td></tr>
<tr class="separator:a6d278b36110f5f0e56b59e058b867b65"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft"> </td><td class="mdescRight">main function <a href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a7eb1a10df8fd98a22d65df31180c5114"><td class="memItemLeft" align="right" valign="top">static volatile unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8c.html#a7eb1a10df8fd98a22d65df31180c5114">minifoc_fsm_state</a> = 0</td></tr>
<tr class="memdesc:a7eb1a10df8fd98a22d65df31180c5114"><td class="mdescLeft"> </td><td class="mdescRight">used to indicate the current status of miniFOC <a href="main_8c.html#a7eb1a10df8fd98a22d65df31180c5114">More...</a><br /></td></tr>
<tr class="separator:a7eb1a10df8fd98a22d65df31180c5114"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >miniFOC main source file, The relevant operations and main function after unpacking of medium capacity transmission protocol are implemented in this document. </p>
<dl class="section author"><dt>Author</dt><dd>Lao·Zhu </dd></dl>
<dl class="section version"><dt>Version</dt><dd>V1.0.2 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>29. October 2021 </dd></dl>
<p class="definition">Definition in file <a class="el" href="main_8c_source.html">main.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe" name="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">◆ </a></span>main()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int main </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>main function </p>
<p class="definition">Definition at line <a class="el" href="main_8c_source.html#l00139">139</a> of file <a class="el" href="main_8c_source.html">main.c</a>.</p>
<p class="reference">References <a class="el" href="system_8c_source.html#l00030">delayms()</a>, <a class="el" href="encoder_8c_source.html#l00119">encoder_zeroing()</a>, <a class="el" href="filter_8c_source.html#l00045">filter_config()</a>, <a class="el" href="flash_8c_source.html#l00046">flash_read_parameters()</a>, <a class="el" href="flash_8c_source.html#l00026">flash_write_parameters()</a>, <a class="el" href="foc_8c_source.html#l00033">foc_calibrate_phase()</a>, <a class="el" href="led_8h_source.html#l00030">led_config</a>, <a class="el" href="led_8h_source.html#l00025">led_toggle</a>, <a class="el" href="main_8c_source.html#l00021">minifoc_fsm_state</a>, <a class="el" href="pid_8c_source.html#l00033">pid_config()</a>, <a class="el" href="pid_8c_source.html#l00020">pid_control_mode_flag</a>, <a class="el" href="timer_8c_source.html#l00117">pwm_config()</a>, <a class="el" href="report_8c_source.html#l00069">report_angle_speed()</a>, <a class="el" href="report_8c_source.html#l00015">report_local_variable()</a>, <a class="el" href="spi_8c_source.html#l00035">spi_config()</a>, <a class="el" href="system_8c_source.html#l00020">systick_config()</a>, <a class="el" href="timer_8c_source.html#l00089">timer13_config()</a>, <a class="el" href="timer_8c_source.html#l00030">timer13_disable()</a>, <a class="el" href="timer_8c_source.html#l00061">timer2_config()</a>, <a class="el" href="timer_8c_source.html#l00044">timer2_disable()</a>, <a class="el" href="pid_8h_source.html#l00014">TORQUE_LOOP_CONTROL</a>, and <a class="el" href="uart_8c_source.html#l00143">uart_config()</a>.</p>
</div>
</div>
<a id="a6d278b36110f5f0e56b59e058b867b65" name="a6d278b36110f5f0e56b59e058b867b65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6d278b36110f5f0e56b59e058b867b65">◆ </a></span>mdtp_callback_handler()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void mdtp_callback_handler </td>
<td>(</td>
<td class="paramtype">unsigned char </td>
<td class="paramname"><em>pid</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const unsigned char * </td>
<td class="paramname"><em>data</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>user callback function for unpacking completion of medium capacity transport protocol </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">pid</td><td>medium capacity transport protocol package id </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>received data array of size 8 bytes </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="main_8c_source.html#l00028">28</a> of file <a class="el" href="main_8c_source.html">main.c</a>.</p>
<p class="reference">References <a class="el" href="pid_8h_source.html#l00018">ANGLE_LOOP_CONTROL</a>, <a class="el" href="pid_8c_source.html#l00028">angle_pid_handler</a>, <a class="el" href="pid_8h_source.html#l00029">PID_Structure_t::expect</a>, <a class="el" href="foc_8c_source.html#l00028">foc_parameter_available_flag</a>, <a class="el" href="foc_8c_source.html#l00020">FOC_Struct</a>, <a class="el" href="system_8c_source.html#l00070">int32_to_float()</a>, <a class="el" href="pid_8h_source.html#l00027">PID_Structure_t::kd</a>, <a class="el" href="pid_8h_source.html#l00026">PID_Structure_t::ki</a>, <a class="el" href="pid_8h_source.html#l00025">PID_Structure_t::kp</a>, <a class="el" href="main_8c_source.html#l00021">minifoc_fsm_state</a>, <a class="el" href="pid_8c_source.html#l00033">pid_config()</a>, <a class="el" href="pid_8c_source.html#l00020">pid_control_mode_flag</a>, <a class="el" href="pid_8c_source.html#l00016">pid_parameter_available_flag</a>, <a class="el" href="pid_8h_source.html#l00016">SPEED_LOOP_CONTROL</a>, <a class="el" href="pid_8c_source.html#l00024">speed_pid_handler</a>, <a class="el" href="pid_8h_source.html#l00032">PID_Structure_t::sum_maximum</a>, <a class="el" href="pid_8h_source.html#l00014">TORQUE_LOOP_CONTROL</a>, and <a class="el" href="foc_8h_source.html#l00020">FOC_Structure_t::user_expect</a>.</p>
<p class="reference">Referenced by <a class="el" href="uart_8c_source.html#l00036">mdtp_receive_handler()</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a7eb1a10df8fd98a22d65df31180c5114" name="a7eb1a10df8fd98a22d65df31180c5114"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7eb1a10df8fd98a22d65df31180c5114">◆ </a></span>minifoc_fsm_state</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">volatile unsigned char minifoc_fsm_state = 0</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>used to indicate the current status of miniFOC </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">1</td><td>calibrate motor phase and sensor offset <br />
2 enable the motor <br />
3 disable the motor <br />
4 return current parameters </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="main_8c_source.html#l00021">21</a> of file <a class="el" href="main_8c_source.html">main.c</a>.</p>
<p class="reference">Referenced by <a class="el" href="main_8c_source.html#l00139">main()</a>, and <a class="el" href="main_8c_source.html#l00028">mdtp_callback_handler()</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.4
</small></address>
</body>
</html>