SX12XX-LoRa icon indicating copy to clipboard operation
SX12XX-LoRa copied to clipboard

Possibility to use different SPI devs (SPI1, SPI2)

Open tvntsr opened this issue 3 years ago • 4 comments

Some hardware have several SPI devs, for instance Teensy 3.x, 4.x. Current implementation of LoRa library allows to use only first SPI dev, this fix add new method setSpi(SPIClass& spi) to allow different SPI dev to be used. By default main spi dev is used (SPI), but it is possible to use other:

LT.setSpi(SPI1);

tvntsr avatar Mar 21 '21 09:03 tvntsr

I will take a look at the suggestion, however it would require a fair bit of testing across all 3 libraries.

Which Arduinos support multiple SPI ports in this way ?

StuartsProjects avatar Mar 24 '21 08:03 StuartsProjects

Thanks, super!

Which Arduinos support multiple SPI ports in this way ?

For instance Teensy 3.x, Teensy 4.x. There are several SPI (s): SPI, SPI1, SPI2. So hardcoded SPI in the code leads to the situation when SPI1 cannot be used with the library.

tvntsr avatar Mar 24 '21 09:03 tvntsr

I really meant to say, is there a geniune Arduino that supports multiple SPI ports in this way ?

StuartsProjects avatar Mar 25 '21 09:03 StuartsProjects

As example I could provide the following link: https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports?view=all

tvntsr avatar Mar 25 '21 10:03 tvntsr