sstaub / Ethernet3

Ethernet library for Arduino and Ethernetshield2 / WIZ550io / WIZ850io / USR-ES1 with Wiznet W5500 chip
Other
82 stars 33 forks source link

SPI Bus #53

Open BluesBilly opened 2 years ago

BluesBilly commented 2 years ago

Can you overload init() function? You can specify which SPI bus to use.

void EthernetClass::init(uint8_t sspin) { W5100.setSS(sspin); }

void EthernetClass::init(uint8_t sspin, SPIClass &spi) { _spi = spi; W5100.setSS(sspin); }

sstaub commented 2 years ago

Can you make a Pull Request? .init is reserved it should changed to .setSPI

sstaub commented 2 years ago

For change the CS pin there is Ethernet.setCsPin(3); // set Pin 3 for CS

BluesBilly commented 2 years ago

Indeed, setspi is more reasonable. You need to add the function of setspi instead of using global SPI.