W5500 driver for mbed OS 5
Dependents: http-webserver-example mbed-os-example-sockets
Fork of W5500Interface by
Diff: WIZnet/W5500.h
- Revision:
- 18:afec30f0922a
- Parent:
- 17:60f75e78f35d
--- a/WIZnet/W5500.h Tue Aug 14 01:20:36 2018 +0000 +++ b/WIZnet/W5500.h Thu Aug 16 07:33:40 2018 +0000 @@ -22,10 +22,10 @@ DISCON = 0x08, CLOSE = 0x10, SEND = 0x20, - SEND_MAC = 0x21, + SEND_MAC = 0x21, SEND_KEEP = 0x22, RECV = 0x40, - + }; enum Interrupt { @@ -75,7 +75,8 @@ -class WIZnet_Chip { +class WIZnet_Chip +{ public: /* * Constructor @@ -93,20 +94,20 @@ * Set MAC Address to W5500 * * @return true if connected, false otherwise - */ + */ bool setmac(); /* * Set Network Informations (SrcIP, Netmask, Gataway) * * @return true if connected, false otherwise - */ + */ bool setip(); /* * Disconnect the connection * - * @ returns true + * @ returns true */ bool disconnect(); @@ -131,14 +132,14 @@ * Set local port number * * @return true if connected, false otherwise - */ - bool setLocalPort(int socket, uint16_t port); + */ + bool setLocalPort(int socket, uint16_t port); /* * Reset the W5500 */ void reset(); - + int wait_readable(int socket, int wait_time_ms, int req_size = 0); int wait_writeable(int socket, int wait_time_ms, int req_size = 0); @@ -196,7 +197,7 @@ void reg_wr(uint16_t addr, T data) { return reg_wr(addr, 0x04, data); } - + template<typename T> void reg_wr(uint16_t addr, uint8_t cb, T data) { uint8_t buf[sizeof(T)]; @@ -253,7 +254,7 @@ uint32_t netmask; uint32_t gateway; uint32_t dnsaddr; - bool dhcp; + //bool dhcp; protected: static WIZnet_Chip* inst; @@ -267,6 +268,7 @@ SPI* spi; DigitalOut cs; DigitalOut reset_pin; + bool connected_reset_pin; }; /*