- resets and configures the Ethernet Controller to the network hardware interface: 10, 100M or 1Gbits/s, full or half duplex. You may also use auto-negotiation mode if your network hub supports this mode. Auto-Negotiation starts with 1G bit/s full-duplex and tries to establish a connection. If unsuccessful, the other modes are checked: 100M bits/s full-duplex, 100M bits/s half-duplex, 10 bits/s full duplex, and 10M bits/s half-duplex, until a matching mode is found.
- Setting the MAC address by passing the mac_addr_str is available on DM2DM642, DM2C6747, VibPilot2, Unidaq and DM2C6657 only
- The link_status() callback function is a user defined function for link status change events. If no link status messages are required, this parameter can be set to NULL.
Example configuration for Autonegotiation and a link status callback:
{
CPrintf (
"\r\n Link status changed: ");
switch (mode)
{
case 0xff:
_link = 0;
break;
default:
_link = 1;
CPrintf (
"Linked at %dMbit %s duplex\r\n",
break;
}
}
...
{
}
Example configuration for 100MBit full duplex without link status callback:
Example configuration using variable network_mode from netconfig.c:
Refer to Device Specific Initialization file netconfig.c