sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.6k stars 621 forks source link

Cannot get standard library to work with SPI1 #686

Closed EduanShuda closed 3 months ago

EduanShuda commented 3 months ago

Discussed in https://github.com/sandeepmistry/arduino-LoRa/discussions/685

Originally posted by **EduanShuda** March 20, 2024 Hi I cannot get the standard library to work as it with SPI1. According to the API documentation: ### Set SPI interface Override the default SPI interface used by the library. **Must** be called before `LoRa.begin()`. ```arduino LoRa.setSPI(spi); ``` * `spi` - new SPI interface to use, defaults to `SPI` This call is optional and only needs to be used if you need to change the default SPI interface used, in the case your Arduino (or compatible) board has more than one SPI interface present. I want to use SPI1. In my sketch I have: `#include ` In setup(): ``` LoRa.setSPI(SPI1); LoRa.setSPIFrequency(1E6); LoRa.setPins(SPI_CS, RST, IRQ_G0); if (!LoRa.begin(433900000)) { // initialize ratio at 433900000 MHz while (true) { LED_FUNC(ERROR_LED, 5, 80); // if failed, do nothing } } ``` I get this error: ` Compilation error: no matching function for call to 'LoRaClass::setSPI(SPI1Class&)'` I have tried everything. Any help will be appreciated.