RadioLib Universal wireless communication library for Arduino

RadioLib.h
1 #if !defined(_RADIOLIB_H)
2 #define _RADIOLIB_H
3
38 #include "TypeDef.h"
39 #include "Module.h"
40
41 #include "Hal.h"
42 #if defined(RADIOLIB_BUILD_ARDUINO)
43 #include "ArduinoHal.h"
44 #endif
45
46
47 // warnings are printed in this file since BuildOpt.h is compiled in multiple places
48
49 // check God mode
50 #if RADIOLIB_GODMODE
51 #warning "God mode active, I hope it was intentional. Buckle up, lads."
52 #endif
53
54 // print debug info
55 #if RADIOLIB_DEBUG
56 #pragma message(RADIOLIB_INFO)
57 #endif
58
59 // check unknown/unsupported platform
60 #if defined(RADIOLIB_UNKNOWN_PLATFORM)
61 #warning "RadioLib might not be compatible with this Arduino board - check supported platforms at https://github.com/jgromes/RadioLib!"
62 #endif
63
64 // print warning for low-end platforms
65 #if defined(RADIOLIB_LOWEND_PLATFORM)
66 #warning "Low-end platform detected, stability issues are likely!"
67 #endif
68
69 #include "modules/CC1101/CC1101.h"
70 #include "modules/LLCC68/LLCC68.h"
71 #include "modules/LR11x0/LR1110.h"
72 #include "modules/nRF24/nRF24.h"
73 #include "modules/RF69/RF69.h"
74 #include "modules/RFM2x/RFM22.h"
75 #include "modules/RFM2x/RFM23.h"
76 #include "modules/Si443x/Si4430.h"
77 #include "modules/Si443x/Si4431.h"
78 #include "modules/Si443x/Si4432.h"
79 #include "modules/SX123x/SX1231.h"
80 #include "modules/SX123x/SX1233.h"
81 #include "modules/SX126x/SX1261.h"
82 #include "modules/SX126x/SX1262.h"
83 #include "modules/SX126x/SX1268.h"
84 #include "modules/SX126x/STM32WLx.h"
85 #include "modules/SX127x/SX1272.h"
86 #include "modules/SX127x/SX1273.h"
87 #include "modules/SX127x/SX1276.h"
88 #include "modules/SX127x/SX1277.h"
89 #include "modules/SX127x/SX1278.h"
90 #include "modules/SX127x/SX1279.h"
91 #include "modules/SX128x/SX1280.h"
92 #include "modules/SX128x/SX1281.h"
93 #include "modules/SX128x/SX1282.h"
94
95 // physical layer protocols
96 #include "protocols/PhysicalLayer/PhysicalLayer.h"
97 #include "protocols/AFSK/AFSK.h"
98 #include "protocols/AX25/AX25.h"
99 #include "protocols/Hellschreiber/Hellschreiber.h"
100 #include "protocols/Morse/Morse.h"
101 #include "protocols/Pager/Pager.h"
102 #include "protocols/RTTY/RTTY.h"
103 #include "protocols/SSTV/SSTV.h"
104 #include "protocols/FSK4/FSK4.h"
105 #include "protocols/APRS/APRS.h"
106 #include "protocols/ExternalRadio/ExternalRadio.h"
107 #include "protocols/Print/Print.h"
108 #include "protocols/BellModem/BellModem.h"
109 #include "protocols/LoRaWAN/LoRaWAN.h"
110
111 // utilities
112 #include "utils/CRC.h"
113 #include "utils/Cryptography.h"
114
115 // only create Radio class when using RadioShield
116 #if RADIOLIB_RADIOSHIELD
117
118 // RadioShield pin definitions
119 #define RADIOSHIELD_CS_A 10
120 #define RADIOSHIELD_IRQ_A 2
121 #define RADIOSHIELD_RST_A 9
122 #define RADIOSHIELD_GPIO_A 8
123 #define RADIOSHIELD_CS_B 5
124 #define RADIOSHIELD_IRQ_B 3
125 #define RADIOSHIELD_RST_B 7
126 #define RADIOSHIELD_GPIO_B 6
127
134 class Radio {
135 public:
136
137 Module* ModuleA;
138 Module* ModuleB;
139
143 Radio() {
144 ModuleA = new Module(RADIOSHIELD_CS_A, RADIOSHIELD_IRQ_A, RADIOSHIELD_RST_A, RADIOSHIELD_GPIO_A);
145 ModuleB = new Module(RADIOSHIELD_CS_B, RADIOSHIELD_IRQ_B, RADIOSHIELD_RST_B, RADIOSHIELD_GPIO_B);
146 }
147
148 #if RADIOLIB_GODMODE
149 private:
150 #endif
151
152 };
153
154 Radio RadioShield;
155 #endif
156
157 #endif
Module
Implements all common low-level methods to control the wireless module. Every module class contains o...
Definition: Module.h:68