no upgrade or change at this. move to new Library for WIZ550io, W5500 -> http://mbed.org/teams/EthernetInterfaceW5500-makers/code/W5500Interface/
Dependents: LPC11U68_NTPClient_HelloWorld_WIZ550io
Fork of WIZ550ioInterface by
please get the new Library for WIZ550io, W5500 (WIZnet) http://mbed.org/teams/EthernetInterfaceW5500-makers/code/W5500Interface/
Import libraryW5500Interface
This is the Interface library for WIZnet W5500 chip which forked of EthernetInterfaceW5500, WIZnetInterface and WIZ550ioInterface. This library has simple name as "W5500Interface". and can be used for Wiz550io users also.
Diff: WIZ820io/WIZ820io.cpp
- Revision:
- 9:615198a7b82b
- Parent:
- 8:8bdf6aac8cea
- Child:
- 10:4da8370d14da
--- a/WIZ820io/WIZ820io.cpp Sun Dec 15 12:29:47 2013 +0000 +++ b/WIZ820io/WIZ820io.cpp Mon Dec 23 13:51:35 2013 +0000 @@ -139,14 +139,22 @@ reset_pin = 1; //wait_ms(150); // 150ms wait_ms(300); // 300ms (w5500) - reg_wr<uint8_t>(MR, 1<<7); -#ifdef TARGET_LPC1114 - uint8_t mac[6] = {0x00,0x02,0xf7,0xf0,0x00,0x00}; -#else - uint8_t mac[6]; - mbed_mac_address((char*)mac); -#endif - reg_wr_mac(SHAR, mac); + + //reg_wr<uint8_t>(MR, 1<<7); + +//#ifdef TARGET_LPC1114 +// uint8_t mac[6] = {0x00,0x02,0xf7,0xf0,0x00,0x00}; +//#else +// uint8_t mac[6]; +// mbed_mac_address((char*)mac); +//#endif +// reg_wr_mac(SHAR, mac); + + // set RX and TX buffer size + for (int socket = 0; socket < MAX_SOCK_NUM; socket++) { + sreg<uint8_t>(socket, Sn_RXBUF_SIZE, 2); + sreg<uint8_t>(socket, Sn_TXBUF_SIZE, 2); + } } bool WIZ820io::close(int socket) @@ -162,6 +170,7 @@ scmd(socket, DISCON); } scmd(socket, CLOSE); + sreg<uint8_t>(socket, Sn_IR, 0xff); return true; } @@ -215,6 +224,15 @@ spi_write(ptr, cntl_byte, (uint8_t*)str, len); sreg<uint16_t>(socket, Sn_TX_WR, ptr + len); scmd(socket, SEND); + + while ((sreg<uint8_t>(socket, Sn_IR) & INT_SEND_OK) != INT_SEND_OK) { + if (sreg<uint8_t>(socket, Sn_SR) == CLOSED) { + close(socket); + return 0; + } + } + sreg<uint8_t>(socket, Sn_IR, INT_SEND_OK); + return len; }