emaclite
Vitis Drivers API Documentation
Overview

Data Structures

struct  XEmacLite_Config
 This typedef contains configuration information for a device. More...
 
struct  XEmacLite
 The XEmacLite driver instance data. More...
 

Macros

#define XEmacLite_NextTransmitAddr(InstancePtr)
 Return the next expected Transmit Buffer's address. More...
 
#define XEmacLite_NextReceiveAddr(InstancePtr)
 Return the next expected Receive Buffer's address. More...
 
#define XEmacLite_IsMdioConfigured(InstancePtr)   ((InstancePtr)->EmacLiteConfig.MdioInclude == 1)
 This macro determines if the device is currently configured for MDIO. More...
 
#define XEmacLite_IsLoopbackConfigured(InstancePtr)   ((InstancePtr)->EmacLiteConfig.Loopback == 1)
 This macro determines if the device is currently configured for internal loopback. More...
 
#define XEmacLite_GetTxActive(BaseAddress)   (XEmacLite_ReadReg((BaseAddress), XEL_TSR_OFFSET))
 Get the TX active location to check status. More...
 
#define XEmacLite_SetTxActive(BaseAddress, Mask)   (XEmacLite_WriteReg((BaseAddress), XEL_TSR_OFFSET, (Mask)))
 Set the TX active location to update status. More...
 
#define XEL_TXBUFF_OFFSET   (0x00000000)
 Register offsets for the Ethernet MAC. More...
 
#define XEL_MDIOADDR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07E4)
 MDIO Address offset register. More...
 
#define XEL_MDIOWR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07E8)
 MDIO write data register offset. More...
 
#define XEL_MDIORD_OFFSET   (XEL_TXBUFF_OFFSET + 0x07EC)
 MDIO read data register offset. More...
 
#define XEL_MDIOCNTR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07F0)
 MDIO Control Register offset. More...
 
#define XEL_GIER_OFFSET   (XEL_TXBUFF_OFFSET + 0x07F8)
 Offset for the GIE Register. More...
 
#define XEL_TSR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07FC)
 Tx status. More...
 
#define XEL_TPLR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07F4)
 Tx packet length. More...
 
#define XEL_RXBUFF_OFFSET   (0x00001000)
 Receive Buffer. More...
 
#define XEL_RSR_OFFSET   (XEL_RXBUFF_OFFSET + 0x07FC)
 Rx status. More...
 
#define XEL_RPLR_OFFSET   (XEL_RXBUFF_OFFSET + 0x0C)
 Rx packet length. More...
 
#define XEL_MAC_HI_OFFSET   (XEL_TXBUFF_OFFSET + 0x14)
 MAC address hi offset. More...
 
#define XEL_MAC_LO_OFFSET   (XEL_TXBUFF_OFFSET)
 MAC address lo offset. More...
 
#define XEL_BUFFER_OFFSET   (0x00000800)
 Next buffer's offset same for both TX and RX. More...
 
#define XEL_MDIO_ADDRESS_MASK   0x00003E0
 MDIO Address/Write Data/Read Data Register Bit Masks. More...
 
#define XEL_MDIO_ADDRESS_SHIFT   0x5
 PHY Address shift. More...
 
#define XEL_MDIO_OP_MASK   0x00000400
 PHY read access. More...
 
#define XEL_MDIOCNTR_STATUS_MASK   0x00000001
 MDIO Control Register Bit Masks. More...
 
#define XEL_MDIOCNTR_ENABLE_MASK   0x00000008
 MDIO Enable. More...
 
#define XEL_GIER_GIE_MASK   0x80000000
 Global Interrupt Enable Register (GIER) Bit Masks. More...
 
#define XEL_TSR_XMIT_BUSY_MASK   0x00000001
 Transmit Status Register (TSR) Bit Masks. More...
 
#define XEL_TSR_PROGRAM_MASK   0x00000002
 Program the MAC address. More...
 
#define XEL_TSR_XMIT_IE_MASK   0x00000008
 Xmit interrupt enable bit. More...
 
#define XEL_TSR_LOOPBACK_MASK   0x00000010
 Loop back enable bit. More...
 
#define XEL_TSR_XMIT_ACTIVE_MASK   0x80000000
 Buffer is active, SW bit only. More...
 
#define XEL_TSR_PROG_MAC_ADDR   (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_PROGRAM_MASK)
 define for programming the MAC address into the EmacLite More...
 
#define XEL_RSR_RECV_DONE_MASK   0x00000001
 Receive Status Register (RSR) More...
 
#define XEL_RSR_RECV_IE_MASK   0x00000008
 Recv interrupt enable bit. More...
 
#define XEL_TPLR_LENGTH_MASK_HI   0x0000FF00
 Transmit Packet Length Register (TPLR) More...
 
#define XEL_TPLR_LENGTH_MASK_LO   0x000000FF
 Transmit packet length lower byte. More...
 
#define XEL_RPLR_LENGTH_MASK_HI   0x0000FF00
 Receive Packet Length Register (RPLR) More...
 
#define XEL_RPLR_LENGTH_MASK_LO   0x000000FF
 Receive packet length lower byte. More...
 
#define XEL_HEADER_SIZE   14
 Size of header in bytes. More...
 
#define XEL_MTU_SIZE   1500
 Max size of data in frame. More...
 
#define XEL_FCS_SIZE   4
 Size of CRC. More...
 
#define XEL_HEADER_OFFSET   12
 Offset to length field. More...
 
#define XEL_HEADER_SHIFT   16
 Right shift value to align length. More...
 
#define XEL_MAX_FRAME_SIZE   (XEL_HEADER_SIZE+XEL_MTU_SIZE+ XEL_FCS_SIZE)
 Max length of Rx frame used if length/type field contains the type (> 1500) More...
 
#define XEL_MAX_TX_FRAME_SIZE   (XEL_HEADER_SIZE + XEL_MTU_SIZE)
 Max length of Tx frame. More...
 
#define XEL_MAC_ADDR_SIZE   6
 length of MAC address More...
 
#define XEL_ETHER_PROTO_TYPE_IP   0x0800
 IP Protocol. More...
 
#define XEL_ETHER_PROTO_TYPE_ARP   0x0806
 ARP Protocol. More...
 
