LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CHIP: LPC18xx/43xx Ethernet driver

Detailed Description

Modules

 CHIP: LPC18xx/43xx Ethernet driver build options
 

Functions

STATIC INLINE void Chip_ENET_Reset (LPC_ENET_T *pENET)
 Resets the ethernet interface.
 
STATIC INLINE void Chip_ENET_SetADDR (LPC_ENET_T *pENET, const uint8_t *macAddr)
 Sets the address of the interface.
 
STATIC INLINE void Chip_ENET_SetupMII (LPC_ENET_T *pENET, uint32_t div, uint8_t addr)
 Sets up the PHY link clock divider and PHY address.
 
STATIC INLINE void Chip_ENET_StartMIIWrite (LPC_ENET_T *pENET, uint8_t reg, uint16_t data)
 Starts a PHY write via the MII.
 
STATIC INLINE void Chip_ENET_StartMIIRead (LPC_ENET_T *pENET, uint8_t reg)
 Starts a PHY read via the MII.
 
STATIC INLINE bool Chip_ENET_IsMIIBusy (LPC_ENET_T *pENET)
 Returns MII link (PHY) busy status.
 
STATIC INLINE uint16_t Chip_ENET_ReadMIIData (LPC_ENET_T *pENET)
 Returns the value read from the PHY.
 
STATIC INLINE void Chip_ENET_TXEnable (LPC_ENET_T *pENET)
 Enables ethernet transmit.
 
STATIC INLINE void Chip_ENET_TXDisable (LPC_ENET_T *pENET)
 Disables ethernet transmit.
 
STATIC INLINE void Chip_ENET_RXEnable (LPC_ENET_T *pENET)
 Enables ethernet packet reception.
 
STATIC INLINE void Chip_ENET_RXDisable (LPC_ENET_T *pENET)
 Disables ethernet packet reception.
 
STATIC INLINE void Chip_ENET_SetDuplex (LPC_ENET_T *pENET, bool full)
 Sets full or half duplex for the interface.
 
STATIC INLINE void Chip_ENET_SetSpeed (LPC_ENET_T *pENET, bool speed100)
 Sets speed for the interface.
 
STATIC INLINE void Chip_ENET_InitDescriptors (LPC_ENET_T *pENET, IP_ENET_001_ENHTXDESC_T *pTXDescs, IP_ENET_001_ENHRXDESC_T *pRXDescs)
 Configures the initial ethernet descriptors.
 
STATIC INLINE void Chip_ENET_RXStart (LPC_ENET_T *pENET)
 Starts receive polling of RX descriptors.
 
STATIC INLINE void Chip_ENET_TXStart (LPC_ENET_T *pENET)
 Starts transmit polling of TX descriptors.
 
void Chip_ENET_Init (LPC_ENET_T *pENET)
 Initialize ethernet interface.
 
void Chip_ENET_DeInit (LPC_ENET_T *pENET)
 De-initialize the ethernet interface.
 

Function Documentation

void Chip_ENET_DeInit ( LPC_ENET_T pENET)

De-initialize the ethernet interface.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing

Definition at line 93 of file enet_17xx_40xx.c.

void Chip_ENET_Init ( LPC_ENET_T pENET)

Initialize ethernet interface.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing
Note
Performs basic initialization of the ethernet interface in a default state. This is enough to place the interface in a usable state, but may require more setup outside this function.

Definition at line 55 of file enet_17xx_40xx.c.

STATIC INLINE void Chip_ENET_InitDescriptors ( LPC_ENET_T pENET,
IP_ENET_001_ENHTXDESC_T pTXDescs,
IP_ENET_001_ENHRXDESC_T pRXDescs 
)

Configures the initial ethernet descriptors.

Parameters
pENET: The base of ENET peripheral on the chip
pTXDescs: Pointer to TX descriptor list
pRXDescs: Pointer to RX descriptor list
Returns
Nothing

Definition at line 210 of file enet_18xx_43xx.h.

STATIC INLINE bool Chip_ENET_IsMIIBusy ( LPC_ENET_T pENET)

Returns MII link (PHY) busy status.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Returns true if busy, otherwise false

Definition at line 126 of file enet_18xx_43xx.h.

STATIC INLINE uint16_t Chip_ENET_ReadMIIData ( LPC_ENET_T pENET)

Returns the value read from the PHY.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Read value from PHY

Definition at line 136 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_Reset ( LPC_ENET_T pENET)

Resets the ethernet interface.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing
Note
Resets the ethernet interface. This should be called prior to Chip_ENET_Init with a small delay after this call.

Definition at line 65 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_RXDisable ( LPC_ENET_T pENET)

Disables ethernet packet reception.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing

Definition at line 176 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_RXEnable ( LPC_ENET_T pENET)

Enables ethernet packet reception.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing

Definition at line 166 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_RXStart ( LPC_ENET_T pENET)

Starts receive polling of RX descriptors.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing

Definition at line 221 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_SetADDR ( LPC_ENET_T pENET,
const uint8_t *  macAddr 
)

Sets the address of the interface.

Parameters
pENET: The base of ENET peripheral on the chip
macAddr: Pointer to the 6 bytes used for the MAC address
Returns
Nothing

Definition at line 76 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_SetDuplex ( LPC_ENET_T pENET,
bool  full 
)

Sets full or half duplex for the interface.

Parameters
pENET: The base of ENET peripheral on the chip
full: true to selected full duplex, false for half
Returns
Nothing

Definition at line 187 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_SetSpeed ( LPC_ENET_T pENET,
bool  speed100 
)

Sets speed for the interface.

Parameters
pENET: The base of ENET peripheral on the chip
speed100: true to select 100Mbps mode, false for 10Mbps
Returns
Nothing

Definition at line 198 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_SetupMII ( LPC_ENET_T pENET,
uint32_t  div,
uint8_t  addr 
)

Sets up the PHY link clock divider and PHY address.

Parameters
pENET: The base of ENET peripheral on the chip
div: Divider index, not a divider value, see user manual
addr: PHY address, used with MII read and write
Returns
Nothing

Definition at line 88 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_StartMIIRead ( LPC_ENET_T pENET,
uint8_t  reg 
)

Starts a PHY read via the MII.

Parameters
pENET: The base of ENET peripheral on the chip
reg: PHY register to read
Returns
Nothing
Note
Start a PHY read operation. Does not block, requires calling IP_ENET_IsMIIBusy to determine when read is complete and calling IP_ENET_ReadMIIData to get the data.

Definition at line 116 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_StartMIIWrite ( LPC_ENET_T pENET,
uint8_t  reg,
uint16_t  data 
)

Starts a PHY write via the MII.

Parameters
pENET: The base of ENET peripheral on the chip
reg: PHY register to write
data: Data to write to PHY register
Returns
Nothing
Note
Start a PHY write operation. Does not block, requires calling IP_ENET_IsMIIBusy to determine when write is complete.

Definition at line 102 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_TXDisable ( LPC_ENET_T pENET)

Disables ethernet transmit.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing

Definition at line 156 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_TXEnable ( LPC_ENET_T pENET)

Enables ethernet transmit.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing

Definition at line 146 of file enet_18xx_43xx.h.

STATIC INLINE void Chip_ENET_TXStart ( LPC_ENET_T pENET)

Starts transmit polling of TX descriptors.

Parameters
pENET: The base of ENET peripheral on the chip
Returns
Nothing

Definition at line 231 of file enet_18xx_43xx.h.