mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 09:26:52 +00:00
RadioLib6 support
This commit is contained in:
parent
2e915e782b
commit
c1a1b450e3
@ -66,9 +66,7 @@ lib_deps =
|
|||||||
https://github.com/meshtastic/ArduinoThread.git#72921ac222eed6f526ba1682023cee290d9aa1b3
|
https://github.com/meshtastic/ArduinoThread.git#72921ac222eed6f526ba1682023cee290d9aa1b3
|
||||||
nanopb/Nanopb@^0.4.7
|
nanopb/Nanopb@^0.4.7
|
||||||
erriez/ErriezCRC32@^1.0.1
|
erriez/ErriezCRC32@^1.0.1
|
||||||
; temp: do this till > 5.7.0 release to keep (some) SX1262 and SX1280 working - resolves -705 error during init
|
jgromes/RadioLib@^6.0.0
|
||||||
https://github.com/jgromes/RadioLib.git#45c5859338590b7eede23cb2f95284c3fb0cf08e
|
|
||||||
; jgromes/RadioLib@^5.7.0
|
|
||||||
|
|
||||||
; Used for the code analysis in PIO Home / Inspect
|
; Used for the code analysis in PIO Home / Inspect
|
||||||
check_tool = cppcheck
|
check_tool = cppcheck
|
||||||
|
16
src/main.cpp
16
src/main.cpp
@ -454,6 +454,8 @@ void setup()
|
|||||||
SPI.setFrequency(4000000);
|
SPI.setFrequency(4000000);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static SPISettings spiSettings(4000000, MSBFIRST, SPI_MODE0);
|
||||||
|
|
||||||
// Initialize the screen first so we can show the logo while we start up everything else.
|
// Initialize the screen first so we can show the logo while we start up everything else.
|
||||||
screen = new graphics::Screen(screen_found, screen_model, screen_geometry);
|
screen = new graphics::Screen(screen_found, screen_model, screen_geometry);
|
||||||
|
|
||||||
@ -507,6 +509,10 @@ void setup()
|
|||||||
digitalWrite(SX126X_ANT_SW, 1);
|
digitalWrite(SX126X_ANT_SW, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Init LockingHAL first, to use it for radio init
|
||||||
|
|
||||||
|
LockingArduinoHal *RadioLibHAL = new LockingArduinoHal(SPI, spiSettings);
|
||||||
|
|
||||||
// radio init MUST BE AFTER service.init, so we have our radio config settings (from nodedb init)
|
// radio init MUST BE AFTER service.init, so we have our radio config settings (from nodedb init)
|
||||||
|
|
||||||
#if !HAS_RADIO && defined(ARCH_PORTDUINO)
|
#if !HAS_RADIO && defined(ARCH_PORTDUINO)
|
||||||
@ -524,7 +530,7 @@ void setup()
|
|||||||
|
|
||||||
#if defined(RF95_IRQ)
|
#if defined(RF95_IRQ)
|
||||||
if (!rIf) {
|
if (!rIf) {
|
||||||
rIf = new RF95Interface(RF95_NSS, RF95_IRQ, RF95_RESET, RF95_DIO1, SPI);
|
rIf = new RF95Interface(RadioLibHAL, RF95_NSS, RF95_IRQ, RF95_RESET, RF95_DIO1);
|
||||||
if (!rIf->init()) {
|
if (!rIf->init()) {
|
||||||
LOG_WARN("Failed to find RF95 radio\n");
|
LOG_WARN("Failed to find RF95 radio\n");
|
||||||
delete rIf;
|
delete rIf;
|
||||||
@ -537,7 +543,7 @@ void setup()
|
|||||||
|
|
||||||
#if defined(USE_SX1262)
|
#if defined(USE_SX1262)
|
||||||
if (!rIf) {
|
if (!rIf) {
|
||||||
rIf = new SX1262Interface(SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY, SPI);
|
rIf = new SX1262Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
||||||
if (!rIf->init()) {
|
if (!rIf->init()) {
|
||||||
LOG_WARN("Failed to find SX1262 radio\n");
|
LOG_WARN("Failed to find SX1262 radio\n");
|
||||||
delete rIf;
|
delete rIf;
|
||||||
@ -550,7 +556,7 @@ void setup()
|
|||||||
|
|
||||||
#if defined(USE_SX1268)
|
#if defined(USE_SX1268)
|
||||||
if (!rIf) {
|
if (!rIf) {
|
||||||
rIf = new SX1268Interface(SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY, SPI);
|
rIf = new SX1268Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
||||||
if (!rIf->init()) {
|
if (!rIf->init()) {
|
||||||
LOG_WARN("Failed to find SX1268 radio\n");
|
LOG_WARN("Failed to find SX1268 radio\n");
|
||||||
delete rIf;
|
delete rIf;
|
||||||
@ -563,7 +569,7 @@ void setup()
|
|||||||
|
|
||||||
#if defined(USE_LLCC68)
|
#if defined(USE_LLCC68)
|
||||||
if (!rIf) {
|
if (!rIf) {
|
||||||
rIf = new LLCC68Interface(SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY, SPI);
|
rIf = new LLCC68Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
|
||||||
if (!rIf->init()) {
|
if (!rIf->init()) {
|
||||||
LOG_WARN("Failed to find LLCC68 radio\n");
|
LOG_WARN("Failed to find LLCC68 radio\n");
|
||||||
delete rIf;
|
delete rIf;
|
||||||
@ -576,7 +582,7 @@ void setup()
|
|||||||
|
|
||||||
#if defined(USE_SX1280)
|
#if defined(USE_SX1280)
|
||||||
if (!rIf) {
|
if (!rIf) {
|
||||||
rIf = new SX1280Interface(SX128X_CS, SX128X_DIO1, SX128X_RESET, SX128X_BUSY, SPI);
|
rIf = new SX1280Interface(RadioLibHAL, SX128X_CS, SX128X_DIO1, SX128X_RESET, SX128X_BUSY);
|
||||||
if (!rIf->init()) {
|
if (!rIf->init()) {
|
||||||
LOG_WARN("Failed to find SX1280 radio\n");
|
LOG_WARN("Failed to find SX1280 radio\n");
|
||||||
delete rIf;
|
delete rIf;
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "memGet.h"
|
#include "memGet.h"
|
||||||
#include "mesh/generated/meshtastic/config.pb.h"
|
#include "mesh/generated/meshtastic/config.pb.h"
|
||||||
#include "mesh/generated/meshtastic/telemetry.pb.h"
|
#include "mesh/generated/meshtastic/telemetry.pb.h"
|
||||||
|
#include <SPI.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||||
#include <SparkFun_ATECCX08a_Arduino_Library.h>
|
#include <SparkFun_ATECCX08a_Arduino_Library.h>
|
||||||
@ -66,3 +67,6 @@ extern bool runASAP;
|
|||||||
void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), clearBonds();
|
void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), clearBonds();
|
||||||
|
|
||||||
meshtastic_DeviceMetadata getDeviceMetadata();
|
meshtastic_DeviceMetadata getDeviceMetadata();
|
||||||
|
|
||||||
|
// FIXME, we default to 4MHz SPI, SPI mode 0, check if the datasheet says it can really do that
|
||||||
|
extern SPISettings spiSettings;
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
LLCC68Interface::LLCC68Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
LLCC68Interface::LLCC68Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
SPIClass &spi)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
: SX126xInterface(cs, irq, rst, busy, spi)
|
: SX126xInterface(hal, cs, irq, rst, busy)
|
||||||
{
|
{
|
||||||
}
|
}
|
@ -6,12 +6,13 @@
|
|||||||
* Our adapter for LLCC68 radios
|
* Our adapter for LLCC68 radios
|
||||||
* https://www.semtech.com/products/wireless-rf/lora-core/llcc68
|
* https://www.semtech.com/products/wireless-rf/lora-core/llcc68
|
||||||
* ⚠️⚠️⚠️
|
* ⚠️⚠️⚠️
|
||||||
* Be aware that LLCC68 does not support Spreading Factor 12 (SF12) and will not work on the default "Long Slow" channel.
|
* Be aware that LLCC68 does not support Spreading Factor 12 (SF12) and will not work on the "LongSlow" and "VLongSlow" channels.
|
||||||
* You must change the channel if you get `Critical Error #3` with this module.
|
* You must change the channel if you get `Critical Error #3` with this module.
|
||||||
* ⚠️⚠️⚠️
|
* ⚠️⚠️⚠️
|
||||||
*/
|
*/
|
||||||
class LLCC68Interface : public SX126xInterface<LLCC68>
|
class LLCC68Interface : public SX126xInterface<LLCC68>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LLCC68Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi);
|
LLCC68Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
|
RADIOLIB_PIN_TYPE busy);
|
||||||
};
|
};
|
@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
#define POWER_DEFAULT 17 // How much power to use if the user hasn't set a power level
|
#define POWER_DEFAULT 17 // How much power to use if the user hasn't set a power level
|
||||||
|
|
||||||
RF95Interface::RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
RF95Interface::RF95Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
SPIClass &spi)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
: RadioLibInterface(cs, irq, rst, busy, spi)
|
: RadioLibInterface(hal, cs, irq, rst, busy)
|
||||||
{
|
{
|
||||||
LOG_WARN("RF95Interface(cs=%d, irq=%d, rst=%d, busy=%d)\n", cs, irq, rst, busy);
|
LOG_WARN("RF95Interface(cs=%d, irq=%d, rst=%d, busy=%d)\n", cs, irq, rst, busy);
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,8 @@ class RF95Interface : public RadioLibInterface
|
|||||||
RadioLibRF95 *lora = NULL; // Either a RFM95 or RFM96 depending on what was stuffed on this board
|
RadioLibRF95 *lora = NULL; // Either a RFM95 or RFM96 depending on what was stuffed on this board
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RF95Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi);
|
RF95Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
|
RADIOLIB_PIN_TYPE busy);
|
||||||
|
|
||||||
// TODO: Verify that this irq flag works with RFM95 / SX1276 radios the way it used to
|
// TODO: Verify that this irq flag works with RFM95 / SX1276 radios the way it used to
|
||||||
bool isIRQPending() override { return lora->getIRQFlags() & RADIOLIB_SX127X_MASK_IRQ_FLAG_VALID_HEADER; }
|
bool isIRQPending() override { return lora->getIRQFlags() & RADIOLIB_SX127X_MASK_IRQ_FLAG_VALID_HEADER; }
|
||||||
@ -39,7 +40,7 @@ class RF95Interface : public RadioLibInterface
|
|||||||
/**
|
/**
|
||||||
* Enable a particular ISR callback glue function
|
* Enable a particular ISR callback glue function
|
||||||
*/
|
*/
|
||||||
virtual void enableInterrupt(void (*callback)()) { lora->setDio0Action(callback); }
|
virtual void enableInterrupt(void (*callback)()) { lora->setDio0Action(callback, RISING); }
|
||||||
|
|
||||||
/** can we detect a LoRa preamble on the current channel? */
|
/** can we detect a LoRa preamble on the current channel? */
|
||||||
virtual bool isChannelActive() override;
|
virtual bool isChannelActive() override;
|
||||||
|
@ -9,26 +9,23 @@
|
|||||||
#include <pb_decode.h>
|
#include <pb_decode.h>
|
||||||
#include <pb_encode.h>
|
#include <pb_encode.h>
|
||||||
|
|
||||||
// FIXME, we default to 4MHz SPI, SPI mode 0, check if the datasheet says it can really do that
|
void LockingArduinoHal::spiBeginTransaction()
|
||||||
static SPISettings spiSettings(4000000, MSBFIRST, SPI_MODE0);
|
|
||||||
|
|
||||||
void LockingModule::SPIbeginTransaction()
|
|
||||||
{
|
{
|
||||||
spiLock->lock();
|
spiLock->lock();
|
||||||
|
|
||||||
Module::SPIbeginTransaction();
|
ArduinoHal::spiBeginTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LockingModule::SPIendTransaction()
|
void LockingArduinoHal::spiEndTransaction()
|
||||||
{
|
{
|
||||||
spiLock->unlock();
|
spiLock->unlock();
|
||||||
|
|
||||||
Module::SPIendTransaction();
|
ArduinoHal::spiEndTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
RadioLibInterface::RadioLibInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
RadioLibInterface::RadioLibInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
SPIClass &spi, PhysicalLayer *_iface)
|
RADIOLIB_PIN_TYPE busy, PhysicalLayer *_iface)
|
||||||
: NotifiedWorkerThread("RadioIf"), module(cs, irq, rst, busy, spi, spiSettings), iface(_iface)
|
: NotifiedWorkerThread("RadioIf"), module(hal, cs, irq, rst, busy), iface(_iface)
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
#if defined(ARCH_STM32WL) && defined(USE_SX1262)
|
#if defined(ARCH_STM32WL) && defined(USE_SX1262)
|
||||||
|
@ -13,35 +13,18 @@
|
|||||||
#define INTERRUPT_ATTR
|
#define INTERRUPT_ATTR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define RADIOLIB_PIN_TYPE uint32_t
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper for the RadioLib Module class, that adds mutex for SPI bus access
|
* We need to override the RadioLib ArduinoHal class to add mutex protection for SPI bus access
|
||||||
*/
|
*/
|
||||||
class LockingModule : public Module
|
class LockingArduinoHal : public ArduinoHal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/*!
|
LockingArduinoHal(SPIClass &spi, SPISettings spiSettings) : ArduinoHal(spi, spiSettings){};
|
||||||
\brief Extended SPI-based module constructor.
|
|
||||||
|
|
||||||
\param cs Arduino pin to be used as chip select.
|
void spiBeginTransaction() override;
|
||||||
|
void spiEndTransaction() override;
|
||||||
\param irq Arduino pin to be used as interrupt/GPIO.
|
|
||||||
|
|
||||||
\param rst Arduino pin to be used as hardware reset for the module.
|
|
||||||
|
|
||||||
\param gpio Arduino pin to be used as additional interrupt/GPIO.
|
|
||||||
|
|
||||||
\param spi SPI interface to be used, can also use software SPI implementations.
|
|
||||||
|
|
||||||
\param spiSettings SPI interface settings.
|
|
||||||
*/
|
|
||||||
LockingModule(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE gpio, SPIClass &spi,
|
|
||||||
SPISettings spiSettings)
|
|
||||||
: Module(cs, irq, rst, gpio, spi, spiSettings)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void SPIbeginTransaction() override;
|
|
||||||
void SPIendTransaction() override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class RadioLibInterface : public RadioInterface, protected concurrency::NotifiedWorkerThread
|
class RadioLibInterface : public RadioInterface, protected concurrency::NotifiedWorkerThread
|
||||||
@ -73,7 +56,7 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified
|
|||||||
|
|
||||||
float currentLimit = 100; // 100mA OCP - Should be acceptable for RFM95/SX127x chipset.
|
float currentLimit = 100; // 100mA OCP - Should be acceptable for RFM95/SX127x chipset.
|
||||||
|
|
||||||
LockingModule module; // The HW interface to the radio
|
Module module; // The HW interface to the radio
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* provides lowest common denominator RadioLib API
|
* provides lowest common denominator RadioLib API
|
||||||
@ -99,8 +82,8 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified
|
|||||||
virtual void enableInterrupt(void (*)()) = 0;
|
virtual void enableInterrupt(void (*)()) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RadioLibInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi,
|
RadioLibInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
PhysicalLayer *iface = NULL);
|
RADIOLIB_PIN_TYPE busy, PhysicalLayer *iface = NULL);
|
||||||
|
|
||||||
virtual ErrorCode send(meshtastic_MeshPacket *p) override;
|
virtual ErrorCode send(meshtastic_MeshPacket *p) override;
|
||||||
|
|
||||||
|
@ -79,5 +79,5 @@ bool RadioLibRF95::isReceiving()
|
|||||||
|
|
||||||
uint8_t RadioLibRF95::readReg(uint8_t addr)
|
uint8_t RadioLibRF95::readReg(uint8_t addr)
|
||||||
{
|
{
|
||||||
return _mod->SPIreadRegister(addr);
|
return mod->SPIreadRegister(addr);
|
||||||
}
|
}
|
@ -2,8 +2,8 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
SX1262Interface::SX1262Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
SX1262Interface::SX1262Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
SPIClass &spi)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
: SX126xInterface(cs, irq, rst, busy, spi)
|
: SX126xInterface(hal, cs, irq, rst, busy)
|
||||||
{
|
{
|
||||||
}
|
}
|
@ -8,5 +8,6 @@
|
|||||||
class SX1262Interface : public SX126xInterface<SX1262>
|
class SX1262Interface : public SX126xInterface<SX1262>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SX1262Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi);
|
SX1262Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
|
RADIOLIB_PIN_TYPE busy);
|
||||||
};
|
};
|
@ -2,9 +2,9 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
SX1268Interface::SX1268Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
SX1268Interface::SX1268Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
SPIClass &spi)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
: SX126xInterface(cs, irq, rst, busy, spi)
|
: SX126xInterface(hal, cs, irq, rst, busy)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,5 +10,6 @@ class SX1268Interface : public SX126xInterface<SX1268>
|
|||||||
public:
|
public:
|
||||||
virtual float getFreq() override;
|
virtual float getFreq() override;
|
||||||
|
|
||||||
SX1268Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi);
|
SX1268Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
|
RADIOLIB_PIN_TYPE busy);
|
||||||
};
|
};
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
SX126xInterface<T>::SX126xInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
SX126xInterface<T>::SX126xInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
SPIClass &spi)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
: RadioLibInterface(cs, irq, rst, busy, spi, &lora), lora(&module)
|
: RadioLibInterface(hal, cs, irq, rst, busy, &lora), lora(&module)
|
||||||
{
|
{
|
||||||
LOG_WARN("SX126xInterface(cs=%d, irq=%d, rst=%d, busy=%d)\n", cs, irq, rst, busy);
|
LOG_WARN("SX126xInterface(cs=%d, irq=%d, rst=%d, busy=%d)\n", cs, irq, rst, busy);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
template <class T> class SX126xInterface : public RadioLibInterface
|
template <class T> class SX126xInterface : public RadioLibInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SX126xInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi);
|
SX126xInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
|
RADIOLIB_PIN_TYPE busy);
|
||||||
|
|
||||||
/// Initialise the Driver transport hardware and software.
|
/// Initialise the Driver transport hardware and software.
|
||||||
/// Make sure the Driver is properly configured before calling init().
|
/// Make sure the Driver is properly configured before calling init().
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
SX1280Interface::SX1280Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
SX1280Interface::SX1280Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
SPIClass &spi)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
: SX128xInterface(cs, irq, rst, busy, spi)
|
: SX128xInterface(hal, cs, irq, rst, busy)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -9,5 +9,6 @@
|
|||||||
class SX1280Interface : public SX128xInterface<SX1280>
|
class SX1280Interface : public SX128xInterface<SX1280>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SX1280Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi);
|
SX1280Interface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
|
RADIOLIB_PIN_TYPE busy);
|
||||||
};
|
};
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
SX128xInterface<T>::SX128xInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
SX128xInterface<T>::SX128xInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
SPIClass &spi)
|
RADIOLIB_PIN_TYPE busy)
|
||||||
: RadioLibInterface(cs, irq, rst, busy, spi, &lora), lora(&module)
|
: RadioLibInterface(hal, cs, irq, rst, busy, &lora), lora(&module)
|
||||||
{
|
{
|
||||||
LOG_WARN("SX128xInterface(cs=%d, irq=%d, rst=%d, busy=%d)\n", cs, irq, rst, busy);
|
LOG_WARN("SX128xInterface(cs=%d, irq=%d, rst=%d, busy=%d)\n", cs, irq, rst, busy);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
template <class T> class SX128xInterface : public RadioLibInterface
|
template <class T> class SX128xInterface : public RadioLibInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SX128xInterface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi);
|
SX128xInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst,
|
||||||
|
RADIOLIB_PIN_TYPE busy);
|
||||||
|
|
||||||
/// Initialise the Driver transport hardware and software.
|
/// Initialise the Driver transport hardware and software.
|
||||||
/// Make sure the Driver is properly configured before calling init().
|
/// Make sure the Driver is properly configured before calling init().
|
||||||
|
Loading…
Reference in New Issue
Block a user