#define XEL_ETHER_PROTO_TYPE_VLAN   0x8100
 VLAN Tagged. More...
 
#define XEL_ARP_PACKET_SIZE   28
 Max ARP packet size. More...
 
#define XEL_HEADER_IP_LENGTH_OFFSET   16
 IP Length Offset. More...
 
#define XEL_VLAN_TAG_SIZE   4
 VLAN Tag Size. More...
 
#define XEmacLite_ReadReg(BaseAddress, RegOffset)   XEmacLite_In32((BaseAddress) + (RegOffset))
 Read from the specified EmacLite device register. More...
 
#define XEmacLite_WriteReg(BaseAddress, RegOffset, RegisterValue)   XEmacLite_Out32((BaseAddress) + (RegOffset), (RegisterValue))
 Write to the specified EmacLite device register. More...
 
#define XEmacLite_GetTxStatus(BaseAddress)   (XEmacLite_ReadReg((BaseAddress), XEL_TSR_OFFSET))
 Get the Tx Status Register Contents. More...
 
#define XEmacLite_SetTxStatus(BaseAddress, Data)   (XEmacLite_WriteReg((BaseAddress), XEL_TSR_OFFSET, (Data)))
 Set the Tx Status Register Contents. More...
 
#define XEmacLite_GetRxStatus(BaseAddress)   (XEmacLite_ReadReg((BaseAddress), XEL_RSR_OFFSET))
 Get the Rx Status Register Contents. More...
 
#define XEmacLite_SetRxStatus(BaseAddress, Data)   (XEmacLite_WriteReg((BaseAddress), XEL_RSR_OFFSET, (Data)))
 Set the Rx Status Register Contents. More...
 
#define XEmacLite_IsTxDone(BaseAddress)
 Check to see if the transmission is complete. More...
 
#define XEmacLite_IsRxEmpty(BaseAddress)
 Check to see if the receive is empty. More...
 

Functions

int XEmacLite_CfgInitialize (XEmacLite *InstancePtr, XEmacLite_Config *EmacLiteConfigPtr, UINTPTR EffectiveAddr)
 Initialize a specific XEmacLite instance/driver. More...
 
int XEmacLite_Send (XEmacLite *InstancePtr, u8 *FramePtr, unsigned ByteCount)
 Send an Ethernet frame. More...
 
u16 XEmacLite_Recv (XEmacLite *InstancePtr, u8 *FramePtr)
 Receive a frame. More...
 
void XEmacLite_SetMacAddress (XEmacLite *InstancePtr, u8 *AddressPtr)
 Set the MAC address for this device. More...
 
void StubHandler (void *CallBackRef)
 This is a stub for the send and receive callbacks. More...
 
int XEmacLite_TxBufferAvailable (XEmacLite *InstancePtr)
 Determine if there is a transmit buffer available. More...
 
void XEmacLite_FlushReceive (XEmacLite *InstancePtr)
 Flush the Receive buffers. More...
 
int XEmacLite_PhyRead (XEmacLite *InstancePtr, u32 PhyAddress, u32 RegNum, u16 *PhyDataPtr)
 Read the specified PHY register. More...
 
int XEmacLite_PhyWrite (XEmacLite *InstancePtr, u32 PhyAddress, u32 RegNum, u16 PhyData)
 Write the given data to the specified register in the PHY device. More...
 
void XEmacLite_EnableLoopBack (XEmacLite *InstancePtr)
 Enable Internal loop back functionality. More...
 
void XEmacLite_DisableLoopBack (XEmacLite *InstancePtr)
 Disable Internal loop back functionality. More...
 
XEmacLite_ConfigXEmacLite_LookupConfig (u16 DeviceId)
 Lookup the device configuration based on the unique device ID. More...
 
int XEmacLite_Initialize (XEmacLite *InstancePtr, u16 DeviceId)
 Initialize a specific XEmacLite instance/driver. More...
 
int XEmacLite_EnableInterrupts (XEmacLite *InstancePtr)
 Enable the EmacLite Interrupts. More...
 
void XEmacLite_DisableInterrupts (XEmacLite *InstancePtr)
 Disables the interrupts from the device (the higher layer software is responsible for disabling interrupts at the interrupt controller). More...
 
void XEmacLite_InterruptHandler (void *InstancePtr)
 Interrupt handler for the EmacLite driver. More...
 
void XEmacLite_SetRecvHandler (XEmacLite *InstancePtr, void *CallBackRef, XEmacLite_Handler FuncPtr)
 Sets the callback function for handling received frames in interrupt mode. More...
 
void XEmacLite_SetSendHandler (XEmacLite *InstancePtr, void *CallBackRef, XEmacLite_Handler FuncPtr)
 Sets the callback function for handling transmitted frames in interrupt mode. More...
 
int XEmacLite_SelfTest (XEmacLite *InstancePtr)
 Performs a SelfTest on the EmacLite device as follows: More...
 
void XEmacLite_AlignedWrite (void *SrcPtr, UINTPTR *DestPtr, unsigned ByteCount)
 This function aligns the incoming data and writes it out to a 32-bit aligned destination address range. More...
 
void XEmacLite_AlignedRead (UINTPTR *SrcPtr, void *DestPtr, unsigned ByteCount)
 This function reads from a 32-bit aligned source address range and aligns the writes to the provided destination pointer alignment. More...
 
void XEmacLite_SendFrame (UINTPTR BaseAddress, u8 *FramePtr, unsigned ByteCount)
 Send an Ethernet frame. More...
 
u16 XEmacLite_RecvFrame (UINTPTR BaseAddress, u8 *FramePtr)
 Receive a frame. More...
 

Variables

XEmacLite_Config XEmacLite_ConfigTable [XPAR_XEMACLITE_NUM_INSTANCES]
 This table contains configuration information for each EmacLite device in the system. More...
 
XEmacLite_Config XEmacLite_ConfigTable []
 This table contains configuration information for each EmacLite device in the system. More...
 
XEmacLite_Config XEmacLite_ConfigTable []
 This table contains configuration information for each EmacLite device in the system. More...
 

Macro Definition Documentation

#define XEL_ARP_PACKET_SIZE   28

Max ARP packet size.

Referenced by XEmacLite_Recv().

#define XEL_BUFFER_OFFSET   (0x00000800)
#define XEL_ETHER_PROTO_TYPE_ARP   0x0806

ARP Protocol.

Referenced by XEmacLite_Recv().

#define XEL_ETHER_PROTO_TYPE_IP   0x0800

IP Protocol.

Referenced by XEmacLite_Recv().

#define XEL_ETHER_PROTO_TYPE_VLAN   0x8100

VLAN Tagged.

#define XEL_FCS_SIZE   4

Size of CRC.

Referenced by XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEL_GIER_GIE_MASK   0x80000000

Global Interrupt Enable Register (GIER) Bit Masks.

Global Enable

Referenced by XEmacLite_EnableInterrupts().

#define XEL_GIER_OFFSET   (XEL_TXBUFF_OFFSET + 0x07F8)

Offset for the GIE Register.

Referenced by XEmacLite_DisableInterrupts(), and XEmacLite_EnableInterrupts().

#define XEL_HEADER_IP_LENGTH_OFFSET   16

IP Length Offset.

Referenced by XEmacLite_Recv().

#define XEL_HEADER_OFFSET   12

Offset to length field.

#define XEL_HEADER_SHIFT   16

Right shift value to align length.

Referenced by XEmacLite_Recv().

#define XEL_HEADER_SIZE   14

Size of header in bytes.

Referenced by XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEL_MAC_ADDR_SIZE   6

length of MAC address

Referenced by XEmacLite_SetMacAddress().

#define XEL_MAC_HI_OFFSET   (XEL_TXBUFF_OFFSET + 0x14)

MAC address hi offset.

#define XEL_MAC_LO_OFFSET   (XEL_TXBUFF_OFFSET)

MAC address lo offset.

#define XEL_MAX_FRAME_SIZE   (XEL_HEADER_SIZE+XEL_MTU_SIZE+ XEL_FCS_SIZE)

Max length of Rx frame used if length/type field contains the type (> 1500)

Referenced by XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEL_MAX_TX_FRAME_SIZE   (XEL_HEADER_SIZE + XEL_MTU_SIZE)

Max length of Tx frame.

Referenced by XEmacLite_Send().

#define XEL_MDIO_ADDRESS_MASK   0x00003E0

MDIO Address/Write Data/Read Data Register Bit Masks.

PHY Address mask

Referenced by XEmacLite_PhyRead(), and XEmacLite_PhyWrite().

#define XEL_MDIO_ADDRESS_SHIFT   0x5

PHY Address shift.

Referenced by XEmacLite_PhyRead(), and XEmacLite_PhyWrite().

#define XEL_MDIO_OP_MASK   0x00000400

PHY read access.

Referenced by XEmacLite_PhyRead(), and XEmacLite_PhyWrite().

#define XEL_MDIOADDR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07E4)

MDIO Address offset register.

Referenced by XEmacLite_PhyRead(), and XEmacLite_PhyWrite().

#define XEL_MDIOCNTR_ENABLE_MASK   0x00000008

MDIO Enable.

Referenced by XEmacLite_PhyRead(), and XEmacLite_PhyWrite().

#define XEL_MDIOCNTR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07F0)

MDIO Control Register offset.

Referenced by XEmacLite_PhyRead(), and XEmacLite_PhyWrite().

#define XEL_MDIOCNTR_STATUS_MASK   0x00000001

MDIO Control Register Bit Masks.

MDIO transfer in Progress

Referenced by XEmacLite_PhyRead(), and XEmacLite_PhyWrite().

#define XEL_MDIORD_OFFSET   (XEL_TXBUFF_OFFSET + 0x07EC)

MDIO read data register offset.

Referenced by XEmacLite_PhyRead().

#define XEL_MDIOWR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07E8)

MDIO write data register offset.

Referenced by XEmacLite_PhyWrite().

#define XEL_MTU_SIZE   1500

Max size of data in frame.

Referenced by EmacLiteIntrLoopbackExample(), and EmacLitePhyLoopbackExample().

#define XEL_RPLR_LENGTH_MASK_HI   0x0000FF00

Receive Packet Length Register (RPLR)

Receive packet length upper byte

Referenced by XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEL_RPLR_LENGTH_MASK_LO   0x000000FF

Receive packet length lower byte.

Referenced by XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEL_RPLR_OFFSET   (XEL_RXBUFF_OFFSET + 0x0C)

Rx packet length.

Referenced by XEmacLite_RecvFrame().

#define XEL_RSR_OFFSET   (XEL_RXBUFF_OFFSET + 0x07FC)

Rx status.

#define XEL_RSR_RECV_DONE_MASK   0x00000001

Receive Status Register (RSR)

Recv complete

Referenced by XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEL_RSR_RECV_IE_MASK   0x00000008
#define XEL_RXBUFF_OFFSET   (0x00001000)

Receive Buffer.

Referenced by XEmacLite_Recv(), XEmacLite_RecvFrame(), and XEmacLite_SelfTest().

#define XEL_TPLR_LENGTH_MASK_HI   0x0000FF00

Transmit Packet Length Register (TPLR)

Transmit packet length upper byte

Referenced by XEmacLite_Send(), and XEmacLite_SendFrame().

#define XEL_TPLR_LENGTH_MASK_LO   0x000000FF

Transmit packet length lower byte.

Referenced by XEmacLite_Send(), and XEmacLite_SendFrame().

#define XEL_TPLR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07F4)

Tx packet length.

Referenced by XEmacLite_Send(), XEmacLite_SendFrame(), and XEmacLite_SetMacAddress().

#define XEL_TSR_LOOPBACK_MASK   0x00000010

Loop back enable bit.

Referenced by XEmacLite_DisableLoopBack(), and XEmacLite_EnableLoopBack().

#define XEL_TSR_OFFSET   (XEL_TXBUFF_OFFSET + 0x07FC)
#define XEL_TSR_PROG_MAC_ADDR   (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_PROGRAM_MASK)

define for programming the MAC address into the EmacLite

Referenced by XEmacLite_SetMacAddress().

#define XEL_TSR_PROGRAM_MASK   0x00000002

Program the MAC address.

#define XEL_TSR_XMIT_ACTIVE_MASK   0x80000000

Buffer is active, SW bit only.

This is not documented in the HW spec

