Bohyun Bang / WIZnetInterface

Dependents:   w7500-paho-mqtt openHAB_mqtt_W7500 kakaoIoTchatbot w7500-RFID-mqtt

Fork of WIZnetInterface by WIZnet

Files at this revision

API Documentation at this revision

Comitter:
Soohwan Kim
Date:
Tue Jun 16 11:24:30 2015 +0900
Parent:
9:40d25592e6a0
Child:
11:b319c1859f9b
Commit message:
fixed link/set_link

Changed in this revision

arch/ext/W5500.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/arch/ext/W5500.cpp	Tue Jun 16 11:20:00 2015 +0900
+++ b/arch/ext/W5500.cpp	Tue Jun 16 11:24:30 2015 +0900
@@ -472,7 +472,7 @@
 }
 
 int ethernet_link(void) {
-    return (reg_rd<uint8_t>(PHYCFGR) & 0x01);
+    return (getPHYCFGR()& 0x01);
 }
 
 void ethernet_set_link(int speed, int duplex) {
@@ -482,10 +482,10 @@
 	} else {
 		val = (((speed&0x01)<<1)+ (duplex&0x01))<<3; 
 	}
-    reg_wr<uint32_t>(PHYCFGR, PHYCFGR_RST&(PHYCFGR_OPMD|val));
-    wait(0.2);
-	reg_wr<uint32_t>(PHYCFGR, (~PHYCFGR_RST)|(PHYCFGR_OPMD|val));
-    wait(0.2);
+   setPHYCFGR(PHYCFGR_RST&(PHYCFGR_OPMD|val);
+   wait(0.2);
+   setPHYCFGR((~PHYCFGR_RST)|(PHYCFGR_OPMD|val);
+   wait(0.2);
 }
 
 #endif