gnuk/ChibiOS_2.0.6/docs/html/group___p_a_l.html

1349 lines
75 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: PAL 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">
2010-11-22 05:53:37 +00:00
<!-- Generated by Doxygen 1.7.1 -->
2010-08-10 03:11:02 +00:00
<div class="navigation" id="top">
<div class="tabs">
2010-11-22 05:53:37 +00:00
<ul class="tablist">
2010-08-10 03:11:02 +00:00
<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>
2010-11-22 05:53:37 +00:00
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#groups">Modules</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
2010-08-10 03:11:02 +00:00
<h1>PAL Driver<br/>
<small>
[<a class="el" href="group___i_o.html">HAL</a>]</small>
2010-11-22 05:53:37 +00:00
</h1> </div>
</div>
<div class="contents">
2010-08-10 03:11:02 +00:00
<p>I/O Ports Abstraction Layer.
<a href="#_details">More...</a></p>
<p><div class="dynheader">
Collaboration diagram for PAL Driver:</div>
2010-11-22 05:53:37 +00:00
<div class="dyncontent">
<center><table><tr><td><img src="group___p_a_l.png" border="0" alt="" usemap="#group______p__a__l"/>
<map name="group______p__a__l" id="group______p__a__l">
<area shape="rect" id="node1" href="group___p_a_l___l_l_d.html" title="PAL Driver low level driver template." alt="" coords="219,5,347,32"/> <area shape="rect" id="node2" href="group___i_o.html" title="Hardware Abstraction Layer." alt="" coords="5,5,48,32"/> </map>
</td></tr></table></center>
2010-08-10 03:11:02 +00:00
</div>
</p>
<hr/><a name="_details"></a><h2>Description</h2>
<p>I/O Ports Abstraction Layer. </p>
<p>This module defines an abstract interface for digital I/O ports. Note that most I/O ports functions are just macros. The macros have default software implementations that can be redefined in a <a class="el" href="group___p_a_l___l_l_d.html">PAL Low Level Driver</a> if the target hardware supports special features like, as example, atomic bit set/reset/masking. Please refer to the ports specific documentation for details.<br/>
The <a class="el" href="group___p_a_l.html">PAL Driver</a> has the advantage to make the access to the I/O ports platform independent and still be optimized for the specific architectures.<br/>
Note that the <a class="el" href="group___p_a_l___l_l_d.html">PAL Low Level Driver</a> may also offer non standard macro and functions in order to support specific features but, of course, the use of such interfaces would not be portable. Such interfaces shall be marked with the architecture name inside the function names.</p>
<h2>Implementation Rules</h2>
<p>In implementing an <a class="el" href="group___p_a_l___l_l_d.html">PAL Low Level Driver</a> there are some rules/behaviors that should be respected.</p>
<h3>Writing on input pads</h3>
<p>The behavior is not specified but there are implementations better than others, this is the list of possible implementations, preferred options are on top:</p>
<ol type="1">
<li>The written value is not actually output but latched, should the pads be reprogrammed as outputs the value would be in effect.</li>
<li>The write operation is ignored.</li>
<li>The write operation has side effects, as example disabling/enabling pull up/down resistors or changing the pad direction. This scenario is discouraged, please try to avoid this scenario.</li>
</ol>
<h3>Reading from output pads</h3>
<p>The behavior is not specified but there are implementations better than others, this is the list of possible implementations, preferred options are on top:</p>
<ol type="1">
<li>The actual pads states are read (not the output latch).</li>
<li>The output latch value is read (regardless of the actual pads states).</li>
<li>Unspecified, please try to avoid this scenario.</li>
</ol>
<h3>Writing unused or unimplemented port bits</h3>
<p>The behavior is not specified.</p>
<h3>Reading from unused or unimplemented port bits</h3>
<p>The behavior is not specified.</p>
<h3>Reading or writing on pins associated to other functionalities</h3>
<p>The behavior is not specified.</p>
<h2>Usage</h2>
<p>The use of I/O ports requires the inclusion of the header file <code><a class="el" href="pal_8h.html" title="I/O Ports Abstraction Layer macros, types and structures.">pal.h</a></code>, this file is not automatically included <code><a class="el" href="ch_8h.html" title="ChibiOS/RT main include file.">ch.h</a></code> like the other header files. </p>
2010-11-22 05:53:37 +00:00
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_i_o_bus.html">IOBus</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">I/O bus descriptor. <a href="struct_i_o_bus.html#_details">More...</a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="groups"></a>
Modules</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l___l_l_d.html">PAL Low Level Driver</a></td></tr>
<p><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p><a class="el" href="group___p_a_l.html">PAL Driver</a> low level driver template. </p>
<br/></td></tr>
</p>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga75a61e666497d9486a2d0495a2ad9e83">PAL_MODE_MASK</a>&nbsp;&nbsp;&nbsp;0xF</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bits in a mode word dedicated as mode selector. <a href="#ga75a61e666497d9486a2d0495a2ad9e83"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga3f3d0c21b3190fc732a4c51b8d1e6c8d">PAL_MODE_RESET</a>&nbsp;&nbsp;&nbsp;0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">After reset state. <a href="#ga3f3d0c21b3190fc732a4c51b8d1e6c8d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga688f69ad947fc020c9d3840b542e1958">PAL_MODE_UNCONNECTED</a>&nbsp;&nbsp;&nbsp;1</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Safe state for <b>unconnected</b> pads. <a href="#ga688f69ad947fc020c9d3840b542e1958"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga6a896b827967dc3016560920d7d74d63">PAL_MODE_INPUT</a>&nbsp;&nbsp;&nbsp;2</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Regular input high-Z pad. <a href="#ga6a896b827967dc3016560920d7d74d63"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gadb37ffcbe38167c0642f7618f0d5b398">PAL_MODE_INPUT_PULLUP</a>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input pad with weak pull up resistor. <a href="#gadb37ffcbe38167c0642f7618f0d5b398"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga0b2c436c6b72194e8c81f92c4e8c0312">PAL_MODE_INPUT_PULLDOWN</a>&nbsp;&nbsp;&nbsp;4</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Input pad with weak pull down resistor. <a href="#ga0b2c436c6b72194e8c81f92c4e8c0312"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga4c506305ade80cef5e580bc65ec54349">PAL_MODE_INPUT_ANALOG</a>&nbsp;&nbsp;&nbsp;5</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Analog input mode. <a href="#ga4c506305ade80cef5e580bc65ec54349"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gaedde8679d38abe282c7a70d75a04cda6">PAL_MODE_OUTPUT_PUSHPULL</a>&nbsp;&nbsp;&nbsp;6</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Push-pull output pad. <a href="#gaedde8679d38abe282c7a70d75a04cda6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga174456e1b2ba6ce57f196de6db8c846c">PAL_MODE_OUTPUT_OPENDRAIN</a>&nbsp;&nbsp;&nbsp;7</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open-drain output pad. <a href="#ga174456e1b2ba6ce57f196de6db8c846c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gabdc4b674dd16fd5dbe8aa36b884cf3ed">PAL_LOW</a>&nbsp;&nbsp;&nbsp;0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Logical low state. <a href="#gabdc4b674dd16fd5dbe8aa36b884cf3ed"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga6a0e02bcb9a99574ff39d32db9a48f63">PAL_HIGH</a>&nbsp;&nbsp;&nbsp;1</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Logical high state. <a href="#ga6a0e02bcb9a99574ff39d32db9a48f63"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga7355801d0ad0c2dc5fd181115d899e74">PAL_PORT_BIT</a>(n)&nbsp;&nbsp;&nbsp;((<a class="el" href="group___p_a_l___l_l_d.html#ga6115967a8db28246105e03741ff5eb18">ioportmask_t</a>)(1 &lt;&lt; (n)))</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Port bit helper macro. <a href="#ga7355801d0ad0c2dc5fd181115d899e74"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga394f79edb774c84dcbaec679df4de24f">PAL_GROUP_MASK</a>(width)&nbsp;&nbsp;&nbsp;((<a class="el" href="group___p_a_l___l_l_d.html#ga6115967a8db28246105e03741ff5eb18">ioportmask_t</a>)(1 &lt;&lt; (width)) - 1)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bits group mask helper. <a href="#ga394f79edb774c84dcbaec679df4de24f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga9b2ca125fccdac75e7513b597f3a4a39">_IOBUS_DATA</a>(name, port, width, offset)&nbsp;&nbsp;&nbsp;{port, PAL_GROUP_MASK(width), offset}</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Data part of a static I/O bus initializer. <a href="#ga9b2ca125fccdac75e7513b597f3a4a39"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga94861905a3eda098da30009d710fb176">IOBUS_DECL</a>(name, port, width, offset)&nbsp;&nbsp;&nbsp;<a class="el" href="struct_i_o_bus.html">IOBus</a> name = _IOBUS_DATA(name, port, width, offset)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Static I/O bus initializer. <a href="#ga94861905a3eda098da30009d710fb176"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga5a9743283a30e13f2513f5abbcac9f97">palInit</a>(config)&nbsp;&nbsp;&nbsp;pal_lld_init(config)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">PAL subsystem initialization. <a href="#ga5a9743283a30e13f2513f5abbcac9f97"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gaf9df3944b1ef206cce8c42ba5de5e3f9">palReadPort</a>(port)&nbsp;&nbsp;&nbsp;((void)(port), 0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads the physical I/O port states. <a href="#gaf9df3944b1ef206cce8c42ba5de5e3f9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga250da7237d3ccf872944d77d151fce24">palReadLatch</a>(port)&nbsp;&nbsp;&nbsp;((void)(port), 0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads the output latch. <a href="#ga250da7237d3ccf872944d77d151fce24"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga7b6d3c589c78f451bc9e1fb080222e71">palWritePort</a>(port, bits)&nbsp;&nbsp;&nbsp;((void)(port), (void)(bits))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes a bits mask on a I/O port. <a href="#ga7b6d3c589c78f451bc9e1fb080222e71"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gafd09c5ce655dd5daf9b39cd5f842e422">palSetPort</a>(port, bits)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets a bits mask on a I/O port. <a href="#gafd09c5ce655dd5daf9b39cd5f842e422"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga5ff3b75aeb4fcd1cb82f451f952ab9a9">palClearPort</a>(port, bits)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clears a bits mask on a I/O port. <a href="#ga5ff3b75aeb4fcd1cb82f451f952ab9a9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga55408d900323e7dd43c0fa83337de7ba">palTogglePort</a>(port, bits)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Toggles a bits mask on a I/O port. <a href="#ga55408d900323e7dd43c0fa83337de7ba"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gad286cfdb9f088a7c8e5085d19ac728d3">palReadGroup</a>(port, mask, offset)&nbsp;&nbsp;&nbsp;((palReadPort(port) &gt;&gt; (offset)) &amp; (mask))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads a group of bits. <a href="#gad286cfdb9f088a7c8e5085d19ac728d3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gacb25ee0b16d9fb701e3fd21e5dbb990a">palWriteGroup</a>(port, mask, offset, bits)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes a group of bits. <a href="#gacb25ee0b16d9fb701e3fd21e5dbb990a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga24789efd90288773d2f928458d1dc6e5">palSetGroupMode</a>(port, mask, mode)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pads group mode setup. <a href="#ga24789efd90288773d2f928458d1dc6e5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga06917ae7f34a92d3a04be8e9364dcfbf">palReadPad</a>(port, pad)&nbsp;&nbsp;&nbsp;((palReadPort(port) &gt;&gt; (pad)) &amp; 1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reads an input pad logical state. <a href="#ga06917ae7f34a92d3a04be8e9364dcfbf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga1b2ea64780d20f11eedaeb34c5b42daa">palWritePad</a>(port, pad, bit)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes a logical state on an output pad. <a href="#ga1b2ea64780d20f11eedaeb34c5b42daa"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gaf2c820c1657afa77cdce398329baaf68">palSetPad</a>(port, pad)&nbsp;&nbsp;&nbsp;palSetPort(port, PAL_PORT_BIT(pad))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets a pad logical state to <code>PAL_HIGH</code>. <a href="#gaf2c820c1657afa77cdce398329baaf68"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga4dce65e0515a349a06bea353f2303286">palClearPad</a>(port, pad)&nbsp;&nbsp;&nbsp;palClearPort(port, PAL_PORT_BIT(pad))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clears a pad logical state to <code>PAL_LOW</code>. <a href="#ga4dce65e0515a349a06bea353f2303286"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga76b4f6024add76681d618f5ac7daeedf">palTogglePad</a>(port, pad)&nbsp;&nbsp;&nbsp;palTogglePort(port, PAL_PORT_BIT(pad))</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Toggles a pad logical state. <a href="#ga76b4f6024add76681d618f5ac7daeedf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gab6377829df3700e742044a2e669c7db7">palSetPadMode</a>(port, pad, mode)&nbsp;&nbsp;&nbsp;palSetGroupMode(port, PAL_PORT_BIT(pad), mode)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Pad mode setup. <a href="#gab6377829df3700e742044a2e669c7db7"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___p_a_l___l_l_d.html#ga6115967a8db28246105e03741ff5eb18">ioportmask_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#gac464cacee6890a3eab2e2db1b7d8d6f9">palReadBus</a> (<a class="el" href="struct_i_o_bus.html">IOBus</a> *bus)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read from an I/O bus. <a href="#gac464cacee6890a3eab2e2db1b7d8d6f9"></a><br/></td></tr>
2010-11-22 05:53:37 +00:00
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___p_a_l.html#ga486b5ab6062e6a8f9d5efdd7a8908a79">palWriteBus</a> (<a class="el" href="struct_i_o_bus.html">IOBus</a> *bus, <a class="el" href="group___p_a_l___l_l_d.html#ga6115967a8db28246105e03741ff5eb18">ioportmask_t</a> bits)</td></tr>
2010-08-10 03:11:02 +00:00
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write to an I/O bus. <a href="#ga486b5ab6062e6a8f9d5efdd7a8908a79"></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___p_a_l.html#ga25ef645e442638716008408357f4ea59">palSetBusMode</a> (<a class="el" href="struct_i_o_bus.html">IOBus</a> *bus, <a class="el" href="group___s_t_m8___c_o_r_e.html#gad0fca8b15c218d2c687f8c373a71d228">uint_fast8_t</a> mode)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Programs a bus with the specified mode. <a href="#ga25ef645e442638716008408357f4ea59"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga75a61e666497d9486a2d0495a2ad9e83"></a><!-- doxytag: member="pal.h::PAL_MODE_MASK" ref="ga75a61e666497d9486a2d0495a2ad9e83" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_MASK&nbsp;&nbsp;&nbsp;0xF</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Bits in a mode word dedicated as mode selector. </p>
<p>The other bits are not defined and may be used as device-specific option bits. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00049">49</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga3f3d0c21b3190fc732a4c51b8d1e6c8d"></a><!-- doxytag: member="pal.h::PAL_MODE_RESET" ref="ga3f3d0c21b3190fc732a4c51b8d1e6c8d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_RESET&nbsp;&nbsp;&nbsp;0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>After reset state. </p>
<p>The state itself is not specified and is architecture dependent, it is guaranteed to be equal to the after-reset state. It is usually an input state. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00057">57</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga688f69ad947fc020c9d3840b542e1958"></a><!-- doxytag: member="pal.h::PAL_MODE_UNCONNECTED" ref="ga688f69ad947fc020c9d3840b542e1958" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_UNCONNECTED&nbsp;&nbsp;&nbsp;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Safe state for <b>unconnected</b> pads. </p>
<p>The state itself is not specified and is architecture dependent, it may be mapped on <code>PAL_MODE_INPUT_PULLUP</code>, <code>PAL_MODE_INPUT_PULLDOWN</code> or <code>PAL_MODE_OUTPUT_PUSHPULL</code> as example. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00066">66</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga6a896b827967dc3016560920d7d74d63"></a><!-- doxytag: member="pal.h::PAL_MODE_INPUT" ref="ga6a896b827967dc3016560920d7d74d63" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_INPUT&nbsp;&nbsp;&nbsp;2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Regular input high-Z pad. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00071">71</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="gadb37ffcbe38167c0642f7618f0d5b398"></a><!-- doxytag: member="pal.h::PAL_MODE_INPUT_PULLUP" ref="gadb37ffcbe38167c0642f7618f0d5b398" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_INPUT_PULLUP&nbsp;&nbsp;&nbsp;3</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Input pad with weak pull up resistor. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00076">76</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga0b2c436c6b72194e8c81f92c4e8c0312"></a><!-- doxytag: member="pal.h::PAL_MODE_INPUT_PULLDOWN" ref="ga0b2c436c6b72194e8c81f92c4e8c0312" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_INPUT_PULLDOWN&nbsp;&nbsp;&nbsp;4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Input pad with weak pull down resistor. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00081">81</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga4c506305ade80cef5e580bc65ec54349"></a><!-- doxytag: member="pal.h::PAL_MODE_INPUT_ANALOG" ref="ga4c506305ade80cef5e580bc65ec54349" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_INPUT_ANALOG&nbsp;&nbsp;&nbsp;5</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Analog input mode. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00086">86</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="gaedde8679d38abe282c7a70d75a04cda6"></a><!-- doxytag: member="pal.h::PAL_MODE_OUTPUT_PUSHPULL" ref="gaedde8679d38abe282c7a70d75a04cda6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_OUTPUT_PUSHPULL&nbsp;&nbsp;&nbsp;6</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Push-pull output pad. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00091">91</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga174456e1b2ba6ce57f196de6db8c846c"></a><!-- doxytag: member="pal.h::PAL_MODE_OUTPUT_OPENDRAIN" ref="ga174456e1b2ba6ce57f196de6db8c846c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_MODE_OUTPUT_OPENDRAIN&nbsp;&nbsp;&nbsp;7</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Open-drain output pad. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00096">96</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="gabdc4b674dd16fd5dbe8aa36b884cf3ed"></a><!-- doxytag: member="pal.h::PAL_LOW" ref="gabdc4b674dd16fd5dbe8aa36b884cf3ed" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_LOW&nbsp;&nbsp;&nbsp;0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Logical low state. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00101">101</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga6a0e02bcb9a99574ff39d32db9a48f63"></a><!-- doxytag: member="pal.h::PAL_HIGH" ref="ga6a0e02bcb9a99574ff39d32db9a48f63" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_HIGH&nbsp;&nbsp;&nbsp;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Logical high state. </p>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00106">106</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga7355801d0ad0c2dc5fd181115d899e74"></a><!-- doxytag: member="pal.h::PAL_PORT_BIT" ref="ga7355801d0ad0c2dc5fd181115d899e74" args="(n)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_PORT_BIT</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">n</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
2010-11-22 05:53:37 +00:00
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group___p_a_l___l_l_d.html#ga6115967a8db28246105e03741ff5eb18">ioportmask_t</a>)(1 &lt;&lt; (n)))</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Port bit helper macro. </p>
<p>This macro calculates the mask of a bit within a port.</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>n</em>&nbsp;</td><td>bit position within the port </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The bit mask. </dd></dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00157">157</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga394f79edb774c84dcbaec679df4de24f"></a><!-- doxytag: member="pal.h::PAL_GROUP_MASK" ref="ga394f79edb774c84dcbaec679df4de24f" args="(width)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PAL_GROUP_MASK</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">width</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
2010-11-22 05:53:37 +00:00
<td>&nbsp;&nbsp;&nbsp;((<a class="el" href="group___p_a_l___l_l_d.html#ga6115967a8db28246105e03741ff5eb18">ioportmask_t</a>)(1 &lt;&lt; (width)) - 1)</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Bits group mask helper. </p>
<p>This macro calculates the mask of a bits group.</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>width</em>&nbsp;</td><td>group width </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The group mask. </dd></dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00167">167</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga9b2ca125fccdac75e7513b597f3a4a39"></a><!-- doxytag: member="pal.h::_IOBUS_DATA" ref="ga9b2ca125fccdac75e7513b597f3a4a39" args="(name, port, width, offset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _IOBUS_DATA</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">name, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">width, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">offset</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;{port, PAL_GROUP_MASK(width), offset}</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Data part of a static I/O bus initializer. </p>
<p>This macro should be used when statically initializing an I/O bus that is part of a bigger 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>name</em>&nbsp;</td><td>name of the <a class="el" href="struct_i_o_bus.html" title="I/O bus descriptor.">IOBus</a> variable </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>port</em>&nbsp;</td><td>I/O port descriptor </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>width</em>&nbsp;</td><td>bus width in bits </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>bus bit offset within the port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00179">179</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga94861905a3eda098da30009d710fb176"></a><!-- doxytag: member="pal.h::IOBUS_DECL" ref="ga94861905a3eda098da30009d710fb176" args="(name, port, width, offset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define IOBUS_DECL</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">name, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">width, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">offset</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;<a class="el" href="struct_i_o_bus.html">IOBus</a> name = _IOBUS_DATA(name, port, width, offset)</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Static I/O bus initializer. </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>name</em>&nbsp;</td><td>name of the <a class="el" href="struct_i_o_bus.html" title="I/O bus descriptor.">IOBus</a> variable </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>port</em>&nbsp;</td><td>I/O port descriptor </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>width</em>&nbsp;</td><td>bus width in bits </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>bus bit offset within the port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00190">190</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga5a9743283a30e13f2513f5abbcac9f97"></a><!-- doxytag: member="pal.h::palInit" ref="ga5a9743283a30e13f2513f5abbcac9f97" args="(config)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palInit</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">config</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;pal_lld_init(config)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PAL subsystem initialization. </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>config</em>&nbsp;</td><td>pointer to an architecture specific configuration structure. This structure is defined in the low level driver header. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00200">200</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
<p>Referenced by <a class="el" href="group___h_a_l.html#gafd89c1650df524d95aef39b8bc38170d">halInit()</a>.</p>
</div>
</div>
<a class="anchor" id="gaf9df3944b1ef206cce8c42ba5de5e3f9"></a><!-- doxytag: member="pal.h::palReadPort" ref="gaf9df3944b1ef206cce8c42ba5de5e3f9" args="(port)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palReadPort</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((void)(port), 0)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the physical I/O port states. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The default implementation always return zero and computes the parameter eventual side effects.</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>port</em>&nbsp;</td><td>port identifier </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The port logical states. </dd></dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00211">211</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga250da7237d3ccf872944d77d151fce24"></a><!-- doxytag: member="pal.h::palReadLatch" ref="ga250da7237d3ccf872944d77d151fce24" args="(port)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palReadLatch</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port</td>
2010-08-10 03:11:02 +00:00
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;((void)(port), 0)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads the output latch. </p>
<p>The purpose of this function is to read back the latched output value. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The default implementation always return zero and computes the parameter eventual side effects.</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>port</em>&nbsp;</td><td>port identifier </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The latched logical states. </dd></dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00227">227</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga7b6d3c589c78f451bc9e1fb080222e71"></a><!-- doxytag: member="pal.h::palWritePort" ref="ga7b6d3c589c78f451bc9e1fb080222e71" args="(port, bits)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palWritePort</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">bits</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;((void)(port), (void)(bits))</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Writes a bits mask on a I/O port. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The default implementation does nothing except computing the parameters eventual side effects.</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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bits</em>&nbsp;</td><td>bits to be written on the specified port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00241">241</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="gafd09c5ce655dd5daf9b39cd5f842e422"></a><!-- doxytag: member="pal.h::palSetPort" ref="gafd09c5ce655dd5daf9b39cd5f842e422" args="(port, bits)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palSetPort</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">bits</td><td>&nbsp;</td>
</tr>
<tr>
2010-08-10 03:11:02 +00:00
<td></td>
2010-11-22 05:53:37 +00:00
<td>)</td>
<td></td><td></td><td></td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<a class="code" href="group___p_a_l.html#ga7b6d3c589c78f451bc9e1fb080222e71" title="Writes a bits mask on a I/O port.">palWritePort</a>(port, <a class="code" href="group___p_a_l.html#ga250da7237d3ccf872944d77d151fce24" title="Reads the output latch.">palReadLatch</a>(port) | (bits)); \
}
</pre></div>
<p>Sets a bits mask on a I/O port. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding.</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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bits</em>&nbsp;</td><td>bits to be ORed on the specified port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00260">260</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga5ff3b75aeb4fcd1cb82f451f952ab9a9"></a><!-- doxytag: member="pal.h::palClearPort" ref="ga5ff3b75aeb4fcd1cb82f451f952ab9a9" args="(port, bits)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palClearPort</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">bits</td><td>&nbsp;</td>
</tr>
<tr>
2010-08-10 03:11:02 +00:00
<td></td>
2010-11-22 05:53:37 +00:00
<td>)</td>
<td></td><td></td><td></td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<a class="code" href="group___p_a_l.html#ga7b6d3c589c78f451bc9e1fb080222e71" title="Writes a bits mask on a I/O port.">palWritePort</a>(port, <a class="code" href="group___p_a_l.html#ga250da7237d3ccf872944d77d151fce24" title="Reads the output latch.">palReadLatch</a>(port) &amp; ~(bits)); \
}
</pre></div>
<p>Clears a bits mask on a I/O port. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding.</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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bits</em>&nbsp;</td><td>bits to be cleared on the specified port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00282">282</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga55408d900323e7dd43c0fa83337de7ba"></a><!-- doxytag: member="pal.h::palTogglePort" ref="ga55408d900323e7dd43c0fa83337de7ba" args="(port, bits)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palTogglePort</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">bits</td><td>&nbsp;</td>
</tr>
<tr>
2010-08-10 03:11:02 +00:00
<td></td>
2010-11-22 05:53:37 +00:00
<td>)</td>
<td></td><td></td><td></td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<a class="code" href="group___p_a_l.html#ga7b6d3c589c78f451bc9e1fb080222e71" title="Writes a bits mask on a I/O port.">palWritePort</a>(port, <a class="code" href="group___p_a_l.html#ga250da7237d3ccf872944d77d151fce24" title="Reads the output latch.">palReadLatch</a>(port) ^ (bits)); \
}
</pre></div>
<p>Toggles a bits mask on a I/O port. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding.</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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bits</em>&nbsp;</td><td>bits to be XORed on the specified port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00303">303</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="gad286cfdb9f088a7c8e5085d19ac728d3"></a><!-- doxytag: member="pal.h::palReadGroup" ref="gad286cfdb9f088a7c8e5085d19ac728d3" args="(port, mask, offset)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palReadGroup</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">mask, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">offset</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;((palReadPort(port) &gt;&gt; (offset)) &amp; (mask))</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads a group of bits. </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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>group mask, a logical AND is performed on the input data </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>group bit offset within the port </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The group logical states. </dd></dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00320">320</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
<p>Referenced by <a class="el" href="group___p_a_l.html#gac464cacee6890a3eab2e2db1b7d8d6f9">palReadBus()</a>.</p>
</div>
</div>
<a class="anchor" id="gacb25ee0b16d9fb701e3fd21e5dbb990a"></a><!-- doxytag: member="pal.h::palWriteGroup" ref="gacb25ee0b16d9fb701e3fd21e5dbb990a" args="(port, mask, offset, bits)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palWriteGroup</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">mask, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">offset, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">bits</td><td>&nbsp;</td>
</tr>
<tr>
2010-08-10 03:11:02 +00:00
<td></td>
2010-11-22 05:53:37 +00:00
<td>)</td>
<td></td><td></td><td></td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<a class="code" href="group___p_a_l.html#ga7b6d3c589c78f451bc9e1fb080222e71" title="Writes a bits mask on a I/O port.">palWritePort</a>(port, (<a class="code" href="group___p_a_l.html#ga250da7237d3ccf872944d77d151fce24" title="Reads the output latch.">palReadLatch</a>(port) &amp; ~((mask) &lt;&lt; (offset))) | \
(((bits) &amp; (mask)) &lt;&lt; (offset))); \
}
</pre></div>
<p>Writes a group of bits. </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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>group mask, a logical AND is performed on the output data </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>offset</em>&nbsp;</td><td>group bit offset within the port </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bits</em>&nbsp;</td><td>bits to be written. Values exceeding the group width are masked. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00337">337</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
<p>Referenced by <a class="el" href="group___p_a_l.html#ga486b5ab6062e6a8f9d5efdd7a8908a79">palWriteBus()</a>.</p>
</div>
</div>
<a class="anchor" id="ga24789efd90288773d2f928458d1dc6e5"></a><!-- doxytag: member="pal.h::palSetGroupMode" ref="ga24789efd90288773d2f928458d1dc6e5" args="(port, mask, mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palSetGroupMode</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">mask, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">mode</td><td>&nbsp;</td>
</tr>
<tr>
2010-08-10 03:11:02 +00:00
<td></td>
2010-11-22 05:53:37 +00:00
<td>)</td>
<td></td><td></td><td></td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Pads group mode setup. </p>
<p>This function programs a pads group belonging to the same port with the specified mode. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Programming an unknown or unsupported mode is silently ignored.</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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mask</em>&nbsp;</td><td>group mask </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mode</em>&nbsp;</td><td>group mode </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00359">359</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
<p>Referenced by <a class="el" href="group___p_a_l.html#ga25ef645e442638716008408357f4ea59">palSetBusMode()</a>.</p>
</div>
</div>
<a class="anchor" id="ga06917ae7f34a92d3a04be8e9364dcfbf"></a><!-- doxytag: member="pal.h::palReadPad" ref="ga06917ae7f34a92d3a04be8e9364dcfbf" args="(port, pad)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palReadPad</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">pad</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;((palReadPort(port) &gt;&gt; (pad)) &amp; 1)</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Reads an input pad logical state. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The default implementation not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding. </dd>
<dd>
The default implementation internally uses the <code><a class="el" href="group___p_a_l.html#gaf9df3944b1ef206cce8c42ba5de5e3f9" title="Reads the physical I/O port states.">palReadPort()</a></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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pad</em>&nbsp;</td><td>pad number within the port </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The logical state. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>PAL_LOW</em>&nbsp;</td><td>low logical state. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>PAL_HIGH</em>&nbsp;</td><td>high logical state. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00379">379</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga1b2ea64780d20f11eedaeb34c5b42daa"></a><!-- doxytag: member="pal.h::palWritePad" ref="ga1b2ea64780d20f11eedaeb34c5b42daa" args="(port, pad, bit)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palWritePad</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">pad, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">bit</td><td>&nbsp;</td>
</tr>
<tr>
2010-08-10 03:11:02 +00:00
<td></td>
2010-11-22 05:53:37 +00:00
<td>)</td>
<td></td><td></td><td></td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<a class="code" href="group___p_a_l.html#ga7b6d3c589c78f451bc9e1fb080222e71" title="Writes a bits mask on a I/O port.">palWritePort</a>(port, (<a class="code" href="group___p_a_l.html#ga250da7237d3ccf872944d77d151fce24" title="Reads the output latch.">palReadLatch</a>(port) &amp; ~<a class="code" href="group___p_a_l.html#ga7355801d0ad0c2dc5fd181115d899e74" title="Port bit helper macro.">PAL_PORT_BIT</a>(pad)) | \
(((bit) &amp; 1) &lt;&lt; pad)); \
}
</pre></div>
<p>Writes a logical state on an output pad. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding. </dd>
<dd>
The default implementation internally uses the <code><a class="el" href="group___p_a_l.html#ga250da7237d3ccf872944d77d151fce24" title="Reads the output latch.">palReadLatch()</a></code> and <code><a class="el" href="group___p_a_l.html#ga7b6d3c589c78f451bc9e1fb080222e71" title="Writes a bits mask on a I/O port.">palWritePort()</a></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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pad</em>&nbsp;</td><td>pad number within the port </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bit</em>&nbsp;</td><td>logical value, the value must be <code>PAL_LOW</code> or <code>PAL_HIGH</code> </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00402">402</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="gaf2c820c1657afa77cdce398329baaf68"></a><!-- doxytag: member="pal.h::palSetPad" ref="gaf2c820c1657afa77cdce398329baaf68" args="(port, pad)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palSetPad</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">pad</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;palSetPort(port, PAL_PORT_BIT(pad))</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets a pad logical state to <code>PAL_HIGH</code>. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding. </dd>
<dd>
The default implementation internally uses the <code><a class="el" href="group___p_a_l.html#gafd09c5ce655dd5daf9b39cd5f842e422" title="Sets a bits mask on a I/O port.">palSetPort()</a></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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pad</em>&nbsp;</td><td>pad number within the port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00425">425</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga4dce65e0515a349a06bea353f2303286"></a><!-- doxytag: member="pal.h::palClearPad" ref="ga4dce65e0515a349a06bea353f2303286" args="(port, pad)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palClearPad</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">pad</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;palClearPort(port, PAL_PORT_BIT(pad))</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Clears a pad logical state to <code>PAL_LOW</code>. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding. </dd>
<dd>
The default implementation internally uses the <code><a class="el" href="group___p_a_l.html#ga5ff3b75aeb4fcd1cb82f451f952ab9a9" title="Clears a bits mask on a I/O port.">palClearPort()</a></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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pad</em>&nbsp;</td><td>pad number within the port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00445">445</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga76b4f6024add76681d618f5ac7daeedf"></a><!-- doxytag: member="pal.h::palTogglePad" ref="ga76b4f6024add76681d618f5ac7daeedf" args="(port, pad)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palTogglePad</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">pad</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;palTogglePort(port, PAL_PORT_BIT(pad))</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Toggles a pad logical state. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding. </dd>
<dd>
The default implementation internally uses the <code><a class="el" href="group___p_a_l.html#ga55408d900323e7dd43c0fa83337de7ba" title="Toggles a bits mask on a I/O port.">palTogglePort()</a></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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pad</em>&nbsp;</td><td>pad number within the port </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00465">465</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<a class="anchor" id="gab6377829df3700e742044a2e669c7db7"></a><!-- doxytag: member="pal.h::palSetPadMode" ref="gab6377829df3700e742044a2e669c7db7" args="(port, pad, mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define palSetPadMode</td>
<td>(</td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">port, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">pad, </td>
2010-08-10 03:11:02 +00:00
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype">&nbsp;</td>
<td class="paramname">mode</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;palSetGroupMode(port, PAL_PORT_BIT(pad), mode)</td>
2010-08-10 03:11:02 +00:00
</tr>
</table>
</div>
<div class="memdoc">
<p>Pad mode setup. </p>
<p>This function programs a pad with the specified mode. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The default implementation not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding. </dd>
<dd>
Programming an unknown or unsupported mode is silently ignored.</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>port</em>&nbsp;</td><td>port identifier </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>pad</em>&nbsp;</td><td>pad number within the port </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mode</em>&nbsp;</td><td>pad mode </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8h_source.html#l00484">484</a> of file <a class="el" href="pal_8h_source.html">pal.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gac464cacee6890a3eab2e2db1b7d8d6f9"></a><!-- doxytag: member="pal.h::palReadBus" ref="gac464cacee6890a3eab2e2db1b7d8d6f9" args="(IOBus *bus)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
2010-11-22 05:53:37 +00:00
<td class="memname"><a class="el" href="group___p_a_l___l_l_d.html#ga6115967a8db28246105e03741ff5eb18">ioportmask_t</a> palReadBus </td>
2010-08-10 03:11:02 +00:00
<td>(</td>
<td class="paramtype"><a class="el" href="struct_i_o_bus.html">IOBus</a> *&nbsp;</td>
<td class="paramname"> <em>bus</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Read from an I/O bus. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The function internally uses the <code><a class="el" href="group___p_a_l.html#gad286cfdb9f088a7c8e5085d19ac728d3" title="Reads a group of bits.">palReadGroup()</a></code> macro. The use of this function is preferred when you value code size, readability and error checking over speed.</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>bus</em>&nbsp;</td><td>the I/O bus, pointer to a <code><a class="el" href="struct_i_o_bus.html" title="I/O bus descriptor.">IOBus</a></code> structure </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The bus logical states. </dd></dl>
<p>Definition at line <a class="el" href="pal_8c_source.html#l00069">69</a> of file <a class="el" href="pal_8c_source.html">pal.c</a>.</p>
<p>References <a class="el" href="struct_i_o_bus.html#ab2efb4f2a7504ac2e737de26c1e4f33a">IOBus::bus_mask</a>, <a class="el" href="struct_i_o_bus.html#a50c155a7f9aa5b254faa372f0619286a">IOBus::bus_offset</a>, <a class="el" href="struct_i_o_bus.html#a79c1372324fc1d9d2c571ac6d47163f9">IOBus::bus_portid</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group___p_a_l___l_l_d.html#ga20ffc1985d583352e179f5f2c3fa700e">PAL_IOPORTS_WIDTH</a>, and <a class="el" href="group___p_a_l.html#gad286cfdb9f088a7c8e5085d19ac728d3">palReadGroup</a>.</p>
</div>
</div>
<a class="anchor" id="ga486b5ab6062e6a8f9d5efdd7a8908a79"></a><!-- doxytag: member="pal.h::palWriteBus" ref="ga486b5ab6062e6a8f9d5efdd7a8908a79" args="(IOBus *bus, ioportmask_t bits)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void palWriteBus </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_i_o_bus.html">IOBus</a> *&nbsp;</td>
<td class="paramname"> <em>bus</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
2010-11-22 05:53:37 +00:00
<td class="paramtype"><a class="el" href="group___p_a_l___l_l_d.html#ga6115967a8db28246105e03741ff5eb18">ioportmask_t</a>&nbsp;</td>
2010-08-10 03:11:02 +00:00
<td class="paramname"> <em>bits</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Write to an I/O bus. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding.</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>bus</em>&nbsp;</td><td>the I/O bus, pointer to a <code><a class="el" href="struct_i_o_bus.html" title="I/O bus descriptor.">IOBus</a></code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>bits</em>&nbsp;</td><td>the bits to be written on the I/O bus. Values exceeding the bus width are masked so most significant bits are lost. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8c_source.html#l00092">92</a> of file <a class="el" href="pal_8c_source.html">pal.c</a>.</p>
<p>References <a class="el" href="struct_i_o_bus.html#ab2efb4f2a7504ac2e737de26c1e4f33a">IOBus::bus_mask</a>, <a class="el" href="struct_i_o_bus.html#a50c155a7f9aa5b254faa372f0619286a">IOBus::bus_offset</a>, <a class="el" href="struct_i_o_bus.html#a79c1372324fc1d9d2c571ac6d47163f9">IOBus::bus_portid</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group___p_a_l___l_l_d.html#ga20ffc1985d583352e179f5f2c3fa700e">PAL_IOPORTS_WIDTH</a>, and <a class="el" href="group___p_a_l.html#gacb25ee0b16d9fb701e3fd21e5dbb990a">palWriteGroup</a>.</p>
</div>
</div>
<a class="anchor" id="ga25ef645e442638716008408357f4ea59"></a><!-- doxytag: member="pal.h::palSetBusMode" ref="ga25ef645e442638716008408357f4ea59" args="(IOBus *bus, uint_fast8_t mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void palSetBusMode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_i_o_bus.html">IOBus</a> *&nbsp;</td>
<td class="paramname"> <em>bus</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___s_t_m8___c_o_r_e.html#gad0fca8b15c218d2c687f8c373a71d228">uint_fast8_t</a>&nbsp;</td>
<td class="paramname"> <em>mode</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Programs a bus with the specified mode. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The operation is not guaranteed to be atomic on all the architectures, for atomicity and/or portability reasons you may need to enclose port I/O operations between <code><a class="el" href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42" title="Enters the kernel lock mode.">chSysLock()</a></code> and <code><a class="el" href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e" title="Leaves the kernel lock mode.">chSysUnlock()</a></code>. </dd>
<dd>
The default implementation is non atomic and not necessarily optimal. Low level drivers may optimize the function by using specific hardware or coding.</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>bus</em>&nbsp;</td><td>the I/O bus, pointer to a <code><a class="el" href="struct_i_o_bus.html" title="I/O bus descriptor.">IOBus</a></code> structure </td></tr>
<tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>mode</em>&nbsp;</td><td>the mode </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="pal_8c_source.html#l00113">113</a> of file <a class="el" href="pal_8c_source.html">pal.c</a>.</p>
<p>References <a class="el" href="struct_i_o_bus.html#ab2efb4f2a7504ac2e737de26c1e4f33a">IOBus::bus_mask</a>, <a class="el" href="struct_i_o_bus.html#a50c155a7f9aa5b254faa372f0619286a">IOBus::bus_offset</a>, <a class="el" href="struct_i_o_bus.html#a79c1372324fc1d9d2c571ac6d47163f9">IOBus::bus_portid</a>, <a class="el" href="group__debug.html#ga6bb6c0f97caab3a66332c8bfbf7a3844">chDbgCheck</a>, <a class="el" href="group___p_a_l___l_l_d.html#ga20ffc1985d583352e179f5f2c3fa700e">PAL_IOPORTS_WIDTH</a>, and <a class="el" href="group___p_a_l.html#ga24789efd90288773d2f928458d1dc6e5">palSetGroupMode</a>.</p>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right;"><small>
2010-11-22 05:53:37 +00:00
Generated on Sun Oct 24 2010 09:40:46 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.7.1</small></address>
2010-08-10 03:11:02 +00:00
</body>
</html>