Referenced by XEmacLite_InterruptHandler(), XEmacLite_Send(), and XEmacLite_TxBufferAvailable().

#define XEL_TSR_XMIT_BUSY_MASK   0x00000001

Transmit Status Register (TSR) Bit Masks.

Xmit complete

Referenced by XEmacLite_InterruptHandler(), XEmacLite_Send(), XEmacLite_SendFrame(), and XEmacLite_TxBufferAvailable().

#define XEL_TSR_XMIT_IE_MASK   0x00000008

Xmit interrupt enable bit.

Referenced by XEmacLite_DisableInterrupts(), XEmacLite_EnableInterrupts(), and XEmacLite_Send().

#define XEL_TXBUFF_OFFSET   (0x00000000)

Register offsets for the Ethernet MAC.

Transmit Buffer

Referenced by XEmacLite_SelfTest().

#define XEL_VLAN_TAG_SIZE   4

VLAN Tag Size.

#define XEmacLite_GetRxStatus (   BaseAddress)    (XEmacLite_ReadReg((BaseAddress), XEL_RSR_OFFSET))

Get the Rx Status Register Contents.

Parameters
BaseAddressis the base address of the device
Returns
The contents of the Rx Status Register.
Note
C-Style signature: u32 XEmacLite_GetRxStatus(u32 BaseAddress)

Referenced by XEmacLite_DisableInterrupts(), XEmacLite_EnableInterrupts(), XEmacLite_FlushReceive(), XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEmacLite_GetTxActive (   BaseAddress)    (XEmacLite_ReadReg((BaseAddress), XEL_TSR_OFFSET))

Get the TX active location to check status.

This is used to check if the TX buffer is currently active. There isn't any way in the hardware to implement this but the register is fully populated so the driver can set the bit in the send routine and the ISR can clear the bit when the handler is complete. This mimics the correct operation of the hardware if it was possible to do this in hardware.

Parameters
BaseAddressis the base address of the device
Returns
Contents of active bit in register.
Note
C-Style signature: u32 XEmacLite_GetTxActive(u32 BaseAddress)
#define XEmacLite_GetTxStatus (   BaseAddress)    (XEmacLite_ReadReg((BaseAddress), XEL_TSR_OFFSET))

Get the Tx Status Register Contents.

Parameters
BaseAddressis the base address of the device
Returns
The contents of the Tx Status Register.
Note
C-Style signature: u32 XEmacLite_GetTxStatus(u32 BaseAddress)

Referenced by XEmacLite_DisableInterrupts(), XEmacLite_EnableInterrupts(), XEmacLite_InterruptHandler(), XEmacLite_Send(), XEmacLite_SendFrame(), XEmacLite_SetMacAddress(), and XEmacLite_TxBufferAvailable().

#define XEmacLite_IsLoopbackConfigured (   InstancePtr)    ((InstancePtr)->EmacLiteConfig.Loopback == 1)

This macro determines if the device is currently configured for internal loopback.

Parameters
InstancePtris the pointer to the instance of the EmacLite driver.
Returns
  • TRUE if the device is configured for internal loopback.
  • FALSE if the device is NOT configured for internal loopback.
Note
C-Style signature: int XEmacLite_IsLoopbackConfigured(XEmacLite *InstancePtr)
#define XEmacLite_IsMdioConfigured (   InstancePtr)    ((InstancePtr)->EmacLiteConfig.MdioInclude == 1)

This macro determines if the device is currently configured for MDIO.

Parameters
InstancePtris the pointer to the instance of the EmacLite driver.
Returns
  • TRUE if the device is configured for MDIO.
  • FALSE if the device is NOT configured for MDIO.
Note
C-Style signature: int XEmacLite_IsMdioConfigured(XEmacLite *InstancePtr)

Referenced by EmacLiteIntrExample(), EmacLitePhyLoopbackExample(), and EmacLitePolledExample().

