226 lines
11 KiB
HTML
226 lines
11 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.3"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Sensor Watch: SPI Controller Driver</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">Sensor Watch<span id="projectnumber"> 0.0.0</span>
|
|
</div>
|
|
<div id="projectbrief">A board replacement for the classic Casio F-91W wristwatch, powered by a Microchip SAM L22 microcontroller.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.3 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle"><div class="title">SPI Controller Driver</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>This section covers functions related to the SAM L22's built-in SPI driver, including configuring the SPI bus and writing to / reading from devices.
|
|
<a href="#details">More...</a></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:ga77252649d1551483308f312131e80dec"><td class="memItemLeft" align="right" valign="top"><a id="ga77252649d1551483308f312131e80dec" name="ga77252649d1551483308f312131e80dec"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>watch_enable_spi</b> (void)</td></tr>
|
|
<tr class="memdesc:ga77252649d1551483308f312131e80dec"><td class="mdescLeft"> </td><td class="mdescRight">Enables the SPI peripheral. Call this before attempting to interface with SPI devices. <br /></td></tr>
|
|
<tr class="separator:ga77252649d1551483308f312131e80dec"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga8ff6df67e49f90daec4c6456d8c07f22"><td class="memItemLeft" align="right" valign="top"><a id="ga8ff6df67e49f90daec4c6456d8c07f22" name="ga8ff6df67e49f90daec4c6456d8c07f22"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>watch_disable_spi</b> (void)</td></tr>
|
|
<tr class="memdesc:ga8ff6df67e49f90daec4c6456d8c07f22"><td class="mdescLeft"> </td><td class="mdescRight">Disables the SPI peripheral. <br /></td></tr>
|
|
<tr class="separator:ga8ff6df67e49f90daec4c6456d8c07f22"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga9e1b869726dc01834ac9a365b32ec492"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#ga9e1b869726dc01834ac9a365b32ec492">watch_spi_write</a> (const uint8_t *buf, uint16_t length)</td></tr>
|
|
<tr class="memdesc:ga9e1b869726dc01834ac9a365b32ec492"><td class="mdescLeft"> </td><td class="mdescRight">Writes a series of values to a device on the SPI bus. <a href="group__spi.html#ga9e1b869726dc01834ac9a365b32ec492">More...</a><br /></td></tr>
|
|
<tr class="separator:ga9e1b869726dc01834ac9a365b32ec492"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga20b320293d43a867233b5bedeeab07b3"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#ga20b320293d43a867233b5bedeeab07b3">watch_spi_read</a> (uint8_t *buf, uint16_t length)</td></tr>
|
|
<tr class="memdesc:ga20b320293d43a867233b5bedeeab07b3"><td class="mdescLeft"> </td><td class="mdescRight">Reads a series of values from a device on the SPI bus. <a href="group__spi.html#ga20b320293d43a867233b5bedeeab07b3">More...</a><br /></td></tr>
|
|
<tr class="separator:ga20b320293d43a867233b5bedeeab07b3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga350791f4a5eb66d0725cd418d1cd1087"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__spi.html#ga350791f4a5eb66d0725cd418d1cd1087">watch_spi_transfer</a> (const uint8_t *data_out, uint8_t *data_in, uint16_t length)</td></tr>
|
|
<tr class="memdesc:ga350791f4a5eb66d0725cd418d1cd1087"><td class="mdescLeft"> </td><td class="mdescRight">Reads a series of values from a device on the SPI bus. <a href="group__spi.html#ga350791f4a5eb66d0725cd418d1cd1087">More...</a><br /></td></tr>
|
|
<tr class="separator:ga350791f4a5eb66d0725cd418d1cd1087"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<p >This section covers functions related to the SAM L22's built-in SPI driver, including configuring the SPI bus and writing to / reading from devices. </p>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<a id="ga20b320293d43a867233b5bedeeab07b3" name="ga20b320293d43a867233b5bedeeab07b3"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga20b320293d43a867233b5bedeeab07b3">◆ </a></span>watch_spi_read()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool watch_spi_read </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t * </td>
|
|
<td class="paramname"><em>buf</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>length</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Reads a series of values from a device on the SPI bus. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">buf</td><td>Storage for the incoming bytes; on return, it will contain the received data. </td></tr>
|
|
<tr><td class="paramname">length</td><td>The number of bytes that you wish to receive. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section note"><dt>Note</dt><dd>This function does not manage the chip select pin (usually A3). </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga350791f4a5eb66d0725cd418d1cd1087" name="ga350791f4a5eb66d0725cd418d1cd1087"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga350791f4a5eb66d0725cd418d1cd1087">◆ </a></span>watch_spi_transfer()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool watch_spi_transfer </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const uint8_t * </td>
|
|
<td class="paramname"><em>data_out</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint8_t * </td>
|
|
<td class="paramname"><em>data_in</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>length</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Reads a series of values from a device on the SPI bus. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">data_out</td><td>Storage for outgoing bytes. </td></tr>
|
|
<tr><td class="paramname">data_in</td><td>Storage for incoming bytes. </td></tr>
|
|
<tr><td class="paramname">length</td><td>The number of bytes to transfer. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section note"><dt>Note</dt><dd>This function does not manage the chip select pin (usually A3). </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga9e1b869726dc01834ac9a365b32ec492" name="ga9e1b869726dc01834ac9a365b32ec492"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga9e1b869726dc01834ac9a365b32ec492">◆ </a></span>watch_spi_write()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool watch_spi_write </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const uint8_t * </td>
|
|
<td class="paramname"><em>buf</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>length</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Writes a series of values to a device on the SPI bus. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">buf</td><td>A series of unsigned bytes; the data you wish to transmit. </td></tr>
|
|
<tr><td class="paramname">length</td><td>The number of bytes in buf that you wish to send. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section note"><dt>Note</dt><dd>This function does not manage the chip select pin (usually A3). </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
|
|
</small></address>
|
|
</body>
|
|
</html>
|