iLLD_TC27xD  1.0
IfxEth.h File Reference

ETH basic functionality. More...

#include "_Impl/IfxEth_cfg.h"
#include "Cpu/Std/Ifx_Types.h"
#include "IfxEth_reg.h"
#include "IfxEth_bf.h"
#include "_PinMap/IfxEth_PinMap.h"
#include "Src/Std/IfxSrc.h"
#include "Scu/Std/IfxScuWdt.h"
#include "_Utilities/Ifx_Assert.h"
#include "Cpu/Std/IfxCpu.h"

Go to the source code of this file.

Data Structures

struct  IfxEth_AltRxDescr0_Bits
 Structure for Alternate/Enhanced RX descriptor DWORD 0 Bit field access. More...
 
struct  IfxEth_AltRxDescr1_Bits
 Structure for Alternate/Enhanced RX descriptor DWORD 1 Bit field access. More...
 
struct  IfxEth_AltTxDescr0_Bits
 Structure for Alternate/Enhanced TX descriptor DWORD 0 Bit field access. More...
 
struct  IfxEth_AltTxDescr1_Bits
 Structure for Alternate/Enhanced TX descriptor DWORD 1 Bit field access. More...
 
union  IfxEth_RxDescr0
 Union for RX descriptor DWORD 0. More...
 
union  IfxEth_RxDescr1
 Union for RX descriptor DWORD 1. More...
 
union  IfxEth_RxDescr2
 Union for RX descriptor DWORD 2. More...
 
union  IfxEth_RxDescr3
 Union for RX descriptor DWORD 3. More...
 
union  IfxEth_TxDescr0
 Union for TX descriptor DWORD 0. More...
 
union  IfxEth_TxDescr1
 Union for TX descriptor DWORD 1. More...
 
union  IfxEth_TxDescr2
 Union for TX descriptor DWORD 2. More...
 
union  IfxEth_TxDescr3
 Union for TX descriptor DWORD 3. More...
 
struct  IfxEth_RxDescr
 Normal RX descriptor. More...
 
struct  IfxEth_TxDescr
 Normal TX descriptor. More...
 
struct  IfxEth_MiiPins
 Port pins for MII mode configuration. More...
 
struct  IfxEth_RmiiPins
 Port pins for RMII mode configuration. More...
 
union  IfxEth_RxDescrList
 
union  IfxEth_TxDescrList
 
struct  IfxEth_Config
 ETH configuration structure. More...
 
struct  IfxEth
 ETH driver structure. More...
 
struct  IfxEth_RxDescr0_Bits
 Structure for RX descriptor DWORD 0 Bit field access. More...
 
struct  IfxEth_RxDescr1_Bits
 Structure for RX descriptor DWORD 1 Bit field access. More...
 
struct  IfxEth_TxDescr0_Bits
 Structure for TX descriptor DWORD 0 Bit field access. More...
 
struct  IfxEth_TxDescr1_Bits
 Structure for TX descriptor DWORD 1 Bit field access. More...
 

Macros

#define IFXETH_RTX_BUFFER_SIZE   1536
 Size of one ethernet frame buffer. More...
 
#define IFXETH_TX_BUFFER_BY_USER   0
 
#define IFXETH_RX_BUFFER_BY_USER   0
 
#define IFXETH_MAX_RX_BUFFERS   8
 Rx buffers (ring mode) More...
 
#define IFXETH_MAX_TX_BUFFERS   16
 Tx buffers (ring mode) More...
 
#define IFXETH_DESCR_SIZE   4
 4 DWORDS (16 bytes) More...
 

Enumerations

enum  IfxEth_ChecksumMode {
  IfxEth_ChecksumMode_bypass = 0,
  IfxEth_ChecksumMode_ipv4 = 1,
  IfxEth_ChecksumMode_tcpUdpIcmpSegment = 2,
  IfxEth_ChecksumMode_tcpUdpIcmpFull = 3
}
 
enum  IfxEth_PhyInterfaceMode {
  IfxEth_PhyInterfaceMode_mii,
  IfxEth_PhyInterfaceMode_rmii
}
 External Phy Interface RMII Mode. More...
 
