Test around the USB Ethernet interface

Dependencies:   USB_Ethernet mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
daniele
Date:
Sat Aug 03 13:21:03 2013 +0000
Child:
1:a511b85eecf9
Commit message:
Initial working version

Changed in this revision

USB_Ethernet.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 annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USB_Ethernet.lib	Sat Aug 03 13:21:03 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/daniele/code/USB_Ethernet/#540f6e142d59
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Aug 03 13:21:03 2013 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+#include "USBCDC_ECM.h"
+
+extern "C"{
+#include <stdint.h>
+#include "pico_stack.h"
+#include "pico_ipv4.h"
+}
+#include "pico_dev_mbed_usb.h"
+
+
+USBCDC_ECM usb = USBCDC_ECM(0x0525, 0xa4a1, 1);
+
+int main(void) {
+#if 1
+    struct pico_device *usb_eth;
+    struct pico_ip4 local={.addr = long_be(0x0a280001)};
+    struct pico_ip4 netmask={.addr = long_be(0xffffff00)};
+
+    printf("Welcome to the PicoTCP USB demo!\n");
+    pico_stack_init();
+    
+    wait(1);
+    printf("Creating device...\n");
+    
+    usb_eth = pico_mbed_usb_create("usb0", &usb);
+    wait(2);
+    
+    printf("Adding link...\n");
+    pico_ipv4_link_add(usb_eth, local, netmask);
+    
+    printf("Looping!\n");
+    while(1){
+        wait(0.002);
+        pico_stack_tick();
+    }
+#else
+while(1);;
+#endif
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Sat Aug 03 13:21:03 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58b30ac3f00e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Aug 03 13:21:03 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file