embeddedsw/XilinxProcessorIPLib/drivers/spips/doc/html/api/xspips_8h.html
Kedareswara rao Appana 9a24a3184e doxygen: Update doxygen for the drivers to include .h files in documentation.
This patch updates the doxygen for the drivers
spi,spips,srio,sysmon,tmrctr to include .h files
in the listof files provided in the index.html file.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
2014-09-02 11:21:40 +05:30

1454 lines
84 KiB
HTML
Executable file

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>
Xilinx Driver spips v2_0: xspips.h File Reference
</title>
<link href="doxygen_kalyanidocs/doc/css/driver_api_doxygen.css" 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.6.1 -->
<div class="navigation" id="top">
<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 class="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>
</div>
<div class="contents">
<h1>xspips.h File Reference</h1><code>#include &quot;xstatus.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="xspips__hw_8h.html">xspips_hw.h</a>&quot;</code><br/>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_spi_ps___config.html">XSpiPs_Config</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a></td></tr>
<tr><td colspan="2"><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#aa16649210a966610b289b3a97a1cf3c9">XSPIPS_H</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a22cf03a11dbb07aa774936b3afb6306b">XSpiPs_IsManualStart</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#ad81e68ddd78fbf85a0b328e31ca8c609">XSpiPs_IsManualChipSelect</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a05ee9513be17c6fab0954ab23645a316">XSpiPs_IsDecodeSSelect</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a0ed699bda6f68affc21d70f4fdbbb131">XSpiPs_IsMaster</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#ac782d76352000f7cab838491744a022a">XSpiPs_SetSlaveIdle</a>(InstancePtr, RegisterValue)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a8f2055cfa93a26da233dff2fa8b0af8b">XSpiPs_GetSlaveIdle</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a5501c2b3144a42ec20d93bcaa4732797">XSpiPs_SetTXWatermark</a>(InstancePtr, RegisterValue)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#ae768acaf29460ddf625c0842a6546991">XSpiPs_GetTXWatermark</a>(InstancePtr)&nbsp;&nbsp;&nbsp;XSpiPs_In32((InstancePtr-&gt;Config.BaseAddress) + XSPIPS_TXWR_OFFSET)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#abf7789f973a99a1192e89e6df23b8d84">XSpiPs_SetRXWatermark</a>(InstancePtr, RegisterValue)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a27fb8402703b83365149ff051bb7aee8">XSpiPs_GetRXWatermark</a>(InstancePtr)&nbsp;&nbsp;&nbsp;XSpiPs_In32((InstancePtr-&gt;Config.BaseAddress) + XSPIPS_RXWR_OFFSET)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a7b3a41972453b0dfb7ec90f3972ddc74">XSpiPs_Enable</a>(InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#ae33752db88677fe0580abb65d6ba70cf">XSpiPs_Disable</a>(InstancePtr)&nbsp;&nbsp;&nbsp;XSpiPs_Out32((InstancePtr-&gt;Config.BaseAddress) + XSPIPS_ER_OFFSET, 0)</td></tr>
<tr><td colspan="2"><div class="groupHeader">Configuration options</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrp50f33d14f129e4548c1c270fd6725a78"></a> The following options are supported to enable/disable certain features of an SPI device. Each of the options is a bit mask, so more than one may be specified.</p>
<p><b>The Master option</b> configures the SPI device as a master. By default, the device is a slave.</p>
<p>The <b>Active Low Clock option</b> configures the device's clock polarity. Setting this option means the clock is active low and the SCK signal idles high. By default, the clock is active high and SCK idles low.</p>
<p>The <b>Clock Phase option</b> configures the SPI device for one of two transfer formats. A clock phase of 0, the default, means data is valid on the first SCK edge (rising or falling) after the slave select (SS) signal has been asserted. A clock phase of 1 means data is valid on the second SCK edge (rising or falling) after SS has been asserted.</p>
<p>The <b>Slave Select Decode Enable option</b> selects how the SPI_SS_outN are controlled by the SPI Slave Select Decode bits. 0: Use this setting for the standard configuration of up to three slave select outputs. Only one of the three slave select outputs will be low. (Default) 1: Use this setting for the optional configuration of an additional decoder to support 8 slave select outputs. SPI_SS_outN reflects the value in the register.</p>
<p>The <b>SPI Force Slave Select option</b> is used to enable manual control of the signals SPI_SS_outN. 0: The SPI_SS_outN signals are controlled by the SPI controller during transfers. (Default) 1: The SPI_SS_outN signal indicated by the Slave Select Control bit is forced active (driven low) regardless of any transfers in progress.</p>
<p>NOTE: The driver will handle setting and clearing the Slave Select when the user sets the "FORCE_SSELECT_OPTION". Using this option will allow the SPI clock to be set to a faster speed. If the SPI clock is too fast, the processor cannot empty and refill the FIFOs before the TX FIFO is empty When the SPI hardware is controlling the Slave Select signals, this will cause slave to be de-selected and terminate the transfer.</p>
<p>The <b>Manual Start option</b> is used to enable manual control of the Start command to perform data transfer. 0: The Start command is controlled by the SPI controller during transfers(Default). Data transmission starts as soon as there is data in the TXFIFO and stalls when the TXFIFO is empty 1: The Start command must be issued by software to perform data transfer. Bit 15 of Configuration register is used to issue Start command. This bit must be set whenever TXFIFO is filled with new data.</p>
<p>NOTE: The driver will set the Manual Start Enable bit in Configuration Register, if Manual Start option is selected. Software will issue Manual Start command whenever TXFIFO is filled with data. When there is no further data, driver will clear the Manual Start Enable bit. </p>
<br/><br/></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a1fbe2203de88e79aa3a6c7e70e2f3436">XSPIPS_MASTER_OPTION</a>&nbsp;&nbsp;&nbsp;0x1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a0aab1b9650381f6e5c64f424ec67844d">XSPIPS_CLK_ACTIVE_LOW_OPTION</a>&nbsp;&nbsp;&nbsp;0x2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a25ffb7f933bd33275a89e6d1d0d340ad">XSPIPS_CLK_PHASE_1_OPTION</a>&nbsp;&nbsp;&nbsp;0x4</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a33e1010355cd9aca2d607fd41140fdce">XSPIPS_DECODE_SSELECT_OPTION</a>&nbsp;&nbsp;&nbsp;0x8</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#af0a0da0e20b70ee21a3998117785638e">XSPIPS_FORCE_SSELECT_OPTION</a>&nbsp;&nbsp;&nbsp;0x10</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a7e6e32f2a23f47aa9f69c6adccbd2ba3">XSPIPS_MANUAL_START_OPTION</a>&nbsp;&nbsp;&nbsp;0x20</td></tr>
<tr><td colspan="2"><div class="groupHeader">SPI Clock Prescaler options</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrp1529b88c4b4146febe284ed1d878e014"></a> The SPI Clock Prescaler Configuration bits are used to program master mode bit rate. The bit rate can be programmed in divide-by-two decrements from pclk/4 to pclk/256. </p>
<br/><br/></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a4984355789693743e51841fd3078cd29">XSPIPS_CLK_PRESCALE_4</a>&nbsp;&nbsp;&nbsp;0x01</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a797ea1218c463e962b5bb3e8c1660519">XSPIPS_CLK_PRESCALE_8</a>&nbsp;&nbsp;&nbsp;0x02</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a46beb1bbc0f69b94eba21c4e9495c8f9">XSPIPS_CLK_PRESCALE_16</a>&nbsp;&nbsp;&nbsp;0x03</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a17461c15895ead044069b54cb0de879c">XSPIPS_CLK_PRESCALE_32</a>&nbsp;&nbsp;&nbsp;0x04</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#ac069eaeb884436a488dbf5d8d56b990e">XSPIPS_CLK_PRESCALE_64</a>&nbsp;&nbsp;&nbsp;0x05</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a009c993558540f5018f794996594f34c">XSPIPS_CLK_PRESCALE_128</a>&nbsp;&nbsp;&nbsp;0x06</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a554021caf9a775e3dceedbc67e8b8dff">XSPIPS_CLK_PRESCALE_256</a>&nbsp;&nbsp;&nbsp;0x07</td></tr>
<tr><td colspan="2"><div class="groupHeader">Callback events</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpc478b096d0c15f7e00fb1b0587e19c87"></a> These constants specify the handler events that are passed to a handler from the driver. These constants are not bit masks such that only one will be passed at a time to the handler. </p>
<br/><br/></div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a57a4f4acf38b7c34eea6033c26f91bf9">XSPIPS_EVENT_MODE_FAULT</a>&nbsp;&nbsp;&nbsp;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a001caa2536734fec092dedbd484204e9">XSPIPS_EVENT_TRANSFER_DONE</a>&nbsp;&nbsp;&nbsp;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a2b83686724f80b3ca235108497ffb99e">XSPIPS_EVENT_TRANSMIT_UNDERRUN</a>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a6fd689b3734d076736704ba0ea228502">XSPIPS_EVENT_RECEIVE_OVERRUN</a>&nbsp;&nbsp;&nbsp;4</td></tr>
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a68b431786f9e933c87472953f831569e">XSpiPs_StatusHandler</a> )(void *CallBackRef, u32 StatusEvent, unsigned ByteCount)</td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_x_spi_ps___config.html">XSpiPs_Config</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a374b10947b4f9915ea10b60208355174">XSpiPs_LookupConfig</a> (u16 DeviceId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a0721137082c2d73870dd1a067e317e9c">XSpiPs_CfgInitialize</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, <a class="el" href="struct_x_spi_ps___config.html">XSpiPs_Config</a> *Config, u32 EffectiveAddr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#ad3abd2456cfa67bc8d24dd255ba7de51">XSpiPs_Reset</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a06d3ce216591f69946d2d4822a0dc57f">XSpiPs_Transfer</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, u8 *SendBufPtr, u8 *RecvBufPtr, unsigned ByteCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a49a95c2c4040817b5c9bd33af1cf54a6">XSpiPs_PolledTransfer</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, u8 *SendBufPtr, u8 *RecvBufPtr, unsigned ByteCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#ae66d524321dcbd9a81f116d3432463fc">XSpiPs_SetStatusHandler</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, void *CallBackRef, <a class="el" href="xspips_8h.html#a68b431786f9e933c87472953f831569e">XSpiPs_StatusHandler</a> FuncPtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a183b277f174211654db2834597375aa8">XSpiPs_InterruptHandler</a> (void *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a1f40732e67f63579b811af115f2c575c">XSpiPs_Abort</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#af632a1b8007163ac34d358220232c22f">XSpiPs_SetSlaveSelect</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, u8 SelectValue)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u8&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a4efc98fb1e6b9a927146bd3bcab8ea8b">XSpiPs_GetSlaveSelect</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a5084889bd89415642343235e4c1567c0">XSpiPs_SelfTest</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a015440ddc36b8c4787730d9513567b19">XSpiPs_SetOptions</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, u32 Options)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a842e4cf2fabf1849f451d9592d0b2722">XSpiPs_GetOptions</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a4f3e0643c808f4cb2ecebc44ca3225eb">XSpiPs_SetClkPrescaler</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, u8 Prescaler)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u8&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#ab8f7c1eb75848839d7dc4fa81bc273e4">XSpiPs_GetClkPrescaler</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a92eba2fca7abff03bd2139ea5aa39f73">XSpiPs_SetDelays</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, u8 DelayNss, u8 DelayBtwn, u8 DelayAfter, u8 DelayInit)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="xspips_8h.html#a716d3d27606e693e765a2b9d01cce462">XSpiPs_GetDelays</a> (<a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *InstancePtr, u8 *DelayNss, u8 *DelayBtwn, u8 *DelayAfter, u8 *DelayInit)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a0aab1b9650381f6e5c64f424ec67844d"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_ACTIVE_LOW_OPTION" ref="a0aab1b9650381f6e5c64f424ec67844d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_ACTIVE_LOW_OPTION&nbsp;&nbsp;&nbsp;0x2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Active Low Clock option </p>
</div>
</div>
<a class="anchor" id="a25ffb7f933bd33275a89e6d1d0d340ad"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_PHASE_1_OPTION" ref="a25ffb7f933bd33275a89e6d1d0d340ad" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_PHASE_1_OPTION&nbsp;&nbsp;&nbsp;0x4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Clock Phase one option </p>
</div>
</div>
<a class="anchor" id="a009c993558540f5018f794996594f34c"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_PRESCALE_128" ref="a009c993558540f5018f794996594f34c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_PRESCALE_128&nbsp;&nbsp;&nbsp;0x06</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PCLK/128 Prescaler </p>
</div>
</div>
<a class="anchor" id="a46beb1bbc0f69b94eba21c4e9495c8f9"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_PRESCALE_16" ref="a46beb1bbc0f69b94eba21c4e9495c8f9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_PRESCALE_16&nbsp;&nbsp;&nbsp;0x03</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PCLK/16 Prescaler </p>
</div>
</div>
<a class="anchor" id="a554021caf9a775e3dceedbc67e8b8dff"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_PRESCALE_256" ref="a554021caf9a775e3dceedbc67e8b8dff" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_PRESCALE_256&nbsp;&nbsp;&nbsp;0x07</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PCLK/256 Prescaler </p>
</div>
</div>
<a class="anchor" id="a17461c15895ead044069b54cb0de879c"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_PRESCALE_32" ref="a17461c15895ead044069b54cb0de879c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_PRESCALE_32&nbsp;&nbsp;&nbsp;0x04</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PCLK/32 Prescaler </p>
</div>
</div>
<a class="anchor" id="a4984355789693743e51841fd3078cd29"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_PRESCALE_4" ref="a4984355789693743e51841fd3078cd29" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_PRESCALE_4&nbsp;&nbsp;&nbsp;0x01</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PCLK/4 Prescaler </p>
</div>
</div>
<a class="anchor" id="ac069eaeb884436a488dbf5d8d56b990e"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_PRESCALE_64" ref="ac069eaeb884436a488dbf5d8d56b990e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_PRESCALE_64&nbsp;&nbsp;&nbsp;0x05</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PCLK/64 Prescaler </p>
</div>
</div>
<a class="anchor" id="a797ea1218c463e962b5bb3e8c1660519"></a><!-- doxytag: member="xspips.h::XSPIPS_CLK_PRESCALE_8" ref="a797ea1218c463e962b5bb3e8c1660519" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_CLK_PRESCALE_8&nbsp;&nbsp;&nbsp;0x02</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PCLK/8 Prescaler </p>
</div>
</div>
<a class="anchor" id="a33e1010355cd9aca2d607fd41140fdce"></a><!-- doxytag: member="xspips.h::XSPIPS_DECODE_SSELECT_OPTION" ref="a33e1010355cd9aca2d607fd41140fdce" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_DECODE_SSELECT_OPTION&nbsp;&nbsp;&nbsp;0x8</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Select 16 slaves Option </p>
</div>
</div>
<a class="anchor" id="ae33752db88677fe0580abb65d6ba70cf"></a><!-- doxytag: member="xspips.h::XSpiPs_Disable" ref="ae33752db88677fe0580abb65d6ba70cf" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_Disable</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;XSpiPs_Out32((InstancePtr-&gt;Config.BaseAddress) + XSPIPS_ER_OFFSET, 0)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Disable the device.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: void <a class="el" href="xspips_8h.html#ae33752db88677fe0580abb65d6ba70cf">XSpiPs_Disable(u32 *InstancePtr)</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a7b3a41972453b0dfb7ec90f3972ddc74"></a><!-- doxytag: member="xspips.h::XSpiPs_Enable" ref="a7b3a41972453b0dfb7ec90f3972ddc74" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_Enable</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="xspips__hw_8h.html#a4653011b7ebe73cb7762821e58d54f4a">XSpiPs_Out32</a>((InstancePtr-&gt;Config.BaseAddress) + <a class="code" href="xspips__hw_8h.html#a96a2524f86a513015b982462f7a6ffcb">XSPIPS_ER_OFFSET</a>, \
<a class="code" href="xspips__hw_8h.html#aa31de4b8fd2bc4cd055be77a535f9048">XSPIPS_ER_ENABLE_MASK</a>)
</pre></div><p>Enable the device and uninhibit master transactions.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: void <a class="el" href="xspips_8h.html#a7b3a41972453b0dfb7ec90f3972ddc74">XSpiPs_Enable(u32 *InstancePtr)</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a57a4f4acf38b7c34eea6033c26f91bf9"></a><!-- doxytag: member="xspips.h::XSPIPS_EVENT_MODE_FAULT" ref="a57a4f4acf38b7c34eea6033c26f91bf9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_EVENT_MODE_FAULT&nbsp;&nbsp;&nbsp;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Mode fault error </p>
</div>
</div>
<a class="anchor" id="a6fd689b3734d076736704ba0ea228502"></a><!-- doxytag: member="xspips.h::XSPIPS_EVENT_RECEIVE_OVERRUN" ref="a6fd689b3734d076736704ba0ea228502" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_EVENT_RECEIVE_OVERRUN&nbsp;&nbsp;&nbsp;4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Receive data loss because RX FIFO full </p>
</div>
</div>
<a class="anchor" id="a001caa2536734fec092dedbd484204e9"></a><!-- doxytag: member="xspips.h::XSPIPS_EVENT_TRANSFER_DONE" ref="a001caa2536734fec092dedbd484204e9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_EVENT_TRANSFER_DONE&nbsp;&nbsp;&nbsp;2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Transfer done </p>
</div>
</div>
<a class="anchor" id="a2b83686724f80b3ca235108497ffb99e"></a><!-- doxytag: member="xspips.h::XSPIPS_EVENT_TRANSMIT_UNDERRUN" ref="a2b83686724f80b3ca235108497ffb99e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_EVENT_TRANSMIT_UNDERRUN&nbsp;&nbsp;&nbsp;3</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>TX FIFO empty </p>
</div>
</div>
<a class="anchor" id="af0a0da0e20b70ee21a3998117785638e"></a><!-- doxytag: member="xspips.h::XSPIPS_FORCE_SSELECT_OPTION" ref="af0a0da0e20b70ee21a3998117785638e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_FORCE_SSELECT_OPTION&nbsp;&nbsp;&nbsp;0x10</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Force Slave Select </p>
</div>
</div>
<a class="anchor" id="a27fb8402703b83365149ff051bb7aee8"></a><!-- doxytag: member="xspips.h::XSpiPs_GetRXWatermark" ref="a27fb8402703b83365149ff051bb7aee8" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_GetRXWatermark</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;XSpiPs_In32((InstancePtr-&gt;Config.BaseAddress) + XSPIPS_RXWR_OFFSET)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get the contents of the receive FIFO watermark register. Use the XSPIPS_RXWR_* constants defined <a class="el" href="xspips__hw_8h.html">xspips_hw.h</a> to interpret the bit-mask returned.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A 8-bit value representing the contents of the RXWR register.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: u32 <a class="el" href="xspips_8h.html#a27fb8402703b83365149ff051bb7aee8">XSpiPs_GetRXWatermark(u32 *InstancePtr)</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a8f2055cfa93a26da233dff2fa8b0af8b"></a><!-- doxytag: member="xspips.h::XSpiPs_GetSlaveIdle" ref="a8f2055cfa93a26da233dff2fa8b0af8b" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_GetSlaveIdle</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="xspips__hw_8h.html#ad7b9b7214de9eb2a51eb559b837de31e">XSpiPs_In32</a>(((InstancePtr)-&gt;Config.BaseAddress) + \
<a class="code" href="xspips__hw_8h.html#a4498f0a85ffc367f14d705f37a2dcc11">XSPIPS_SICR_OFFSET</a>)
</pre></div><p>Get the contents of the slave idle count register. Use the XSPIPS_SICR_* constants defined in <a class="el" href="xspips__hw_8h.html">xspips_hw.h</a> to interpret the bit-mask returned.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>8-bit value representing the contents of the SIC register.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: u32 <a class="el" href="xspips_8h.html#a8f2055cfa93a26da233dff2fa8b0af8b">XSpiPs_GetSlaveIdle(XSpiPs *InstancePtr)</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ae768acaf29460ddf625c0842a6546991"></a><!-- doxytag: member="xspips.h::XSpiPs_GetTXWatermark" ref="ae768acaf29460ddf625c0842a6546991" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_GetTXWatermark</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;XSpiPs_In32((InstancePtr-&gt;Config.BaseAddress) + XSPIPS_TXWR_OFFSET)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Get the contents of the transmit FIFO watermark register. Use the XSPIPS_TXWR_* constants defined <a class="el" href="xspips__hw_8h.html">xspips_hw.h</a> to interpret the bit-mask returned.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>8-bit value representing the contents of the TXWR register.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: u32 <a class="el" href="xspips_8h.html#ae768acaf29460ddf625c0842a6546991">XSpiPs_GetTXWatermark(u32 *InstancePtr)</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aa16649210a966610b289b3a97a1cf3c9"></a><!-- doxytag: member="xspips.h::XSPIPS_H" ref="aa16649210a966610b289b3a97a1cf3c9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_H</td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="a05ee9513be17c6fab0954ab23645a316"></a><!-- doxytag: member="xspips.h::XSpiPs_IsDecodeSSelect" ref="a05ee9513be17c6fab0954ab23645a316" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_IsDecodeSSelect</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xspips_8h.html#a842e4cf2fabf1849f451d9592d0b2722">XSpiPs_GetOptions</a>(InstancePtr) &amp; \
<a class="code" href="xspips_8h.html#a33e1010355cd9aca2d607fd41140fdce">XSPIPS_DECODE_SSELECT_OPTION</a>) ? TRUE : FALSE)
</pre></div>
</div>
</div>
<a class="anchor" id="ad81e68ddd78fbf85a0b328e31ca8c609"></a><!-- doxytag: member="xspips.h::XSpiPs_IsManualChipSelect" ref="ad81e68ddd78fbf85a0b328e31ca8c609" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_IsManualChipSelect</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xspips_8h.html#a842e4cf2fabf1849f451d9592d0b2722">XSpiPs_GetOptions</a>(InstancePtr) &amp; \
<a class="code" href="xspips_8h.html#af0a0da0e20b70ee21a3998117785638e">XSPIPS_FORCE_SSELECT_OPTION</a>) ? TRUE : FALSE)
</pre></div>
</div>
</div>
<a class="anchor" id="a22cf03a11dbb07aa774936b3afb6306b"></a><!-- doxytag: member="xspips.h::XSpiPs_IsManualStart" ref="a22cf03a11dbb07aa774936b3afb6306b" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_IsManualStart</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xspips_8h.html#a842e4cf2fabf1849f451d9592d0b2722">XSpiPs_GetOptions</a>(InstancePtr) &amp; \
<a class="code" href="xspips_8h.html#a7e6e32f2a23f47aa9f69c6adccbd2ba3">XSPIPS_MANUAL_START_OPTION</a>) ? TRUE : FALSE)
</pre></div>
</div>
</div>
<a class="anchor" id="a0ed699bda6f68affc21d70f4fdbbb131"></a><!-- doxytag: member="xspips.h::XSpiPs_IsMaster" ref="a0ed699bda6f68affc21d70f4fdbbb131" args="(InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_IsMaster</td>
<td>(</td>
<td class="paramtype">InstancePtr&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">((<a class="code" href="xspips_8h.html#a842e4cf2fabf1849f451d9592d0b2722">XSpiPs_GetOptions</a>(InstancePtr) &amp; \
<a class="code" href="xspips_8h.html#a1fbe2203de88e79aa3a6c7e70e2f3436">XSPIPS_MASTER_OPTION</a>) ? TRUE : FALSE)
</pre></div>
</div>
</div>
<a class="anchor" id="a7e6e32f2a23f47aa9f69c6adccbd2ba3"></a><!-- doxytag: member="xspips.h::XSPIPS_MANUAL_START_OPTION" ref="a7e6e32f2a23f47aa9f69c6adccbd2ba3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_MANUAL_START_OPTION&nbsp;&nbsp;&nbsp;0x20</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Manual Start mode option </p>
</div>
</div>
<a class="anchor" id="a1fbe2203de88e79aa3a6c7e70e2f3436"></a><!-- doxytag: member="xspips.h::XSPIPS_MASTER_OPTION" ref="a1fbe2203de88e79aa3a6c7e70e2f3436" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSPIPS_MASTER_OPTION&nbsp;&nbsp;&nbsp;0x1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Master mode option </p>
</div>
</div>
<a class="anchor" id="abf7789f973a99a1192e89e6df23b8d84"></a><!-- doxytag: member="xspips.h::XSpiPs_SetRXWatermark" ref="abf7789f973a99a1192e89e6df23b8d84" args="(InstancePtr, RegisterValue)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_SetRXWatermark</td>
<td>(</td>
<td class="paramtype">InstancePtr, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">RegisterValue&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="xspips__hw_8h.html#a4653011b7ebe73cb7762821e58d54f4a">XSpiPs_Out32</a>(((InstancePtr)-&gt;Config.BaseAddress) + \
<a class="code" href="xspips__hw_8h.html#a708b416f4994dca83b3d50a464552286">XSPIPS_RXWR_OFFSET</a>, (RegisterValue))
</pre></div><p>Set the contents of the receive FIFO watermark register.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RegisterValue</em>&nbsp;</td><td>is the value to be written, valid values are 1-128.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: void <a class="el" href="xspips_8h.html#abf7789f973a99a1192e89e6df23b8d84">XSpiPs_SetRXWatermark(XSpiPs *InstancePtr, u32 RegisterValue)</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ac782d76352000f7cab838491744a022a"></a><!-- doxytag: member="xspips.h::XSpiPs_SetSlaveIdle" ref="ac782d76352000f7cab838491744a022a" args="(InstancePtr, RegisterValue)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_SetSlaveIdle</td>
<td>(</td>
<td class="paramtype">InstancePtr, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">RegisterValue&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="xspips__hw_8h.html#a4653011b7ebe73cb7762821e58d54f4a">XSpiPs_Out32</a>(((InstancePtr)-&gt;Config.BaseAddress) + \
<a class="code" href="xspips__hw_8h.html#a4498f0a85ffc367f14d705f37a2dcc11">XSPIPS_SICR_OFFSET</a>, (RegisterValue))
</pre></div><p>Set the contents of the slave idle count register.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RegisterValue</em>&nbsp;</td><td>is the value to be writen, valid values are 0-255.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: void <a class="el" href="xspips_8h.html#ac782d76352000f7cab838491744a022a">XSpiPs_SetSlaveIdle(XSpiPs *InstancePtr, u32 RegisterValue)</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a5501c2b3144a42ec20d93bcaa4732797"></a><!-- doxytag: member="xspips.h::XSpiPs_SetTXWatermark" ref="a5501c2b3144a42ec20d93bcaa4732797" args="(InstancePtr, RegisterValue)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XSpiPs_SetTXWatermark</td>
<td>(</td>
<td class="paramtype">InstancePtr, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">RegisterValue&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><a class="code" href="xspips__hw_8h.html#a4653011b7ebe73cb7762821e58d54f4a">XSpiPs_Out32</a>(((InstancePtr)-&gt;Config.BaseAddress) + \
<a class="code" href="xspips__hw_8h.html#a82b0c7855556fbb3d13b1d0fc3f7ae24">XSPIPS_TXWR_OFFSET</a>, (RegisterValue))
</pre></div><p>Set the contents of the transmit FIFO watermark register.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RegisterValue</em>&nbsp;</td><td>is the value to be written, valid values are 1-128.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>C-Style signature: void <a class="el" href="xspips_8h.html#a5501c2b3144a42ec20d93bcaa4732797">XSpiPs_SetTXWatermark(XSpiPs *InstancePtr, u32 RegisterValue)</a> </dd></dl>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="a68b431786f9e933c87472953f831569e"></a><!-- doxytag: member="xspips.h::XSpiPs_StatusHandler" ref="a68b431786f9e933c87472953f831569e" args=")(void *CallBackRef, u32 StatusEvent, unsigned ByteCount)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="xspips_8h.html#a68b431786f9e933c87472953f831569e">XSpiPs_StatusHandler</a>)(void *CallBackRef, u32 StatusEvent, unsigned ByteCount)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The handler data type allows the user to define a callback function to handle the asynchronous processing for the SPI device. The application using this driver is expected to define a handler of this type to support interrupt driven mode. The handler executes in an interrupt context, so only minimal processing should be performed.</p>
<dl><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 the callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. Its type is not important to the driver, so it is a void pointer. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>StatusEvent</em>&nbsp;</td><td>holds one or more status events that have occurred. See the <a class="el" href="xspips_8c.html#ae66d524321dcbd9a81f116d3432463fc">XSpiPs_SetStatusHandler()</a> for details on the status events that can be passed in the callback. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ByteCount</em>&nbsp;</td><td>indicates how many bytes of data were successfully transferred. This may be less than the number of bytes requested if the status event indicates an error. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a1f40732e67f63579b811af115f2c575c"></a><!-- doxytag: member="xspips.h::XSpiPs_Abort" ref="a1f40732e67f63579b811af115f2c575c" args="(XSpiPs *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XSpiPs_Abort </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Aborts a transfer in progress by disabling the device and resetting the FIFOs if present. The byte counts are cleared, the busy flag is cleared, and mode fault is cleared.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>This function does a read/modify/write of the Config register. The user of this function needs to take care of critical sections. </p>
</div>
</div>
<a class="anchor" id="a0721137082c2d73870dd1a067e317e9c"></a><!-- doxytag: member="xspips.h::XSpiPs_CfgInitialize" ref="a0721137082c2d73870dd1a067e317e9c" args="(XSpiPs *InstancePtr, XSpiPs_Config *Config, u32 EffectiveAddr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XSpiPs_CfgInitialize </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps___config.html">XSpiPs_Config</a> *&nbsp;</td>
<td class="paramname"> <em>ConfigPtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32&nbsp;</td>
<td class="paramname"> <em>EffectiveAddr</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes a specific <a class="el" href="struct_x_spi_ps.html">XSpiPs</a> instance such that the driver is ready to use.</p>
<p>The state of the device after initialization is:</p>
<ul>
<li>Device is disabled</li>
<li>Slave mode</li>
<li>Active high clock polarity</li>
<li>Clock phase 0</li>
</ul>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ConfigPtr</em>&nbsp;</td><td>is a reference to a structure containing information about a specific SPI device. This function initializes an InstancePtr object for a specific device specified by the contents of Config. This function can initialize multiple instance objects with the use of multiple calls giving different Config information on each call. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>EffectiveAddr</em>&nbsp;</td><td>is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, use ConfigPtr-&gt;Config.BaseAddress for this device.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_DEVICE_IS_STARTED if the device is already started. It must be stopped to re-initialize.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="ab8f7c1eb75848839d7dc4fa81bc273e4"></a><!-- doxytag: member="xspips.h::XSpiPs_GetClkPrescaler" ref="ab8f7c1eb75848839d7dc4fa81bc273e4" args="(XSpiPs *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u8 XSpiPs_GetClkPrescaler </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function gets the clock prescaler of an SPI device.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The prescaler value.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a716d3d27606e693e765a2b9d01cce462"></a><!-- doxytag: member="xspips.h::XSpiPs_GetDelays" ref="a716d3d27606e693e765a2b9d01cce462" args="(XSpiPs *InstancePtr, u8 *DelayNss, u8 *DelayBtwn, u8 *DelayAfter, u8 *DelayInit)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XSpiPs_GetDelays </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>DelayNss</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>DelayBtwn</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>DelayAfter</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>DelayInit</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function gets the delay settings for an SPI device. The delay register controls the Delay Between Transfers, Delay After Transfers, and the Delay Initially. The default value is 0x0.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DelayNss</em>&nbsp;</td><td>is a pointer to the delay for which the chip select outputs will be de-asserted between words when CPHA=0. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DelayBtwn</em>&nbsp;</td><td>is a pointer to the Delay Between transfers value. This is a return parameter. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DelayAfter</em>&nbsp;</td><td>is a pointer to the Delay After transfer value. This is a return parameter. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DelayInit</em>&nbsp;</td><td>is a pointer to the Delay Initially value. This is a return parameter.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a842e4cf2fabf1849f451d9592d0b2722"></a><!-- doxytag: member="xspips.h::XSpiPs_GetOptions" ref="a842e4cf2fabf1849f451d9592d0b2722" args="(XSpiPs *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u32 XSpiPs_GetOptions </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function gets the options for the SPI device. The options control how the device behaves relative to the SPI bus.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd></dd></dl>
<p>Options contains the specified options currently set. This is a bit value where a 1 means the option is on, and a 0 means the option is off. See the bit definitions named XSPIPS_*_OPTIONS in file <a class="el" href="xspips_8h.html">xspips.h</a>.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a4efc98fb1e6b9a927146bd3bcab8ea8b"></a><!-- doxytag: member="xspips.h::XSpiPs_GetSlaveSelect" ref="a4efc98fb1e6b9a927146bd3bcab8ea8b" args="(XSpiPs *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">u8 XSpiPs_GetSlaveSelect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the current slave select setting for the SPI device.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The slave number selected (starting from 0).</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a183b277f174211654db2834597375aa8"></a><!-- doxytag: member="xspips.h::XSpiPs_InterruptHandler" ref="a183b277f174211654db2834597375aa8" args="(void *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XSpiPs_InterruptHandler </td>
<td>(</td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The interrupt handler for SPI interrupts. This function must be connected by the user to an interrupt controller.</p>
<p>The interrupts that are handled are:</p>
<ul>
<li>Mode Fault Error. This interrupt is generated if this device is selected as a slave when it is configured as a master. The driver aborts any data transfer that is in progress by resetting FIFOs (if present) and resetting its buffer pointers. The upper layer software is informed of the error.</li>
</ul>
<ul>
<li>Data Transmit Register (FIFO) Empty. This interrupt is generated when the transmit register or FIFO is empty. The driver uses this interrupt during a transmission to continually send/receive data until the transfer is done.</li>
</ul>
<ul>
<li>Data Transmit Register (FIFO) Underflow. This interrupt is generated when the SPI device, when configured as a slave, attempts to read an empty DTR/FIFO. An empty DTR/FIFO usually means that software is not giving the device data in a timely manner. No action is taken by the driver other than to inform the upper layer software of the error.</li>
</ul>
<ul>
<li>Data Receive Register (FIFO) Overflow. This interrupt is generated when the SPI device attempts to write a received byte to an already full DRR/FIFO. A full DRR/FIFO usually means software is not emptying the data in a timely manner. No action is taken by the driver other than to inform the upper layer software of the error.</li>
</ul>
<ul>
<li>Slave Mode Fault Error. This interrupt is generated if a slave device is selected as a slave while it is disabled. No action is taken by the driver other than to inform the upper layer software of the error.</li>
</ul>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>The slave select register is being set to deselect the slave when a transfer is complete. This is being done regardless of whether it is a slave or a master since the hardware does not drive the slave select as a slave. </p>
</div>
</div>
<a class="anchor" id="a374b10947b4f9915ea10b60208355174"></a><!-- doxytag: member="xspips.h::XSpiPs_LookupConfig" ref="a374b10947b4f9915ea10b60208355174" args="(u16 DeviceId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct_x_spi_ps___config.html">XSpiPs_Config</a>* XSpiPs_LookupConfig </td>
<td>(</td>
<td class="paramtype">u16&nbsp;</td>
<td class="paramname"> <em>DeviceId</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Looks up the device configuration based on the unique device ID. A table contains the configuration info for each device in the system.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>DeviceId</em>&nbsp;</td><td>contains the ID of the device to look up the configuration for.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd></dd></dl>
<p>A pointer to the configuration found or NULL if the specified device ID was not found. See <a class="el" href="xspips_8h.html">xspips.h</a> for the definition of <a class="el" href="struct_x_spi_ps___config.html">XSpiPs_Config</a>.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a49a95c2c4040817b5c9bd33af1cf54a6"></a><!-- doxytag: member="xspips.h::XSpiPs_PolledTransfer" ref="a49a95c2c4040817b5c9bd33af1cf54a6" args="(XSpiPs *InstancePtr, u8 *SendBufPtr, u8 *RecvBufPtr, unsigned ByteCount)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XSpiPs_PolledTransfer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>SendBufPtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>RecvBufPtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned&nbsp;</td>
<td class="paramname"> <em>ByteCount</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Transfers specified data on the SPI bus in polled mode.</p>
<p>The caller has the option of providing two different buffers for send and receive, or one buffer for both send and receive, or no buffer for receive. The receive buffer must be at least as big as the send buffer to prevent unwanted memory writes. This implies that the byte count passed in as an argument must be the smaller of the two buffers if they differ in size. Here are some sample usages: </p>
<pre>
XSpiPs_PolledTransfer(InstancePtr, SendBuf, RecvBuf, ByteCount)
The caller wishes to send and receive, and provides two different
buffers for send and receive.</pre><pre> XSpiPs_PolledTransfer(InstancePtr, SendBuf, NULL, ByteCount)
The caller wishes only to send and does not care about the received
data. The driver ignores the received data in this case.</pre><pre> XSpiPs_PolledTransfer(InstancePtr, SendBuf, SendBuf, ByteCount)
The caller wishes to send and receive, but provides the same buffer
for doing both. The driver sends the data and overwrites the send
buffer with received data as it transfers the data.</pre><pre> XSpiPs_PolledTransfer(InstancePtr, RecvBuf, RecvBuf, ByteCount)
The caller wishes to only receive and does not care about sending
data. In this case, the caller must still provide a send buffer, but
it can be the same as the receive buffer if the caller does not care
what it sends. The device must send N bytes of data if it wishes to
receive N bytes of data.</pre><pre> </pre><dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>SendBufPtr</em>&nbsp;</td><td>is a pointer to a buffer of data for sending. This buffer must not be NULL. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RecvBufPtr</em>&nbsp;</td><td>is a pointer to a buffer for received data. This argument can be NULL if do not care about receiving. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ByteCount</em>&nbsp;</td><td>contains the number of bytes to send/receive. The number of bytes received always equals the number of bytes sent.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if the buffers are successfully handed off to the device for transfer.</li>
<li>XST_DEVICE_BUSY indicates that a data transfer is already in progress. This is determined by the driver.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>This function is not thread-safe. The higher layer software must ensure that no two threads are transferring data on the SPI bus at the same time. </p>
</div>
</div>
<a class="anchor" id="ad3abd2456cfa67bc8d24dd255ba7de51"></a><!-- doxytag: member="xspips.h::XSpiPs_Reset" ref="ad3abd2456cfa67bc8d24dd255ba7de51" args="(XSpiPs *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XSpiPs_Reset </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Resets the SPI device. Reset must only be called after the driver has been initialized. The configuration of the device after reset is the same as its configuration after initialization. Any data transfer that is in progress is aborted.</p>
<p>The upper layer software is responsible for re-configuring (if necessary) and restarting the SPI device after the reset.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a5084889bd89415642343235e4c1567c0"></a><!-- doxytag: member="xspips.h::XSpiPs_SelfTest" ref="a5084889bd89415642343235e4c1567c0" args="(XSpiPs *InstancePtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XSpiPs_SelfTest </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Runs a self-test on the driver/device. The self-test is destructive in that a reset of the device is performed in order to check the reset values of the registers and to get the device into a known state.</p>
<p>Upon successful return from the self-test, the device is reset.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_REGISTER_ERROR indicates a register did not read or write correctly.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a4f3e0643c808f4cb2ecebc44ca3225eb"></a><!-- doxytag: member="xspips.h::XSpiPs_SetClkPrescaler" ref="a4f3e0643c808f4cb2ecebc44ca3225eb" args="(XSpiPs *InstancePtr, u8 Prescaler)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XSpiPs_SetClkPrescaler </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8&nbsp;</td>
<td class="paramname"> <em>Prescaler</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function sets the clock prescaler for an SPI device. The device must be idle rather than busy transferring data before setting these device options.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Prescaler</em>&nbsp;</td><td>is the value that determine how much the clock should be divided by. Use the XSPIPS_CLK_PRESCALE_* constants defined in <a class="el" href="xspips_8h.html">xspips.h</a> for this setting.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if options are successfully set.</li>
<li>XST_DEVICE_BUSY if the device is currently transferring data. The transfer must complete or be aborted before setting options.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>This function is not thread-safe. </dd></dl>
</div>
</div>
<a class="anchor" id="a92eba2fca7abff03bd2139ea5aa39f73"></a><!-- doxytag: member="xspips.h::XSpiPs_SetDelays" ref="a92eba2fca7abff03bd2139ea5aa39f73" args="(XSpiPs *InstancePtr, u8 DelayNss, u8 DelayBtwn, u8 DelayAfter, u8 DelayInit)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XSpiPs_SetDelays </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8&nbsp;</td>
<td class="paramname"> <em>DelayNss</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8&nbsp;</td>
<td class="paramname"> <em>DelayBtwn</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8&nbsp;</td>
<td class="paramname"> <em>DelayAfter</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8&nbsp;</td>
<td class="paramname"> <em>DelayInit</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function sets the delay register for the SPI device driver. The delay register controls the Delay Between Transfers, Delay After Transfers, and the Delay Initially. The default value is 0x0. The range of each delay value is 0-255.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DelayNss</em>&nbsp;</td><td>is the delay for which the chip select outputs will be de-asserted between words when CPHA=0. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DelayBtwn</em>&nbsp;</td><td>is the delay between one Slave Select being de-activated and the activation of another slave. The delay is the number of master clock periods given by DelayBtwn + 2. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DelayAfter</em>&nbsp;</td><td>define the delay between the last bit of the current byte transfer and the first bit of the next byte transfer. The delay in number of master clock periods is given as: CPHA=0:DelayInit+DelayAfter+3 CPHA=1:DelayAfter+1 </td></tr>
<tr><td valign="top"></td><td valign="top"><em>DelayInit</em>&nbsp;</td><td>is the delay between asserting the slave select signal and the first bit transfer. The delay int number of master clock periods is DelayInit+1.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if delays are successfully set.</li>
<li>XST_DEVICE_BUSY if the device is currently transferring data. The transfer must complete or be aborted before setting options.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>None. </dd></dl>
</div>
</div>
<a class="anchor" id="a015440ddc36b8c4787730d9513567b19"></a><!-- doxytag: member="xspips.h::XSpiPs_SetOptions" ref="a015440ddc36b8c4787730d9513567b19" args="(XSpiPs *InstancePtr, u32 Options)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XSpiPs_SetOptions </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u32&nbsp;</td>
<td class="paramname"> <em>Options</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function sets the options for the SPI device driver. The options control how the device behaves relative to the SPI bus. The device must be idle rather than busy transferring data before setting these device options.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Options</em>&nbsp;</td><td>contains the specified options to be set. This is a bit mask where a 1 means to turn the option on, and a 0 means to turn the option off. One or more bit values may be contained in the mask. See the bit definitions named XSPIPS_*_OPTIONS in the file <a class="el" href="xspips_8h.html">xspips.h</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if options are successfully set.</li>
<li>XST_DEVICE_BUSY if the device is currently transferring data. The transfer must complete or be aborted before setting options.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>This function is not thread-safe. </dd></dl>
</div>
</div>
<a class="anchor" id="af632a1b8007163ac34d358220232c22f"></a><!-- doxytag: member="xspips.h::XSpiPs_SetSlaveSelect" ref="af632a1b8007163ac34d358220232c22f" args="(XSpiPs *InstancePtr, u8 SelectValue)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XSpiPs_SetSlaveSelect </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8&nbsp;</td>
<td class="paramname"> <em>SlaveSel</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Selects or deselect the slave with which the master communicates. This setting affects the SPI_ss_outN signals. The behavior depends on the setting of the CR_SSDECEN bit. If CR_SSDECEN is 0, the SPI_ss_outN bits will be output with a single signal low. If CR_SSDECEN is 1, the SPI_ss_outN bits will reflect the value set.</p>
<p>The user is not allowed to deselect the slave while a transfer is in progress. If no transfer is in progress, the user can select a new slave, which implicitly deselects the current slave. In order to explicitly deselect the current slave, a value of all 1's, 0x0F can be passed in as the argument to the function.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>SlaveSel</em>&nbsp;</td><td>is the slave number to be selected. Normally, 3 slaves can be selected with values 0-2. In case, 3-8 decode option is set, then upto 8 slaves can be selected. Only one slave can be selected at a time.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if the slave is selected or deselected successfully.</li>
<li>XST_DEVICE_BUSY if a transfer is in progress, slave cannot be changed.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>This function only sets the slave which will be selected when a transfer occurs. The slave is not selected when the SPI is idle. The slave select has no affect when the device is configured as a slave. </p>
</div>
</div>
<a class="anchor" id="ae66d524321dcbd9a81f116d3432463fc"></a><!-- doxytag: member="xspips.h::XSpiPs_SetStatusHandler" ref="ae66d524321dcbd9a81f116d3432463fc" args="(XSpiPs *InstancePtr, void *CallBackRef, XSpiPs_StatusHandler FuncPtr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void XSpiPs_SetStatusHandler </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>CallBackRef</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="xspips_8h.html#a68b431786f9e933c87472953f831569e">XSpiPs_StatusHandler</a>&nbsp;</td>
<td class="paramname"> <em>FuncPtr</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the status callback function, the status handler, which the driver calls when it encounters conditions that should be reported to upper layer software. The handler executes in an interrupt context, so it must minimize the amount of processing performed. One of the following status events is passed to the status handler.</p>
<pre>
XST_SPI_MODE_FAULT A mode fault error occurred, meaning the device
is selected as slave while being a master.</pre><pre> XST_SPI_TRANSFER_DONE The requested data transfer is done</pre><pre> XST_SPI_TRANSMIT_UNDERRUN As a slave device, the master clocked data
but there were none available in the transmit
register/FIFO. This typically means the slave
application did not issue a transfer request
fast enough, or the processor/driver could not
fill the transmit register/FIFO fast enough.</pre><pre> XST_SPI_RECEIVE_OVERRUN The SPI device lost data. Data was received
but the receive data register/FIFO was full.</pre><pre> XST_SPI_SLAVE_MODE_FAULT A slave SPI device was selected as a slave
while it was disabled. This indicates the
master is already transferring data (which is
being dropped until the slave application
issues a transfer).
</pre> <dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>CallBackRef</em>&nbsp;</td><td>is the upper layer callback reference passed back when the callback function is invoked. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>FuncPtr</em>&nbsp;</td><td>is the pointer to the callback function.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>None.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>The handler is called within interrupt context, so it should do its work quickly and queue potentially time-consuming work to a task-level thread. </p>
</div>
</div>
<a class="anchor" id="a06d3ce216591f69946d2d4822a0dc57f"></a><!-- doxytag: member="xspips.h::XSpiPs_Transfer" ref="a06d3ce216591f69946d2d4822a0dc57f" args="(XSpiPs *InstancePtr, u8 *SendBufPtr, u8 *RecvBufPtr, unsigned ByteCount)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int XSpiPs_Transfer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="struct_x_spi_ps.html">XSpiPs</a> *&nbsp;</td>
<td class="paramname"> <em>InstancePtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>SendBufPtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">u8 *&nbsp;</td>
<td class="paramname"> <em>RecvBufPtr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned&nbsp;</td>
<td class="paramname"> <em>ByteCount</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Transfers specified data on the SPI bus. If the SPI device is configured as a master, this function initiates bus communication and sends/receives the data to/from the selected SPI slave. If the SPI device is configured as a slave, this function prepares the buffers to be sent/received when selected by a master. For every byte sent, a byte is received. This function should be used to perform interrupt based transfers.</p>
<p>The caller has the option of providing two different buffers for send and receive, or one buffer for both send and receive, or no buffer for receive. The receive buffer must be at least as big as the send buffer to prevent unwanted memory writes. This implies that the byte count passed in as an argument must be the smaller of the two buffers if they differ in size. Here are some sample usages: </p>
<pre>
XSpiPs_Transfer(InstancePtr, SendBuf, RecvBuf, ByteCount)
The caller wishes to send and receive, and provides two different
buffers for send and receive.</pre><pre> XSpiPs_Transfer(InstancePtr, SendBuf, NULL, ByteCount)
The caller wishes only to send and does not care about the received
data. The driver ignores the received data in this case.</pre><pre> XSpiPs_Transfer(InstancePtr, SendBuf, SendBuf, ByteCount)
The caller wishes to send and receive, but provides the same buffer
for doing both. The driver sends the data and overwrites the send
buffer with received data as it transfers the data.</pre><pre> XSpiPs_Transfer(InstancePtr, RecvBuf, RecvBuf, ByteCount)
The caller wishes to only receive and does not care about sending
data. In this case, the caller must still provide a send buffer, but
it can be the same as the receive buffer if the caller does not care
what it sends. The device must send N bytes of data if it wishes to
receive N bytes of data.
</pre><p> Although this function takes entire buffers as arguments, the driver can only transfer a limited number of bytes at a time, limited by the size of the FIFO. A call to this function only starts the transfer, then subsequent transfers of the data is performed by the interrupt service routine until the entire buffer has been transferred. The status callback function is called when the entire buffer has been sent/received.</p>
<p>This function is non-blocking. As a master, the SetSlaveSelect function must be called prior to this function.</p>
<dl><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_spi_ps.html">XSpiPs</a> instance. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>SendBufPtr</em>&nbsp;</td><td>is a pointer to a buffer of data for sending. This buffer must not be NULL. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>RecvBufPtr</em>&nbsp;</td><td>is a pointer to a buffer for received data. This argument can be NULL if do not care about receiving. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>ByteCount</em>&nbsp;</td><td>contains the number of bytes to send/receive. The number of bytes received always equals the number of bytes sent.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
<li>XST_SUCCESS if the buffers are successfully handed off to the device for transfer.</li>
<li>XST_DEVICE_BUSY indicates that a data transfer is already in progress. This is determined by the driver.</li>
</ul>
</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd></dd></dl>
<p>This function is not thread-safe. The higher layer software must ensure that no two threads are transferring data on the SPI bus at the same time. </p>
</div>
</div>
</div>
<p class="Copyright">
Copyright &copy; 1995-2014 Xilinx, Inc. All rights reserved.
</p>
</body>
</html>