enum  IfxEth_ReceiveProcessState {
  IfxEth_ReceiveProcessState_reset,
  IfxEth_ReceiveProcessState_fetching,
  IfxEth_ReceiveProcessState_none,
  IfxEth_ReceiveProcessState_waiting,
  IfxEth_ReceiveProcessState_suspended,
  IfxEth_ReceiveProcessState_closing,
  IfxEth_ReceiveProcessState_timestampWrite,
  IfxEth_ReceiveProcessState_transfering
}
 indicates the Receive DMA FSM state More...
 
enum  IfxEth_TransmitProcessState {
  IfxEth_TransmitProcessState_reset,
  IfxEth_TransmitProcessState_fetching,
  IfxEth_TransmitProcessState_waiting,
  IfxEth_TransmitProcessState_reading,
  IfxEth_TransmitProcessState_timestampWrite,
  IfxEth_TransmitProcessState_none,
  IfxEth_TransmitProcessState_suspended,
  IfxEth_TransmitProcessState_closing
}
 indicates the Transmit DMA FSM state More...
 

Functions

IFX_INLINE void IfxEth_RxDescr_setBuffer (IfxEth_RxDescr *descr, void *buffer)
 Set buffer of an RX descriptor. More...
 
IFX_INLINE IfxEth_TxDescrIfxEth_TxDescr_getNext (IfxEth_TxDescr *descr)
 Get pointer to next TX descriptor. More...
 
IFX_INLINE boolean IfxEth_TxDescr_isAvailable (IfxEth_TxDescr *descr)
 Return TRUE if a TX descriptor is available for setup. More...
 
IFX_INLINE void IfxEth_TxDescr_setBuffer (IfxEth_TxDescr *descr, void *buffer)
 Set buffer of a TX descriptor. More...
 
IFX_INLINE void IfxEth_applySoftwareReset (IfxEth *eth)
 Applies the Software Reset. More...
 
IFX_INLINE void IfxEth_clearRxInterrupt (IfxEth *eth)
 Clear receive interrupt request. More...
 
IFX_INLINE void IfxEth_clearTxInterrupt (IfxEth *eth)
 Clear transmit interrupt request. More...
 
IFX_INLINE boolean IfxEth_isSoftwareResetDone (IfxEth *eth)
 Returns the status of Software Reset. More...
 
IFX_INLINE void IfxEth_setLoopbackMode (IfxEth *eth, boolean loopbackMode)
 Sets the loopback mode. More...
 
IFX_INLINE void IfxEth_setPhyInterfaceMode (IfxEth *eth, IfxEth_PhyInterfaceMode mode)
 Sets the Phy Interface mode. More...
 
IFX_INLINE void IfxEth_setReceiveDescriptorAddress (Ifx_ETH *eth, void *address)
 Sets receive descriptor address. More...
 
IFX_INLINE void IfxEth_setTransmitDescriptorAddress (Ifx_ETH *eth, void *address)
 Sets transmit descriptor address. More...
 
IFX_INLINE void * IfxEth_waitTransmitBuffer (IfxEth *eth)
 Waits for one TX buffer becomes available. More...
 
IFX_EXTERN void IfxEth_freeReceiveBuffer (IfxEth *eth)
 Free the receive buffer, enabling it for the further reception. More...
 
IFX_EXTERN void IfxEth_sendTransmitBuffer (IfxEth *eth, uint16 len)
 Request to send the transmit buffer. More...
 
IFX_EXTERN void IfxEth_setMacAddress (IfxEth *eth, const uint8 *macAddress)
 Sets the MAC address. More...
 
IFX_EXTERN void IfxEth_startReceiver (IfxEth *eth)
 Start the receiver functions. More...
 
IFX_EXTERN void IfxEth_writeHeader (IfxEth *eth, uint8 *txBuffer, uint8 *destinationAddress, uint8 *sourceAddress, uint32 packetSize)
 writes the header format into buffrer More...
 
IFX_INLINE IfxEth_RxDescrIfxEth_RxDescr_getNext (IfxEth_RxDescr *descr)
 Get pointer to next RX descriptor. More...
 
