[En-Nut-Discussion] Link status of RTL8019AS

Henrik Maier hmlists at focus-sw.com
Thu Jul 21 04:48:26 CEST 2005


Peter Cobb wrote:
> Hi,
> 
> I'm using an Ethernut 1.3G based system. I want to monitor the Ethernet link
> and notify an application thread whenever it's state changes.
> 
> I've read the RTL9019AS's datasheet and can't see an obvious register to
> read to find out what the Ethernet link's state is. Does anyone know how to
> get this information from the device?

For a Nut/OS unrelated project (PIC based) we used the following logic 
to detect the link status:

BOOL MACIsLinked(void)
{
     BYTE_VAL temp;

     // Select Page 3
     NICPut(CMDR, 0xe0);

     // Read CONFIG0.
     temp.Val = NICGet(0x03);

     // Reset to page 0.
     NICPut(CMDR, 0x20);

     // Bit 2 "BNC" will be '0' if LINK is established.
     return (temp.bits.b2 == 0);
}

This logic worked well and was used to restart DHCP.

Henrik

-- 
proconX - Nut/OS compatible Programmable Protocol Converter,
Device Server and Industrial Gateways ::: http://www.proconx.com



More information about the En-Nut-Discussion mailing list