[SX126x] Synced parameters of all LoRa modules
This commit is contained in:
parent
e1141ca64c
commit
b21f93342e
7 changed files with 13 additions and 20 deletions
|
@ -70,9 +70,8 @@ void setup() {
|
|||
// coding rate: 5
|
||||
// sync word: 0x34 (public network/LoRaWAN)
|
||||
// output power: 2 dBm
|
||||
// current limit: 50 mA
|
||||
// preamble length: 20 symbols
|
||||
state = radio2.begin(915.0, 500.0, 6, 5, 0x34, 50, 20);
|
||||
state = radio2.begin(915.0, 500.0, 6, 5, 0x34, 20);
|
||||
if (state == ERR_NONE) {
|
||||
Serial.println(F("success!"));
|
||||
} else {
|
||||
|
|
|
@ -5,9 +5,9 @@ SX1262::SX1262(Module* mod) : SX126x(mod) {
|
|||
|
||||
}
|
||||
|
||||
int16_t SX1262::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, float currentLimit, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) {
|
||||
int16_t SX1262::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) {
|
||||
// execute common part
|
||||
int16_t state = SX126x::begin(bw, sf, cr, syncWord, currentLimit, preambleLength, tcxoVoltage, useRegulatorLDO);
|
||||
int16_t state = SX126x::begin(bw, sf, cr, syncWord, tcxoVoltage, useRegulatorLDO);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// configure publicly accessible settings
|
||||
|
|
|
@ -42,13 +42,13 @@ class SX1262: public SX126x {
|
|||
|
||||
\param power Output power in dBm. Defaults to 10 dBm.
|
||||
|
||||
\param preambleLength LoRa preamble length in symbols.Defaults to 8 symbols.
|
||||
\param preambleLength LoRa preamble length in symbols. Defaults to 8 symbols.
|
||||
|
||||
\param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip.
|
||||
|
||||
\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 = SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, float currentLimit = 60.0, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
|
||||
int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
|
||||
|
||||
/*!
|
||||
\brief Initialization method for FSK modem.
|
||||
|
@ -63,8 +63,6 @@ class SX1262: public SX126x {
|
|||
|
||||
\param power Output power in dBm. Defaults to 10 dBm.
|
||||
|
||||
\param currentLimit Current protection limit in mA. Defaults to 60.0 mA.
|
||||
|
||||
\parma preambleLength FSK preamble length in bits. Defaults to 16 bits.
|
||||
|
||||
\param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip.
|
||||
|
|
|
@ -5,9 +5,9 @@ SX1268::SX1268(Module* mod) : SX126x(mod) {
|
|||
|
||||
}
|
||||
|
||||
int16_t SX1268::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, float currentLimit, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) {
|
||||
int16_t SX1268::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) {
|
||||
// execute common part
|
||||
int16_t state = SX126x::begin(bw, sf, cr, syncWord, currentLimit, preambleLength, tcxoVoltage, useRegulatorLDO);
|
||||
int16_t state = SX126x::begin(bw, sf, cr, syncWord, preambleLength, tcxoVoltage, useRegulatorLDO);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// configure publicly accessible settings
|
||||
|
|
|
@ -42,15 +42,13 @@ class SX1268: public SX126x {
|
|||
|
||||
\param power Output power in dBm. Defaults to 10 dBm.
|
||||
|
||||
\param currentLimit Current protection limit in mA. Defaults to 60.0 mA.
|
||||
|
||||
\param preambleLength LoRa preamble length in symbols. Defaults to 8 symbols.
|
||||
|
||||
\param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip.
|
||||
|
||||
\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 = SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, float currentLimit = 60.0, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
|
||||
int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
|
||||
|
||||
/*!
|
||||
\brief Initialization method for FSK modem.
|
||||
|
|
|
@ -5,7 +5,7 @@ SX126x::SX126x(Module* mod) : PhysicalLayer(SX126X_FREQUENCY_STEP_SIZE, SX126X_M
|
|||
_mod = mod;
|
||||
}
|
||||
|
||||
int16_t SX126x::begin(float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, float currentLimit, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) {
|
||||
int16_t SX126x::begin(float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) {
|
||||
// set module properties
|
||||
_mod->init(RADIOLIB_USE_SPI);
|
||||
Module::pinMode(_mod->getIrq(), INPUT);
|
||||
|
@ -56,13 +56,13 @@ int16_t SX126x::begin(float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, float
|
|||
state = setSyncWord(syncWord);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
state = setCurrentLimit(currentLimit);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
state = setPreambleLength(preambleLength);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// set publicly accessible settings that are not a part of begin method
|
||||
state = setCurrentLimit(60.0);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
state = setDio2AsRfSwitch(true);
|
||||
RADIOLIB_ASSERT(state);
|
||||
|
||||
|
|
|
@ -367,8 +367,6 @@ class SX126x: public PhysicalLayer {
|
|||
|
||||
\param syncWord 1-byte LoRa sync word.
|
||||
|
||||
\param currentLimit Current protection limit in mA.
|
||||
|
||||
\param preambleLength LoRa preamble length in symbols. Allowed values range from 1 to 65535.
|
||||
|
||||
\param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip.
|
||||
|
@ -377,7 +375,7 @@ class SX126x: public PhysicalLayer {
|
|||
|
||||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t begin(float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, float currentLimit, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO = false);
|
||||
int16_t begin(float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO = false);
|
||||
|
||||
/*!
|
||||
\brief Initialization method for FSK modem.
|
||||
|
|
Loading…
Add table
Reference in a new issue