#define XEmacLite_IsRxEmpty (   BaseAddress)
Value:
((XEmacLite_ReadReg((BaseAddress), XEL_RSR_OFFSET) & \
#define XEmacLite_ReadReg(BaseAddress, RegOffset)
Read from the specified EmacLite device register.
Definition: xemaclite_l.h:240
#define XEL_RSR_RECV_DONE_MASK
Receive Status Register (RSR)
Definition: xemaclite_l.h:159
#define XEL_RSR_OFFSET
Rx status.
Definition: xemaclite_l.h:95

Check to see if the receive is empty.

Parameters
BaseAddressis the base address of the device
Returns
TRUE if it is empty, or FALSE if it is not.
Note
C-Style signature: int XEmacLite_IsRxEmpty(u32 BaseAddress)

Referenced by XEmacLite_InterruptHandler(), and XEmacLite_RecvFrame().

#define XEmacLite_IsTxDone (   BaseAddress)
Value:
((XEmacLite_ReadReg((BaseAddress), XEL_TSR_OFFSET) & \
#define XEmacLite_ReadReg(BaseAddress, RegOffset)
Read from the specified EmacLite device register.
Definition: xemaclite_l.h:240
#define XEL_TSR_XMIT_BUSY_MASK
Transmit Status Register (TSR) Bit Masks.
Definition: xemaclite_l.h:133
#define XEL_TSR_OFFSET
Tx status.
Definition: xemaclite_l.h:91

Check to see if the transmission is complete.

Parameters
BaseAddressis the base address of the device
Returns
TRUE if it is done, or FALSE if it is not.
Note
C-Style signature: int XEmacLite_IsTxDone(u32 BaseAddress)

Referenced by XEmacLite_SendFrame().

#define XEmacLite_NextReceiveAddr (   InstancePtr)
Value:
((InstancePtr)->EmacLiteConfig.BaseAddress + \
(InstancePtr)->NextRxBufferToUse)

Return the next expected Receive Buffer's address.

Parameters
InstancePtris the pointer to the instance of the driver to be worked on
Note
C-Style signature: u32 XEmacLite_NextReceiveAddr(XEmacLite *InstancePtr);

This macro returns the address of the next receive buffer to read data from. This is the expected receive buffer address if the driver is in sync.

Referenced by XEmacLite_Recv().

#define XEmacLite_NextTransmitAddr (   InstancePtr)
Value:
((InstancePtr)->EmacLiteConfig.BaseAddress + \
(InstancePtr)->NextTxBufferToUse) + XEL_TXBUFF_OFFSET
#define XEL_TXBUFF_OFFSET
Register offsets for the Ethernet MAC.
Definition: xemaclite_l.h:75

Return the next expected Transmit Buffer's address.

Parameters
InstancePtris the pointer to the instance of the driver to be worked on
Note
C-Style signature: u32 XEmacLite_NextTransmitAddr(XEmacLite *InstancePtr);

This macro returns the address of the next transmit buffer to put data into. This is used to determine the destination of the next transmit data frame.

Referenced by XEmacLite_Send(), and XEmacLite_SetMacAddress().

#define XEmacLite_ReadReg (   BaseAddress,
  RegOffset 
)    XEmacLite_In32((BaseAddress) + (RegOffset))

Read from the specified EmacLite device register.

Parameters
BaseAddresscontains the base address of the device.
RegOffsetcontains the offset from the 1st register of the device to select the specific register.
Returns
The value read from the register.
Note
C-Style signature: u32 XEmacLite_ReadReg(u32 BaseAddress, u32 RegOffset);

Referenced by XEmacLite_DisableLoopBack(), XEmacLite_EnableLoopBack(), XEmacLite_PhyRead(), XEmacLite_PhyWrite(), XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEmacLite_SetRxStatus (   BaseAddress,
  Data 
)    (XEmacLite_WriteReg((BaseAddress), XEL_RSR_OFFSET, (Data)))

Set the Rx Status Register Contents.

Parameters
BaseAddressis the base address of the device
Datais the value to be written to the Register.
Returns
None.
Note
C-Style signature: u32 XEmacLite_SetRxStatus(u32 BaseAddress, u32 Data)

Referenced by XEmacLite_DisableInterrupts(), XEmacLite_EnableInterrupts(), XEmacLite_FlushReceive(), XEmacLite_Recv(), and XEmacLite_RecvFrame().

#define XEmacLite_SetTxActive (   BaseAddress,
  Mask 
)    (XEmacLite_WriteReg((BaseAddress), XEL_TSR_OFFSET, (Mask)))

Set the TX active location to update status.

This is used to set the bit indicating which TX buffer is currently active. There isn't any way in the hardware to implement this but the register is fully populated so the driver can set the bit in the send routine and the ISR can clear the bit when the handler is complete. This mimics the correct operation of the hardware if it was possible to do this in hardware.

Parameters
BaseAddressis the base address of the device
Maskis the data to be written
Returns
None
Note
C-Style signature: void XEmacLite_SetTxActive(u32 BaseAddress, u32 Mask)
#define XEmacLite_SetTxStatus (   BaseAddress,
  Data 
)    (XEmacLite_WriteReg((BaseAddress), XEL_TSR_OFFSET, (Data)))

Set the Tx Status Register Contents.

Parameters
BaseAddressis the base address of the device
Datais the value to be written to the Register.
Returns
None.
Note
C-Style signature: u32 XEmacLite_SetTxStatus(u32 BaseAddress, u32 Data)

Referenced by XEmacLite_DisableInterrupts(), XEmacLite_EnableInterrupts(), XEmacLite_InterruptHandler(), XEmacLite_Send(), XEmacLite_SendFrame(), and XEmacLite_SetMacAddress().

#define XEmacLite_WriteReg (   BaseAddress,
  RegOffset,
  RegisterValue 
)    XEmacLite_Out32((BaseAddress) + (RegOffset), (RegisterValue))

Write to the specified EmacLite device register.

Parameters
BaseAddresscontains the base address of the device.
RegOffsetcontains the offset from the 1st register of the device to select the specific register.
RegisterValueis the value to be written to the register.
Returns
None.
Note
C-Style signature: void XEmacLite_WriteReg(u32 BaseAddress, u32 RegOffset, u32 RegisterValue);

Referenced by XEmacLite_CfgInitialize(), XEmacLite_DisableInterrupts(), XEmacLite_DisableLoopBack(), XEmacLite_EnableInterrupts(), XEmacLite_EnableLoopBack(), XEmacLite_PhyRead(), XEmacLite_PhyWrite(), XEmacLite_Send(), XEmacLite_SendFrame(), and XEmacLite_SetMacAddress().

Function Documentation

void StubHandler ( void *  CallBackRef)

This is a stub for the send and receive callbacks.

The stub is here in case the upper layers forget to set the handlers.

Parameters
CallBackRefis a pointer to the upper layer callback reference.
Returns
None.
Note
None.

Referenced by XEmacLite_CfgInitialize(), and XEmacLite_EnableInterrupts().

void XEmacLite_AlignedRead ( UINTPTR *  SrcPtr,
void *  DestPtr,
unsigned  ByteCount 
)

This function reads from a 32-bit aligned source address range and aligns the writes to the provided destination pointer alignment.

Parameters
SrcPtris a pointer to incoming data of 32-bit alignment.
DestPtris a pointer to outgoing data of any alignment.
ByteCountis the number of bytes to read.
Returns
None.
Note
None.

Referenced by XEmacLite_Recv(), XEmacLite_RecvFrame(), and XEmacLite_SelfTest().

void XEmacLite_AlignedWrite ( void *  SrcPtr,
UINTPTR *  DestPtr,
unsigned  ByteCount 
)

This function aligns the incoming data and writes it out to a 32-bit aligned destination address range.

Parameters
SrcPtris a pointer to incoming data of any alignment.
DestPtris a pointer to outgoing data of 32-bit alignment.
ByteCountis the number of bytes to write.
Returns
None.
Note
None.

Referenced by XEmacLite_SelfTest(), XEmacLite_Send(), XEmacLite_SendFrame(), and XEmacLite_SetMacAddress().

int XEmacLite_CfgInitialize ( XEmacLite InstancePtr,
XEmacLite_Config EmacLiteConfigPtr,
UINTPTR  EffectiveAddr 
)

Initialize a specific XEmacLite instance/driver.

The initialization entails:

  • Initialize fields of the XEmacLite instance structure.

The driver defaults to polled mode operation.

Parameters
InstancePtris a pointer to the XEmacLite instance.
EmacLiteConfigPtrpoints to the XEmacLite device configuration structure.
EffectiveAddris 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.
Returns
  • XST_SUCCESS if initialization was successful.
