-
MIIwrite
- Writes internal EPHY registers through EMAC MII serial management interface.
ANSIC prototype: tU08 MIIwrite(tU08 _mpadr,tU08 _mradr,tU16 _mwdata)
- _mpadr:tU08 - address of the device
- _mradr:tU08 - address of the register within the device
- _mwdata:tU16 - data to write to the PHY register
- Return value:tU08 - 0xff = operation completed OK
0x00 = MII busy
-
MIIread
- Reads internal EPHY registers through EMAC MII serial management interface.
ANSIC prototype: tU08 MIIread(tU08 _mpadr,tU08 _mradr,tU16 *_mrdata)
- _mpadr:tU08 - address of the device
- _mradr:tU08 - address of the register within the device
- _mrdata: Pointer to tU16 - pointer to where to store the received contents of PHY register
- Return value:tU08 - 0xff = operation completed OK
0x00 = MII busy
-
EtherInit
- This function initializes the NE64 EMAC and EPHY and sets speed and duplex based on the users configuation.
ANSIC prototype: void EtherInit(void)
-
EtherType
- This function sets the Ethertype acceptance registers based on the users configuration.
ANSIC prototype: void EtherType(tU08 control,tU16 etype)
- control:tU08 - the acceptance mask
- etype:tU16 - programmable ethertype
-
EtherIoctl
- Sets the multicast hash table.
ANSIC prototype: void EtherIoctl(tU08 flag,void* optionPtr,tU08 optionLen)
- flag:tU08 - either MC_ALL or MC_LIST
- optionPtr:void* - pointer to address list (valid only if flag == MC_LIST)
- optionLen:tU08 - number of addresses in list (valid only if flag == MC_LIST)
-
EtherGetPhysAddr
- Returns EMAC current physical address.
ANSIC prototype: void EtherGetPhysAddr(void* ethaddr)
- ethaddr:void* - pointer to place (6 bytes) where the physical address will be stored to
-
EtherSend
- This function sends one frame.
ANSIC prototype: void EtherSend(void* databuf,tU16 datalen)
- databuf:void* - pointer to data which should be sent
- datalen:tU16 - length of the data to be sent
-
EtherReceive
- This function reads the received frame.
ANSIC prototype: tU16 EtherReceive(void* buffer)
- buffer:void* - pointer to place where the physical address will be stored
- Return value:tU16 - length of the received data (if 0 - then no data received)
-
EtherReceiveZeroCopy
- This function reads the received frame with zero copy.
ANSIC prototype: tU16 EtherReceiveZeroCopy(tU08 *whichbuffer)
- whichbuffer: Pointer to tU08 - Pointer to the buffer.
- Return value:tU16 - Number of received bytes.
-
EtherOpen
- This function initializes the NE64 EMAC.
ANSIC prototype: void EtherOpen(tU08 miisetup,tU08 bufmap,tU16 maxfl,void* pmacad,tU08 control,tU16 etype,tU08 rxmode,tU08 netctl)
- miisetup:tU08 - mii preamble & clock setup
- bufmap:tU08 - buffer configuration (see tables 3-5&3-6 in EMAC doc.)
- maxfl:tU16 - initial max.frame length for receive
- pmacad:void* - pointer to MAC address definition
- control:tU08 - the acceptance mask (same as in EtherType function)
- etype:tU16 - programmable ethertype (16bit value)
- rxmode:tU08 - reception mode settings (see RXCT_X possible values)
- netctl:tU08 - network control setup (see NETCT_X possible values)
-
EtherClose
- This function switches off the EMAC and clear interrupt flags.
ANSIC prototype: void EtherClose(void)
-
EmacDisable
- Switches off the EMAC.
ANSIC prototype: void EmacDisable(void)
-
EmacEnable
- Switches on the EMAC.
ANSIC prototype: void EmacEnable(void)
-
EmacControl
- Sets control bits in EMAC netctl register.
ANSIC prototype: void EmacControl(tU08 netctl)
- netctl:tU08 - Value of netctl register
-
EtherAbortTx
- Aborts TX in progress.
ANSIC prototype: void EtherAbortTx(void)
-
EtherPause
- This function sends PAUSE frame.
ANSIC prototype: tU16 EtherPause(tU08 ptrc,tU16 ptime)
- ptrc:tU08 - if 1 ptime used for PAUSE time setting, if 0 ptime not used
- ptime:tU16 - value of PAUSE timer
- Return value:tU16 - Current PAUSE counter value
-
EtherOtherTx
- This function sets up of other TX parameters.
ANSIC prototype: void EtherOtherTx(tU08 txpar)
- txpar:tU08 - acceptable values (see TXCT_X possible values)
-
ExternalBusCfg
- This function sets up external bus mode and forces the bus clock to 16 Mhz which is the external bus mode maximum. The function needs to be located in main().
ANSIC prototype: void ExternalBusCfg(void)
-
UseSWLedRun
- This function turns off EPHY indicator LED when driven by software. The function need to be located in main() and required a global counter called, LEDcounter. lternatively, this code can be can be placed in a timer function .
ANSIC prototype: void UseSWLedRun(void)
Note: Some methods can be implemented as macros.