diff --git a/UIPEthernet.cpp b/UIPEthernet.cpp index ea02c97..3f8cb50 100644 --- a/UIPEthernet.cpp +++ b/UIPEthernet.cpp @@ -310,6 +310,11 @@ void UIPEthernetClass::configure(IPAddress ip, IPAddress dns, IPAddress gateway, _dnsServerAddress = dns; } +void UIPEthernetClass::setSSPIN(uint8_t cs, uint8_t ss) { + Enc28J60Network::CONTROL_CS = cs; + Enc28J60Network::SPI_SS = ss; +} + UIPEthernetClass UIPEthernet; /*---------------------------------------------------------------------------*/ diff --git a/UIPEthernet.h b/UIPEthernet.h index 3bb18d4..083b40b 100644 --- a/UIPEthernet.h +++ b/UIPEthernet.h @@ -76,6 +76,8 @@ class UIPEthernetClass // events have been processed. Renews dhcp-lease if required. int maintain(); + static void setSSPIN(uint8_t cs, uint8_t ss); + IPAddress localIP(); IPAddress subnetMask(); IPAddress gatewayIP(); @@ -95,6 +97,7 @@ class UIPEthernetClass static void init(const uint8_t* mac); static void configure(IPAddress ip, IPAddress dns, IPAddress gateway, IPAddress subnet); + static void tick(); static boolean network_send(); diff --git a/utility/Enc28J60Network.cpp b/utility/Enc28J60Network.cpp index fbef88d..e639c1b 100644 --- a/utility/Enc28J60Network.cpp +++ b/utility/Enc28J60Network.cpp @@ -36,15 +36,24 @@ extern "C" { #endif // set CS to 0 = active -#define CSACTIVE digitalWrite(ENC28J60_CONTROL_CS, LOW) +#define CSACTIVE digitalWrite(CONTROL_CS, LOW) // set CS to 1 = passive -#define CSPASSIVE digitalWrite(ENC28J60_CONTROL_CS, HIGH) +#define CSPASSIVE digitalWrite(CONTROL_CS, HIGH) // #define waitspi() while(!(SPSR&(1<