Note
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.

References XEmacLite_Config::BaseAddress, XEmacLite_Config::DeviceId, XEmacLite_Config::Loopback, XEmacLite_Config::MdioInclude, XEmacLite_Config::RxPingPong, StubHandler(), XEmacLite_Config::TxPingPong, XEL_BUFFER_OFFSET, XEL_TSR_OFFSET, and XEmacLite_WriteReg.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), EmacLitePhyLoopbackExample(), EmacLitePolledExample(), EMACLiteSelfTestExample(), and XEmacLite_Initialize().

void XEmacLite_DisableInterrupts ( XEmacLite InstancePtr)

Disables the interrupts from the device (the higher layer software is responsible for disabling interrupts at the interrupt controller).

To start using the device again, _EnableInterrupts must be called.

Parameters
InstancePtris a pointer to the XEmacLite instance .
Returns
None.
Note
None.

References XEmacLite_Config::BaseAddress, XEL_GIER_OFFSET, XEL_RSR_RECV_IE_MASK, XEL_TSR_XMIT_IE_MASK, XEmacLite_GetRxStatus, XEmacLite_GetTxStatus, XEmacLite_SetRxStatus, XEmacLite_SetTxStatus, and XEmacLite_WriteReg.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), and EmacLitePhyLoopbackExample().

void XEmacLite_DisableLoopBack ( XEmacLite InstancePtr)

Disable Internal loop back functionality.

Parameters
InstancePtris the pointer to the instance of the driver.
Returns
None.
Note
None.

References XEmacLite_Config::BaseAddress, XEmacLite_Config::Loopback, XEL_TSR_LOOPBACK_MASK, XEL_TSR_OFFSET, XEmacLite_ReadReg, and XEmacLite_WriteReg.

Referenced by EmacLiteIntrLoopbackExample().

int XEmacLite_EnableInterrupts ( XEmacLite InstancePtr)

Enable the EmacLite Interrupts.

This function must be called before other functions to send or receive data in interrupt driven mode. The user should have connected the interrupt handler of the driver to an interrupt source such as an interrupt controller or the processor interrupt prior to this function being called.

Parameters
InstancePtris a pointer to the XEmacLite instance.
Returns
  • XST_SUCCESS if the device interrupts were enabled successfully.
  • XST_NO_CALLBACK if the callbacks were not set.
Note
None.

References XEmacLite_Config::BaseAddress, StubHandler(), XEL_GIER_GIE_MASK, XEL_GIER_OFFSET, XEL_RSR_RECV_IE_MASK, XEL_TSR_XMIT_IE_MASK, XEmacLite_GetRxStatus, XEmacLite_GetTxStatus, XEmacLite_SetRxStatus, XEmacLite_SetTxStatus, and XEmacLite_WriteReg.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), and EmacLitePhyLoopbackExample().

void XEmacLite_EnableLoopBack ( XEmacLite InstancePtr)

Enable Internal loop back functionality.

Parameters
InstancePtris the pointer to the instance of the driver.
Returns
None.
Note
None.

References XEmacLite_Config::BaseAddress, XEmacLite_Config::Loopback, XEL_TSR_LOOPBACK_MASK, XEL_TSR_OFFSET, XEmacLite_ReadReg, and XEmacLite_WriteReg.

Referenced by EmacLiteIntrLoopbackExample().

void XEmacLite_FlushReceive ( XEmacLite InstancePtr)

Flush the Receive buffers.

All data will be lost.

Parameters
InstancePtris the pointer to the instance of the driver to be worked on.
Returns
None.
Note
None.

References XEmacLite_Config::BaseAddress, XEmacLite_Config::RxPingPong, XEL_BUFFER_OFFSET, XEL_RSR_RECV_IE_MASK, XEmacLite_GetRxStatus, and XEmacLite_SetRxStatus.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), EmacLitePhyLoopbackExample(), and EmacLitePolledExample().

int XEmacLite_Initialize ( XEmacLite InstancePtr,
u16  DeviceId 
)

Initialize a specific XEmacLite instance/driver.

The initialization entails:

  • Initialize fields of the XEmacLite instance structure.

The driver defaults to polled mode operation.

Parameters
InstancePtris a pointer to the XEmacLite instance.
DeviceIdis the unique id of the device controlled by this XEmacLite instance. Passing in a device id associates the generic XEmacLite instance to a specific device, as chosen by the caller or application developer.
Returns
  • XST_SUCCESS if initialization was successful.
  • XST_DEVICE_NOT_FOUND/XST_FAILURE if device configuration information was not found for a device with the supplied device ID.
Note
None

References XEmacLite_Config::BaseAddress, XEmacLite_CfgInitialize(), and XEmacLite_LookupConfig().

void XEmacLite_InterruptHandler ( void *  InstancePtr)

Interrupt handler for the EmacLite driver.

It performs the following processing:

  - Get the interrupt status from the registers to determine the source
    of the interrupt.
    - Call the appropriate handler based on the source of the interrupt.
Parameters
InstancePtrcontains a pointer to the EmacLite device instance for the interrupt.
Returns
None.
Note
None.

References XEmacLite_Config::BaseAddress, XEL_BUFFER_OFFSET, XEL_TSR_XMIT_ACTIVE_MASK, XEL_TSR_XMIT_BUSY_MASK, XEmacLite_GetTxStatus, XEmacLite_IsRxEmpty, and XEmacLite_SetTxStatus.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), and EmacLitePhyLoopbackExample().

XEmacLite_Config * XEmacLite_LookupConfig ( u16  DeviceId)

Lookup the device configuration based on the unique device ID.

The table XEmacLite_ConfigTable contains the configuration info for each device in the system.

Parameters
DeviceIdis the unique device ID of the device being looked up.
Returns
A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found.
Note
None.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), EmacLitePhyLoopbackExample(), EmacLitePolledExample(), EMACLiteSelfTestExample(), and XEmacLite_Initialize().

int XEmacLite_PhyRead ( XEmacLite InstancePtr,
u32  PhyAddress,
u32  RegNum,
u16 *  PhyDataPtr 
)

Read the specified PHY register.

Parameters
InstancePtris the pointer to the instance of the driver.
PhyAddressis the address of the PHY device. The valid range is is from 0 to 31.
RegNumis the register number in the PHY device which is to be read. The valid range is is from 0 to 31.
PhyDataPtris a pointer to the data in which the data read from the PHY device is returned.
Returns
  • XST_SUCCESS if the data is read from the PHY.
  • XST_DEVICE_BUSY if MDIO is busy.
Note
This function waits for the completion of MDIO data transfer.

References XEmacLite_Config::BaseAddress, XEmacLite_Config::MdioInclude, XEL_MDIO_ADDRESS_MASK, XEL_MDIO_ADDRESS_SHIFT, XEL_MDIO_OP_MASK, XEL_MDIOADDR_OFFSET, XEL_MDIOCNTR_ENABLE_MASK, XEL_MDIOCNTR_OFFSET, XEL_MDIOCNTR_STATUS_MASK, XEL_MDIORD_OFFSET, XEmacLite_ReadReg, and XEmacLite_WriteReg.

Referenced by EmacLiteDisablePhyLoopBack(), and EmacLitePhyDetect().

int XEmacLite_PhyWrite ( XEmacLite InstancePtr,
u32  PhyAddress,
u32  RegNum,
u16  PhyData 
)

Write the given data to the specified register in the PHY device.

Parameters
InstancePtris the pointer to the instance of the driver.
PhyAddressis the address of the PHY device. The valid range is is from 0 to 31.
RegNumis the register number in the PHY device which is to be written. The valid range is is from 0 to 31.
PhyDatais the data to be written to the specified register in the PHY device.
Returns
  • XST_SUCCESS if the data is written to the PHY.
  • XST_DEVICE_BUSY if MDIO is busy.
Note
This function waits for the completion of MDIO data transfer.

References XEmacLite_Config::BaseAddress, XEmacLite_Config::MdioInclude, XEL_MDIO_ADDRESS_MASK, XEL_MDIO_ADDRESS_SHIFT, XEL_MDIO_OP_MASK, XEL_MDIOADDR_OFFSET, XEL_MDIOCNTR_ENABLE_MASK, XEL_MDIOCNTR_OFFSET, XEL_MDIOCNTR_STATUS_MASK, XEL_MDIOWR_OFFSET, XEmacLite_ReadReg, and XEmacLite_WriteReg.

Referenced by EmacLiteDisablePhyLoopBack(), and EmacLiteEnablePhyLoopBack().

u16 XEmacLite_Recv ( XEmacLite InstancePtr,
u8 *  FramePtr 
)

Receive a frame.

Intended to be called from the interrupt context or with a wrapper which waits for the receive frame to be available.

Parameters
InstancePtris a pointer to the XEmacLite instance.
FramePtris 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.
Returns

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.

Note

This function call is not blocking in nature, i.e. it will not wait until a frame arrives.

References XEmacLite_Config::RxPingPong, XEL_ARP_PACKET_SIZE, XEL_BUFFER_OFFSET, XEL_ETHER_PROTO_TYPE_ARP, XEL_ETHER_PROTO_TYPE_IP, XEL_FCS_SIZE, XEL_HEADER_IP_LENGTH_OFFSET, XEL_HEADER_SHIFT, XEL_HEADER_SIZE, XEL_MAX_FRAME_SIZE, XEL_RPLR_LENGTH_MASK_HI, XEL_RPLR_LENGTH_MASK_LO, XEL_RSR_RECV_DONE_MASK, XEL_RXBUFF_OFFSET, XEmacLite_AlignedRead(), XEmacLite_GetRxStatus, XEmacLite_NextReceiveAddr, XEmacLite_ReadReg, and XEmacLite_SetRxStatus.

Referenced by EmacLitePolledExample().

u16 XEmacLite_RecvFrame ( UINTPTR  BaseAddress,
u8 *  FramePtr 
)

Receive a frame.

Wait for a frame to arrive.

Parameters
BaseAddressis the base address of the device
FramePtris a pointer to a buffer where the frame will be stored.
Returns

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.

Note

This function call is blocking in nature, i.e. it will wait until a frame arrives.

If the ping buffer is the source of the data, the argument should be DeviceAddress + XEL_RXBUFF_OFFSET. If the pong buffer is the source of the data, the argument should be DeviceAddress + XEL_RXBUFF_OFFSET + XEL_BUFFER_OFFSET. The function does not take the different buffers into consideration.

References XEL_FCS_SIZE, XEL_HEADER_SIZE, XEL_MAX_FRAME_SIZE, XEL_RPLR_LENGTH_MASK_HI, XEL_RPLR_LENGTH_MASK_LO, XEL_RPLR_OFFSET, XEL_RSR_RECV_DONE_MASK, XEL_RXBUFF_OFFSET, XEmacLite_AlignedRead(), XEmacLite_GetRxStatus, XEmacLite_IsRxEmpty, XEmacLite_ReadReg, and XEmacLite_SetRxStatus.

int XEmacLite_SelfTest ( XEmacLite InstancePtr)

Performs a SelfTest on the EmacLite device as follows:

  • Writes to the mandatory TX buffer and reads back to verify.
  • If configured, writes to the secondary TX buffer and reads back to verify.
  • Writes to the mandatory RX buffer and reads back to verify.
  • If configured, writes to the secondary RX buffer and reads back to verify.
Parameters
InstancePtris a pointer to the XEmacLite instance .
Returns
  • XST_SUCCESS if the device Passed the Self Test.
    • XST_FAILURE if any of the data read backs fail.
Note
None.

References XEmacLite_Config::BaseAddress, XEmacLite_Config::RxPingPong, XEmacLite_Config::TxPingPong, XEL_BUFFER_OFFSET, XEL_RXBUFF_OFFSET, XEL_TXBUFF_OFFSET, XEmacLite_AlignedRead(), and XEmacLite_AlignedWrite().

Referenced by EMACLiteSelfTestExample().

int XEmacLite_Send ( XEmacLite InstancePtr,
u8 *  FramePtr,
unsigned  ByteCount 
)

Send an Ethernet frame.

The ByteCount is the total frame size, including header.

Parameters
InstancePtris a pointer to the XEmacLite instance.
FramePtris 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.
ByteCountis the size, in bytes, of the frame
Returns
  • XST_SUCCESS if data was transmitted.
  • XST_FAILURE if buffer(s) was (were) full and no valid data was transmitted.
