2021-03-13 18:06:04 +00:00
|
|
|
#if !defined(_RADIOLIB_H)
|
2019-02-08 14:58:29 +00:00
|
|
|
#define _RADIOLIB_H
|
2018-03-05 16:08:42 +00:00
|
|
|
|
2019-05-24 13:13:04 +00:00
|
|
|
/*!
|
|
|
|
\mainpage RadioLib Documentation
|
|
|
|
|
|
|
|
Universal wireless communication library for Arduino.
|
|
|
|
|
|
|
|
\par Currently Supported Wireless Modules and Protocols
|
|
|
|
- CC1101 FSK module
|
|
|
|
- RF69 FSK module
|
2020-03-30 15:38:04 +00:00
|
|
|
- Si443x FSK module
|
2019-05-24 13:13:04 +00:00
|
|
|
- SX126x LoRa/FSK module
|
|
|
|
- SX127x LoRa/FSK module
|
2020-04-07 11:30:05 +00:00
|
|
|
- SX128x LoRa/GFSK/BLE/FLRC module
|
2019-05-24 13:13:04 +00:00
|
|
|
- SX1231 FSK module
|
|
|
|
- PhysicalLayer protocols
|
2019-05-24 16:01:50 +00:00
|
|
|
- RTTY (RTTYClient)
|
|
|
|
- Morse Code (MorseClient)
|
2020-02-14 07:39:10 +00:00
|
|
|
- AX.25 (AX25Client)
|
2020-03-31 16:02:51 +00:00
|
|
|
- SSTV (SSTVClient)
|
2020-04-14 08:54:44 +00:00
|
|
|
- Hellschreiber (HellClient)
|
2021-09-24 06:58:11 +00:00
|
|
|
- 4-FSK (FSK4Client)
|
2019-05-24 13:13:04 +00:00
|
|
|
|
|
|
|
\par Quick Links
|
|
|
|
Documentation for most common methods can be found in its reference page (see the list above).\n
|
|
|
|
Some methods (mainly configuration) are also overridden in derived classes, such as SX1272, SX1278, RFM96 etc. for SX127x.\n
|
|
|
|
\ref status_codes have their own page.\n
|
2019-05-24 16:01:50 +00:00
|
|
|
Some modules implement methods of one or more compatibility layers, loosely based on the ISO/OSI model:
|
2019-05-24 13:13:04 +00:00
|
|
|
- PhysicalLayer - FSK and LoRa radio modules
|
|
|
|
|
|
|
|
\see https://github.com/jgromes/RadioLib
|
|
|
|
|
|
|
|
\copyright Copyright (c) 2019 Jan Gromes
|
|
|
|
*/
|
|
|
|
|
2018-03-05 16:08:42 +00:00
|
|
|
#include "TypeDef.h"
|
|
|
|
#include "Module.h"
|
|
|
|
|
2020-04-01 08:49:45 +00:00
|
|
|
// warnings are printed in this file since BuildOpt.h is compiled in multiple places
|
|
|
|
|
|
|
|
// check God mode
|
2021-11-14 10:29:51 +00:00
|
|
|
#if defined(RADIOLIB_GODMODE)
|
2019-11-20 15:55:11 +00:00
|
|
|
#warning "God mode active, I hope it was intentional. Buckle up, lads."
|
|
|
|
#endif
|
|
|
|
|
2020-04-22 12:58:47 +00:00
|
|
|
// print debug info
|
2021-11-14 10:29:51 +00:00
|
|
|
#if defined(RADIOLIB_DEBUG)
|
2020-04-22 12:58:47 +00:00
|
|
|
#pragma message "RADIOLIB_PLATFORM: " RADIOLIB_PLATFORM
|
|
|
|
#endif
|
|
|
|
|
2020-04-01 08:49:45 +00:00
|
|
|
// check unknown/unsupported platform
|
2021-11-14 10:29:51 +00:00
|
|
|
#if defined(RADIOLIB_UNKNOWN_PLATFORM)
|
2020-04-01 08:49:45 +00:00
|
|
|
#warning "RadioLib might not be compatible with this Arduino board - check supported platforms at https://github.com/jgromes/RadioLib!"
|
|
|
|
#endif
|
|
|
|
|
2019-11-20 16:19:15 +00:00
|
|
|
#include "modules/CC1101/CC1101.h"
|
2021-06-20 14:08:01 +00:00
|
|
|
#include "modules/LLCC68/LLCC68.h"
|
2019-11-20 16:19:15 +00:00
|
|
|
#include "modules/nRF24/nRF24.h"
|
|
|
|
#include "modules/RF69/RF69.h"
|
2020-03-30 15:38:04 +00:00
|
|
|
#include "modules/RFM2x/RFM22.h"
|
|
|
|
#include "modules/RFM2x/RFM23.h"
|
2019-11-20 16:19:15 +00:00
|
|
|
#include "modules/RFM9x/RFM95.h"
|
|
|
|
#include "modules/RFM9x/RFM96.h"
|
|
|
|
#include "modules/RFM9x/RFM97.h"
|
2020-03-30 15:38:04 +00:00
|
|
|
#include "modules/Si443x/Si4430.h"
|
|
|
|
#include "modules/Si443x/Si4431.h"
|
|
|
|
#include "modules/Si443x/Si4432.h"
|
2019-11-20 16:19:15 +00:00
|
|
|
#include "modules/SX1231/SX1231.h"
|
|
|
|
#include "modules/SX126x/SX1261.h"
|
|
|
|
#include "modules/SX126x/SX1262.h"
|
|
|
|
#include "modules/SX126x/SX1268.h"
|
|
|
|
#include "modules/SX127x/SX1272.h"
|
|
|
|
#include "modules/SX127x/SX1273.h"
|
|
|
|
#include "modules/SX127x/SX1276.h"
|
|
|
|
#include "modules/SX127x/SX1277.h"
|
|
|
|
#include "modules/SX127x/SX1278.h"
|
|
|
|
#include "modules/SX127x/SX1279.h"
|
2020-04-07 11:30:05 +00:00
|
|
|
#include "modules/SX128x/SX1280.h"
|
|
|
|
#include "modules/SX128x/SX1281.h"
|
|
|
|
#include "modules/SX128x/SX1282.h"
|
2018-03-05 16:08:42 +00:00
|
|
|
|
2019-05-24 13:13:04 +00:00
|
|
|
// physical layer protocols
|
2019-11-20 16:19:15 +00:00
|
|
|
#include "protocols/PhysicalLayer/PhysicalLayer.h"
|
2020-04-30 15:09:25 +00:00
|
|
|
#include "protocols/AFSK/AFSK.h"
|
2020-02-14 07:08:59 +00:00
|
|
|
#include "protocols/AX25/AX25.h"
|
2020-04-14 07:33:39 +00:00
|
|
|
#include "protocols/Hellschreiber/Hellschreiber.h"
|
2019-11-20 16:19:15 +00:00
|
|
|
#include "protocols/Morse/Morse.h"
|
|
|
|
#include "protocols/RTTY/RTTY.h"
|
2020-03-31 15:31:10 +00:00
|
|
|
#include "protocols/SSTV/SSTV.h"
|
2021-05-31 11:46:38 +00:00
|
|
|
#include "protocols/FSK4/FSK4.h"
|
2018-08-20 18:42:14 +00:00
|
|
|
|
2019-11-23 14:34:19 +00:00
|
|
|
// only create Radio class when using RadioShield
|
2021-11-14 10:29:51 +00:00
|
|
|
#if defined(RADIOLIB_RADIOSHIELD)
|
2019-11-23 14:34:19 +00:00
|
|
|
|
2019-05-24 13:13:04 +00:00
|
|
|
// RadioShield pin definitions
|
2019-02-08 14:58:29 +00:00
|
|
|
#define RADIOSHIELD_CS_A 10
|
|
|
|
#define RADIOSHIELD_RX_A 9
|
|
|
|
#define RADIOSHIELD_TX_A 8
|
|
|
|
#define RADIOSHIELD_CS_B 5
|
|
|
|
#define RADIOSHIELD_RX_B 7
|
|
|
|
#define RADIOSHIELD_TX_B 6
|
|
|
|
#define RADIOSHIELD_INT_0 2
|
|
|
|
#define RADIOSHIELD_INT_1 3
|
2018-03-05 16:08:42 +00:00
|
|
|
|
2019-05-24 13:13:04 +00:00
|
|
|
/*!
|
|
|
|
\class Radio
|
|
|
|
|
|
|
|
\brief Library control object when using RadioShield.
|
|
|
|
Contains two pre-configured "modules", which correspond to the slots on shield.
|
|
|
|
*/
|
2019-02-08 14:58:29 +00:00
|
|
|
class Radio {
|
2018-03-05 16:08:42 +00:00
|
|
|
public:
|
2019-05-24 13:13:04 +00:00
|
|
|
|
2019-11-20 16:19:15 +00:00
|
|
|
Module* ModuleA;
|
|
|
|
Module* ModuleB;
|
|
|
|
|
2019-05-24 13:13:04 +00:00
|
|
|
/*!
|
2019-05-24 13:52:52 +00:00
|
|
|
\brief Default constructor. Only used to set ModuleA and ModuleB configuration.
|
2019-05-24 13:13:04 +00:00
|
|
|
*/
|
2019-11-20 16:19:15 +00:00
|
|
|
Radio() {
|
|
|
|
ModuleA = new Module(RADIOSHIELD_CS_A, RADIOSHIELD_INT_0, RADIOSHIELD_INT_1, RADIOSHIELD_RX_A, RADIOSHIELD_TX_A, SPI, SPISettings(2000000, MSBFIRST, SPI_MODE0), nullptr);
|
|
|
|
ModuleB = new Module(RADIOSHIELD_CS_B, RADIOSHIELD_INT_0, RADIOSHIELD_INT_1, RADIOSHIELD_RX_B, RADIOSHIELD_TX_B, SPI, SPISettings(2000000, MSBFIRST, SPI_MODE0), nullptr);
|
|
|
|
}
|
2019-05-18 11:27:43 +00:00
|
|
|
|
2021-11-14 10:29:51 +00:00
|
|
|
#if defined(RADIOLIB_GODMODE)
|
2018-03-05 16:08:42 +00:00
|
|
|
private:
|
2019-11-20 15:55:11 +00:00
|
|
|
#endif
|
2019-05-18 11:27:43 +00:00
|
|
|
|
2018-03-05 16:08:42 +00:00
|
|
|
};
|
|
|
|
|
2019-11-20 16:19:15 +00:00
|
|
|
Radio RadioShield;
|
2019-11-23 14:34:19 +00:00
|
|
|
#endif
|
2018-03-05 16:08:42 +00:00
|
|
|
|
|
|
|
#endif
|