W5500-Ethernet-Interface Makers / EthernetInterfaceW5500

Fork of EthernetInterfaceW5500 by Bongjun Hur

Revision:
10:cadac6bcd169
Parent:
7:93e358253dd8
diff -r 615198a7b82b -r cadac6bcd169 WIZ550ioInterface.h
--- a/WIZ550ioInterface.h	Mon Dec 23 13:51:35 2013 +0000
+++ b/WIZ550ioInterface.h	Thu Jul 17 07:10:36 2014 +0000
@@ -1,30 +1,12 @@
-// WIZ550ioInterface.h 2013/4/10
-/* Copyright (C) 2012 mbed.org, MIT License
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge, publish, distribute,
- * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all copies or
- * substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
- * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
+// EthernetInterfaceW5500.h 2014/7/17
 
 #pragma once
+#include "wiznet.h"
 
-#include "WIZ820io.h"
-
- /** Interface using WIZ820io to connect to an IP-based network
+ /** Interface using Wiznet chip to connect to an IP-based network
  *
  */
-class WIZ550ioInterface: public WIZ820io {
+class EthernetInterfaceW5500: public WIZnet_Chip {
 public:
 
     /**
@@ -33,26 +15,42 @@
     * \param mosi mbed pin to use for SPI
     * \param miso mbed pin to use for SPI
     * \param sclk mbed pin to use for SPI
-    * \param cs
-    * \param reset reset pin of the WIZ820io module
+    * \param cs chip select of the WIZnet_Chip
+    * \param reset reset pin of the WIZnet_Chip
     */
-  WIZ550ioInterface(PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset);
-  WIZ550ioInterface(SPI* spi, PinName cs, PinName reset);
+    EthernetInterfaceW5500(PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset);
+    EthernetInterfaceW5500(SPI* spi, PinName cs, PinName reset);
 
-  /** Initialize the interface with DHCP.
+  /** Initialize the interface with DHCP w/o MAC address
   * Initialize the interface and configure it to use DHCP (no connection at this point).
   * \return 0 on success, a negative number on failure
   */
   int init(); //With DHCP
+  /** Initialize the interface with DHCP.
+  * Initialize the interface and configure it to use DHCP (no connection at this point).
+  * \param mac the MAC address to use
+  * \return 0 on success, a negative number on failure
+  */
+  int init(uint8_t * mac); //With DHCP
 
-  /** Initialize the interface with a static IP address.
+  /** Initialize the interface with a static IP address without MAC.
   * Initialize the interface and configure it with the following static configuration (no connection at this point).
   * \param ip the IP address to use
   * \param mask the IP address mask
   * \param gateway the gateway to use
   * \return 0 on success, a negative number on failure
   */
+
   int init(const char* ip, const char* mask, const char* gateway);
+  /** Initialize the interface with a static IP address.
+  * Initialize the interface and configure it with the following static configuration (no connection at this point).
+  * \param mac the MAC address to use
+  * \param ip the IP address to use
+  * \param mask the IP address mask
+  * \param gateway the gateway to use
+  * \return 0 on success, a negative number on failure
+  */
+  int init(uint8_t * mac, const char* ip, const char* mask, const char* gateway);
 
   /** Connect
   * Bring the interface up, start DHCP if needed.