IFX_INLINE void IfxEth_RxDescr_release (IfxEth_RxDescr *descr)
 release RX descriptor More...
 
IFX_INLINE void IfxEth_TxDescr_release (IfxEth_TxDescr *descr)
 Release a TX descriptor for transmit queue. More...
 
IFX_INLINE IfxEth_RxDescrIfxEth_getActualRxDescriptor (IfxEth *eth)
 Get pointer to actual RX descriptor. More...
 
IFX_INLINE uint32 IfxEth_getActualRxIndex (IfxEth *eth)
 
IFX_INLINE IfxEth_TxDescrIfxEth_getActualTxDescriptor (IfxEth *eth)
 Get pointer to actual TX descriptor. More...
 
IFX_INLINE IfxEth_RxDescrIfxEth_getBaseRxDescriptor (IfxEth *eth)
 Get pointer to base RX descriptor. More...
 
IFX_INLINE IfxEth_TxDescrIfxEth_getBaseTxDescriptor (IfxEth *eth)
 Get pointer to base TX descriptor. More...
 
IFX_INLINE boolean IfxEth_getLoopbackMode (IfxEth *eth)
 returns the status of th eloopback mode More...
 
IFX_INLINE void * IfxEth_getMacAddressPointer (IfxEth *eth)
 Returns pointer to the MAC address configured for this ETH. More...
 
IFX_INLINE
IfxEth_ReceiveProcessState 
IfxEth_getReceiveProcessState (IfxEth *eth)
 returns the Receive Process State More...
 
IFX_INLINE uint16 IfxEth_getRxDataLength (IfxEth *eth)
 Returns length of the oldest available RX data. More...
 
IFX_INLINE
IfxEth_TransmitProcessState 
IfxEth_getTransmitProcessState (IfxEth *eth)
 returns the Transmit Process State More...
 
IFX_INLINE boolean IfxEth_isLinkActive (IfxEth *eth)
 Checks whether physical connection is active. More...
 
IFX_INLINE boolean IfxEth_isRxChecksumError (IfxEth *eth)
 
IFX_INLINE boolean IfxEth_isRxDataAvailable (IfxEth *eth)
 Checks whether one or more RX data is available. More...
 
IFX_INLINE boolean IfxEth_isRxInterrupt (IfxEth *eth)
 Checks whether receive interrupt is requested. More...
 
IFX_INLINE boolean IfxEth_isTxInterrupt (IfxEth *eth)
 Checks whether transmit interrupt is requested. More...
 
IFX_INLINE void IfxEth_readAllFlags (IfxEth *eth)
 reads the status of all flags More...
 
IFX_INLINE void IfxEth_shuffleRxDescriptor (IfxEth *eth)
 Shuffle to next RX descriptor. More...
 
IFX_INLINE void IfxEth_shuffleTxDescriptor (IfxEth *eth)
 Shuffle to next TX descriptor. More...
 
IFX_EXTERN void IfxEth_enableModule (void)
 Enable ETH Module. More...
 
IFX_EXTERN void * IfxEth_getReceiveBuffer (IfxEth *eth)
 Gets receive buffer
note: IfxEth_freeReceiveBuffer() shall be called after the data from the RX buffer has been processed. More...
 
IFX_EXTERN void * IfxEth_getTransmitBuffer (IfxEth *eth)
 Get a free transmit buffer. More...
 
IFX_EXTERN void IfxEth_readMacAddress (IfxEth *eth, uint8 *macAddress)
 Reads the MAC address from module register. More...
 
IFX_EXTERN void IfxEth_resetModule (void)
 resets Ethernet kernel More...
 
IFX_EXTERN void IfxEth_setAndSendTransmitBuffer (IfxEth *eth, void *buffer, uint16 len)
 
IFX_EXTERN void IfxEth_setupChecksumEngine (IfxEth *eth, IfxEth_ChecksumMode mode)
 Set up checksum Engine. More...
 
IFX_EXTERN void IfxEth_startTransmitter (IfxEth *eth)
 Start the transmitter functions. More...
 
IFX_EXTERN void IfxEth_stopTransmitter (IfxEth *eth)
 Stop the transmitter functions. More...
 
IFX_EXTERN void IfxEth_wakeupReceiver (IfxEth *eth)
 Wakeup the receiver functions. More...
 
IFX_EXTERN void IfxEth_wakeupTransmitter (IfxEth *eth)
 Wakeup the transmitter functions. More...
 
IFX_INLINE void IfxEth_TxDescr_setup (IfxEth_TxDescr *descr, uint16 length, boolean firstSegment, boolean lastSegment)
 Setup some properties of a TX descriptor. More...
 
IFX_EXTERN void IfxEth_init (IfxEth *eth, const IfxEth_Config *config)
 Initialises the driver. More...
 
IFX_EXTERN void IfxEth_initConfig (IfxEth_Config *config, Ifx_ETH *ethSfr)
 Initialises the configuration Structure. More...
 
IFX_EXTERN void IfxEth_initReceiveDescriptors (IfxEth *eth)
 Initialises the receive descriptors. More...
 
IFX_EXTERN void IfxEth_initTransmitDescriptors (IfxEth *eth)
 Initialises transmit descriptors. More...
 
IFX_EXTERN void IfxEth_setupMiiInputPins (IfxEth *eth, const IfxEth_MiiPins *miiPins)
 Set up MII mode input pins. More...
 
IFX_EXTERN void IfxEth_setupMiiOutputPins (IfxEth *eth, const IfxEth_MiiPins *miiPins)
 setup MII mode output pins More...
 
IFX_EXTERN void IfxEth_setupRmiiInputPins (IfxEth *eth, const IfxEth_RmiiPins *rmiiPins)
 Set up input pins. More...
 
IFX_EXTERN void IfxEth_setupRmiiOutputPins (IfxEth *eth, const IfxEth_RmiiPins *rmiiPins)
 set output pin of port More...
 

Variables

IFX_EXTERN uint8 IfxEth_rxBuffer [IFXETH_MAX_RX_BUFFERS][IFXETH_RTX_BUFFER_SIZE]
 receive buffers More...
 
IFX_EXTERN IfxEth_RxDescrList IfxEth_rxDescr
 
IFX_EXTERN uint8 IfxEth_txBuffer [IFXETH_MAX_TX_BUFFERS][IFXETH_RTX_BUFFER_SIZE]
 Transmit buffers. More...
 
IFX_EXTERN IfxEth_TxDescrList IfxEth_txDescr
 

Detailed Description

ETH basic functionality.

Version
iLLD_1_0_0_11_0
                            IMPORTANT NOTICE

Infineon Technologies AG (Infineon) is supplying this file for use exclusively with Infineon's microcontroller products. This file can be freely distributed within development tools that are supporting such microcontroller products.

THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

Definition in file IfxEth.h.

Macro Definition Documentation

#define IFXETH_DESCR_SIZE   4

4 DWORDS (16 bytes)

Definition at line 87 of file IfxEth.h.

Referenced by IfxEth_init().

#define IFXETH_MAX_RX_BUFFERS   8

Rx buffers (ring mode)

Definition at line 76 of file IfxEth.h.

Referenced by IfxEth_initReceiveDescriptors().

#define IFXETH_MAX_TX_BUFFERS   16

Tx buffers (ring mode)

Definition at line 82 of file IfxEth.h.

Referenced by IfxEth_initTransmitDescriptors(), and IfxEth_setupChecksumEngine().

#define IFXETH_RTX_BUFFER_SIZE   1536

Size of one ethernet frame buffer.

Definition at line 62 of file IfxEth.h.

Referenced by IfxEth_initReceiveDescriptors().

#define IFXETH_RX_BUFFER_BY_USER   0

Definition at line 70 of file IfxEth.h.

#define IFXETH_TX_BUFFER_BY_USER   0

Definition at line 66 of file IfxEth.h.

Variable Documentation

receive buffers

Definition at line 919 of file IfxEth.h.

Definition at line 921 of file IfxEth.h.

Transmit buffers.

Definition at line 925 of file IfxEth.h.

Definition at line 927 of file IfxEth.h.