sstaub / Ethernet3

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

Multiple W5500, sharing the SPI, with CS selector #61

Open f3rn4ndes opened 1 year ago

f3rn4ndes commented 1 year ago

Hi SStaub! First, thanks for that job. It´s cool.

So, We are working on scenario where we using 2 W5500, sharing the ESP32 SPI bus, but each W5500 has own CS, RST, INT pins. We´ve noted that w5100_Impl.h has an object W5100Class W5100 and mentioned as extern W5100Class W5100 at w5100.h file. Screenshot_1984

So, does it possible improve the library, e.g. put some void pointer at classes class EthernetUDP; class EthernetClient; class EthernetServer; class EthernetClass

and do a static casting to W5100Class objects to void the use that library with more than one W5500 sharing SPI , and put a method to turn on/off CS pin to control the "active" W5500 ?

In that scenario we can use a sharing SPI where just one W5500 is active (and disable the existing other at same SPI bus). Other scenario is to use different SPI bus at ESP32 , and different CS, RST, INT pins, but with own implementation.

In short, allow different physical controllers to be used with the same library.

Thanks In Advace.