PaulStoffregen / Ethernet

Ethernet library for Teensy (Wiznet W5100 / W5200 / W5500)
http://www.pjrc.com/teensy/td_libs_Ethernet.html
130 stars 83 forks source link

Allow the user to change which SPI Port is used #55

Closed KurtE closed 2 years ago

KurtE commented 2 years ago

Added an optional parameter to the init method, where you can setup which CS pin to use.

On my own Micromod breakout board I tried it on SPI, SPI1, and SPI2 note I only tested using the LinkStatus program.

This has to do with the thread: https://forum.pjrc.com/threads/68399-Teensy-MicroMod-Ethernet-on-SPI1

I tried it with the mentioned sketch with:

SPI pins (10, 11, 12, 13) Ethernet.init(10); Ethernet.init(10, SPI);

SPI1 pins (10, 26, 1, 27) Ethernet.init(10, SPI1);

SPI2 pins (10, 35, 34, 37) Ethernet.init(10, SPI2);

Using: https://smile.amazon.com/dp/B08KXM8TKJ?psc=1 image

PaulStoffregen commented 2 years ago

Looks good!