[SX126x] Added builtin module for CubeCell (#412)

This commit is contained in:
jgromes 2021-11-27 10:20:51 +01:00
parent 7545343f0c
commit afe524cfc7
11 changed files with 42 additions and 8 deletions

View file

@ -29,6 +29,9 @@ SX1262 radio = new Module(10, 2, 3, 9);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA; //SX1262 radio = RadioShield.ModuleA;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);

View file

@ -29,6 +29,9 @@ SX1262 radio = new Module(10, 2, 3, 9);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA; //SX1262 radio = RadioShield.ModuleA;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);

View file

@ -30,6 +30,9 @@ SX1262 radio = new Module(10, 2, 3, 9);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA; //SX1262 radio = RadioShield.ModuleA;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);

View file

@ -26,6 +26,9 @@ SX1262 radio = new Module(10, 2, 3, 9);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA; //SX1262 radio = RadioShield.ModuleA;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
// save transmission states between loops // save transmission states between loops
int transmissionState = RADIOLIB_ERR_NONE; int transmissionState = RADIOLIB_ERR_NONE;

View file

@ -34,6 +34,9 @@ SX1262 radio = new Module(10, 2, 3, 9);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA; //SX1262 radio = RadioShield.ModuleA;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);

View file

@ -35,6 +35,9 @@ SX1262 radio = new Module(10, 2, 3, 9);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA; //SX1262 radio = RadioShield.ModuleA;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);

View file

@ -45,6 +45,9 @@ SX1268 radio2 = new Module(8, 4, 5, 6);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1261 radio3 = RadioShield.ModuleB; //SX1261 radio3 = RadioShield.ModuleB;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);

View file

@ -30,6 +30,9 @@ SX1262 radio = new Module(10, 2, 3, 9);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA; //SX1262 radio = RadioShield.ModuleA;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);

View file

@ -31,6 +31,9 @@ SX1262 radio = new Module(10, 2, 3, 9);
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1262 radio = RadioShield.ModuleA; //SX1262 radio = RadioShield.ModuleA;
// or using CubeCell
//SX1262 radio = new Module(RADIOLIB_ONBOARD_MODULE);
// save transmission state between loops // save transmission state between loops
int transmissionState = RADIOLIB_ERR_NONE; int transmissionState = RADIOLIB_ERR_NONE;

View file

@ -234,6 +234,8 @@ RADIOLIB_ENCODING_NRZ LITERAL1
RADIOLIB_ENCODING_MANCHESTER LITERAL1 RADIOLIB_ENCODING_MANCHESTER LITERAL1
RADIOLIB_ENCODING_WHITENING LITERAL1 RADIOLIB_ENCODING_WHITENING LITERAL1
RADIOLIB_BUILTIN_MODULE LITERAL1
RADIOLIB_ERR_NONE LITERAL1 RADIOLIB_ERR_NONE LITERAL1
RADIOLIB_ERR_UNKNOWN LITERAL1 RADIOLIB_ERR_UNKNOWN LITERAL1

View file

@ -27,6 +27,7 @@
* RADIOLIB_NONVOLATILE_READ_BYTE - function/macro to read variables saved in program storage (usually Flash). * RADIOLIB_NONVOLATILE_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_TYPE_ALIAS - construct to create an alias for a type, usually vai the `using` keyword.
* 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.
* RADIOLIB_BUILTIN_MODULE - some platforms have a builtin radio module on fixed pins, this macro is used to specify that pinout.
* *
* In addition, some platforms may require RadioLib to disable specific drivers (such as ESP8266). * In addition, some platforms may require RadioLib to disable specific drivers (such as ESP8266).
* *
@ -699,6 +700,10 @@
#define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void) #define RADIOLIB_CB_ARGS_SPI_END_TRANSACTION (void, SPIendTransaction, void)
#define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void) #define RADIOLIB_CB_ARGS_SPI_END (void, SPIend, void)
// provide an easy access to the on-board module
#include "board-config.h"
#define RADIOLIB_BUILTIN_MODULE RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY
// CubeCell doesn't seem to define nullptr, let's do something like that now // CubeCell doesn't seem to define nullptr, let's do something like that now
#define nullptr NULL #define nullptr NULL