gnuk/ChibiOS_2.0.2/docs/html/group___s_p_i.html

720 lines
49 KiB
HTML
Raw Normal View History

2010-08-10 03:11:02 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ChibiOS/RT: SPI Driver</title>
<link href="custom.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<table style="text-align: center; width: 100%;" border="0"
cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="width: 80px;"><img alt="ChibiOS/RT Logo" src="logo_small.png"></td>
<td><big><big>ChibiOS/RT</big></big><br><br>Architecture - Reference Manual - Guides</td>
<td style="width: 80px;"></td>
</tr>
</tbody>
</table>
<hr size="1">
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>SPI Driver<br/>
<small>
[<a class="el" href="group___i_o.html">HAL</a>]</small>
</h1>
<p>Generic SPI Driver.
<a href="#_details">More...</a></p>
<p><div class="dynheader">
Collaboration diagram for SPI Driver:</div>
<div class="dynsection">
<center><table><tr><td><img src="group___s_p_i.png" border="0" alt="" usemap="#group______s__p__i_map"/>
<map name="group______s__p__i_map" id="group______s__p__i">
<area shape="rect" href="group___i_o.html" title="Hardware Abstraction Layer." alt="" coords="5,5,48,29"/> <area shape="rect" href="group___s_p_i___l_l_d.html" title="SPI Driver low level driver template." alt="" coords="213,5,336,29"/> </map></td></tr></table></center>
</div>
</p>
<hr/><a name="_details"></a><h2>Description</h2>
<p>Generic SPI Driver. </p>
<p>This module implements a generic SPI driver. The driver implements a state machine internally: </p>
<div align="center">
<img src="inline_dotgraph_15.dot.png" alt="inline_dotgraph_15.dot" border="0" usemap="#inline_dotgraph_15.dot.map">
<map name="inline_dotgraph_15.dot.map" id="inline_dotgraph_15.dot.map"></map>
</div>
<p>The driver is not thread safe for performance reasons, if you need to access the SPI bus from multiple thread then use the <code><a class="el" href="group___s_p_i.html#ga803cec73f6dd8d3d1f18fb6a61b8255a" title="Gains exclusive access to the SPI bus.">spiAcquireBus()</a></code> and <code><a class="el" href="group___s_p_i.html#ga1b04a2410ef4323ee4e37c63f320c18f" title="Releases exclusive access to the SPI bus.">spiReleaseBus()</a></code> APIs in order to gain exclusive access. </p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i___l_l_d.html">SPI Low Level Driver</a></td></tr>
<p><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p><a class="el" href="group___s_p_i.html">SPI Driver</a> low level driver template. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga36d1818f9631f955f7cc94629b1d5498">SPI_USE_MUTUAL_EXCLUSION</a>&nbsp;&nbsp;&nbsp;TRUE</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables the mutual exclusion APIs on the SPI bus. <a href="#ga36d1818f9631f955f7cc94629b1d5498"></a><br/></td></tr>
<tr><td colspan="2"><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga2570f8c1ee9fc0dceaa8f77b999013c3">spistate_t</a> { <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a1f6aeb0405018546d0679b424bfb0f50">SPI_UNINIT</a> = 0,
<a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a22a603b07f381cba1ced3de36a0c3ce7">SPI_STOP</a> = 1,
<a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a2894d6080831bc10e8c6f7c33c60c4ba">SPI_READY</a> = 2,
<a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f">SPI_ACTIVE</a> = 3
}</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p>Driver state machine possible states. </p>
<a href="group___s_p_i.html#ga2570f8c1ee9fc0dceaa8f77b999013c3">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga3c484a97cdec02c5dbf46a11245e3395">spiInit</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">SPI Driver initialization. <a href="#ga3c484a97cdec02c5dbf46a11245e3395"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga87a7bdc554b8e8fdfc77064e67689fcf">spiObjectInit</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initializes the standard part of a <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> structure. <a href="#ga87a7bdc554b8e8fdfc77064e67689fcf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga6752c9f736f8de774a5bef6dfe2aae2e">spiStart</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip, const <a class="el" href="struct_s_p_i_config.html">SPIConfig</a> *config)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Configures and activates the SPI peripheral. <a href="#ga6752c9f736f8de774a5bef6dfe2aae2e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#gad3a359eea03e68e95899886ae93a06e4">spiStop</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deactivates the SPI peripheral. <a href="#gad3a359eea03e68e95899886ae93a06e4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga00809152c869db80192aa3e04266a99a">spiSelect</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Asserts the slave select signal and prepares for transfers. <a href="#ga00809152c869db80192aa3e04266a99a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#gae291c012872da9c89dec23581f701b5f">spiUnselect</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deasserts the slave select signal. <a href="#gae291c012872da9c89dec23581f701b5f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga43889a7d4c473f653596f8c0acafce2a">spiIgnore</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip, size_t n)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Ignores data on the SPI bus. <a href="#ga43889a7d4c473f653596f8c0acafce2a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#gaf1c59f3fd2f85620a5253c23d9586095">spiExchange</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip, size_t n, const void *txbuf, void *rxbuf)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Exchanges data on the SPI bus. <a href="#gaf1c59f3fd2f85620a5253c23d9586095"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga382cfbdffd2df57cf3843d45164e8bfc">spiSend</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip, size_t n, const void *txbuf)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sends data ever the SPI bus. <a href="#ga382cfbdffd2df57cf3843d45164e8bfc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#gadd99ad823b391dde114f04dedafe5e80">spiReceive</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip, size_t n, void *rxbuf)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Receives data from the SPI bus. <a href="#gadd99ad823b391dde114f04dedafe5e80"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga803cec73f6dd8d3d1f18fb6a61b8255a">spiAcquireBus</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gains exclusive access to the SPI bus. <a href="#ga803cec73f6dd8d3d1f18fb6a61b8255a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_p_i.html#ga1b04a2410ef4323ee4e37c63f320c18f">spiReleaseBus</a> (<a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *spip)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Releases exclusive access to the SPI bus. <a href="#ga1b04a2410ef4323ee4e37c63f320c18f"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga36d1818f9631f955f7cc94629b1d5498"></a><!-- doxytag: member="spi.h::SPI_USE_MUTUAL_EXCLUSION" ref="ga36d1818f9631f955f7cc94629b1d5498" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SPI_USE_MUTUAL_EXCLUSION&nbsp;&nbsp;&nbsp;TRUE</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Enables the mutual exclusion APIs on the SPI bus. </p>
<p>Definition at line <a class="el" href="spi_8h_source.html#l00052">52</a> of file <a class="el" href="spi_8h_source.html">spi.h</a>.</p>
</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="ga2570f8c1ee9fc0dceaa8f77b999013c3"></a><!-- doxytag: member="spi.h::spistate_t" ref="ga2570f8c1ee9fc0dceaa8f77b999013c3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group___s_p_i.html#ga2570f8c1ee9fc0dceaa8f77b999013c3">spistate_t</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Driver state machine possible states. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga2570f8c1ee9fc0dceaa8f77b999013c3a1f6aeb0405018546d0679b424bfb0f50"></a><!-- doxytag: member="SPI_UNINIT" ref="gga2570f8c1ee9fc0dceaa8f77b999013c3a1f6aeb0405018546d0679b424bfb0f50" args="" -->SPI_UNINIT</em>&nbsp;</td><td>
<p>Not initialized. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga2570f8c1ee9fc0dceaa8f77b999013c3a22a603b07f381cba1ced3de36a0c3ce7"></a><!-- doxytag: member="SPI_STOP" ref="gga2570f8c1ee9fc0dceaa8f77b999013c3a22a603b07f381cba1ced3de36a0c3ce7" args="" -->SPI_STOP</em>&nbsp;</td><td>
<p>Stopped. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga2570f8c1ee9fc0dceaa8f77b999013c3a2894d6080831bc10e8c6f7c33c60c4ba"></a><!-- doxytag: member="SPI_READY" ref="gga2570f8c1ee9fc0dceaa8f77b999013c3a2894d6080831bc10e8c6f7c33c60c4ba" args="" -->SPI_READY</em>&nbsp;</td><td>
<p>Ready. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f"></a><!-- doxytag: member="SPI_ACTIVE" ref="gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f" args="" -->SPI_ACTIVE</em>&nbsp;</td><td>
<p>Slave selected. </p>
</td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8h_source.html#l00070">70</a> of file <a class="el" href="spi_8h_source.html">spi.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga3c484a97cdec02c5dbf46a11245e3395"></a><!-- doxytag: member="spi.h::spiInit" ref="ga3c484a97cdec02c5dbf46a11245e3395" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiInit </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>SPI Driver initialization. </p>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00059">59</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group___s_p_i___l_l_d.html#ga5bdaf423b4fa6a78a1689b5a7721ea7e">spi_lld_init()</a>.</p>
<p>Referenced by <a class="el" href="group___h_a_l.html#gafd89c1650df524d95aef39b8bc38170d">halInit()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_ga3c484a97cdec02c5dbf46a11245e3395_cgraph.png" border="0" usemap="#group___s_p_i_ga3c484a97cdec02c5dbf46a11245e3395_cgraph_map" alt=""></div>
<map name="group___s_p_i_ga3c484a97cdec02c5dbf46a11245e3395_cgraph_map" id="group___s_p_i_ga3c484a97cdec02c5dbf46a11245e3395_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#ga5bdaf423b4fa6a78a1689b5a7721ea7e" title="Low level SPI driver initialization." alt="" coords="103,5,172,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga87a7bdc554b8e8fdfc77064e67689fcf"></a><!-- doxytag: member="spi.h::spiObjectInit" ref="ga87a7bdc554b8e8fdfc77064e67689fcf" args="(SPIDriver *spip)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiObjectInit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes the standard part of a <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> structure. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00069">69</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6">chMtxInit()</a>, <a class="el" href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58">chSemInit()</a>, <a class="el" href="struct_s_p_i_driver.html#a5dd4d2ee17acb22bf3e14dc8fa392195">SPIDriver::spd_config</a>, <a class="el" href="struct_s_p_i_driver.html#aad4a0dbb074013406c4bce20d1cb9326">SPIDriver::spd_mutex</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, and <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a22a603b07f381cba1ced3de36a0c3ce7">SPI_STOP</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_ga87a7bdc554b8e8fdfc77064e67689fcf_cgraph.png" border="0" usemap="#group___s_p_i_ga87a7bdc554b8e8fdfc77064e67689fcf_cgraph_map" alt=""></div>
<map name="group___s_p_i_ga87a7bdc554b8e8fdfc77064e67689fcf_cgraph_map" id="group___s_p_i_ga87a7bdc554b8e8fdfc77064e67689fcf_cgraph">
<area shape="rect" href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6" title="Initializes s Mutex structure." alt="" coords="136,5,200,29"/> <area shape="rect" href="group__semaphores.html#gafe8fc6155a871074e8017efd908b2c58" title="Initializes a semaphore with the specified counter value." alt="" coords="135,53,201,77"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga6752c9f736f8de774a5bef6dfe2aae2e"></a><!-- doxytag: member="spi.h::spiStart" ref="ga6752c9f736f8de774a5bef6dfe2aae2e" args="(SPIDriver *spip, const SPIConfig *config)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiStart </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="struct_s_p_i_config.html">SPIConfig</a> *&nbsp;</td>
<td class="paramname"> <em>config</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Configures and activates the SPI peripheral. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>config</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_config.html" title="Driver configuration structure.">SPIConfig</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00086">86</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_s_p_i_driver.html#a5dd4d2ee17acb22bf3e14dc8fa392195">SPIDriver::spd_config</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, <a class="el" href="group___s_p_i___l_l_d.html#gaf35495bd4459608ae22a3f728fd4697b">spi_lld_start()</a>, <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a2894d6080831bc10e8c6f7c33c60c4ba">SPI_READY</a>, and <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a22a603b07f381cba1ced3de36a0c3ce7">SPI_STOP</a>.</p>
<p>Referenced by <a class="el" href="group___m_m_c___s_p_i.html#ga9ff4f12fa759c3cb4aca2b64b11f1d22">mmcConnect()</a>, <a class="el" href="group___m_m_c___s_p_i.html#ga6c62caa5d008460e7319fb2c36518ddc">mmcStartSequentialRead()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#ga8031c8222f92a0c6632b36ff943fe825">mmcStartSequentialWrite()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_ga6752c9f736f8de774a5bef6dfe2aae2e_cgraph.png" border="0" usemap="#group___s_p_i_ga6752c9f736f8de774a5bef6dfe2aae2e_cgraph_map" alt=""></div>
<map name="group___s_p_i_ga6752c9f736f8de774a5bef6dfe2aae2e_cgraph_map" id="group___s_p_i_ga6752c9f736f8de774a5bef6dfe2aae2e_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#gaf35495bd4459608ae22a3f728fd4697b" title="Configures and activates the SPI peripheral." alt="" coords="112,5,192,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gad3a359eea03e68e95899886ae93a06e4"></a><!-- doxytag: member="spi.h::spiStop" ref="gad3a359eea03e68e95899886ae93a06e4" args="(SPIDriver *spip)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiStop </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deactivates the SPI peripheral. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00105">105</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, <a class="el" href="group___s_p_i___l_l_d.html#ga8d6b2e0764d39b892b51e6abe4923f80">spi_lld_stop()</a>, <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a2894d6080831bc10e8c6f7c33c60c4ba">SPI_READY</a>, and <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a22a603b07f381cba1ced3de36a0c3ce7">SPI_STOP</a>.</p>
<p>Referenced by <a class="el" href="group___m_m_c___s_p_i.html#gab90f252316351a93ec38b11f7eaf1f16">mmcDisconnect()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#ga27833cde77794f914e4802c7e65281a5">mmcStop()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_gad3a359eea03e68e95899886ae93a06e4_cgraph.png" border="0" usemap="#group___s_p_i_gad3a359eea03e68e95899886ae93a06e4_cgraph_map" alt=""></div>
<map name="group___s_p_i_gad3a359eea03e68e95899886ae93a06e4_cgraph_map" id="group___s_p_i_gad3a359eea03e68e95899886ae93a06e4_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#ga8d6b2e0764d39b892b51e6abe4923f80" title="Deactivates the SPI peripheral." alt="" coords="113,5,191,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga00809152c869db80192aa3e04266a99a"></a><!-- doxytag: member="spi.h::spiSelect" ref="ga00809152c869db80192aa3e04266a99a" args="(SPIDriver *spip)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiSelect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Asserts the slave select signal and prepares for transfers. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00123">123</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f">SPI_ACTIVE</a>, <a class="el" href="group___s_p_i___l_l_d.html#ga5a671d4e8d120120a26d9bfb0c016507">spi_lld_select()</a>, and <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a2894d6080831bc10e8c6f7c33c60c4ba">SPI_READY</a>.</p>
<p>Referenced by <a class="el" href="group___m_m_c___s_p_i.html#ga6c62caa5d008460e7319fb2c36518ddc">mmcStartSequentialRead()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#ga8031c8222f92a0c6632b36ff943fe825">mmcStartSequentialWrite()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_ga00809152c869db80192aa3e04266a99a_cgraph.png" border="0" usemap="#group___s_p_i_ga00809152c869db80192aa3e04266a99a_cgraph_map" alt=""></div>
<map name="group___s_p_i_ga00809152c869db80192aa3e04266a99a_cgraph_map" id="group___s_p_i_ga00809152c869db80192aa3e04266a99a_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#ga5a671d4e8d120120a26d9bfb0c016507" title="Asserts the slave select signal and prepares for transfers." alt="" coords="121,5,207,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gae291c012872da9c89dec23581f701b5f"></a><!-- doxytag: member="spi.h::spiUnselect" ref="gae291c012872da9c89dec23581f701b5f" args="(SPIDriver *spip)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiUnselect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deasserts the slave select signal. </p>
<p>The previously selected peripheral is unselected.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00143">143</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42">chSysLock</a>, <a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e">chSysUnlock</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f">SPI_ACTIVE</a>, <a class="el" href="group___s_p_i___l_l_d.html#gafa343fd905298991aa4005015263bcd2">spi_lld_unselect()</a>, and <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a2894d6080831bc10e8c6f7c33c60c4ba">SPI_READY</a>.</p>
<p>Referenced by <a class="el" href="group___m_m_c___s_p_i.html#ga7e02b9210a8d3d9f8465b8000983dadf">mmcSequentialRead()</a>, <a class="el" href="group___m_m_c___s_p_i.html#ga9ce0adb181138efc1f835aff6d8eb203">mmcSequentialWrite()</a>, <a class="el" href="group___m_m_c___s_p_i.html#ga6c62caa5d008460e7319fb2c36518ddc">mmcStartSequentialRead()</a>, <a class="el" href="group___m_m_c___s_p_i.html#ga8031c8222f92a0c6632b36ff943fe825">mmcStartSequentialWrite()</a>, <a class="el" href="group___m_m_c___s_p_i.html#gaf55b97f76be81f4ce5cde415f3131400">mmcStopSequentialRead()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#gae84abdd53540f03262822aa1f9a213b5">mmcStopSequentialWrite()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_gae291c012872da9c89dec23581f701b5f_cgraph.png" border="0" usemap="#group___s_p_i_gae291c012872da9c89dec23581f701b5f_cgraph_map" alt=""></div>
<map name="group___s_p_i_gae291c012872da9c89dec23581f701b5f_cgraph_map" id="group___s_p_i_gae291c012872da9c89dec23581f701b5f_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#gafa343fd905298991aa4005015263bcd2" title="Deasserts the slave select signal." alt="" coords="131,5,229,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga43889a7d4c473f653596f8c0acafce2a"></a><!-- doxytag: member="spi.h::spiIgnore" ref="ga43889a7d4c473f653596f8c0acafce2a" args="(SPIDriver *spip, size_t n)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiIgnore </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>n</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Ignores data on the SPI bus. </p>
<p>This function transmits a series of idle words on the SPI bus and ignores the received data. This function can be invoked even when a slave select signal has not been yet asserted.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>n</em>&nbsp;</td><td>number of words to be ignored </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00166">166</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f">SPI_ACTIVE</a>, <a class="el" href="group___s_p_i___l_l_d.html#ga076fdc5d74009a7917723b663984d502">spi_lld_ignore()</a>, and <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a2894d6080831bc10e8c6f7c33c60c4ba">SPI_READY</a>.</p>
<p>Referenced by <a class="el" href="group___m_m_c___s_p_i.html#ga9ff4f12fa759c3cb4aca2b64b11f1d22">mmcConnect()</a>, <a class="el" href="group___m_m_c___s_p_i.html#ga7e02b9210a8d3d9f8465b8000983dadf">mmcSequentialRead()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#ga9ce0adb181138efc1f835aff6d8eb203">mmcSequentialWrite()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_ga43889a7d4c473f653596f8c0acafce2a_cgraph.png" border="0" usemap="#group___s_p_i_ga43889a7d4c473f653596f8c0acafce2a_cgraph_map" alt=""></div>
<map name="group___s_p_i_ga43889a7d4c473f653596f8c0acafce2a_cgraph_map" id="group___s_p_i_ga43889a7d4c473f653596f8c0acafce2a_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#ga076fdc5d74009a7917723b663984d502" title="Ignores data on the SPI bus." alt="" coords="120,5,208,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gaf1c59f3fd2f85620a5253c23d9586095"></a><!-- doxytag: member="spi.h::spiExchange" ref="gaf1c59f3fd2f85620a5253c23d9586095" args="(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiExchange </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>n</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void *&nbsp;</td>
<td class="paramname"> <em>txbuf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>rxbuf</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Exchanges data on the SPI bus. </p>
<p>This function performs a simultaneous transmit/receive operation. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The buffers are organized as uint8_t arrays for data sizes below or equal to 8 bits else it is organized as uint16_t arrays.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>n</em>&nbsp;</td><td>number of words to be exchanged </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>txbuf</em>&nbsp;</td><td>the pointer to the transmit buffer </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>rxbuf</em>&nbsp;</td><td>the pointer to the receive buffer </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00187">187</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f">SPI_ACTIVE</a>, and <a class="el" href="group___s_p_i___l_l_d.html#ga61b61b0999c813c1d8a3ddc415e8b0c7">spi_lld_exchange()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_gaf1c59f3fd2f85620a5253c23d9586095_cgraph.png" border="0" usemap="#group___s_p_i_gaf1c59f3fd2f85620a5253c23d9586095_cgraph_map" alt=""></div>
<map name="group___s_p_i_gaf1c59f3fd2f85620a5253c23d9586095_cgraph_map" id="group___s_p_i_gaf1c59f3fd2f85620a5253c23d9586095_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#ga61b61b0999c813c1d8a3ddc415e8b0c7" title="Exchanges data on the SPI bus." alt="" coords="140,5,244,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga382cfbdffd2df57cf3843d45164e8bfc"></a><!-- doxytag: member="spi.h::spiSend" ref="ga382cfbdffd2df57cf3843d45164e8bfc" args="(SPIDriver *spip, size_t n, const void *txbuf)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiSend </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>n</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void *&nbsp;</td>
<td class="paramname"> <em>txbuf</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sends data ever the SPI bus. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The buffers are organized as uint8_t arrays for data sizes below or equal to 8 bits else it is organized as uint16_t arrays.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>n</em>&nbsp;</td><td>number of words to send </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>txbuf</em>&nbsp;</td><td>the pointer to the transmit buffer </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00207">207</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f">SPI_ACTIVE</a>, and <a class="el" href="group___s_p_i___l_l_d.html#gaa460d53de2de1c3bac67f95fe04da0fe">spi_lld_send()</a>.</p>
<p>Referenced by <a class="el" href="group___m_m_c___s_p_i.html#ga9ce0adb181138efc1f835aff6d8eb203">mmcSequentialWrite()</a>, <a class="el" href="group___m_m_c___s_p_i.html#gaf55b97f76be81f4ce5cde415f3131400">mmcStopSequentialRead()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#gae84abdd53540f03262822aa1f9a213b5">mmcStopSequentialWrite()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_ga382cfbdffd2df57cf3843d45164e8bfc_cgraph.png" border="0" usemap="#group___s_p_i_ga382cfbdffd2df57cf3843d45164e8bfc_cgraph_map" alt=""></div>
<map name="group___s_p_i_ga382cfbdffd2df57cf3843d45164e8bfc_cgraph_map" id="group___s_p_i_ga382cfbdffd2df57cf3843d45164e8bfc_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#gaa460d53de2de1c3bac67f95fe04da0fe" title="Sends data ever the SPI bus." alt="" coords="116,5,196,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="gadd99ad823b391dde114f04dedafe5e80"></a><!-- doxytag: member="spi.h::spiReceive" ref="gadd99ad823b391dde114f04dedafe5e80" args="(SPIDriver *spip, size_t n, void *rxbuf)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiReceive </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>n</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>rxbuf</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Receives data from the SPI bus. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The buffers are organized as uint8_t arrays for data sizes below or equal to 8 bits else it is organized as uint16_t arrays.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>n</em>&nbsp;</td><td>number of words to receive </td></tr>
<tr><td valign="top"><tt>[out]</tt>&nbsp;</td><td valign="top"><em>rxbuf</em>&nbsp;</td><td>the pointer to the receive buffer </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00227">227</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga43d50c69eb730d0f024eb832d61f30c9">chDbgAssert</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="struct_s_p_i_driver.html#ae6b2b959753b948d1333885c745abc2a">SPIDriver::spd_state</a>, <a class="el" href="group___s_p_i.html#gga2570f8c1ee9fc0dceaa8f77b999013c3a11bc2d5065a95dc8d721e2070708ba5f">SPI_ACTIVE</a>, and <a class="el" href="group___s_p_i___l_l_d.html#ga5b608b91dcec69818b2b3977a0d98bcb">spi_lld_receive()</a>.</p>
<p>Referenced by <a class="el" href="group___m_m_c___s_p_i.html#ga7e02b9210a8d3d9f8465b8000983dadf">mmcSequentialRead()</a>, and <a class="el" href="group___m_m_c___s_p_i.html#ga9ce0adb181138efc1f835aff6d8eb203">mmcSequentialWrite()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_gadd99ad823b391dde114f04dedafe5e80_cgraph.png" border="0" usemap="#group___s_p_i_gadd99ad823b391dde114f04dedafe5e80_cgraph_map" alt=""></div>
<map name="group___s_p_i_gadd99ad823b391dde114f04dedafe5e80_cgraph_map" id="group___s_p_i_gadd99ad823b391dde114f04dedafe5e80_cgraph">
<area shape="rect" href="group___s_p_i___l_l_d.html#ga5b608b91dcec69818b2b3977a0d98bcb" title="Receives data from the SPI bus." alt="" coords="128,5,221,29"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga803cec73f6dd8d3d1f18fb6a61b8255a"></a><!-- doxytag: member="spi.c::spiAcquireBus" ref="ga803cec73f6dd8d3d1f18fb6a61b8255a" args="(SPIDriver *spip)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiAcquireBus </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gains exclusive access to the SPI bus. </p>
<p>This function tries to gain ownership to the SPI bus, if the bus is already being used then the invoking thread is queued. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>This function is only available when the <code>SPI_USE_MUTUAL_EXCLUSION</code> option is set to <code>TRUE</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00249">249</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba">chMtxLock()</a>, <a class="el" href="group__semaphores.html#gabc8f7e509870e9b0527a6a68fad71425">chSemWait()</a>, and <a class="el" href="struct_s_p_i_driver.html#aad4a0dbb074013406c4bce20d1cb9326">SPIDriver::spd_mutex</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_ga803cec73f6dd8d3d1f18fb6a61b8255a_cgraph.png" border="0" usemap="#group___s_p_i_ga803cec73f6dd8d3d1f18fb6a61b8255a_cgraph_map" alt=""></div>
<map name="group___s_p_i_ga803cec73f6dd8d3d1f18fb6a61b8255a_cgraph_map" id="group___s_p_i_ga803cec73f6dd8d3d1f18fb6a61b8255a_cgraph">
<area shape="rect" href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba" title="Locks the specified mutex." alt="" coords="149,5,221,29"/> <area shape="rect" href="group__semaphores.html#gabc8f7e509870e9b0527a6a68fad71425" title="Performs a wait operation on a semaphore." alt="" coords="148,53,223,77"/> <area shape="rect" href="group__mutexes.html#ga2d6350c2d147d1165c359f30798205f5" title="Locks the specified mutex." alt="" coords="273,5,353,29"/> <area shape="rect" href="group__semaphores.html#gaa2c0367078533e291d2e889e251d8b67" title="Performs a wait operation on a semaphore." alt="" coords="272,53,355,77"/> </map>
</div>
</p>
</div>
</div>
<a class="anchor" id="ga1b04a2410ef4323ee4e37c63f320c18f"></a><!-- doxytag: member="spi.c::spiReleaseBus" ref="ga1b04a2410ef4323ee4e37c63f320c18f" args="(SPIDriver *spip)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void spiReleaseBus </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_s_p_i_driver.html">SPIDriver</a> *&nbsp;</td>
<td class="paramname"> <em>spip</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Releases exclusive access to the SPI bus. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>This function is only available when the <code>SPI_USE_MUTUAL_EXCLUSION</code> option is set to <code>TRUE</code>.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>spip</em>&nbsp;</td><td>pointer to the <code><a class="el" href="struct_s_p_i_driver.html" title="Structure representing a SPI driver.">SPIDriver</a></code> object </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="spi_8c_source.html#l00267">267</a> of file <a class="el" href="spi_8c_source.html">spi.c</a>.</p>
<p>References <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669">chMtxUnlock()</a>, and <a class="el" href="group__semaphores.html#ga7ec0cbda23e49e2370e0b91f20baf05e">chSemSignal()</a>.</p>
<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
<div class="center"><img src="group___s_p_i_ga1b04a2410ef4323ee4e37c63f320c18f_cgraph.png" border="0" usemap="#group___s_p_i_ga1b04a2410ef4323ee4e37c63f320c18f_cgraph_map" alt=""></div>
<map name="group___s_p_i_ga1b04a2410ef4323ee4e37c63f320c18f_cgraph_map" id="group___s_p_i_ga1b04a2410ef4323ee4e37c63f320c18f_cgraph">
<area shape="rect" href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669" title="Unlocks the next owned mutex in reverse lock order." alt="" coords="148,5,231,29"/> <area shape="rect" href="group__semaphores.html#ga7ec0cbda23e49e2370e0b91f20baf05e" title="Performs a signal operation on a semaphore." alt="" coords="148,53,231,77"/> <area shape="rect" href="group__scheduler.html#gae47a8819a21ef2d521124e76bfb37c95" title="Wakes up a thread." alt="" coords="280,5,379,29"/> <area shape="rect" href="group__internals.html#ga042479f09357fc59befebf4dfe0e9f4a" title="Removes the first&#45;out Thread from a queue and returns it." alt="" coords="289,53,369,77"/> </map>
</div>
</p>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated on Sun Jul 11 13:13:22 2010 for ChibiOS/RT by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.6.3</small></address>
</body>
</html>