WIZNet W5500 with additional enhancements
Fork of WIZnetInterface by
Revision 37:018436dccfcd, committed 2017-10-11
- Comitter:
- Helmut Tschemernjak
- Date:
- Wed Oct 11 14:25:44 2017 +0200
- Parent:
- 36:0ba2e8d5274a
- Child:
- 38:67e763cdde02
- Commit message:
- Added more W7500x support, however this does not compile
for some time, when somebody uses the W7500x they need to
spend the time.
Changed in this revision
| EthernetInterface.h | Show annotated file Show diff for this revision Revisions of this file |
| arch/int/W7500x_toe.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/EthernetInterface.h Wed Oct 11 11:18:41 2017 +0200
+++ b/EthernetInterface.h Wed Oct 11 14:25:44 2017 +0200
@@ -37,8 +37,8 @@
*/
EthernetInterface(PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset);
EthernetInterface(SPI* spi, PinName cs, PinName reset);
+#endif
~EthernetInterface();
-#endif
/** Initialize the interface with DHCP.
* Initialize the interface and configure it to use DHCP (no connection at this point).
--- a/arch/int/W7500x_toe.h Wed Oct 11 11:18:41 2017 +0200
+++ b/arch/int/W7500x_toe.h Wed Oct 11 14:25:44 2017 +0200
@@ -237,7 +237,7 @@
buf[sizeof(buf)-1-i] = t;
}
*/
- for(int i = 0; i < sizeof(buf); i++) { // Little Endian to Big Endian
+ for(int i = 0; i < (int)sizeof(buf); i++) { // Little Endian to Big Endian
*(volatile uint8_t *)(W7500x_WZTOE_BASE + (uint32_t)((cb<<16)+addr)+i) = buf[i];
}
}
@@ -250,7 +250,7 @@
template<typename T>
T reg_rd(uint16_t addr, uint8_t cb) {
uint8_t buf[sizeof(T)] = {0,};
- for(int i = 0; i < sizeof(buf); i++) { // Little Endian to Big Endian
+ for(int i = 0; i < (int)sizeof(buf); i++) { // Little Endian to Big Endian
buf[i] = *(volatile uint8_t *)(W7500x_WZTOE_BASE + (uint32_t)((cb<<16)+addr)+i);
}
/*
@@ -270,8 +270,16 @@
void sreg_ip(int socket, uint16_t addr, const char* ip);
int ethernet_link(void);
+
+ int ethernet_speed(void);
void ethernet_set_link(int speed, int duplex);
+
+ bool ethernet_fullduplex(void);
+
+ uint32_t getDNSAddr(void) {
+ return dnsaddr;
+ };
protected:
@@ -280,6 +288,8 @@
uint32_t netmask;
uint32_t gateway;
uint32_t dnsaddr;
+ uint32_t timesrv;
+ uint32_t leaseTime;
bool dhcp;
static WIZnet_Chip* inst;
Helmut Tschemernjak
