WIZnet WIZ550io (W5500) support

Dependencies:   NTPClient WIZ550ioInterface mbed

Fork of NTPClient_HelloWorld by Donatien Garnier

Files at this revision

API Documentation at this revision

Comitter:
ban4jp
Date:
Mon Dec 23 14:42:34 2013 +0000
Parent:
2:bf7dc5f5bca9
Commit message:
Add WIZ550io support.

Changed in this revision

EthernetInterface.lib Show diff for this revision Revisions of this file
NTPClient.lib Show annotated file Show diff for this revision Revisions of this file
WIZ550ioInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r bf7dc5f5bca9 -r c6741dc3b6c0 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 c6741dc3b6c0 NTPClient.lib
--- a/NTPClient.lib	Sun Aug 05 16:17:31 2012 +0000
+++ b/NTPClient.lib	Mon Dec 23 14:42:34 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/donatien/code/NTPClient/#881559865a93
+http://mbed.org/users/ban4jp/code/NTPClient/#c70ed0bfab2e
diff -r bf7dc5f5bca9 -r c6741dc3b6c0 WIZ550ioInterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WIZ550ioInterface.lib	Mon Dec 23 14:42:34 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/ban4jp/code/WIZ550ioInterface/#615198a7b82b
diff -r bf7dc5f5bca9 -r c6741dc3b6c0 main.cpp
--- a/main.cpp	Sun Aug 05 16:17:31 2012 +0000
+++ b/main.cpp	Mon Dec 23 14:42:34 2013 +0000
@@ -1,15 +1,46 @@
 #include "mbed.h"
-#include "EthernetInterface.h"
+//#include "EthernetInterface.h"
+#include "WIZ550ioInterface.h"
 #include "NTPClient.h"
 
-EthernetInterface eth;
+//EthernetInterface eth;
+#if defined(TARGET_LPC1114)
+SPI spi(dp2, dp1, dp6); // mosi, miso, sclk
+WIZ550ioInterface eth(&spi, dp25, dp26); // spi, cs, reset
+
+#elif defined(TARGET_LPC1768)
+SPI spi(p11, p12, p13); // mosi, miso, sclk
+WIZ550ioInterface 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 c6741dc3b6c0 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 c6741dc3b6c0 mbed.bld
--- a/mbed.bld	Sun Aug 05 16:17:31 2012 +0000
+++ b/mbed.bld	Mon Dec 23 14:42:34 2013 +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