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 |
SX1268.h (3117B)
1 #if !defined(_RADIOLIB_SX1268_H) 2 #define _RADIOLIB_SX1268_H 3 4 #include "../../TypeDef.h" 5 6 #if !defined(RADIOLIB_EXCLUDE_SX126X) 7 8 #include "../../Module.h" 9 #include "SX126x.h" 10 11 //RADIOLIB_SX126X_CMD_SET_PA_CONFIG 12 #define RADIOLIB_SX126X_PA_CONFIG_SX1268 0x00 13 14 /*! 15 \class SX1268 16 17 \brief Derived class for %SX1268 modules. 18 */ 19 class SX1268: public SX126x { 20 public: 21 /*! 22 \brief Default constructor. 23 24 \param mod Instance of Module that will be used to communicate with the radio. 25 */ 26 SX1268(Module* mod); 27 28 // basic methods 29 30 /*! 31 \brief Initialization method for LoRa modem. 32 33 \param freq Carrier frequency in MHz. Defaults to 434.0 MHz. 34 35 \param bw LoRa bandwidth in kHz. Defaults to 125.0 kHz. 36 37 \param sf LoRa spreading factor. Defaults to 9. 38 39 \param cr LoRa coding rate denominator. Defaults to 7 (coding rate 4/7). 40 41 \param syncWord 2-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12). 42 43 \param power Output power in dBm. Defaults to 10 dBm. 44 45 \param preambleLength LoRa preamble length in symbols. Defaults to 8 symbols. 46 47 \param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip. 48 49 \returns \ref status_codes 50 */ 51 int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = RADIOLIB_SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false); 52 53 /*! 54 \brief Initialization method for FSK modem. 55 56 \param freq Carrier frequency in MHz. Defaults to 434.0 MHz. 57 58 \param br FSK bit rate in kbps. Defaults to 4.8 kbps. 59 60 \param freqDev Frequency deviation from carrier frequency in kHz. Defaults to 5.0 kHz. 61 62 \param rxBw Receiver bandwidth in kHz. Defaults to 156.2 kHz. 63 64 \param power Output power in dBm. Defaults to 10 dBm. 65 66 \parma preambleLength FSK preamble length in bits. Defaults to 16 bits. 67 68 \param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip. 69 70 \param useRegulatorLDO Whether to use only LDO regulator (true) or DC-DC regulator (false). Defaults to false. 71 72 \returns \ref status_codes 73 */ 74 int16_t beginFSK(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 156.2, int8_t power = 10, uint16_t preambleLength = 16, float tcxoVoltage = 1.6, bool useRegulatorLDO = false); 75 76 // configuration methods 77 78 /*! 79 \brief Sets carrier frequency. Allowed values are in range from 410.0 to 810.0 MHz. 80 81 \param freq Carrier frequency to be set in MHz. 82 83 \param calibrate Run image calibration. 84 85 \returns \ref status_codes 86 */ 87 int16_t setFrequency(float freq, bool calibrate = true); 88 89 /*! 90 \brief Sets output power. Allowed values are in range from -9 to 22 dBm. 91 92 \param power Output power to be set in dBm. 93 94 \returns \ref status_codes 95 */ 96 int16_t setOutputPower(int8_t power); 97 98 #if !defined(RADIOLIB_GODMODE) 99 private: 100 #endif 101 102 }; 103 104 #endif 105 106 #endif