Grzegorz Michalec / Mbed 2 deprecated sisk_project

Dependencies:   EthernetInterface mbed-rtos mbed

Fork of sisk_project by Szymon Guza

Files at this revision

API Documentation at this revision

Comitter:
guzbi
Date:
Fri Dec 02 07:48:20 2016 +0000
Child:
1:65cfd74a3ae5
Commit message:
Projekt ethernet

Changed in this revision

EthernetInterface.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/EthernetInterface.lib	Fri Dec 02 07:48:20 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/guzbi/code/EthernetInterface/#f8842a7216ff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Dec 02 07:48:20 2016 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+
+int main() {
+
+    EthernetInterface eth;
+    eth.init(); //Use DHCP
+    eth.connect();
+    
+    while(1) {
+        if((int)phy_link_status()){
+            printf("Cable is connected\n");
+            if((int)phy_get_duplex())
+                printf("Full duplex\n");
+            else
+                printf("Half duplex\n");
+            if((int)phy_get_speed())
+                printf("100 Mbit per second\n");
+            else
+                printf("10 Mbit per second\n");
+            }
+        else
+            printf("Cable is disconnected\n");
+        
+
+        //printf("Connection status %d\n", (int)phy_link_status());
+        //printf("Duplex status %d\n", (int)phy_get_duplex());
+        //printf("Speed status %d\n", (int)phy_get_speed());
+        wait(5);
+        }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Fri Dec 02 07:48:20 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Dec 02 07:48:20 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf
\ No newline at end of file