Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
EthernetXpresso.cpp
00001 #include "EthernetXpresso.h" 00002 #include "LPC1768/ARM/cmsis.h" 00003 #include <string.h> 00004 #include <mbed.h> 00005 00006 // === public functions === 00007 EthernetXpresso::EthernetXpresso() { 00008 ResetEmac_(); 00009 //emac_.SetAddress(0x00, 0x00, 0x00, 0x00, 0x00, 0x00); 00010 } 00011 00012 EthernetXpresso::~EthernetXpresso() { 00013 } 00014 00015 void 00016 EthernetXpresso::set_link(Mode mode) { 00017 } 00018 00019 // === private functions === 00020 bool 00021 EthernetXpresso::ResetEmac_() { 00022 if (!emac_.Reset()) return false; // auto-neg 00023 int i; 00024 for (i = 0; i < 0x1000; i++) { // 10 sec 00025 if (emac_.Link()) break; 00026 wait_ms(10); 00027 } 00028 emac_.StartTx(); 00029 emac_.StartRx(); 00030 return true; 00031 }
Generated on Wed Jul 13 2022 03:01:38 by
1.7.2