[RFM9x] Synced parameters of all LoRa modules
This commit is contained in:
parent
8682357881
commit
59c4fe638f
4 changed files with 9 additions and 14 deletions
|
@ -5,12 +5,12 @@ RFM95::RFM95(Module* mod) : SX1278(mod) {
|
|||
|
||||
}
|
||||
|
||||
int16_t RFM95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint8_t currentLimit, uint16_t preambleLength, uint8_t gain) {
|
||||
int16_t RFM95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint16_t preambleLength, uint8_t gain) {
|
||||
// execute common part
|
||||
int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, currentLimit, preambleLength);
|
||||
int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, preambleLength);
|
||||
if(state == ERR_CHIP_NOT_FOUND) {
|
||||
// SX127X_REG_VERSION might be set 0x12
|
||||
state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, currentLimit, preambleLength);
|
||||
state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, preambleLength);
|
||||
RADIOLIB_ASSERT(state);
|
||||
} else if(state != ERR_NONE) {
|
||||
// some other error
|
||||
|
|
|
@ -47,9 +47,6 @@ class RFM95: public SX1278 {
|
|||
|
||||
\param power Transmission output power in dBm. Allowed values range from 2 to 17 dBm.
|
||||
|
||||
\param currentLimit Trim value for OCP (over current protection) in mA. Can be set to multiplies of 5 in range 45 to 120 mA and to multiples of 10 in range 120 to 240 mA.
|
||||
Set to 0 to disable OCP (not recommended).
|
||||
|
||||
\param preambleLength Length of %LoRa transmission preamble in symbols. The actual preamble length is 4.25 symbols longer than the set number.
|
||||
Allowed values range from 6 to 65535.
|
||||
|
||||
|
@ -58,7 +55,7 @@ class RFM95: public SX1278 {
|
|||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t begin(float freq = 915.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX127X_SYNC_WORD, int8_t power = 17, uint8_t currentLimit = 100, uint16_t preambleLength = 8, uint8_t gain = 0);
|
||||
int16_t begin(float freq = 915.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX127X_SYNC_WORD, int8_t power = 10, uint16_t preambleLength = 8, uint8_t gain = 0);
|
||||
|
||||
// configuration methods
|
||||
|
||||
|
|
|
@ -5,12 +5,12 @@ RFM96::RFM96(Module* mod) : SX1278(mod) {
|
|||
|
||||
}
|
||||
|
||||
int16_t RFM96::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint8_t currentLimit, uint16_t preambleLength, uint8_t gain) {
|
||||
int16_t RFM96::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint16_t preambleLength, uint8_t gain) {
|
||||
// execute common part
|
||||
int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, currentLimit, preambleLength);
|
||||
int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, preambleLength);
|
||||
if(state == ERR_CHIP_NOT_FOUND) {
|
||||
// SX127X_REG_VERSION might be set 0x12
|
||||
state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, currentLimit, preambleLength);
|
||||
state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, preambleLength);
|
||||
RADIOLIB_ASSERT(state);
|
||||
} else if(state != ERR_NONE) {
|
||||
// some other error
|
||||
|
@ -38,6 +38,7 @@ int16_t RFM96::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncW
|
|||
RADIOLIB_ASSERT(state);
|
||||
|
||||
state = setGain(gain);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
return(state);
|
||||
}
|
||||
|
|
|
@ -47,9 +47,6 @@ class RFM96: public SX1278 {
|
|||
|
||||
\param power Transmission output power in dBm. Allowed values range from 2 to 17 dBm.
|
||||
|
||||
\param currentLimit Trim value for OCP (over current protection) in mA. Can be set to multiplies of 5 in range 45 to 120 mA and to multiples of 10 in range 120 to 240 mA.
|
||||
Set to 0 to disable OCP (not recommended).
|
||||
|
||||
\param preambleLength Length of %LoRa transmission preamble in symbols. The actual preamble length is 4.25 symbols longer than the set number.
|
||||
Allowed values range from 6 to 65535.
|
||||
|
||||
|
@ -58,7 +55,7 @@ class RFM96: public SX1278 {
|
|||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX127X_SYNC_WORD, int8_t power = 17, uint8_t currentLimit = 100, uint16_t preambleLength = 8, uint8_t gain = 0);
|
||||
int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX127X_SYNC_WORD, int8_t power = 10, uint16_t preambleLength = 8, uint8_t gain = 0);
|
||||
|
||||
// configuration methods
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue