acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
RadioLib.h (3951B)
1 #if !defined(_RADIOLIB_H) 2 #define _RADIOLIB_H 3 4 /*! 5 \mainpage RadioLib Documentation 6 7 Universal wireless communication library for Arduino. 8 9 \par Currently Supported Wireless Modules and Protocols 10 - CC1101 FSK module 11 - RF69 FSK module 12 - Si443x FSK module 13 - SX126x LoRa/FSK module 14 - SX127x LoRa/FSK module 15 - SX128x LoRa/GFSK/BLE/FLRC module 16 - SX1231 FSK module 17 - PhysicalLayer protocols 18 - RTTY (RTTYClient) 19 - Morse Code (MorseClient) 20 - AX.25 (AX25Client) 21 - SSTV (SSTVClient) 22 - Hellschreiber (HellClient) 23 - 4-FSK (FSK4Client) 24 - APRS (APRSClient) 25 26 \par Quick Links 27 Documentation for most common methods can be found in its reference page (see the list above).\n 28 Some methods (mainly configuration) are also overridden in derived classes, such as SX1272, SX1278, RFM96 etc. for SX127x.\n 29 \ref status_codes have their own page.\n 30 Some modules implement methods of one or more compatibility layers, loosely based on the ISO/OSI model: 31 - PhysicalLayer - FSK and LoRa radio modules 32 33 \see https://github.com/jgromes/RadioLib 34 35 \copyright Copyright (c) 2019 Jan Gromes 36 */ 37 38 #include "TypeDef.h" 39 #include "Module.h" 40 41 // warnings are printed in this file since BuildOpt.h is compiled in multiple places 42 43 // check God mode 44 #if defined(RADIOLIB_GODMODE) 45 #warning "God mode active, I hope it was intentional. Buckle up, lads." 46 #endif 47 48 // print debug info 49 #if defined(RADIOLIB_DEBUG) 50 #pragma message "RADIOLIB_PLATFORM: " RADIOLIB_PLATFORM 51 #endif 52 53 // check unknown/unsupported platform 54 #if defined(RADIOLIB_UNKNOWN_PLATFORM) 55 #warning "RadioLib might not be compatible with this Arduino board - check supported platforms at https://github.com/jgromes/RadioLib!" 56 #endif 57 58 #include "modules/CC1101/CC1101.h" 59 #include "modules/LLCC68/LLCC68.h" 60 #include "modules/nRF24/nRF24.h" 61 #include "modules/RF69/RF69.h" 62 #include "modules/RFM2x/RFM22.h" 63 #include "modules/RFM2x/RFM23.h" 64 #include "modules/RFM9x/RFM95.h" 65 #include "modules/RFM9x/RFM96.h" 66 #include "modules/RFM9x/RFM97.h" 67 #include "modules/Si443x/Si4430.h" 68 #include "modules/Si443x/Si4431.h" 69 #include "modules/Si443x/Si4432.h" 70 #include "modules/SX1231/SX1231.h" 71 #include "modules/SX126x/SX1261.h" 72 #include "modules/SX126x/SX1262.h" 73 #include "modules/SX126x/SX1268.h" 74 #include "modules/SX127x/SX1272.h" 75 #include "modules/SX127x/SX1273.h" 76 #include "modules/SX127x/SX1276.h" 77 #include "modules/SX127x/SX1277.h" 78 #include "modules/SX127x/SX1278.h" 79 #include "modules/SX127x/SX1279.h" 80 #include "modules/SX128x/SX1280.h" 81 #include "modules/SX128x/SX1281.h" 82 #include "modules/SX128x/SX1282.h" 83 84 // physical layer protocols 85 #include "protocols/PhysicalLayer/PhysicalLayer.h" 86 #include "protocols/AFSK/AFSK.h" 87 #include "protocols/AX25/AX25.h" 88 #include "protocols/Hellschreiber/Hellschreiber.h" 89 #include "protocols/Morse/Morse.h" 90 #include "protocols/RTTY/RTTY.h" 91 #include "protocols/SSTV/SSTV.h" 92 #include "protocols/FSK4/FSK4.h" 93 #include "protocols/APRS/APRS.h" 94 95 // only create Radio class when using RadioShield 96 #if defined(RADIOLIB_RADIOSHIELD) 97 98 // RadioShield pin definitions 99 #define RADIOSHIELD_CS_A 10 100 #define RADIOSHIELD_IRQ_A 2 101 #define RADIOSHIELD_RST_A 9 102 #define RADIOSHIELD_GPIO_A 8 103 #define RADIOSHIELD_CS_B 5 104 #define RADIOSHIELD_IRQ_B 3 105 #define RADIOSHIELD_RST_B 7 106 #define RADIOSHIELD_GPIO_B 6 107 108 /*! 109 \class Radio 110 111 \brief Library control object when using RadioShield. 112 Contains two pre-configured "modules", which correspond to the slots on shield. 113 */ 114 class Radio { 115 public: 116 117 Module* ModuleA; 118 Module* ModuleB; 119 120 /*! 121 \brief Default constructor. Only used to set ModuleA and ModuleB configuration. 122 */ 123 Radio() { 124 ModuleA = new Module(RADIOSHIELD_CS_A, RADIOSHIELD_IRQ_A, RADIOSHIELD_RST_A, RADIOSHIELD_GPIO_A); 125 ModuleB = new Module(RADIOSHIELD_CS_B, RADIOSHIELD_IRQ_B, RADIOSHIELD_RST_B, RADIOSHIELD_GPIO_B); 126 } 127 128 #if defined(RADIOLIB_GODMODE) 129 private: 130 #endif 131 132 }; 133 134 Radio RadioShield; 135 #endif 136 137 #endif