forked from ZhuYanzhen1/miniFOC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spi_8c.html
170 lines (155 loc) · 7.91 KB
/
spi_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
<!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: hardware/spi.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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_42e555215cde261dd5295a864caa3e52.html">hardware</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">spi.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<p>this file contains the initialization of SPI peripherals and the code implementation of reading and writing half words.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include "<a class="el" href="spi_8h_source.html">spi.h</a>"</code><br />
<code>#include "gd32f1x0.h"</code><br />
<code>#include "<a class="el" href="config_8h_source.html">config.h</a>"</code><br />
</div>
<p><a href="spi_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:abbbc27ff0ee7fe2241ea2935b92d66cc"><td class="memItemLeft" align="right" valign="top">unsigned short </td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8c.html#abbbc27ff0ee7fe2241ea2935b92d66cc">spi_readwrite_halfworld</a> (unsigned short data)</td></tr>
<tr class="memdesc:abbbc27ff0ee7fe2241ea2935b92d66cc"><td class="mdescLeft"> </td><td class="mdescRight">spi0 transmit data for sc60228 <a href="spi_8c.html#abbbc27ff0ee7fe2241ea2935b92d66cc">More...</a><br /></td></tr>
<tr class="separator:abbbc27ff0ee7fe2241ea2935b92d66cc"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa913932d23eead8cf414e5d605b9175d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="spi_8c.html#aa913932d23eead8cf414e5d605b9175d">spi_config</a> (void)</td></tr>
<tr class="memdesc:aa913932d23eead8cf414e5d605b9175d"><td class="mdescLeft"> </td><td class="mdescRight">configure spi0 periph and its gpios <a href="spi_8c.html#aa913932d23eead8cf414e5d605b9175d">More...</a><br /></td></tr>
<tr class="separator:aa913932d23eead8cf414e5d605b9175d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >this file contains the initialization of SPI peripherals and the code implementation of reading and writing half words. </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="spi_8c_source.html">spi.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="aa913932d23eead8cf414e5d605b9175d" name="aa913932d23eead8cf414e5d605b9175d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa913932d23eead8cf414e5d605b9175d">◆ </a></span>spi_config()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spi_config </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>configure spi0 periph and its gpios </p>
<p class="definition">Definition at line <a class="el" href="spi_8c_source.html#l00035">35</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p class="reference">References <a class="el" href="config_8h_source.html#l00034">SPI_PRESCALE</a>.</p>
<p class="reference">Referenced by <a class="el" href="main_8c_source.html#l00139">main()</a>.</p>
</div>
</div>
<a id="abbbc27ff0ee7fe2241ea2935b92d66cc" name="abbbc27ff0ee7fe2241ea2935b92d66cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abbbc27ff0ee7fe2241ea2935b92d66cc">◆ </a></span>spi_readwrite_halfworld()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned short spi_readwrite_halfworld </td>
<td>(</td>
<td class="paramtype">unsigned short </td>
<td class="paramname"><em>data</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>spi0 transmit data for sc60228 </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>data to transmit </td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">data</td><td>received from slave </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="spi_8c_source.html#l00019">19</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p class="reference">Referenced by <a class="el" href="encoder_8c_source.html#l00056">encoder_read_data()</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>