Hill Kim / W5200Interface

Dependents:   IBMIoTClientEthernetExample_W5200

Fork of W5500Interface by W5500-Ethernet-Interface Makers

Embed: (wiki syntax)

« Back to documentation index

EthernetInterface Class Reference

EthernetInterface Class Reference

Interface using Wiznet W5500 chip to connect to an IP-based network. More...

#include <EthernetInterface.h>

Inherits WIZnet_Chip.

Public Member Functions

 EthernetInterface (PinName mosi, PinName miso, PinName sclk, PinName cs, PinName reset)
 Constructor.
int init ()
 Initialize the interface with DHCP w/o MAC address Initialize the interface and configure it to use DHCP (no connection at this point).
int init (uint8_t *mac)
 Initialize the interface with DHCP.
int init (const char *ip, const char *mask, const char *gateway)
 Initialize the interface with a static IP address without MAC.
int init (uint8_t *mac, const char *ip, const char *mask, const char *gateway)
 Initialize the interface with a static IP address.
int connect ()
 Connect Bring the interface up, start DHCP if needed.
int disconnect ()
 Disconnect Bring the interface down.
char * getIPAddress ()
 Get IP address.

Detailed Description

Interface using Wiznet W5500 chip to connect to an IP-based network.

Definition at line 9 of file EthernetInterface.h.


Constructor & Destructor Documentation

EthernetInterface ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  cs,
PinName  reset 
)

Constructor.

Parameters:
mosimbed pin to use for SPI
misombed pin to use for SPI
sclkmbed pin to use for SPI
cschip select of the WIZnet_Chip
resetreset pin of the WIZnet_Chip

Definition at line 32 of file EthernetInterface.cpp.


Member Function Documentation

int connect (  )

Connect Bring the interface up, start DHCP if needed.

Returns:
0 on success, a negative number on failure

Definition at line 107 of file EthernetInterface.cpp.

int disconnect (  )

Disconnect Bring the interface down.

Returns:
0 on success, a negative number on failure

Definition at line 121 of file EthernetInterface.cpp.

char * getIPAddress (  )

Get IP address.

@ returns ip address

Definition at line 127 of file EthernetInterface.cpp.

int init ( uint8_t *  mac,
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).

Parameters:
macthe MAC address to use
ipthe IP address to use
maskthe IP address mask
gatewaythe gateway to use
Returns:
0 on success, a negative number on failure

Definition at line 86 of file EthernetInterface.cpp.

int init (  )

Initialize the interface with DHCP w/o MAC address Initialize the interface and configure it to use DHCP (no connection at this point).

Returns:
0 on success, a negative number on failure

Definition at line 45 of file EthernetInterface.cpp.

int init ( uint8_t *  mac )

Initialize the interface with DHCP.

Initialize the interface and configure it to use DHCP (no connection at this point).

Parameters:
macthe MAC address to use
Returns:
0 on success, a negative number on failure

Definition at line 55 of file EthernetInterface.cpp.

int init ( const char *  ip,
const char *  mask,
const char *  gateway 
)

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).

Parameters:
ipthe IP address to use
maskthe IP address mask
gatewaythe gateway to use
Returns:
0 on success, a negative number on failure

Definition at line 67 of file EthernetInterface.cpp.