]> begriffs open source - cmsis/blob - main/Driver/html/theoryOperation.html
Update documentation for branch main
[cmsis] / main / Driver / html / theoryOperation.html
1 <!-- HTML header for doxygen 1.9.6-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
4 <head>
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=11"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>CMSIS-Driver: Theory of Operation</title>
9 <link href="doxygen.css" rel="stylesheet" type="text/css"/>
10 <link href="tabs.css" rel="stylesheet" type="text/css"/>
11 <link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
12 <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
13 <link href="extra_search.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="jquery.js"></script>
15 <script type="text/javascript" src="dynsections.js"></script>
16 <script type="text/javascript" src="printComponentTabs.js"></script>
17 <script type="text/javascript" src="footer.js"></script>
18 <script type="text/javascript" src="navtree.js"></script>
19 <link href="navtree.css" rel="stylesheet" type="text/css"/>
20 <script type="text/javascript" src="resize.js"></script>
21 <script type="text/javascript" src="navtreedata.js"></script>
22 <script type="text/javascript" src="navtree.js"></script>
23 <link href="search/search.css" rel="stylesheet" type="text/css"/>
24 <script type="text/javascript" src="search/searchdata.js"></script>
25 <script type="text/javascript" src="search/search.js"></script>
26 <script type="text/javascript">
27 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
28   $(document).ready(function() { init_search(); });
29 /* @license-end */
30 </script>
31 <script type="text/javascript" src="darkmode_toggle.js"></script>
32 <link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
33 <link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
34 <link href="extra_search.css" rel="stylesheet" type="text/css"/>
35 <link href="version.css" rel="stylesheet" type="text/css" />
36 <script type="text/javascript" src="../../version.js"></script>
37 </head>
38 <body>
39 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
40 <div id="titlearea">
41 <table cellspacing="0" cellpadding="0">
42  <tbody>
43  <tr style="height: 55px;">
44   <td id="projectlogo" style="padding: 1.5em;"><img alt="Logo" src="cmsis_logo_white_small.png"/></td>
45   <td style="padding-left: 1em; padding-bottom: 1em;padding-top: 1em;">
46    <div id="projectname">CMSIS-Driver
47    &#160;<span id="projectnumber"><script type="text/javascript">
48      <!--
49      writeHeader.call(this);
50      writeVersionDropdown.call(this, "CMSIS-Driver");
51      //-->
52     </script>
53    </span>
54    </div>
55    <div id="projectbrief">Peripheral Interface for Middleware and Application Code</div>
56   </td>
57    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
58         <span class="left">
59           <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
60           <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
61                onfocus="searchBox.OnSearchFieldFocus(true)" 
62                onblur="searchBox.OnSearchFieldFocus(false)" 
63                onkeyup="searchBox.OnSearchFieldChange(event)"/>
64           </span><span class="right">
65             <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
66           </span>
67         </div>
68 </td>
69   <!--END !PROJECT_NAME-->
70  </tr>
71  </tbody>
72 </table>
73 </div>
74 <!-- end header part -->
75 <div id="CMSISnav" class="tabs1">
76   <ul class="tablist">
77     <script type="text/javascript">
78       writeComponentTabs.call(this);
79     </script>
80   </ul>
81 </div>
82 <!-- Generated by Doxygen 1.9.6 -->
83 <script type="text/javascript">
84 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
85 var searchBox = new SearchBox("searchBox", "search/",'.html');
86 /* @license-end */
87 </script>
88 </div><!-- top -->
89 <div id="side-nav" class="ui-resizable side-nav-resizable">
90   <div id="nav-tree">
91     <div id="nav-tree-contents">
92       <div id="nav-sync" class="sync"></div>
93     </div>
94   </div>
95   <div id="splitbar" style="-moz-user-select:none;" 
96        class="ui-resizable-handle">
97   </div>
98 </div>
99 <script type="text/javascript">
100 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
101 $(document).ready(function(){initNavTree('theoryOperation.html',''); initResizable(); });
102 /* @license-end */
103 </script>
104 <div id="doc-content">
105 <!-- window showing the filter options -->
106 <div id="MSearchSelectWindow"
107      onmouseover="return searchBox.OnSearchSelectShow()"
108      onmouseout="return searchBox.OnSearchSelectHide()"
109      onkeydown="return searchBox.OnSearchSelectKey(event)">
110 </div>
111
112 <!-- iframe showing the search results (closed by default) -->
113 <div id="MSearchResultsWindow">
114 <div id="MSearchResults">
115 <div class="SRPage">
116 <div id="SRIndex">
117 <div id="SRResults"></div>
118 <div class="SRStatus" id="Loading">Loading...</div>
119 <div class="SRStatus" id="Searching">Searching...</div>
120 <div class="SRStatus" id="NoMatches">No Matches</div>
121 </div>
122 </div>
123 </div>
124 </div>
125
126 <div><div class="header">
127   <div class="headertitle"><div class="title">Theory of Operation </div></div>
128 </div><!--header-->
129 <div class="contents">
130 <div class="toc"><h3>Table of Contents</h3>
131 <ul><li class="level1"><a href="#DriverFunctions">Common Driver Functions</a><ul><li class="level2"><a href="#ProcessorMode">Cortex-M Processor Mode</a></li>
132 </ul>
133 </li>
134 <li class="level1"><a href="#CallSequence">Function Call Sequence</a><ul><li class="level2"><a href="#CS_start">Start Sequence</a></li>
135 <li class="level2"><a href="#CS_stop">Stop Sequence</a></li>
136 </ul>
137 </li>
138 <li class="level1"><a href="#Share_IO">Shared I/O Pins</a></li>
139 <li class="level1"><a href="#Data_Xfer_Functions">Data Transfer Functions</a></li>
140 <li class="level1"><a href="#AccessStruct">Access Struct</a><ul><li class="level2"><a href="#DriverInstances">Driver Instances</a></li>
141 </ul>
142 </li>
143 <li class="level1"><a href="#DriverConfiguration">Driver Configuration</a></li>
144 <li class="level1"><a href="#CodeExample">Code Example</a></li>
145 </ul>
146 </div>
147 <div class="textblock"><p>This section gives an overview of the general operation of CMSIS-Drivers. It explains the <a class="el" href="theoryOperation.html#DriverFunctions">Common Driver Functions</a> that are common in all CMSIS-Drivers along with the <a class="el" href="theoryOperation.html#CallSequence">Function Call Sequence</a>. The topic <a class="el" href="theoryOperation.html#Data_Xfer_Functions">Data Transfer Functions</a> describes how data read/write operations to the peripheral are implemented.</p>
148 <p>Each CMSIS-Driver defines an <a class="el" href="theoryOperation.html#AccessStruct">Access Struct</a> for calling the various driver functions and each peripheral (that is accessed via a CMSIS-Driver) has one <a class="el" href="theoryOperation.html#DriverInstances">Driver Instance</a>.</p>
149 <h1><a class="anchor" id="DriverFunctions"></a>
150 Common Driver Functions</h1>
151 <p>Each CMSIS-Driver contains these functions:</p>
152 <ul>
153 <li><b>GetVersion:</b> can be called at any time to obtain version information of the driver interface.</li>
154 <li><b>GetCapabilities:</b> can be called at any time to obtain capabilities of the driver interface.</li>
155 <li><b>Initialize:</b> must be called before powering the peripheral using <b>PowerControl</b>. This function performs the following:<ul>
156 <li>allocate I/O resources.</li>
157 <li>register an optional <b>SignalEvent</b> callback function.</li>
158 </ul>
159 </li>
160 <li><b>SignalEvent:</b> is an optional callback function that is registered with the <b>Initialize</b> function. This callback function is initiated from interrupt service routines and indicates hardware events or the completion of a data block transfer operation.</li>
161 <li><b>PowerControl:</b> Controls the power profile of the peripheral and needs to be called after <b>Initialize</b>. Typically, three power options are available:<ul>
162 <li><code>ARM_POWER_FULL:</code> Peripheral is turned on and fully operational. The driver initializes the peripheral registers, interrupts, and (optionally) DMA.</li>
163 <li><code>ARM_POWER_LOW:</code> (optional) Peripheral is in low power mode and partially operational; usually, it can detect external events and wake-up.</li>
164 <li><code>ARM_POWER_OFF:</code> Peripheral is turned off and not operational (pending operations are terminated). This is the state after device reset.</li>
165 </ul>
166 </li>
167 <li><b>Uninitialize:</b> Complementary function to Initialize. Releases the I/O pin resources used by the interface.</li>
168 <li><b>Control:</b> Several drivers provide a control function to configure communication parameters or execute miscellaneous control functions.</li>
169 </ul>
170 <p>The section <a class="el" href="theoryOperation.html#CallSequence">Function Call Sequence</a> contains more information on the operation of each function. Additional functions are specific to each driver interface and are described in the individual sections of each driver.</p>
171 <h2><a class="anchor" id="ProcessorMode"></a>
172 Cortex-M Processor Mode</h2>
173 <p>The CMSIS-Driver functions access peripherals and interrupts and are designed to execute in <b>Privileged</b> mode. When calling CMSIS-Driver functions from RTOS threads, it should be ensure that these threads execute in <b>Privileged</b> mode.</p>
174 <h1><a class="anchor" id="CallSequence"></a>
175 Function Call Sequence</h1>
176 <p>For normal operation of the driver, the API functions <b>GetVersion</b>, <b>GetCapabilities</b>, <b>Initialize</b>, <b>PowerControl</b>, <b>Uninitialize</b> are called in the following order:</p>
177 <div class="mscgraph">
178 <img src="msc_inline_mscgraph_1.png" alt="msc_inline_mscgraph_1" border="0"/>
179 </div>
180 <p>The functions <b>GetVersion</b> and <b>GetCapabilities</b> can be called any time to obtain the required information from the driver. These functions return always the same information.</p>
181 <h2><a class="anchor" id="CS_start"></a>
182 Start Sequence</h2>
183 <p>To start working with a peripheral the functions <b>Initialize</b> and <b>PowerControl</b> need to be called in this order: </p><div class="fragment"><div class="line">drv-&gt;Initialize (...);                 <span class="comment">// Allocate I/O pins</span></div>
184 <div class="line">drv-&gt;PowerControl (<a class="code hl_enumvalue" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a>);    <span class="comment">// Power up peripheral, setup IRQ/DMA</span></div>
185 <div class="ttc" id="aDriver__Common_8h_html_ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e"><div class="ttname"><a href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a></div><div class="ttdeci">@ ARM_POWER_FULL</div><div class="ttdoc">Power on: full operation at maximum performance.</div><div class="ttdef"><b>Definition:</b> Driver_Common.h:66</div></div>
186 </div><!-- fragment --><ul>
187 <li><b>Initialize</b> typically allocates the I/O resources (pins) for the peripheral. The function can be called multiple times; if the I/O resources are already initialized it performs no operation and just returns with <a class="el" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>.</li>
188 <li><b>PowerControl</b> (<code>ARM_POWER_FULL</code>) sets the peripheral registers including interrupt (NVIC) and optionally DMA. The function can be called multiple times; if the registers are already set it performs no operation and just returns with <a class="el" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>.</li>
189 </ul>
190 <h2><a class="anchor" id="CS_stop"></a>
191 Stop Sequence</h2>
192 <p>To stop working with a peripheral the functions <b>PowerControl</b> and <b>Uninitialize</b> need to be called in this order: </p><div class="fragment"><div class="line">drv-&gt;PowerControl (<a class="code hl_enumvalue" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5ab6f5becc85ebd51c3dd2524a95d2ca35">ARM_POWER_OFF</a>);     <span class="comment">// Terminate any pending transfers, reset IRQ/DMA, power off peripheral</span></div>
193 <div class="line">drv-&gt;Uninitialize (...);               <span class="comment">// Release I/O pins</span></div>
194 <div class="ttc" id="aDriver__Common_8h_html_ga47d6d7c31f88f3b8ae4aaf9d8444afa5ab6f5becc85ebd51c3dd2524a95d2ca35"><div class="ttname"><a href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5ab6f5becc85ebd51c3dd2524a95d2ca35">ARM_POWER_OFF</a></div><div class="ttdeci">@ ARM_POWER_OFF</div><div class="ttdoc">Power off: no operation possible.</div><div class="ttdef"><b>Definition:</b> Driver_Common.h:64</div></div>
195 </div><!-- fragment --><p> The functions <b>PowerControl</b> and <b>Uninitialize</b> always execute and can be used to put the peripheral into a <b>Safe State</b>, for example after any data transmission errors. To restart the peripheral in a error condition, you should first execute the <a class="el" href="theoryOperation.html#CS_stop">Stop Sequence</a> and then the <a class="el" href="theoryOperation.html#CS_start">Start Sequence</a>.</p>
196 <ul>
197 <li><b>PowerControl</b> (<code>ARM_POWER_OFF</code>) terminates any pending data transfers with the peripheral, disables the peripheral and leaves it in a defined mode (typically the reset state).<ul>
198 <li>when DMA is used it is disabled (including the interrupts)</li>
199 <li>peripheral interrupts are disabled on NVIC level</li>
200 <li>the peripheral is reset using a dedicated reset mechanism (if available) or by clearing the peripheral registers</li>
201 <li>pending peripheral interrupts are cleared on NVIC level</li>
202 <li>driver variables are cleared</li>
203 </ul>
204 </li>
205 <li><b>Uninitialize</b> always releases I/O pin resources.</li>
206 </ul>
207 <h1><a class="anchor" id="Share_IO"></a>
208 Shared I/O Pins</h1>
209 <p>All CMSIS-Driver provide a <a class="el" href="theoryOperation.html#CS_start">Start Sequence</a> and <a class="el" href="theoryOperation.html#CS_stop">Stop Sequence</a>. Therefore two different drivers can share the same I/O pins, for example UART1 and SPI1 can have overlapping I/O pins. In this case the communication channels can be used as shown below:</p>
210 <div class="fragment"><div class="line">SPI1drv-&gt;Initialize (...);                <span class="comment">// Start SPI1</span></div>
211 <div class="line">SPI1drv-&gt;PowerControl (<a class="code hl_enumvalue" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a>);</div>
212 <div class="line"> ...                                      <span class="comment">// Do operations with SPI1</span></div>
213 <div class="line">SPI1drv-&gt;PowerControl (<a class="code hl_enumvalue" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5ab6f5becc85ebd51c3dd2524a95d2ca35">ARM_POWER_OFF</a>);    <span class="comment">// Stop SPI1</span></div>
214 <div class="line">SPI1drv-&gt;Uninitialize ();</div>
215 <div class="line"> ...</div>
216 <div class="line">USART1drv-&gt;Initialize (...);              <span class="comment">// Start USART1</span></div>
217 <div class="line">USART1drv-&gt;PowerControl (<a class="code hl_enumvalue" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a>);</div>
218 <div class="line"> ...                                      <span class="comment">// Do operations with USART1</span></div>
219 <div class="line">USART1drv-&gt;PowerControl (<a class="code hl_enumvalue" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5ab6f5becc85ebd51c3dd2524a95d2ca35">ARM_POWER_OFF</a>);  <span class="comment">// Stop USART1</span></div>
220 <div class="line">USART1drv-&gt;Uninitialize ();</div>
221 </div><!-- fragment --><h1><a class="anchor" id="Data_Xfer_Functions"></a>
222 Data Transfer Functions</h1>
223 <p>A CMSIS-Driver implements non-blocking functions to transfer data to a peripheral. This means that the driver configures the read or write access to the peripheral and instantly returns to the calling application. The function names for data transfer end with:</p><ul>
224 <li><b>Send</b> to write data to a peripheral.</li>
225 <li><b>Receive</b> to read data from a peripheral.</li>
226 <li><b>Transfer</b> to indicate combined read/write operations to a peripheral.</li>
227 </ul>
228 <p>During a data transfer, the application can query the number of transferred data items using functions named <b>Get<em>xxx</em>Count</b>. On completion of a data transfer, the driver calls a callback function with a specific event code.</p>
229 <p>During the data exchange with the peripheral, the application can decide to:</p><ul>
230 <li>Wait (using an RTOS scheduler) for the callback completion event. The RTOS is controlled by the application code which makes the driver itself RTOS independent.</li>
231 <li>Use polling functions that return the number of transferred data items to show progress information or partly read or fill data transfer buffers.</li>
232 <li>Prepare another data transfer buffer for the next data transfer.</li>
233 </ul>
234 <p>The following diagram shows the basic communication flow when using the <b>_Send</b> function in an application.</p>
235 <div class="image">
236 <img src="Non_blocking_transmit_small.png" alt=""/>
237 <div class="caption">
238 Non-blocking Send Function</div></div>
239 <h1><a class="anchor" id="AccessStruct"></a>
240 Access Struct</h1>
241 <p>A CMSIS-Driver publishes an <a class="el" href="theoryOperation.html#AccessStruct">Access Struct</a> with the data type name ARM_DRIVER_xxxx that gives to access the driver functions.</p>
242 <p><b>Code</b> <b>Example:</b> <b>Function</b> <b>Access</b> <b>of</b> <b>the</b> <b>SPI</b> <b>driver</b> </p><div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>_ARM_DRIVER_SPI {</div>
243 <div class="line">  <a class="code hl_struct" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>   (*GetVersion)      (void);</div>
244 <div class="line">  <a class="code hl_struct" href="group__spi__interface__gr.html#structARM__SPI__CAPABILITIES">ARM_SPI_CAPABILITIES</a> (*GetCapabilities) (void);</div>
245 <div class="line">  int32_t              (*Initialize)      (<a class="code hl_typedef" href="group__spi__interface__gr.html#gafde9205364241ee81290adc0481c6640">ARM_SPI_SignalEvent_t</a> cb_event);</div>
246 <div class="line">  int32_t              (*Uninitialize)    (void);</div>
247 <div class="line">  int32_t              (*PowerControl)    (<a class="code hl_enumeration" href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a> state);</div>
248 <div class="line">  int32_t              (*Send)            (<span class="keyword">const</span> <span class="keywordtype">void</span> *data, uint32_t num);</div>
249 <div class="line">  int32_t              (*Receive)         (      <span class="keywordtype">void</span> *data, uint32_t num);</div>
250 <div class="line">  int32_t              (*Transfer)        (<span class="keyword">const</span> <span class="keywordtype">void</span> *data_out, <span class="keywordtype">void</span> *data_in, uint32_t num);</div>
251 <div class="line">  uint32_t             (*GetDataCount)    (void);</div>
252 <div class="line">  int32_t              (*Control)         (uint32_t control, uint32_t arg);</div>
253 <div class="line">  <a class="code hl_struct" href="group__spi__interface__gr.html#structARM__SPI__STATUS">ARM_SPI_STATUS</a>       (*GetStatus)       (void);</div>
254 <div class="line">} <span class="keyword">const</span> <a class="code hl_struct" href="group__spi__interface__gr.html#structARM__DRIVER__SPI">ARM_DRIVER_SPI</a>;</div>
255 <div class="ttc" id="agroup__common__drv__gr_html_ga47d6d7c31f88f3b8ae4aaf9d8444afa5"><div class="ttname"><a href="group__common__drv__gr.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5">ARM_POWER_STATE</a></div><div class="ttdeci">ARM_POWER_STATE</div><div class="ttdoc">General power states.</div><div class="ttdef"><b>Definition:</b> Driver_Common.h:63</div></div>
256 <div class="ttc" id="agroup__common__drv__gr_html_structARM__DRIVER__VERSION"><div class="ttname"><a href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a></div><div class="ttdoc">Driver Version.</div><div class="ttdef"><b>Definition:</b> Driver_Common.h:46</div></div>
257 <div class="ttc" id="agroup__spi__interface__gr_html_gafde9205364241ee81290adc0481c6640"><div class="ttname"><a href="group__spi__interface__gr.html#gafde9205364241ee81290adc0481c6640">ARM_SPI_SignalEvent_t</a></div><div class="ttdeci">void(* ARM_SPI_SignalEvent_t)(uint32_t event)</div><div class="ttdoc">Pointer to ARM_SPI_SignalEvent : Signal SPI Event.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:216</div></div>
258 <div class="ttc" id="agroup__spi__interface__gr_html_structARM__DRIVER__SPI"><div class="ttname"><a href="group__spi__interface__gr.html#structARM__DRIVER__SPI">ARM_DRIVER_SPI</a></div><div class="ttdoc">Access structure of the SPI Driver.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:234</div></div>
259 <div class="ttc" id="agroup__spi__interface__gr_html_structARM__SPI__CAPABILITIES"><div class="ttname"><a href="group__spi__interface__gr.html#structARM__SPI__CAPABILITIES">ARM_SPI_CAPABILITIES</a></div><div class="ttdoc">SPI Driver Capabilities.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:222</div></div>
260 <div class="ttc" id="agroup__spi__interface__gr_html_structARM__SPI__STATUS"><div class="ttname"><a href="group__spi__interface__gr.html#structARM__SPI__STATUS">ARM_SPI_STATUS</a></div><div class="ttdoc">SPI Status.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:137</div></div>
261 </div><!-- fragment --><h2><a class="anchor" id="DriverInstances"></a>
262 Driver Instances</h2>
263 <p>A device may offer several peripherals of the same type. For such devices, the CMSIS-Driver publishes multiple instances of the <a class="el" href="theoryOperation.html#AccessStruct">Access Struct</a>. The name of each driver instance reflects the names of the peripheral available in the device.</p>
264 <p><b>Code</b> <b>Example:</b> <a class="el" href="theoryOperation.html#AccessStruct">Access Struct</a> <b>for</b> <b>three</b> <b>SPIs</b> <b>in</b> <b>a</b> <b>microcontroller</b> <b>device</b>. </p><div class="fragment"><div class="line"><a class="code hl_struct" href="group__spi__interface__gr.html#structARM__DRIVER__SPI">ARM_DRIVER_SPI</a> Driver_SPI1;     <span class="comment">// access functions for SPI1 interface</span></div>
265 <div class="line"><a class="code hl_struct" href="group__spi__interface__gr.html#structARM__DRIVER__SPI">ARM_DRIVER_SPI</a> Driver_SPI2;     <span class="comment">// access functions for SPI2 interface</span></div>
266 <div class="line"><a class="code hl_struct" href="group__spi__interface__gr.html#structARM__DRIVER__SPI">ARM_DRIVER_SPI</a> Driver_SPI3;     <span class="comment">// access functions for SPI3 interface</span></div>
267 </div><!-- fragment --><p>The access functions can be passed to middleware to specify the driver instance that the middleware should use for communication.</p>
268 <p><b>Naming</b> <b>Convention</b> </p>
269 <p>The access structs need to follow this naming convention: the keyword "Driver" followed by an underscore "_", the interface name "IFNAME" (usually in upper case letters), and the instance number "n". Here's the full list of access struct names for all drivers (n to be replaced with the actual instance number): </p><div class="fragment"><div class="line">Driver_CANn</div>
270 <div class="line">Driver_ETH_MACn</div>
271 <div class="line">Driver_ETH_PHYn</div>
272 <div class="line">Driver_Flashn</div>
273 <div class="line">Driver_I2Cn</div>
274 <div class="line">Driver_MCIn</div>
275 <div class="line">Driver_NANDn</div>
276 <div class="line">Driver_SAIn</div>
277 <div class="line">Driver_SPIn</div>
278 <div class="line">Driver_Storagen</div>
279 <div class="line">Driver_USARTn</div>
280 <div class="line">Driver_USBDn</div>
281 <div class="line">Driver_USBHn</div>
282 <div class="line">Driver_WiFin</div>
283 </div><!-- fragment --><p><b>Example:</b> </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> init_middleware (<a class="code hl_struct" href="group__spi__interface__gr.html#structARM__DRIVER__SPI">ARM_DRIVER_SPI</a> *Drv_spi) ...</div>
284 <div class="line">\\ inside the middleware the SPI driver functions are called with:</div>
285 <div class="line">\\   Drv_spi-&gt;function (...);</div>
286 </div><!-- fragment --><div class="fragment"><div class="line">\\ setup middleware</div>
287 <div class="line">init_middleware (&amp;Driver_SPI1);      <span class="comment">// connect middleware to SPI1 interface</span></div>
288 <div class="line">  :</div>
289 <div class="line">init_middleware (&amp;Driver_SPI2);      <span class="comment">// connect middleware to SPI2 interface</span></div>
290 </div><!-- fragment --><h1><a class="anchor" id="DriverConfiguration"></a>
291 Driver Configuration</h1>
292 <p>For a device family, the drivers may be configurable. The <a class="el" href="referenceImplementation.html">Reference Implementation</a> stores configuration options in a central file with the name <b>RTE_Device.h</b>. However, the configuration of the drivers itself is not part of the CMSIS-Driver specification.</p>
293 <h1><a class="anchor" id="CodeExample"></a>
294 Code Example</h1>
295 <p>The following example code shows the usage of the SPI interface.</p>
296 <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Driver__SPI_8h.html">Driver_SPI.h</a>&quot;</span></div>
297 <div class="line"><span class="preprocessor">#include &quot;cmsis_os.h&quot;</span>                   <span class="comment">// ARM::CMSIS:RTOS:Keil RTX</span></div>
298 <div class="line"> </div>
299 <div class="line"> </div>
300 <div class="line"><span class="keywordtype">void</span> mySPI_Thread(<span class="keywordtype">void</span> <span class="keyword">const</span> *argument);</div>
301 <div class="line">osThreadId tid_mySPI_Thread;</div>
302 <div class="line"> </div>
303 <div class="line"> </div>
304 <div class="line"><span class="comment">/* SPI Driver */</span></div>
305 <div class="line"><span class="keyword">extern</span> <a class="code hl_struct" href="group__spi__interface__gr.html#structARM__DRIVER__SPI">ARM_DRIVER_SPI</a> Driver_SPI0;</div>
306 <div class="line"> </div>
307 <div class="line"> </div>
308 <div class="line"><span class="keywordtype">void</span> mySPI_callback(uint32_t event)</div>
309 <div class="line">{</div>
310 <div class="line">    <span class="keywordflow">switch</span> (event)</div>
311 <div class="line">    {</div>
312 <div class="line">    <span class="keywordflow">case</span> <a class="code hl_define" href="group__SPI__events.html#gaabdfc9e17641144cd50d36d15511a1b8">ARM_SPI_EVENT_TRANSFER_COMPLETE</a>:</div>
313 <div class="line">        <span class="comment">/* Success: Wakeup Thread */</span></div>
314 <div class="line">        osSignalSet(tid_mySPI_Thread, 0x01);</div>
315 <div class="line">        <span class="keywordflow">break</span>;</div>
316 <div class="line">    <span class="keywordflow">case</span> <a class="code hl_define" href="group__SPI__events.html#ga8e63d99c80ea56de596a8d0a51fd8244">ARM_SPI_EVENT_DATA_LOST</a>:</div>
317 <div class="line">        <span class="comment">/*  Occurs in slave mode when data is requested/sent by master</span></div>
318 <div class="line"><span class="comment">            but send/receive/transfer operation has not been started</span></div>
319 <div class="line"><span class="comment">            and indicates that data is lost. Occurs also in master mode</span></div>
320 <div class="line"><span class="comment">            when driver cannot transfer data fast enough. */</span></div>
321 <div class="line">        __breakpoint(0);  <span class="comment">/* Error: Call debugger or replace with custom error handling */</span></div>
322 <div class="line">        <span class="keywordflow">break</span>;</div>
323 <div class="line">    <span class="keywordflow">case</span> <a class="code hl_define" href="group__SPI__events.html#ga7eaa229003689aa18598273490b3e630">ARM_SPI_EVENT_MODE_FAULT</a>:</div>
324 <div class="line">        <span class="comment">/*  Occurs in master mode when Slave Select is deactivated and</span></div>
325 <div class="line"><span class="comment">            indicates Master Mode Fault. */</span></div>
326 <div class="line">        __breakpoint(0);  <span class="comment">/* Error: Call debugger or replace with custom error handling */</span></div>
327 <div class="line">        <span class="keywordflow">break</span>;</div>
328 <div class="line">    }</div>
329 <div class="line">}</div>
330 <div class="line"> </div>
331 <div class="line"><span class="comment">/* Test data buffers */</span></div>
332 <div class="line"><span class="keyword">const</span> uint8_t testdata_out[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; </div>
333 <div class="line">uint8_t       testdata_in [8];</div>
334 <div class="line"> </div>
335 <div class="line"><span class="keywordtype">void</span> mySPI_Thread(<span class="keywordtype">void</span> <span class="keyword">const</span>* arg)</div>
336 <div class="line">{</div>
337 <div class="line">    <a class="code hl_struct" href="group__spi__interface__gr.html#structARM__DRIVER__SPI">ARM_DRIVER_SPI</a>* SPIdrv = &amp;Driver_SPI0;</div>
338 <div class="line">    osEvent evt;</div>
339 <div class="line"> </div>
340 <div class="line"><span class="preprocessor">#ifdef DEBUG</span></div>
341 <div class="line">    <a class="code hl_struct" href="group__common__drv__gr.html#structARM__DRIVER__VERSION">ARM_DRIVER_VERSION</a>   version;</div>
342 <div class="line">    <a class="code hl_struct" href="group__spi__interface__gr.html#structARM__SPI__CAPABILITIES">ARM_SPI_CAPABILITIES</a> drv_capabilities;</div>
343 <div class="line"> </div>
344 <div class="line">    version = SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a30afd9cb3113c037b5f1926f5ef93b59">GetVersion</a>();</div>
345 <div class="line">    <span class="keywordflow">if</span> (version.<a class="code hl_variable" href="group__common__drv__gr.html#ad180da20fbde1d3dafc074af87c19540">api</a> &lt; 0x200) <span class="comment">/* requires at minimum API version 2.00 or higher */</span></div>
346 <div class="line">    {                        <span class="comment">/* error handling                                 */</span></div>
347 <div class="line">        <span class="keywordflow">return</span>;</div>
348 <div class="line">    }</div>
349 <div class="line"> </div>
350 <div class="line">    drv_capabilities = SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a806a8a77ab11c714b769a754501c6062">GetCapabilities</a>();</div>
351 <div class="line">    <span class="keywordflow">if</span> (drv_capabilities.<a class="code hl_variable" href="group__spi__interface__gr.html#a309619714f0c4febaa497ebdb9b7e3ca">event_mode_fault</a> == 0)</div>
352 <div class="line">    {                        <span class="comment">/* error handling */</span></div>
353 <div class="line">        <span class="keywordflow">return</span>;</div>
354 <div class="line">    }</div>
355 <div class="line"><span class="preprocessor">#endif</span></div>
356 <div class="line"> </div>
357 <div class="line">    <span class="comment">/* Initialize the SPI driver */</span></div>
358 <div class="line">    SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a31866b083830420451c5ca7049166698">Initialize</a>(mySPI_callback);</div>
359 <div class="line">    <span class="comment">/* Power up the SPI peripheral */</span></div>
360 <div class="line">    SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a24ebae5c6011631f76027f9a16eaf5ce">PowerControl</a>(<a class="code hl_enumvalue" href="Driver__Common_8h.html#ga47d6d7c31f88f3b8ae4aaf9d8444afa5abed52b77a9ce4775570e44a842b1295e">ARM_POWER_FULL</a>);</div>
361 <div class="line">    <span class="comment">/* Configure the SPI to Master, 8-bit mode @10000 kBits/sec */</span></div>
362 <div class="line">    SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a5e96d73d3a3c366aba50bf5304edb029">Control</a>(<a class="code hl_define" href="group__spi__mode__ctrls.html#ga3143ef07c1607b9bc57e29df35cf2fa8">ARM_SPI_MODE_MASTER</a> | <a class="code hl_define" href="group__spi__frame__format__ctrls.html#ga7fab572b2fec303e979e47eb2d13ca74">ARM_SPI_CPOL1_CPHA1</a> | <a class="code hl_define" href="group__spi__bit__order__ctrls.html#ga98228a708cbab6e214c7ac696f77dab6">ARM_SPI_MSB_LSB</a> | <a class="code hl_define" href="group__spi__slave__select__mode__ctrls.html#gab5e319aa3f9d4d8c9ed92f0fe865f624">ARM_SPI_SS_MASTER_SW</a> | <a class="code hl_define" href="group__spi__data__bits__ctrls.html#gaf6c099a1d67256a32010120c66c55250">ARM_SPI_DATA_BITS</a>(8), 10000000);</div>
363 <div class="line"> </div>
364 <div class="line">    <span class="comment">/* SS line = INACTIVE = HIGH */</span></div>
365 <div class="line">    SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a5e96d73d3a3c366aba50bf5304edb029">Control</a>(<a class="code hl_define" href="group__spi__misc__ctrls.html#ga5776272b82decff92da003568540c92f">ARM_SPI_CONTROL_SS</a>, <a class="code hl_define" href="Driver__SPI_8h.html#a335b448e07422e9c25616a693ec581cc">ARM_SPI_SS_INACTIVE</a>);</div>
366 <div class="line"> </div>
367 <div class="line">    <span class="comment">/* thread loop */</span></div>
368 <div class="line">    <span class="keywordflow">while</span> (1)</div>
369 <div class="line">    {</div>
370 <div class="line">        <span class="comment">/* SS line = ACTIVE = LOW */</span></div>
371 <div class="line">        SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a5e96d73d3a3c366aba50bf5304edb029">Control</a>(<a class="code hl_define" href="group__spi__misc__ctrls.html#ga5776272b82decff92da003568540c92f">ARM_SPI_CONTROL_SS</a>, <a class="code hl_define" href="Driver__SPI_8h.html#a3f465cdbd1238ddd74f78e14457076c4">ARM_SPI_SS_ACTIVE</a>);</div>
372 <div class="line">        <span class="comment">/* Transmit some data */</span></div>
373 <div class="line">        SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a6e880dae8e9733a3c0f152a131076ca4">Send</a>(testdata_out, <span class="keyword">sizeof</span>(testdata_out));</div>
374 <div class="line">        <span class="comment">/* Wait for completion */</span></div>
375 <div class="line">        evt = osSignalWait(0x01, 100);</div>
376 <div class="line">        <span class="keywordflow">if</span> (evt.status == osEventTimeout) {</div>
377 <div class="line">            __breakpoint(0); <span class="comment">/* Timeout error: Call debugger */</span></div>
378 <div class="line">        }</div>
379 <div class="line">        <span class="comment">/* SS line = INACTIVE = HIGH */</span></div>
380 <div class="line">        SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a5e96d73d3a3c366aba50bf5304edb029">Control</a>(<a class="code hl_define" href="group__spi__misc__ctrls.html#ga5776272b82decff92da003568540c92f">ARM_SPI_CONTROL_SS</a>, <a class="code hl_define" href="Driver__SPI_8h.html#a335b448e07422e9c25616a693ec581cc">ARM_SPI_SS_INACTIVE</a>);</div>
381 <div class="line"> </div>
382 <div class="line">        <span class="comment">/* SS line = ACTIVE = LOW */</span></div>
383 <div class="line">        SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a5e96d73d3a3c366aba50bf5304edb029">Control</a>(<a class="code hl_define" href="group__spi__misc__ctrls.html#ga5776272b82decff92da003568540c92f">ARM_SPI_CONTROL_SS</a>, <a class="code hl_define" href="Driver__SPI_8h.html#a3f465cdbd1238ddd74f78e14457076c4">ARM_SPI_SS_ACTIVE</a>);</div>
384 <div class="line">        <span class="comment">/* Receive 8 bytes of reply */</span></div>
385 <div class="line">        SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a784cafe08ad8f9052dca8cd8071d2a9b">Receive</a>(testdata_in, 8);</div>
386 <div class="line">        evt = osSignalWait(0x01, 100);</div>
387 <div class="line">        <span class="keywordflow">if</span> (evt.status == osEventTimeout) {</div>
388 <div class="line">            __breakpoint(0); <span class="comment">/* Timeout error: Call debugger */</span></div>
389 <div class="line">        }</div>
390 <div class="line">        <span class="comment">/* SS line = INACTIVE = HIGH */</span></div>
391 <div class="line">        SPIdrv-&gt;<a class="code hl_variable" href="group__spi__interface__gr.html#a5e96d73d3a3c366aba50bf5304edb029">Control</a>(<a class="code hl_define" href="group__spi__misc__ctrls.html#ga5776272b82decff92da003568540c92f">ARM_SPI_CONTROL_SS</a>, <a class="code hl_define" href="Driver__SPI_8h.html#a335b448e07422e9c25616a693ec581cc">ARM_SPI_SS_INACTIVE</a>);</div>
392 <div class="line">    }</div>
393 <div class="line">}</div>
394 <div class="ttc" id="aDriver__SPI_8h_html"><div class="ttname"><a href="Driver__SPI_8h.html">Driver_SPI.h</a></div></div>
395 <div class="ttc" id="aDriver__SPI_8h_html_a335b448e07422e9c25616a693ec581cc"><div class="ttname"><a href="Driver__SPI_8h.html#a335b448e07422e9c25616a693ec581cc">ARM_SPI_SS_INACTIVE</a></div><div class="ttdeci">#define ARM_SPI_SS_INACTIVE</div><div class="ttdoc">SPI Slave Select Signal Inactive.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:122</div></div>
396 <div class="ttc" id="aDriver__SPI_8h_html_a3f465cdbd1238ddd74f78e14457076c4"><div class="ttname"><a href="Driver__SPI_8h.html#a3f465cdbd1238ddd74f78e14457076c4">ARM_SPI_SS_ACTIVE</a></div><div class="ttdeci">#define ARM_SPI_SS_ACTIVE</div><div class="ttdoc">SPI Slave Select Signal Active.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:123</div></div>
397 <div class="ttc" id="agroup__SPI__events_html_ga7eaa229003689aa18598273490b3e630"><div class="ttname"><a href="group__SPI__events.html#ga7eaa229003689aa18598273490b3e630">ARM_SPI_EVENT_MODE_FAULT</a></div><div class="ttdeci">#define ARM_SPI_EVENT_MODE_FAULT</div><div class="ttdoc">Master Mode Fault (SS deactivated when Master)</div></div>
398 <div class="ttc" id="agroup__SPI__events_html_ga8e63d99c80ea56de596a8d0a51fd8244"><div class="ttname"><a href="group__SPI__events.html#ga8e63d99c80ea56de596a8d0a51fd8244">ARM_SPI_EVENT_DATA_LOST</a></div><div class="ttdeci">#define ARM_SPI_EVENT_DATA_LOST</div><div class="ttdoc">Data lost: Receive overflow / Transmit underflow.</div></div>
399 <div class="ttc" id="agroup__SPI__events_html_gaabdfc9e17641144cd50d36d15511a1b8"><div class="ttname"><a href="group__SPI__events.html#gaabdfc9e17641144cd50d36d15511a1b8">ARM_SPI_EVENT_TRANSFER_COMPLETE</a></div><div class="ttdeci">#define ARM_SPI_EVENT_TRANSFER_COMPLETE</div><div class="ttdoc">Data Transfer completed.</div></div>
400 <div class="ttc" id="agroup__common__drv__gr_html_ad180da20fbde1d3dafc074af87c19540"><div class="ttname"><a href="group__common__drv__gr.html#ad180da20fbde1d3dafc074af87c19540">ARM_DRIVER_VERSION::api</a></div><div class="ttdeci">uint16_t api</div><div class="ttdoc">API version.</div><div class="ttdef"><b>Definition:</b> Driver_Common.h:47</div></div>
401 <div class="ttc" id="agroup__spi__bit__order__ctrls_html_ga98228a708cbab6e214c7ac696f77dab6"><div class="ttname"><a href="group__spi__bit__order__ctrls.html#ga98228a708cbab6e214c7ac696f77dab6">ARM_SPI_MSB_LSB</a></div><div class="ttdeci">#define ARM_SPI_MSB_LSB</div><div class="ttdoc">SPI Bit order from MSB to LSB (default)</div></div>
402 <div class="ttc" id="agroup__spi__data__bits__ctrls_html_gaf6c099a1d67256a32010120c66c55250"><div class="ttname"><a href="group__spi__data__bits__ctrls.html#gaf6c099a1d67256a32010120c66c55250">ARM_SPI_DATA_BITS</a></div><div class="ttdeci">#define ARM_SPI_DATA_BITS(n)</div><div class="ttdoc">Number of Data bits.</div></div>
403 <div class="ttc" id="agroup__spi__frame__format__ctrls_html_ga7fab572b2fec303e979e47eb2d13ca74"><div class="ttname"><a href="group__spi__frame__format__ctrls.html#ga7fab572b2fec303e979e47eb2d13ca74">ARM_SPI_CPOL1_CPHA1</a></div><div class="ttdeci">#define ARM_SPI_CPOL1_CPHA1</div><div class="ttdoc">Clock Polarity 1, Clock Phase 1.</div></div>
404 <div class="ttc" id="agroup__spi__interface__gr_html_a24ebae5c6011631f76027f9a16eaf5ce"><div class="ttname"><a href="group__spi__interface__gr.html#a24ebae5c6011631f76027f9a16eaf5ce">ARM_DRIVER_SPI::PowerControl</a></div><div class="ttdeci">int32_t(* PowerControl)(ARM_POWER_STATE state)</div><div class="ttdoc">Pointer to ARM_SPI_PowerControl : Control SPI Interface Power.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:239</div></div>
405 <div class="ttc" id="agroup__spi__interface__gr_html_a309619714f0c4febaa497ebdb9b7e3ca"><div class="ttname"><a href="group__spi__interface__gr.html#a309619714f0c4febaa497ebdb9b7e3ca">ARM_SPI_CAPABILITIES::event_mode_fault</a></div><div class="ttdeci">uint32_t event_mode_fault</div><div class="ttdoc">Signal Mode Fault event: ARM_SPI_EVENT_MODE_FAULT.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:226</div></div>
406 <div class="ttc" id="agroup__spi__interface__gr_html_a30afd9cb3113c037b5f1926f5ef93b59"><div class="ttname"><a href="group__spi__interface__gr.html#a30afd9cb3113c037b5f1926f5ef93b59">ARM_DRIVER_SPI::GetVersion</a></div><div class="ttdeci">ARM_DRIVER_VERSION(* GetVersion)(void)</div><div class="ttdoc">Pointer to ARM_SPI_GetVersion : Get driver version.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:235</div></div>
407 <div class="ttc" id="agroup__spi__interface__gr_html_a31866b083830420451c5ca7049166698"><div class="ttname"><a href="group__spi__interface__gr.html#a31866b083830420451c5ca7049166698">ARM_DRIVER_SPI::Initialize</a></div><div class="ttdeci">int32_t(* Initialize)(ARM_SPI_SignalEvent_t cb_event)</div><div class="ttdoc">Pointer to ARM_SPI_Initialize : Initialize SPI Interface.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:237</div></div>
408 <div class="ttc" id="agroup__spi__interface__gr_html_a5e96d73d3a3c366aba50bf5304edb029"><div class="ttname"><a href="group__spi__interface__gr.html#a5e96d73d3a3c366aba50bf5304edb029">ARM_DRIVER_SPI::Control</a></div><div class="ttdeci">int32_t(* Control)(uint32_t control, uint32_t arg)</div><div class="ttdoc">Pointer to ARM_SPI_Control : Control SPI Interface.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:246</div></div>
409 <div class="ttc" id="agroup__spi__interface__gr_html_a6e880dae8e9733a3c0f152a131076ca4"><div class="ttname"><a href="group__spi__interface__gr.html#a6e880dae8e9733a3c0f152a131076ca4">ARM_DRIVER_SPI::Send</a></div><div class="ttdeci">int32_t(* Send)(const void *data, uint32_t num)</div><div class="ttdoc">Pointer to ARM_SPI_Send : Start sending data to SPI Interface.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:240</div></div>
410 <div class="ttc" id="agroup__spi__interface__gr_html_a784cafe08ad8f9052dca8cd8071d2a9b"><div class="ttname"><a href="group__spi__interface__gr.html#a784cafe08ad8f9052dca8cd8071d2a9b">ARM_DRIVER_SPI::Receive</a></div><div class="ttdeci">int32_t(* Receive)(void *data, uint32_t num)</div><div class="ttdoc">Pointer to ARM_SPI_Receive : Start receiving data from SPI Interface.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:241</div></div>
411 <div class="ttc" id="agroup__spi__interface__gr_html_a806a8a77ab11c714b769a754501c6062"><div class="ttname"><a href="group__spi__interface__gr.html#a806a8a77ab11c714b769a754501c6062">ARM_DRIVER_SPI::GetCapabilities</a></div><div class="ttdeci">ARM_SPI_CAPABILITIES(* GetCapabilities)(void)</div><div class="ttdoc">Pointer to ARM_SPI_GetCapabilities : Get driver capabilities.</div><div class="ttdef"><b>Definition:</b> Driver_SPI.h:236</div></div>
412 <div class="ttc" id="agroup__spi__misc__ctrls_html_ga5776272b82decff92da003568540c92f"><div class="ttname"><a href="group__spi__misc__ctrls.html#ga5776272b82decff92da003568540c92f">ARM_SPI_CONTROL_SS</a></div><div class="ttdeci">#define ARM_SPI_CONTROL_SS</div><div class="ttdoc">Control Slave Select; arg: 0=inactive, 1=active.</div></div>
413 <div class="ttc" id="agroup__spi__mode__ctrls_html_ga3143ef07c1607b9bc57e29df35cf2fa8"><div class="ttname"><a href="group__spi__mode__ctrls.html#ga3143ef07c1607b9bc57e29df35cf2fa8">ARM_SPI_MODE_MASTER</a></div><div class="ttdeci">#define ARM_SPI_MODE_MASTER</div><div class="ttdoc">SPI Master (Output on MOSI, Input on MISO); arg = Bus Speed in bps.</div></div>
414 <div class="ttc" id="agroup__spi__slave__select__mode__ctrls_html_gab5e319aa3f9d4d8c9ed92f0fe865f624"><div class="ttname"><a href="group__spi__slave__select__mode__ctrls.html#gab5e319aa3f9d4d8c9ed92f0fe865f624">ARM_SPI_SS_MASTER_SW</a></div><div class="ttdeci">#define ARM_SPI_SS_MASTER_SW</div><div class="ttdoc">SPI Slave Select when Master: Software controlled.</div></div>
415 </div><!-- fragment --> </div></div><!-- contents -->
416 </div><!-- PageDoc -->
417 </div><!-- doc-content -->
418 <!-- start footer part -->
419 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
420   <ul>
421     <li class="footer">
422       <script type="text/javascript">
423         <!--
424         writeFooter.call(this);
425         //-->
426       </script> 
427     </li>
428   </ul>
429 </div>
430 </body>
431 </html>