RadioLib Universal wireless communication library for Arduino

RFM96.h
1 #if !defined(_RADIOLIB_RFM96_H)
2 #define _RADIOLIB_RFM96_H
3
4 #include "../../TypeDef.h"
5
6 #if !defined(RADIOLIB_EXCLUDE_RFM9X)
7
8 #include "../../Module.h"
9 #include "../SX127x/SX127x.h"
10 #include "../SX127x/SX1278.h"
11
12 // SX127X_REG_VERSION
13 #define RADIOLIB_RFM9X_CHIP_VERSION_OFFICIAL 0x11
14 #define RADIOLIB_RFM9X_CHIP_VERSION_UNOFFICIAL 0x12 // according to datasheet, only 0x11 should be possible, but some modules seem to have 0x12
15
21 class RFM96: public SX1278 {
22 public:
23
24 // constructor
25
31 RFM96(Module* mod);
32
33 // basic methods
34
58 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);
59
80 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);
81
82 // configuration methods
83
91 int16_t setFrequency(float freq);
92
93 #if !defined(RADIOLIB_GODMODE)
94 private:
95 #endif
96
97 };
98
104 RADIOLIB_TYPE_ALIAS(RFM96, RFM98);
105
106 #endif
107
108 #endif
Module
Implements all common low-level methods to control the wireless module. Every module class contains o...
Definition: Module.h:28
RFM96
Derived class for RFM96 modules. Overrides some methods from SX1278 due to different parameter ranges...
Definition: RFM96.h:21
RFM96::beginFSK
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)
FSK modem initialization method. Must be called at least once from Arduino sketch to initialize the m...
Definition: RFM96.cpp:44
RFM96::RFM96
RFM96(Module *mod)
Default constructor. Called from Arduino sketch when creating new LoRa instance.
Definition: RFM96.cpp:4
RFM96::setFrequency
int16_t setFrequency(float freq)
Sets carrier frequency. Allowed values range from 433.0 MHz to 470.0 MHz.
Definition: RFM96.cpp:83
RFM96::begin
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)
LoRa modem initialization method. Must be called at least once from Arduino sketch to initialize the ...
Definition: RFM96.cpp:8
RFM98
Only exists as alias for RFM96, since there seems to be no difference between RFM96 and RFM98 modules...
SX1278
Derived class for SX1278 modules. Also used as base class for SX1276, SX1277, SX1279,...
Definition: SX1278.h:104