Skip to content

Commit

Permalink
Ethernet lib: first implementation for zero
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Jun 22, 2015
1 parent ed8cdcc commit 76b2f99
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libraries/Ethernet/src/utility/w5100.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ class W5100Class {
inline static void setSS() { PORTB &= ~_BV(2); };
inline static void resetSS() { PORTB |= _BV(2); };
#endif
#else
inline static void initSS() {
*portModeRegister(digitalPinToPort(ETHERNET_SHIELD_SPI_CS)) |= digitalPinToBitMask(ETHERNET_SHIELD_SPI_CS);
}
inline static void setSS() {
*portOutputRegister(digitalPinToPort(ETHERNET_SHIELD_SPI_CS)) &= ~digitalPinToBitMask(ETHERNET_SHIELD_SPI_CS);
}
inline static void resetSS() {
*portOutputRegister(digitalPinToPort(ETHERNET_SHIELD_SPI_CS)) |= digitalPinToBitMask(ETHERNET_SHIELD_SPI_CS);
}
#endif
#else
#define SPI_ETHERNET_SETTINGS ETHERNET_SHIELD_SPI_CS,SPISettings(4000000, MSBFIRST, SPI_MODE0)
Expand Down

0 comments on commit 76b2f99

Please sign in to comment.