Added CubeCell support
This commit is contained in:
parent
6475507274
commit
2bdec154ad
4 changed files with 54 additions and 4 deletions
|
@ -19,7 +19,8 @@
|
||||||
* RADIOLIB_NC - alias for unused pin, usually the largest possible value of RADIOLIB_PIN_TYPE.
|
* RADIOLIB_NC - alias for unused pin, usually the largest possible value of RADIOLIB_PIN_TYPE.
|
||||||
* RADIOLIB_DEFAULT_SPI - default SPIClass instance to use.
|
* RADIOLIB_DEFAULT_SPI - default SPIClass instance to use.
|
||||||
* RADIOLIB_PROGMEM - macro to place variable into program storage (usually Flash).
|
* RADIOLIB_PROGMEM - macro to place variable into program storage (usually Flash).
|
||||||
* RADIOLIB_PROGMEM_READ_BYTE - function/macro to read variables saved in program storage (usually Flash).
|
* RADIOLIB_PROGMEM_READ_BYTE - function/macro to read variables saved in program storage (usually Flash).
|
||||||
|
* RADIOLIB_TYPE_ALIAS - construct to create an alias for a type, usually vai the `using` keyword.
|
||||||
* RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED - defined if the specific platform does not support SoftwareSerial.
|
* RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED - defined if the specific platform does not support SoftwareSerial.
|
||||||
* RADIOLIB_HARDWARE_SERIAL_PORT - which hardware serial port should be used on platform that do not have SoftwareSerial support.
|
* RADIOLIB_HARDWARE_SERIAL_PORT - which hardware serial port should be used on platform that do not have SoftwareSerial support.
|
||||||
* RADIOLIB_TONE_UNSUPPORTED - some platforms do not have tone()/noTone(), which is required for AFSK.
|
* RADIOLIB_TONE_UNSUPPORTED - some platforms do not have tone()/noTone(), which is required for AFSK.
|
||||||
|
@ -48,6 +49,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
|
|
||||||
// the following must be defined if the Arduino core does not support SoftwareSerial library
|
// the following must be defined if the Arduino core does not support SoftwareSerial library
|
||||||
//#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
//#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
|
@ -102,6 +104,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
|
|
||||||
#elif defined(ESP8266)
|
#elif defined(ESP8266)
|
||||||
// ESP8266 boards
|
// ESP8266 boards
|
||||||
|
@ -115,6 +118,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
|
|
||||||
// RadioLib has ESP8266 driver, this must be disabled to use ESP8266 as platform
|
// RadioLib has ESP8266 driver, this must be disabled to use ESP8266 as platform
|
||||||
#define RADIOLIB_EXCLUDE_ESP8266
|
#define RADIOLIB_EXCLUDE_ESP8266
|
||||||
|
@ -132,6 +136,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
|
|
||||||
|
@ -151,6 +156,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
|
|
||||||
|
@ -169,6 +175,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
|
|
||||||
|
@ -187,6 +194,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
|
|
||||||
|
@ -202,6 +210,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
#define RADIOLIB_TONE_UNSUPPORTED
|
#define RADIOLIB_TONE_UNSUPPORTED
|
||||||
|
@ -218,6 +227,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
|
|
||||||
#elif defined(ARDUINO_ARC32_TOOLS)
|
#elif defined(ARDUINO_ARC32_TOOLS)
|
||||||
// Intel Curie
|
// Intel Curie
|
||||||
|
@ -244,6 +254,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
|
|
||||||
#elif defined(ARDUINO_ARCH_APOLLO3)
|
#elif defined(ARDUINO_ARCH_APOLLO3)
|
||||||
// Sparkfun Apollo3 boards
|
// Sparkfun Apollo3 boards
|
||||||
|
@ -257,6 +268,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
|
|
||||||
|
@ -278,6 +290,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
|
|
||||||
|
@ -296,6 +309,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
|
|
||||||
|
@ -314,6 +328,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
|
|
||||||
|
@ -329,6 +344,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
|
|
||||||
#elif defined(ARDUINO_ARCH_RP2040)
|
#elif defined(ARDUINO_ARCH_RP2040)
|
||||||
// Raspberry Pi Pico
|
// Raspberry Pi Pico
|
||||||
|
@ -342,10 +358,36 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
#define RADIOLIB_SOFTWARE_SERIAL_UNSUPPORTED
|
||||||
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
#define RADIOLIB_HARDWARE_SERIAL_PORT Serial1
|
||||||
#define RADIOLIB_EXCLUDE_ESP8266
|
#define RADIOLIB_EXCLUDE_ESP8266
|
||||||
|
|
||||||
|
#elif defined(__ASR6501__)
|
||||||
|
// CubeCell
|
||||||
|
#define RADIOLIB_PLATFORM "CubeCell"
|
||||||
|
#define RADIOLIB_PIN_TYPE uint8_t
|
||||||
|
#define RADIOLIB_PIN_MODE PINMODE
|
||||||
|
#define RADIOLIB_PIN_STATUS uint8_t
|
||||||
|
#define RADIOLIB_INTERRUPT_STATUS IrqModes
|
||||||
|
#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)
|
||||||
|
|
||||||
|
// CubeCell doesn't seem to define nullptr, let's do something like that now
|
||||||
|
#define nullptr NULL
|
||||||
|
|
||||||
|
// ... and also defines pinMode() as a macro, which is by far the stupidest thing I have seen on Arduino
|
||||||
|
#undef pinMode
|
||||||
|
|
||||||
|
// ... and uses an outdated GCC which does not support type aliases
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) typedef class type alias;
|
||||||
|
|
||||||
|
// ... and it also has no tone(). This platform was designed by an idiot.
|
||||||
|
#define RADIOLIB_TONE_UNSUPPORTED
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// other platforms not covered by the above list - this may or may not work
|
// other platforms not covered by the above list - this may or may not work
|
||||||
#define RADIOLIB_PLATFORM "Unknown"
|
#define RADIOLIB_PLATFORM "Unknown"
|
||||||
|
@ -359,6 +401,7 @@
|
||||||
#define RADIOLIB_DEFAULT_SPI SPI
|
#define RADIOLIB_DEFAULT_SPI SPI
|
||||||
#define RADIOLIB_PROGMEM PROGMEM
|
#define RADIOLIB_PROGMEM PROGMEM
|
||||||
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
#define RADIOLIB_PROGMEM_READ_BYTE(addr) pgm_read_byte(addr)
|
||||||
|
#define RADIOLIB_TYPE_ALIAS(type, alias) using alias = type;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -8,10 +8,11 @@ void ISerial::begin(long speed) {
|
||||||
_mod->ModuleSerial->begin(speed);
|
_mod->ModuleSerial->begin(speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(__ASR6501__)
|
||||||
void ISerial::end() {
|
void ISerial::end() {
|
||||||
_mod->ModuleSerial->end();
|
_mod->ModuleSerial->end();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int ISerial::peek() {
|
int ISerial::peek() {
|
||||||
return(_mod->ModuleSerial->peek());
|
return(_mod->ModuleSerial->peek());
|
||||||
|
@ -33,7 +34,7 @@ void ISerial::flush() {
|
||||||
_mod->ModuleSerial->flush();
|
_mod->ModuleSerial->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ARDUINO_ARCH_MEGAAVR
|
#if !defined(ARDUINO_ARCH_MEGAAVR)
|
||||||
size_t ISerial::print(const __FlashStringHelper *ifsh) {
|
size_t ISerial::print(const __FlashStringHelper *ifsh) {
|
||||||
return(_mod->ModuleSerial->print(ifsh));
|
return(_mod->ModuleSerial->print(ifsh));
|
||||||
}
|
}
|
||||||
|
@ -79,7 +80,7 @@ size_t ISerial::print(const Printable& x) {
|
||||||
return(_mod->ModuleSerial->print(x));
|
return(_mod->ModuleSerial->print(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ARDUINO_ARCH_MEGAAVR
|
#if !defined(ARDUINO_ARCH_MEGAAVR)
|
||||||
size_t ISerial::println(const __FlashStringHelper *ifsh) {
|
size_t ISerial::println(const __FlashStringHelper *ifsh) {
|
||||||
return(_mod->ModuleSerial->println(ifsh));
|
return(_mod->ModuleSerial->println(ifsh));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,9 @@ class ISerial {
|
||||||
explicit ISerial(Module* mod);
|
explicit ISerial(Module* mod);
|
||||||
|
|
||||||
void begin(long);
|
void begin(long);
|
||||||
|
#if !defined(__ASR6501__)
|
||||||
void end();
|
void end();
|
||||||
|
#endif
|
||||||
int peek();
|
int peek();
|
||||||
size_t write(uint8_t);
|
size_t write(uint8_t);
|
||||||
int read();
|
int read();
|
||||||
|
|
|
@ -139,9 +139,11 @@ void Module::term(uint8_t interface) {
|
||||||
_spi->end();
|
_spi->end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(__ASR6501__)
|
||||||
if(((interface == RADIOLIB_USE_UART) && ModuleSerial != nullptr)) {
|
if(((interface == RADIOLIB_USE_UART) && ModuleSerial != nullptr)) {
|
||||||
ModuleSerial->end();
|
ModuleSerial->end();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::ATemptyBuffer() {
|
void Module::ATemptyBuffer() {
|
||||||
|
@ -374,7 +376,9 @@ void Module::detachInterrupt(RADIOLIB_PIN_TYPE interruptNum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::yield() {
|
void Module::yield() {
|
||||||
|
#if !defined(__ASR6501__)
|
||||||
::yield();
|
::yield();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::delay(uint32_t ms) {
|
void Module::delay(uint32_t ms) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue