Changed name for SPI the last couple of places
This commit is contained in:
@@ -16,10 +16,10 @@ int EthernetClass::begin(uint8_t *mac_address, unsigned long timeout, unsigned l
|
|||||||
|
|
||||||
// Initialise the basic info
|
// Initialise the basic info
|
||||||
W5100.init();
|
W5100.init();
|
||||||
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
|
SPI_ETH.beginTransaction(SPI_ETHERNET_SETTINGS);
|
||||||
W5100.setMACAddress(mac_address);
|
W5100.setMACAddress(mac_address);
|
||||||
W5100.setIPAddress(IPAddress(0,0,0,0).raw_address());
|
W5100.setIPAddress(IPAddress(0,0,0,0).raw_address());
|
||||||
SPI.endTransaction();
|
SPI_ETH.endTransaction();
|
||||||
|
|
||||||
// Now try to get our config info from a DHCP server
|
// Now try to get our config info from a DHCP server
|
||||||
int ret = _dhcp->beginWithDHCP(mac_address, timeout, responseTimeout);
|
int ret = _dhcp->beginWithDHCP(mac_address, timeout, responseTimeout);
|
||||||
@@ -27,11 +27,11 @@ int EthernetClass::begin(uint8_t *mac_address, unsigned long timeout, unsigned l
|
|||||||
{
|
{
|
||||||
// We've successfully found a DHCP server and got our configuration info, so set things
|
// We've successfully found a DHCP server and got our configuration info, so set things
|
||||||
// accordingly
|
// accordingly
|
||||||
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
|
SPI_ETH.beginTransaction(SPI_ETHERNET_SETTINGS);
|
||||||
W5100.setIPAddress(_dhcp->getLocalIp().raw_address());
|
W5100.setIPAddress(_dhcp->getLocalIp().raw_address());
|
||||||
W5100.setGatewayIp(_dhcp->getGatewayIp().raw_address());
|
W5100.setGatewayIp(_dhcp->getGatewayIp().raw_address());
|
||||||
W5100.setSubnetMask(_dhcp->getSubnetMask().raw_address());
|
W5100.setSubnetMask(_dhcp->getSubnetMask().raw_address());
|
||||||
SPI.endTransaction();
|
SPI_ETH.endTransaction();
|
||||||
_dnsServerAddress = _dhcp->getDnsServerIp();
|
_dnsServerAddress = _dhcp->getDnsServerIp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,12 +65,12 @@ void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dn
|
|||||||
void EthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
|
void EthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
|
||||||
{
|
{
|
||||||
W5100.init();
|
W5100.init();
|
||||||
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
|
SPI_ETH.beginTransaction(SPI_ETHERNET_SETTINGS);
|
||||||
W5100.setMACAddress(mac);
|
W5100.setMACAddress(mac);
|
||||||
W5100.setIPAddress(local_ip.raw_address());
|
W5100.setIPAddress(local_ip.raw_address());
|
||||||
W5100.setGatewayIp(gateway.raw_address());
|
W5100.setGatewayIp(gateway.raw_address());
|
||||||
W5100.setSubnetMask(subnet.raw_address());
|
W5100.setSubnetMask(subnet.raw_address());
|
||||||
SPI.endTransaction();
|
SPI_ETH.endTransaction();
|
||||||
_dnsServerAddress = dns_server;
|
_dnsServerAddress = dns_server;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,11 +86,11 @@ int EthernetClass::maintain(){
|
|||||||
case DHCP_CHECK_RENEW_OK:
|
case DHCP_CHECK_RENEW_OK:
|
||||||
case DHCP_CHECK_REBIND_OK:
|
case DHCP_CHECK_REBIND_OK:
|
||||||
//we might have got a new IP.
|
//we might have got a new IP.
|
||||||
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
|
SPI_ETH.beginTransaction(SPI_ETHERNET_SETTINGS);
|
||||||
W5100.setIPAddress(_dhcp->getLocalIp().raw_address());
|
W5100.setIPAddress(_dhcp->getLocalIp().raw_address());
|
||||||
W5100.setGatewayIp(_dhcp->getGatewayIp().raw_address());
|
W5100.setGatewayIp(_dhcp->getGatewayIp().raw_address());
|
||||||
W5100.setSubnetMask(_dhcp->getSubnetMask().raw_address());
|
W5100.setSubnetMask(_dhcp->getSubnetMask().raw_address());
|
||||||
SPI.endTransaction();
|
SPI_ETH.endTransaction();
|
||||||
_dnsServerAddress = _dhcp->getDnsServerIp();
|
_dnsServerAddress = _dhcp->getDnsServerIp();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -104,27 +104,27 @@ int EthernetClass::maintain(){
|
|||||||
IPAddress EthernetClass::localIP()
|
IPAddress EthernetClass::localIP()
|
||||||
{
|
{
|
||||||
IPAddress ret;
|
IPAddress ret;
|
||||||
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
|
SPI_ETH.beginTransaction(SPI_ETHERNET_SETTINGS);
|
||||||
W5100.getIPAddress(ret.raw_address());
|
W5100.getIPAddress(ret.raw_address());
|
||||||
SPI.endTransaction();
|
SPI_ETH.endTransaction();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPAddress EthernetClass::subnetMask()
|
IPAddress EthernetClass::subnetMask()
|
||||||
{
|
{
|
||||||
IPAddress ret;
|
IPAddress ret;
|
||||||
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
|
SPI_ETH.beginTransaction(SPI_ETHERNET_SETTINGS);
|
||||||
W5100.getSubnetMask(ret.raw_address());
|
W5100.getSubnetMask(ret.raw_address());
|
||||||
SPI.endTransaction();
|
SPI_ETH.endTransaction();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPAddress EthernetClass::gatewayIP()
|
IPAddress EthernetClass::gatewayIP()
|
||||||
{
|
{
|
||||||
IPAddress ret;
|
IPAddress ret;
|
||||||
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
|
SPI_ETH.beginTransaction(SPI_ETHERNET_SETTINGS);
|
||||||
W5100.getGatewayIp(ret.raw_address());
|
W5100.getGatewayIp(ret.raw_address());
|
||||||
SPI.endTransaction();
|
SPI_ETH.endTransaction();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user