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 |
SX1277.h (3791B)
1 #if !defined(_RADIOLIB_SX1277_H) 2 #define _RADIOLIB_SX1277_H 3 4 #include "../../TypeDef.h" 5 6 #if !defined(RADIOLIB_EXCLUDE_SX127X) 7 8 #include "SX1278.h" 9 10 /*! 11 \class SX1277 12 13 \brief Derived class for %SX1277 modules. Overrides some methods from SX1278 due to different parameter ranges. 14 */ 15 class SX1277: public SX1278 { 16 public: 17 18 // constructor 19 20 /*! 21 \brief Default constructor. Called from Arduino sketch when creating new LoRa instance. 22 23 \param mod Instance of Module that will be used to communicate with the %LoRa chip. 24 */ 25 SX1277(Module* mod); 26 27 // basic methods 28 29 /*! 30 \brief %LoRa modem initialization method. Must be called at least once from Arduino sketch to initialize the module. 31 32 \param freq Carrier frequency in MHz. Allowed values range from 137.0 MHz to 1020.0 MHz. 33 34 \param bw %LoRa link bandwidth in kHz. Allowed values are 10.4, 15.6, 20.8, 31.25, 41.7, 62.5, 125, 250 and 500 kHz. 35 36 \param sf %LoRa link spreading factor. Allowed values range from 6 to 9. 37 38 \param cr %LoRa link coding rate denominator. Allowed values range from 5 to 8. 39 40 \param syncWord %LoRa sync word. Can be used to distinguish different networks. Note that value 0x34 is reserved for LoRaWAN networks. 41 42 \param power Transmission output power in dBm. Allowed values range from 2 to 17 dBm. 43 44 \param preambleLength Length of %LoRa transmission preamble in symbols. The actual preamble length is 4.25 symbols longer than the set number. 45 Allowed values range from 6 to 65535. 46 47 \param gain Gain of receiver LNA (low-noise amplifier). Can be set to any integer in range 1 to 6 where 1 is the highest gain. 48 Set to 0 to enable automatic gain control (recommended). 49 50 \returns \ref status_codes 51 */ 52 int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = RADIOLIB_SX127X_SYNC_WORD, int8_t power = 10, uint16_t preambleLength = 8, uint8_t gain = 0); 53 54 /*! 55 \brief FSK modem initialization method. Must be called at least once from Arduino sketch to initialize the module. 56 57 \param freq Carrier frequency in MHz. Allowed values range from 137.0 MHz to 525.0 MHz. 58 59 \param br Bit rate of the FSK transmission in kbps (kilobits per second). Allowed values range from 1.2 to 300.0 kbps. 60 61 \param freqDev Frequency deviation of the FSK transmission in kHz. Allowed values range from 0.6 to 200.0 kHz. 62 Note that the allowed range changes based on bit rate setting, so that the condition FreqDev + BitRate/2 <= 250 kHz is always met. 63 64 \param rxBw Receiver bandwidth in kHz. Allowed values are 2.6, 3.1, 3.9, 5.2, 6.3, 7.8, 10.4, 12.5, 15.6, 20.8, 25, 31.3, 41.7, 50, 62.5, 83.3, 100, 125, 166.7, 200 and 250 kHz. 65 66 \param power Transmission output power in dBm. Allowed values range from 2 to 17 dBm. 67 68 \param preambleLength Length of FSK preamble in bits. 69 70 \param enableOOK Use OOK modulation instead of FSK. 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 = 125.0, int8_t power = 10, uint16_t preambleLength = 16, bool enableOOK = false); 75 76 // configuration methods 77 78 /*! 79 \brief Sets carrier frequency. Allowed values range from 137.0 MHz to 1020.0 MHz. 80 81 \param freq Carrier frequency to be set in MHz. 82 83 \returns \ref status_codes 84 */ 85 int16_t setFrequency(float freq); 86 87 /*! 88 \brief Sets %LoRa link spreading factor. Allowed values range from 6 to 9. Only available in %LoRa mode. 89 90 \param sf %LoRa link spreading factor to be set. 91 92 \returns \ref status_codes 93 */ 94 int16_t setSpreadingFactor(uint8_t sf); 95 96 #if !defined(RADIOLIB_GODMODE) 97 private: 98 #endif 99 100 }; 101 102 #endif 103 104 #endif