2014-06-24 16:45:01 +05:30
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html;charset=iso-8859-1" >
< title >
2014-08-21 15:07:44 +05:30
Xilinx Driver dmaps v4_0: xemaclite.c File Reference
2014-06-24 16:45:01 +05:30
< / title >
2014-08-21 15:07:44 +05:30
< link href = "doxygen_kalyanidocs/doc/css/driver_api_doxygen.css" rel = "stylesheet" type = "text/css" >
2014-06-24 16:45:01 +05:30
< / head >
< h3 class = "PageHeader" > Xilinx Processor IP Library< / h3 >
< hl > Software Drivers< / hl >
< hr class = "whs1" >
2014-08-21 15:07:44 +05:30
<!-- Generated by Doxygen 1.6.1 -->
< div class = "navigation" id = "top" >
< div class = "tabs" >
< ul >
< li > < a href = "index.html" > < span > Main 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 List< / span > < / a > < / li >
< li > < a href = "globals.html" > < span > File Members< / span > < / a > < / li >
< / ul >
< / div >
< / div >
< div class = "contents" >
< h1 > xemaclite.c File Reference< / h1 > < code > #include " xil_io.h" < / code > < br / >
< code > #include " xenv.h" < / code > < br / >
< code > #include " < a class = "el" href = "xemaclite_8h.html" > xemaclite.h< / a > " < / code > < br / >
< code > #include " < a class = "el" href = "xemaclite__i_8h.html" > xemaclite_i.h< / a > " < / code > < br / >
< table border = "0" cellpadding = "0" cellspacing = "0" >
< tr > < td colspan = "2" > < h2 > Functions< / h2 > < / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > int < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#a24330d0e9ca51b8e9cd097ca4b870e91" > XEmacLite_CfgInitialize< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr, < a class = "el" href = "struct_x_emac_lite___config.html" > XEmacLite_Config< / a > *EmacLiteConfigPtr, u32 EffectiveAddr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > int < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#aa509977aea023dfeef6bddb10b2597dc" > XEmacLite_Send< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr, u8 *FramePtr, unsigned ByteCount)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > u16 < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#a6b771b95e193baa02186c6e106c7aefb" > XEmacLite_Recv< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr, u8 *FramePtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > void < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#aaf404b645896f5fb74e87b4ada362809" > XEmacLite_SetMacAddress< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr, u8 *AddressPtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > void < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#a98577fb052d9327b2c5ed429d3740b97" > StubHandler< / a > (void *CallBackRef)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > int < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#a3f75e1a5a0b8d0e5e085880919ad693a" > XEmacLite_TxBufferAvailable< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > void < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#ae7ced3b39bd2f06d037660e884c0706b" > XEmacLite_FlushReceive< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > int < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#a444ab091bdc373bf2e1a266d5febecd0" > XEmacLite_PhyRead< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr, u32 PhyAddress, u32 RegNum, u16 *PhyDataPtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > int < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#a63ef92abf534fcf6f41601e93efa4cc7" > XEmacLite_PhyWrite< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr, u32 PhyAddress, u32 RegNum, u16 PhyData)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > void < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#a1bd8c7361add009208f4c6778644a83c" > XEmacLite_EnableLoopBack< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr)< / td > < / tr >
< tr > < td class = "memItemLeft" align = "right" valign = "top" > void < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "xemaclite_8c.html#a55c4a0b58c4e35dbf81c4866946f368a" > XEmacLite_DisableLoopBack< / a > (< a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > *InstancePtr)< / td > < / tr >
< / table >
< hr / > < a name = "_details" > < / a > < h2 > Detailed Description< / h2 >
< p > Functions in this file are the minimum required functions for the EmacLite driver. See < a class = "el" href = "xemaclite_8h.html" > xemaclite.h< / a > for a detailed description of the driver.< / p >
2014-06-24 16:45:01 +05:30
< pre >
2014-08-21 15:07:44 +05:30
MODIFICATION HISTORY:< / pre > < pre > Ver Who Date Changes
2014-06-24 16:45:01 +05:30
----- ---- -------- --------------------------------------------------------
1.01a ecm 01/31/04 First release
1.11a mta 03/21/07 Updated to new coding style
1.11a ecm 05/18/07 Updated the TxBufferAvailable routine to look at both
the active and busy bits
1.13a sv 02/1/08 Updated the TxBufferAvailable routine to return
busy status properly
2.00a ktn 02/16/09 Added support for MDIO
2.01a ktn 07/20/09 Modified XEmacLite_Send function to use Ping buffers
Interrupt enable bit since this alone is used to enable
the interrupts for both Ping and Pong Buffers.
3.00a ktn 10/22/09 Updated driver to use the HAL APIs/macros.
The macros have been renamed to remove _m from the name.
3.01a ktn 07/08/10 The macro XEmacLite_GetReceiveDataLength is changed to
a static function.
Updated the XEmacLite_GetReceiveDataLength and
XEmacLite_Recv functions to support little endian
MicroBlaze.
3.02a sdm 07/22/11 Removed redundant code in XEmacLite_Recv functions for
CR617290
2014-08-21 15:07:44 +05:30
3.04a srt 04/13/13 Removed warnings (CR 705000).< / pre > < pre > < / pre > < hr / > < h2 > Function Documentation< / h2 >
< a class = "anchor" id = "a98577fb052d9327b2c5ed429d3740b97" > < / a > <!-- doxytag: member="xemaclite.c::StubHandler" ref="a98577fb052d9327b2c5ed429d3740b97" args="(void *CallBackRef)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > void StubHandler < / td >
< td > (< / td >
< td class = "paramtype" > void * < / td >
< td class = "paramname" > < em > CallBackRef< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > This is a stub for the send and receive callbacks. The stub is here in case the upper layers forget to set the handlers.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > CallBackRef< / em > < / td > < td > is a pointer to the upper layer callback reference.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< 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 = "a24330d0e9ca51b8e9cd097ca4b870e91" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_CfgInitialize" ref="a24330d0e9ca51b8e9cd097ca4b870e91" args="(XEmacLite *InstancePtr, XEmacLite_Config *EmacLiteConfigPtr, u32 EffectiveAddr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > int XEmacLite_CfgInitialize < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite___config.html" > XEmacLite_Config< / a > * < / td >
< td class = "paramname" > < em > EmacLiteConfigPtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u32 < / td >
< td class = "paramname" > < em > EffectiveAddr< / em > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Initialize a specific < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > instance/driver. The initialization entails:< / p >
< ul >
< li > Initialize fields of the < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > instance structure.< / li >
< / ul >
< p > The driver defaults to polled mode operation.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > instance. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > EmacLiteConfigPtr< / em > < / td > < td > points to the < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > device configuration structure. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > EffectiveAddr< / em > < / td > < td > is the device base address in the virtual memory address space. If the address translation is not used then the physical address is passed. Unexpected errors may occur if the address mapping is changed after this function is invoked.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > < ul >
< li > XST_SUCCESS if initialization was successful.< / li >
< / ul >
2014-06-24 16:45:01 +05:30
< / dd > < / dl >
2014-08-21 15:07:44 +05:30
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > The initialization of the PHY device is not done in this function. The user needs to use XEmacLite_PhyRead and XEmacLite_PhyWrite functions to access the PHY device. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "a55c4a0b58c4e35dbf81c4866946f368a" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_DisableLoopBack" ref="a55c4a0b58c4e35dbf81c4866946f368a" args="(XEmacLite *InstancePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > void XEmacLite_DisableLoopBack < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Disable Internal loop back functionality.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is the pointer to the instance of the driver.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< 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 = "a1bd8c7361add009208f4c6778644a83c" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_EnableLoopBack" ref="a1bd8c7361add009208f4c6778644a83c" args="(XEmacLite *InstancePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > void XEmacLite_EnableLoopBack < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Enable Internal loop back functionality.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is the pointer to the instance of the driver.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< 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 = "ae7ced3b39bd2f06d037660e884c0706b" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_FlushReceive" ref="ae7ced3b39bd2f06d037660e884c0706b" args="(XEmacLite *InstancePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > void XEmacLite_FlushReceive < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Flush the Receive buffers. All data will be lost.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is the pointer to the instance of the driver to be worked on.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< 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 = "a444ab091bdc373bf2e1a266d5febecd0" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_PhyRead" ref="a444ab091bdc373bf2e1a266d5febecd0" args="(XEmacLite *InstancePtr, u32 PhyAddress, u32 RegNum, u16 *PhyDataPtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > int XEmacLite_PhyRead < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u32 < / td >
< td class = "paramname" > < em > PhyAddress< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u32 < / td >
< td class = "paramname" > < em > RegNum< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u16 * < / td >
< td class = "paramname" > < em > PhyDataPtr< / em > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Read the specified PHY register.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is the pointer to the instance of the driver. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > PhyAddress< / em > < / td > < td > is the address of the PHY device. The valid range is is from 0 to 31. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > RegNum< / em > < / td > < td > is the register number in the PHY device which is to be read. The valid range is is from 0 to 31. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > PhyDataPtr< / em > < / td > < td > is a pointer to the data in which the data read from the PHY device is returned.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > < ul >
< li > XST_SUCCESS if the data is read from the PHY.< / li >
< li > XST_DEVICE_BUSY if MDIO is busy.< / li >
< / ul >
2014-06-24 16:45:01 +05:30
< / dd > < / dl >
2014-08-21 15:07:44 +05:30
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > This function waits for the completion of MDIO data transfer. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "a63ef92abf534fcf6f41601e93efa4cc7" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_PhyWrite" ref="a63ef92abf534fcf6f41601e93efa4cc7" args="(XEmacLite *InstancePtr, u32 PhyAddress, u32 RegNum, u16 PhyData)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > int XEmacLite_PhyWrite < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u32 < / td >
< td class = "paramname" > < em > PhyAddress< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u32 < / td >
< td class = "paramname" > < em > RegNum< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u16 < / td >
< td class = "paramname" > < em > PhyData< / em > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Write the given data to the specified register in the PHY device.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is the pointer to the instance of the driver. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > PhyAddress< / em > < / td > < td > is the address of the PHY device. The valid range is is from 0 to 31. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > RegNum< / em > < / td > < td > is the register number in the PHY device which is to be written. The valid range is is from 0 to 31. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > PhyData< / em > < / td > < td > is the data to be written to the specified register in the PHY device.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > < ul >
< li > XST_SUCCESS if the data is written to the PHY.< / li >
< li > XST_DEVICE_BUSY if MDIO is busy.< / li >
< / ul >
2014-06-24 16:45:01 +05:30
< / dd > < / dl >
2014-08-21 15:07:44 +05:30
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > This function waits for the completion of MDIO data transfer. < / dd > < / dl >
< / div >
< / div >
< a class = "anchor" id = "a6b771b95e193baa02186c6e106c7aefb" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_Recv" ref="a6b771b95e193baa02186c6e106c7aefb" args="(XEmacLite *InstancePtr, u8 *FramePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > u16 XEmacLite_Recv < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u8 * < / td >
< td class = "paramname" > < em > FramePtr< / em > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Receive a frame. Intended to be called from the interrupt context or with a wrapper which waits for the receive frame to be available.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > instance. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > FramePtr< / em > < / td > < td > is a pointer to a buffer where the frame will be stored. The buffer must be at least XEL_MAX_FRAME_SIZE bytes. For optimal performance, a 32-bit aligned buffer should be used but it is not required, the function will align the data if necessary.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > < / dd > < / dl >
< p > The type/length field of the frame received. When the type/length field contains the type, XEL_MAX_FRAME_SIZE bytes will be copied out of the buffer and it is up to the higher layers to sort out the frame. Function returns 0 if there is no data waiting in the receive buffer or the pong buffer if configured.< / p >
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > < / dd > < / dl >
< p > This function call is not blocking in nature, i.e. it will not wait until a frame arrives. < / p >
< / div >
< / div >
< a class = "anchor" id = "aa509977aea023dfeef6bddb10b2597dc" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_Send" ref="aa509977aea023dfeef6bddb10b2597dc" args="(XEmacLite *InstancePtr, u8 *FramePtr, unsigned ByteCount)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > int XEmacLite_Send < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u8 * < / td >
< td class = "paramname" > < em > FramePtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > unsigned < / td >
< td class = "paramname" > < em > ByteCount< / em > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Send an Ethernet frame. The ByteCount is the total frame size, including header.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > instance. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > FramePtr< / em > < / td > < td > is a pointer to frame. For optimal performance, a 32-bit aligned buffer should be used but it is not required, the function will align the data if necessary. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > ByteCount< / em > < / td > < td > is the size, in bytes, of the frame< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > < ul >
< li > XST_SUCCESS if data was transmitted.< / li >
< li > XST_FAILURE if buffer(s) was (were) full and no valid data was transmitted.< / li >
< / ul >
2014-06-24 16:45:01 +05:30
< / dd > < / dl >
2014-08-21 15:07:44 +05:30
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > < / dd > < / dl >
< p > This function call is not blocking in nature, i.e. it will not wait until the frame is transmitted. < / p >
< / div >
< / div >
< a class = "anchor" id = "aaf404b645896f5fb74e87b4ada362809" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_SetMacAddress" ref="aaf404b645896f5fb74e87b4ada362809" args="(XEmacLite *InstancePtr, u8 *AddressPtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > void XEmacLite_SetMacAddress < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > , < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > u8 * < / td >
< td class = "paramname" > < em > AddressPtr< / em > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< tr >
2014-08-21 15:07:44 +05:30
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td > < td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Set the MAC address for this device. The address is a 48-bit value.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is a pointer to the < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > instance. < / td > < / tr >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > AddressPtr< / em > < / td > < td > is a pointer to a 6-byte MAC address. the format of the MAC address is major octet to minor octet< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > None.< / dd > < / dl >
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > < / dd > < / dl >
2014-06-24 16:45:01 +05:30
< ul >
2014-08-21 15:07:44 +05:30
< li > TX must be idle and RX should be idle for deterministic results. It is recommended that this function should be called after the initialization and before transmission of any packets from the device.< / li >
< li > Function will not return if hardware is absent or not functioning properly.< / li >
< li > The MAC address can be programmed using any of the two transmit buffers (if configured). < / li >
< / ul >
< / div >
< / div >
< a class = "anchor" id = "a3f75e1a5a0b8d0e5e085880919ad693a" > < / a > <!-- doxytag: member="xemaclite.c::XEmacLite_TxBufferAvailable" ref="a3f75e1a5a0b8d0e5e085880919ad693a" args="(XEmacLite *InstancePtr)" -->
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
2014-06-24 16:45:01 +05:30
< tr >
2014-08-21 15:07:44 +05:30
< td class = "memname" > int XEmacLite_TxBufferAvailable < / td >
< td > (< / td >
< td class = "paramtype" > < a class = "el" href = "struct_x_emac_lite.html" > XEmacLite< / a > * < / td >
< td class = "paramname" > < em > InstancePtr< / em > < / td >
< td > ) < / td >
< td > < / td >
2014-06-24 16:45:01 +05:30
< / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / div >
< div class = "memdoc" >
< p > Determine if there is a transmit buffer available.< / p >
< dl > < dt > < b > Parameters:< / b > < / dt > < dd >
2014-06-24 16:45:01 +05:30
< table border = "0" cellspacing = "2" cellpadding = "0" >
< tr > < td valign = "top" > < / td > < td valign = "top" > < em > InstancePtr< / em > < / td > < td > is the pointer to the instance of the driver to be worked on.< / td > < / tr >
< / table >
2014-08-21 15:07:44 +05:30
< / dd >
2014-06-24 16:45:01 +05:30
< / dl >
2014-08-21 15:07:44 +05:30
< dl class = "return" > < dt > < b > Returns:< / b > < / dt > < dd > < ul >
< li > TRUE if there is a TX buffer available for data to be written< / li >
< li > FALSE if Tx Buffer is not available.< / li >
< / ul >
2014-06-24 16:45:01 +05:30
< / dd > < / dl >
2014-08-21 15:07:44 +05:30
< dl class = "note" > < dt > < b > Note:< / b > < / dt > < dd > None. < / dd > < / dl >
< / div >
< / div >
< / div >
< p class = "Copyright" >
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.
< / p >
< / body >
< / html >