Note

This function call is not blocking in nature, i.e. it will not wait until the frame is transmitted.

References XEmacLite_Config::BaseAddress, XEmacLite_Config::TxPingPong, XEL_BUFFER_OFFSET, XEL_MAX_TX_FRAME_SIZE, XEL_TPLR_LENGTH_MASK_HI, XEL_TPLR_LENGTH_MASK_LO, XEL_TPLR_OFFSET, XEL_TSR_XMIT_ACTIVE_MASK, XEL_TSR_XMIT_BUSY_MASK, XEL_TSR_XMIT_IE_MASK, XEmacLite_AlignedWrite(), XEmacLite_GetTxStatus, XEmacLite_NextTransmitAddr, XEmacLite_SetTxStatus, and XEmacLite_WriteReg.

void XEmacLite_SendFrame ( UINTPTR  BaseAddress,
u8 *  FramePtr,
unsigned  ByteCount 
)

Send an Ethernet frame.

The size is the total frame size, including header. This function blocks waiting for the frame to be transmitted.

Parameters
BaseAddressis the base address of the device
FramePtris a pointer to frame
ByteCountis the size, in bytes, of the frame
Returns
None.
Note

This function call is blocking in nature, i.e. it will wait until the frame is transmitted. This function can hang and not exit if the hardware is not configured properly.

If the ping buffer is the destination of the data, the argument should be DeviceAddress + XEL_TXBUFF_OFFSET. If the pong buffer is the destination of the data, the argument should be DeviceAddress + XEL_TXBUFF_OFFSET + XEL_BUFFER_OFFSET. The function does not take the different buffers into consideration.

References XEL_TPLR_LENGTH_MASK_HI, XEL_TPLR_LENGTH_MASK_LO, XEL_TPLR_OFFSET, XEL_TSR_XMIT_BUSY_MASK, XEmacLite_AlignedWrite(), XEmacLite_GetTxStatus, XEmacLite_IsTxDone, XEmacLite_SetTxStatus, and XEmacLite_WriteReg.

void XEmacLite_SetMacAddress ( XEmacLite InstancePtr,
u8 *  AddressPtr 
)

Set the MAC address for this device.

The address is a 48-bit value.

Parameters
InstancePtris a pointer to the XEmacLite instance.
AddressPtris a pointer to a 6-byte MAC address. the format of the MAC address is major octet to minor octet
Returns
None.
Note
    - 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.
    - Function will not return if hardware is absent or not functioning
    properly.
  - The MAC address can be programmed using any of the two transmit
  buffers (if configured).

References XEL_MAC_ADDR_SIZE, XEL_TPLR_OFFSET, XEL_TSR_PROG_MAC_ADDR, XEmacLite_AlignedWrite(), XEmacLite_GetTxStatus, XEmacLite_NextTransmitAddr, XEmacLite_SetTxStatus, and XEmacLite_WriteReg.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), EmacLitePhyLoopbackExample(), and EmacLitePolledExample().

void XEmacLite_SetRecvHandler ( XEmacLite InstancePtr,
void *  CallBackRef,
XEmacLite_Handler  FuncPtr 
)

Sets the callback function for handling received frames in interrupt mode.

The upper layer software should call this function during initialization. The callback is called when a frame is received. The callback function should communicate the data to a thread such that the processing is not performed in an interrupt context.

The callback is invoked by the driver within interrupt context, so it needs to do its job quickly. If there are other potentially slow operations within the callback, these should be done at task-level.

Parameters
InstancePtris a pointer to the XEmacLite instance..
CallBackRefis a reference pointer to be passed back to the application in the callback. This helps the application correlate the callback to a particular driver.
FuncPtris the pointer to the callback function.
Returns
None.
Note
None.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), and EmacLitePhyLoopbackExample().

void XEmacLite_SetSendHandler ( XEmacLite InstancePtr,
void *  CallBackRef,
XEmacLite_Handler  FuncPtr 
)

Sets the callback function for handling transmitted frames in interrupt mode.

The upper layer software should call this function during initialization. The callback is called when a frame is transmitted. The callback function should communicate the data to a thread such that the processing is not performed in an interrupt context.

The callback is invoked by the driver within interrupt context, so it needs to do its job quickly. If there are other potentially slow operations within the callback, these should be done at task-level.

Parameters
InstancePtris a pointer to the XEmacLite instance.
CallBackRefis a reference pointer to be passed back to the application in the callback. This helps the application correlate the callback to a particular driver.
FuncPtris the pointer to the callback function.
Returns
None.
Note
None.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), and EmacLitePhyLoopbackExample().

int XEmacLite_TxBufferAvailable ( XEmacLite InstancePtr)

Determine if there is a transmit buffer available.

Parameters
InstancePtris the pointer to the instance of the driver to be worked on.
Returns
  • TRUE if there is a TX buffer available for data to be written
  • FALSE if Tx Buffer is not available.
Note
None.

References XEmacLite_Config::TxPingPong, XEL_BUFFER_OFFSET, XEL_TSR_XMIT_ACTIVE_MASK, XEL_TSR_XMIT_BUSY_MASK, and XEmacLite_GetTxStatus.

Referenced by EmacLiteIntrExample(), EmacLiteIntrLoopbackExample(), EmacLitePhyLoopbackExample(), and EmacLitePolledExample().

Variable Documentation

XEmacLite_Config XEmacLite_ConfigTable[]

This table contains configuration information for each EmacLite device in the system.

XEmacLite_Config XEmacLite_ConfigTable[XPAR_XEMACLITE_NUM_INSTANCES]
Initial value:
= {
{
XPAR_EMACLITE_0_DEVICE_ID,
XPAR_EMACLITE_0_BASEADDR,
XPAR_EMACLITE_0_TX_PING_PONG,
XPAR_EMACLITE_0_RX_PING_PONG,
XPAR_EMACLITE_0_INCLUDE_MDIO
XPAR_EMACLITE_0_INCLUDE_INTERNAL_LOOPBACK
}
}

This table contains configuration information for each EmacLite device in the system.

XEmacLite_Config XEmacLite_ConfigTable[]

This table contains configuration information for each EmacLite device in the system.