WIZnet WIZ820io (W5200) support
Dependencies: NTPClient WIZ820ioInterface mbed
Fork of NTPClient_HelloWorld by
Revision 3:34e833a7e861, committed 2014-02-02
- Comitter:
- ban4jp
- Date:
- Sun Feb 02 14:46:24 2014 +0000
- Parent:
- 2:bf7dc5f5bca9
- Commit message:
- Add WIZ820io support.
Changed in this revision
diff -r bf7dc5f5bca9 -r 34e833a7e861 EthernetInterface.lib --- a/EthernetInterface.lib Sun Aug 05 16:17:31 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/EthernetInterface/#2a797ba9babe
diff -r bf7dc5f5bca9 -r 34e833a7e861 WIZ820ioInterface.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WIZ820ioInterface.lib Sun Feb 02 14:46:24 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/ban4jp/code/WIZ820ioInterface/#c0cd6680bcb7
diff -r bf7dc5f5bca9 -r 34e833a7e861 main.cpp --- a/main.cpp Sun Aug 05 16:17:31 2012 +0000 +++ b/main.cpp Sun Feb 02 14:46:24 2014 +0000 @@ -1,15 +1,46 @@ #include "mbed.h" -#include "EthernetInterface.h" +//#include "EthernetInterface.h" +#include "WIZ820ioInterface.h" #include "NTPClient.h" -EthernetInterface eth; +//EthernetInterface eth; +#if defined(TARGET_LPC1114) +SPI spi(dp2, dp1, dp6); // mosi, miso, sclk +WIZ820ioInterface eth(&spi, dp25, dp26); // spi, cs, reset + +#elif defined(TARGET_LPC1768) +SPI spi(p11, p12, p13); // mosi, miso, sclk +WIZ820ioInterface eth(&spi, p14, p15); // spi, cs, reset + +#endif + NTPClient ntp; int main() { - eth.init(); //Use DHCP + int ret = eth.init(); //Use DHCP + if (!ret) + { + printf("Initialized, MAC: %s\n", eth.getMACAddress()); + } + else + { + printf("Error eth.init() - ret = %d\n", ret); + return -1; + } - eth.connect(); + ret = eth.connect(); + if (!ret) + { + printf("Connected, IP: %s, MASK: %s, GW: %s\n", + eth.getIPAddress(), eth.getNetworkMask(), eth.getGateway()); + } + else + { + printf("Error eth.connect() - ret = %d\n", ret); + return -1; + } + printf("Trying to update time...\r\n"); if (ntp.setTime("0.pool.ntp.org") == 0)
diff -r bf7dc5f5bca9 -r 34e833a7e861 mbed-rtos.lib --- a/mbed-rtos.lib Sun Aug 05 16:17:31 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#9654a71f5a90
diff -r bf7dc5f5bca9 -r 34e833a7e861 mbed.bld --- a/mbed.bld Sun Aug 05 16:17:31 2012 +0000 +++ b/mbed.bld Sun Feb 02 14:46:24 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/976df7c37ad5 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/673126e12c73 \ No newline at end of file