Skip to content

Commit

Permalink
Move RadioShield and CubeCell pin definition to RadioBoards
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Oct 20, 2024
1 parent 2aa8c6e commit a525d45
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 55 deletions.
1 change: 0 additions & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#######################################

RadioLib KEYWORD1
RadioShield KEYWORD1
Module KEYWORD1
RadioLibHal KEYWORD1
ArduinoHal KEYWORD1
Expand Down
12 changes: 0 additions & 12 deletions src/BuildOpt.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,6 @@
#define RADIOLIB_LOW_LEVEL (0)
#endif

/*
* Enable pre-defined modules when using RadioShield, disabled by default.
*/
#if !defined(RADIOLIB_RADIOSHIELD)
#define RADIOLIB_RADIOSHIELD (0)
#endif

/*
* Enable interrupt-based timing control
* For details, see https://github.com/jgromes/RadioLib/wiki/Interrupt-Based-Timing
Expand Down Expand Up @@ -142,7 +135,6 @@
* 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_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).
*
Expand Down Expand Up @@ -320,10 +312,6 @@
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PINMODE)
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (IrqModes)

// 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
#define nullptr NULL

Expand Down
42 changes: 0 additions & 42 deletions src/RadioLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,46 +114,4 @@
#include "utils/CRC.h"
#include "utils/Cryptography.h"

// only create Radio class when using RadioShield
#if RADIOLIB_RADIOSHIELD

// RadioShield pin definitions
#define RADIOSHIELD_CS_A 10
#define RADIOSHIELD_IRQ_A 2
#define RADIOSHIELD_RST_A 9
#define RADIOSHIELD_GPIO_A 8
#define RADIOSHIELD_CS_B 5
#define RADIOSHIELD_IRQ_B 3
#define RADIOSHIELD_RST_B 7
#define RADIOSHIELD_GPIO_B 6

/*!
\class Radio
\brief Library control object when using RadioShield.
Contains two pre-configured "modules", which correspond to the slots on shield.
*/
class Radio {
public:

Module* ModuleA;
Module* ModuleB;

/*!
\brief Default constructor. Only used to set ModuleA and ModuleB configuration.
*/
Radio() {
ModuleA = new Module(RADIOSHIELD_CS_A, RADIOSHIELD_IRQ_A, RADIOSHIELD_RST_A, RADIOSHIELD_GPIO_A);
ModuleB = new Module(RADIOSHIELD_CS_B, RADIOSHIELD_IRQ_B, RADIOSHIELD_RST_B, RADIOSHIELD_GPIO_B);
}

#if RADIOLIB_GODMODE
private:
#endif

};

Radio RadioShield;
#endif

#endif

0 comments on commit a525d45

Please sign in to comment.