mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-03 11:19:58 +00:00
[LLCC68] module support
This commit is contained in:
parent
eee6ef018c
commit
8eb0d685ac
@ -256,6 +256,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// supported modules list
|
||||
#define USE_SX1262
|
||||
#define USE_SX1268
|
||||
#define USE_LLCC68
|
||||
|
||||
// common pinouts for SX126X modules
|
||||
#define SX126X_CS 18 // NSS for SX126X
|
||||
|
14
src/main.cpp
14
src/main.cpp
@ -40,6 +40,7 @@
|
||||
#include "RF95Interface.h"
|
||||
#include "SX1262Interface.h"
|
||||
#include "SX1268Interface.h"
|
||||
#include "LLCC68Interface.h"
|
||||
|
||||
#ifdef NRF52_SERIES
|
||||
#include "variant.h"
|
||||
@ -539,6 +540,19 @@ void setup()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_LLCC68)
|
||||
if (!rIf) {
|
||||
rIf = new LLCC68Interface(SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY, SPI);
|
||||
if (!rIf->init()) {
|
||||
DEBUG_MSG("Warning: Failed to find LLCC68 radio\n");
|
||||
delete rIf;
|
||||
rIf = NULL;
|
||||
} else {
|
||||
DEBUG_MSG("LLCC68 Radio init succeeded, using LLCC68 radio\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_SIM_RADIO
|
||||
if (!rIf) {
|
||||
rIf = new SimRadio;
|
||||
|
@ -4,3 +4,4 @@
|
||||
// We need this declaration for proper linking in derived classes
|
||||
template class SX126xInterface<SX1262>;
|
||||
template class SX126xInterface<SX1268>;
|
||||
template class SX126xInterface<LLCC68>;
|
9
src/mesh/LLCC68Interface.cpp
Normal file
9
src/mesh/LLCC68Interface.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "configuration.h"
|
||||
#include "LLCC68Interface.h"
|
||||
#include "error.h"
|
||||
|
||||
LLCC68Interface::LLCC68Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy,
|
||||
SPIClass &spi)
|
||||
: SX126xInterface(cs, irq, rst, busy, spi)
|
||||
{
|
||||
}
|
13
src/mesh/LLCC68Interface.h
Normal file
13
src/mesh/LLCC68Interface.h
Normal file
@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "SX126xInterface.h"
|
||||
|
||||
/**
|
||||
* Our adapter for LLCC68 radios
|
||||
* https://www.semtech.com/products/wireless-rf/lora-core/llcc68
|
||||
*/
|
||||
class LLCC68Interface : public SX126xInterface<LLCC68>
|
||||
{
|
||||
public:
|
||||
LLCC68Interface(RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy, SPIClass &spi);
|
||||
};
|
Loading…
Reference in New Issue
Block a user