Added support for RP2040 (#361)

This commit is contained in:
jgromes 2021-09-24 08:04:35 +02:00
parent 9bd17bdb4c
commit 8b0858850c
2 changed files with 19 additions and 0 deletions

View file

@ -73,6 +73,9 @@ SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x and SX128x
* __MCUdude__
* [__MegaCoreX__](https://github.com/MCUdude/MegaCoreX) - megaAVR-0 series (ATmega4809, ATmega3209 etc.)
* __Raspberry Pi__
* [__RP2040__](https://github.com/arduino/ArduinoCore-mbed) - Raspberry Pi Pico and Arduino Nano RP2040 Connect
The list above is by no means exhaustive. Most of RadioLib code is independent of the used platform, so as long as your board is running some Arduino-compatible core, RadioLib should work. Compilation of all examples is tested for all platforms prior to releasing new version.
### In development:

View file

@ -330,6 +330,22 @@
#define RADIOLIB_PROGMEM PROGMEM
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
#elif defined(ARDUINO_ARCH_RP2040)
// Raspberry Pi Pico
#define RADIOLIB_PLATFORM "Raspberry Pi Pico"
#define RADIOLIB_PIN_TYPE pin_size_t
#define RADIOLIB_PIN_MODE PinMode
#define RADIOLIB_PIN_STATUS PinStatus
#define RADIOLIB_INTERRUPT_STATUS RADIOLIB_PIN_STATUS
#define RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(p) digitalPinToInterrupt(p)
#define RADIOLIB_NC (0xFF)
#define RADIOLIB_DEFAULT_SPI SPI
#define RADIOLIB_PROGMEM PROGMEM
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
#define RADIOLIB_EXCLUDE_ESP8266
#else
// other platforms not covered by the above list - this may or may not work
#define RADIOLIB_PLATFORM "Unknown"