embeddedsw/XilinxProcessorIPLib/drivers/gpiops/doc/html/api/xgpiops_8c.html

721 lines
33 KiB
HTML
Raw Normal View History

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
xgpiops.c File Reference
</title>
<link href="$DriverApiDocsCssPath" rel="stylesheet" type="text/css">
</head>
<h3 class="PageHeader">Xilinx Processor IP Library</h3>
<hl>Software Drivers</hl>
<hr class="whs1">
<!-- Generated by Doxygen 1.4.5 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li id="current"><a href="files.html"><span>Files</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul></div>
<h1>xgpiops.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> driver. Functions in this file are the minimum required functions for this driver. See xgpiops.h for a detailed description of the driver.<p>
<pre>
MODIFICATION HISTORY:</pre><p>
<pre> Ver Who Date Changes
----- ---- -------- -----------------------------------------------
1.00a sv 01/15/10 First Release
1.01a sv 04/15/12 Removed the APIs XGpioPs_SetMode, XGpioPs_SetModePin
XGpioPs_GetMode, XGpioPs_GetModePin as they are not
relevant to Zynq device. The interrupts are disabled
for output pins on all banks during initialization.
2.1 hk 04/29/14 Use Input data register DATA_RO for read. CR# 771667.</pre><p>
<pre> </pre>
<p>
<code>#include &quot;xgpiops.h&quot;</code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#bd7c23f7dd2ff26c0e3daf5e21e09a2f">StubHandler</a> (void *CallBackRef, int Bank, u32 Status)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#942763c1a5c1d3608c32303e1ca21bac">XGpioPs_Read</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, u8 Bank)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#e71dc9e365808f8dabb0299c23163757">XGpioPs_ReadPin</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, int Pin)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#540f8a356fcc3ddc08228860c7622736">XGpioPs_Write</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, u8 Bank, u32 Data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#da9b2f9b07b0b303bafa5c166c62c070">XGpioPs_WritePin</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, int Pin, int Data)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#17a0e9dd780614a64ea6a2d488e01dee">XGpioPs_SetDirection</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, u8 Bank, u32 Direction)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#c513f12d89d713a82f7c7bf41c96f535">XGpioPs_SetDirectionPin</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, int Pin, int Direction)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#114672d74d77de6ee1f6fd6879f574fe">XGpioPs_GetDirection</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, u8 Bank)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#4e74d3a9851faef5b15b1bc3cffe95ed">XGpioPs_GetDirectionPin</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, int Pin)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#d47c4962add38486be9d0a8f8e8d3776">XGpioPs_SetOutputEnable</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, u8 Bank, u32 OpEnable)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#d19b7b3be0e38c01eed608cafa7a8f6f">XGpioPs_SetOutputEnablePin</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, int Pin, int OpEnable)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#ff9a0a41d1f2451d419a97d7d2d1cf56">XGpioPs_GetOutputEnable</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, u8 Bank)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xgpiops_8c.html#543ea98d3121f31d62dc0235af09fdd6">XGpioPs_GetOutputEnablePin</a> (<a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *InstancePtr, int Pin)</td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="bd7c23f7dd2ff26c0e3daf5e21e09a2f"></a><!-- doxytag: member="xgpiops.c::StubHandler" ref="bd7c23f7dd2ff26c0e3daf5e21e09a2f" args="(void *CallBackRef, int Bank, u32 Status)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void StubHandler </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void *&nbsp;</td>
<td class="mdname" nowrap> <em>CallBackRef</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Bank</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u32&nbsp;</td>
<td class="mdname" nowrap> <em>Status</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
This is a stub for the status callback. The stub is here in case the upper layers do not set the handler.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>CallBackRef</em>&nbsp;</td><td>is a pointer to the upper layer callback reference </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Bank</em>&nbsp;</td><td>is the GPIO Bank in which an interrupt occurred. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Status</em>&nbsp;</td><td>is the Interrupt status of the GPIO bank.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="114672d74d77de6ee1f6fd6879f574fe"></a><!-- doxytag: member="xgpiops.c::XGpioPs_GetDirection" ref="114672d74d77de6ee1f6fd6879f574fe" args="(XGpioPs *InstancePtr, u8 Bank)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u32 XGpioPs_GetDirection </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u8&nbsp;</td>
<td class="mdname" nowrap> <em>Bank</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the Direction of the pins of the specified GPIO Bank.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Bank</em>&nbsp;</td><td>is the bank number of the GPIO to operate on. Valid values are 0 to XGPIOPS_MAX_BANKS - 1.</td></tr>
</table>
</dl>
return Returns a 32 bit mask of the Direction register. Bits with 0 are in Input mode, bits with 1 are in Output Mode.<p>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="4e74d3a9851faef5b15b1bc3cffe95ed"></a><!-- doxytag: member="xgpiops.c::XGpioPs_GetDirectionPin" ref="4e74d3a9851faef5b15b1bc3cffe95ed" args="(XGpioPs *InstancePtr, int Pin)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XGpioPs_GetDirectionPin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Pin</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the Direction of the specified pin.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Pin</em>&nbsp;</td><td>is the pin number for which the Direction is to be retrieved. Valid values are 0 to XGPIOPS_DEVICE_MAX_PIN_NUM - 1.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Direction of the specified pin.<ul>
<li>0 for Input Direction</li><li>1 for Output Direction</li></ul>
</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ff9a0a41d1f2451d419a97d7d2d1cf56"></a><!-- doxytag: member="xgpiops.c::XGpioPs_GetOutputEnable" ref="ff9a0a41d1f2451d419a97d7d2d1cf56" args="(XGpioPs *InstancePtr, u8 Bank)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u32 XGpioPs_GetOutputEnable </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u8&nbsp;</td>
<td class="mdname" nowrap> <em>Bank</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the Output Enable status of the pins of the specified GPIO Bank.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Bank</em>&nbsp;</td><td>is the bank number of the GPIO to operate on. Valid values are 0 to XGPIOPS_MAX_BANKS - 1.</td></tr>
</table>
</dl>
return Returns a a 32 bit mask of the Output Enable register. Bits with 0 are in Disabled state, bits with 1 are in Enabled State.<p>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="543ea98d3121f31d62dc0235af09fdd6"></a><!-- doxytag: member="xgpiops.c::XGpioPs_GetOutputEnablePin" ref="543ea98d3121f31d62dc0235af09fdd6" args="(XGpioPs *InstancePtr, int Pin)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XGpioPs_GetOutputEnablePin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Pin</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Get the Output Enable status of the specified pin.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Pin</em>&nbsp;</td><td>is the pin number for which the Output Enable status is to be retrieved. Valid values are 0 to XGPIOPS_DEVICE_MAX_PIN_NUM - 1.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Output Enable of the specified pin.<ul>
<li>0 if Output Enable is disabled for this pin</li><li>1 if Output Enable is enabled for this pin</li></ul>
</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="942763c1a5c1d3608c32303e1ca21bac"></a><!-- doxytag: member="xgpiops.c::XGpioPs_Read" ref="942763c1a5c1d3608c32303e1ca21bac" args="(XGpioPs *InstancePtr, u8 Bank)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">u32 XGpioPs_Read </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u8&nbsp;</td>
<td class="mdname" nowrap> <em>Bank</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Read the Data register of the specified GPIO bank.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Bank</em>&nbsp;</td><td>is the bank number of the GPIO to operate on. Valid values are 0 to XGPIOPS_MAX_BANKS - 1.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Current value of the Data register.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This function is used for reading the state of all the GPIO pins of specified bank. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="e71dc9e365808f8dabb0299c23163757"></a><!-- doxytag: member="xgpiops.c::XGpioPs_ReadPin" ref="e71dc9e365808f8dabb0299c23163757" args="(XGpioPs *InstancePtr, int Pin)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int XGpioPs_ReadPin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Pin</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Read Data from the specified pin.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Pin</em>&nbsp;</td><td>is the pin number for which the data has to be read. Valid values are 0 to XGPIOPS_DEVICE_MAX_PIN_NUM - 1. See xgpiops.h for the mapping of the pin numbers in the banks.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>Current value of the Pin (0 or 1).</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This function is used for reading the state of the specified GPIO pin. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="17a0e9dd780614a64ea6a2d488e01dee"></a><!-- doxytag: member="xgpiops.c::XGpioPs_SetDirection" ref="17a0e9dd780614a64ea6a2d488e01dee" args="(XGpioPs *InstancePtr, u8 Bank, u32 Direction)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XGpioPs_SetDirection </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u8&nbsp;</td>
<td class="mdname" nowrap> <em>Bank</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u32&nbsp;</td>
<td class="mdname" nowrap> <em>Direction</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the Direction of the pins of the specified GPIO Bank.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Bank</em>&nbsp;</td><td>is the bank number of the GPIO to operate on. Valid values are 0 to XGPIOPS_MAX_BANKS - 1. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Direction</em>&nbsp;</td><td>is the 32 bit mask of the Pin direction to be set for all the pins in the Bank. Bits with 0 are set to Input mode, bits with 1 are set to Output Mode.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This function is used for setting the direction of all the pins in the specified bank. The previous state of the pins is not maintained. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="c513f12d89d713a82f7c7bf41c96f535"></a><!-- doxytag: member="xgpiops.c::XGpioPs_SetDirectionPin" ref="c513f12d89d713a82f7c7bf41c96f535" args="(XGpioPs *InstancePtr, int Pin, int Direction)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XGpioPs_SetDirectionPin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Pin</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Direction</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the Direction of the specified pin.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Pin</em>&nbsp;</td><td>is the pin number to which the Data is to be written. Valid values are 0 to XGPIOPS_DEVICE_MAX_PIN_NUM - 1. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Direction</em>&nbsp;</td><td>is the direction to be set for the specified pin. Valid values are 0 for Input Direction, 1 for Output Direction.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="d47c4962add38486be9d0a8f8e8d3776"></a><!-- doxytag: member="xgpiops.c::XGpioPs_SetOutputEnable" ref="d47c4962add38486be9d0a8f8e8d3776" args="(XGpioPs *InstancePtr, u8 Bank, u32 OpEnable)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XGpioPs_SetOutputEnable </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u8&nbsp;</td>
<td class="mdname" nowrap> <em>Bank</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u32&nbsp;</td>
<td class="mdname" nowrap> <em>OpEnable</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the Output Enable of the pins of the specified GPIO Bank.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Bank</em>&nbsp;</td><td>is the bank number of the GPIO to operate on. Valid values are 0 to XGPIOPS_MAX_BANKS - 1. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>OpEnable</em>&nbsp;</td><td>is the 32 bit mask of the Output Enables to be set for all the pins in the Bank. The Output Enable of bits with 0 are disabled, the Output Enable of bits with 1 are enabled.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This function is used for setting the Output Enables of all the pins in the specified bank. The previous state of the Output Enables is not maintained. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="d19b7b3be0e38c01eed608cafa7a8f6f"></a><!-- doxytag: member="xgpiops.c::XGpioPs_SetOutputEnablePin" ref="d19b7b3be0e38c01eed608cafa7a8f6f" args="(XGpioPs *InstancePtr, int Pin, int OpEnable)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XGpioPs_SetOutputEnablePin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Pin</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>OpEnable</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Set the Output Enable of the specified pin.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Pin</em>&nbsp;</td><td>is the pin number to which the Data is to be written. Valid values are 0 to XGPIOPS_DEVICE_MAX_PIN_NUM - 1. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>OpEnable</em>&nbsp;</td><td>specifies whether the Output Enable for the specified pin should be enabled. Valid values are 0 for Disabling Output Enable, 1 for Enabling Output Enable.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>None. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="540f8a356fcc3ddc08228860c7622736"></a><!-- doxytag: member="xgpiops.c::XGpioPs_Write" ref="540f8a356fcc3ddc08228860c7622736" args="(XGpioPs *InstancePtr, u8 Bank, u32 Data)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XGpioPs_Write </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u8&nbsp;</td>
<td class="mdname" nowrap> <em>Bank</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>u32&nbsp;</td>
<td class="mdname" nowrap> <em>Data</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Write to the Data register of the specified GPIO bank.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Bank</em>&nbsp;</td><td>is the bank number of the GPIO to operate on. Valid values are 0 to XGPIOPS_MAX_BANKS - 1. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Data</em>&nbsp;</td><td>is the value to be written to the Data register.</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This function is used for writing to all the GPIO pins of the bank. The previous state of the pins is not maintained. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="da9b2f9b07b0b303bafa5c166c62c070"></a><!-- doxytag: member="xgpiops.c::XGpioPs_WritePin" ref="da9b2f9b07b0b303bafa5c166c62c070" args="(XGpioPs *InstancePtr, int Pin, int Data)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void XGpioPs_WritePin </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> *&nbsp;</td>
<td class="mdname" nowrap> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Pin</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>int&nbsp;</td>
<td class="mdname" nowrap> <em>Data</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Write data to the specified pin.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>InstancePtr</em>&nbsp;</td><td>is a pointer to the <a class="el" href="struct_x_gpio_ps.html">XGpioPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Pin</em>&nbsp;</td><td>is the pin number to which the Data is to be written. Valid values are 0 to XGPIOPS_DEVICE_MAX_PIN_NUM - 1. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Data</em>&nbsp;</td><td>is the data to be written to the specified pin (0 or 1).</td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl compact><dt><b>Note:</b></dt><dd>This function does a masked write to the specified pin of the specified GPIO bank. The previous state of other pins is maintained. </dd></dl>
</td>
</tr>
</table>
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.