From 47163f4398aabae8c92a819608050aafcb40adcd Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 20 Dec 2022 20:58:19 +0100 Subject: [PATCH 1/2] [SX126x] Make begin parameter docs consistent This: - Updates syncWord comments after changing it from uint16_t to uint8_t in commit 55aff74a ([SX126x] Changed pin mapping, added reset, changed LoRa sync word to 1B). - Adds missing useRegulatorLDO comments forgoten in commit ea85a663 ([SX126x] Pass useRegulatorLDO to SX1262/SX1261/SX1268). - Makes useRegulatorLDO comments the same in all places (using the more explicit version). - Fixes a typo in the doxygen \parma -> \param command. --- src/modules/LLCC68/LLCC68.h | 4 +++- src/modules/SX126x/SX1262.h | 6 ++++-- src/modules/SX126x/SX1268.h | 6 ++++-- src/modules/SX126x/SX126x.h | 4 ++-- src/modules/SX128x/SX128x.h | 4 ++-- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/modules/LLCC68/LLCC68.h b/src/modules/LLCC68/LLCC68.h index f8dd2219..2810041d 100644 --- a/src/modules/LLCC68/LLCC68.h +++ b/src/modules/LLCC68/LLCC68.h @@ -33,7 +33,7 @@ class LLCC68: public SX1262 { \param cr LoRa coding rate denominator. Defaults to 7 (coding rate 4/7). - \param syncWord 2-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12). + \param syncWord 1-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12). \param power Output power in dBm. Defaults to 10 dBm. @@ -41,6 +41,8 @@ class LLCC68: public SX1262 { \param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip. + \param useRegulatorLDO Whether to use only LDO regulator (true) or DC-DC regulator (false). Defaults to false. + \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 = RADIOLIB_SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false); diff --git a/src/modules/SX126x/SX1262.h b/src/modules/SX126x/SX1262.h index cac19280..dbe6c1d2 100644 --- a/src/modules/SX126x/SX1262.h +++ b/src/modules/SX126x/SX1262.h @@ -38,7 +38,7 @@ class SX1262: public SX126x { \param cr LoRa coding rate denominator. Defaults to 7 (coding rate 4/7). - \param syncWord 2-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12). + \param syncWord 1-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12). \param power Output power in dBm. Defaults to 10 dBm. @@ -46,6 +46,8 @@ class SX1262: public SX126x { \param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip. + \param useRegulatorLDO Whether to use only LDO regulator (true) or DC-DC regulator (false). Defaults to false. + \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 = RADIOLIB_SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false); @@ -63,7 +65,7 @@ class SX1262: public SX126x { \param power Output power in dBm. Defaults to 10 dBm. - \parma preambleLength FSK preamble length in bits. Defaults to 16 bits. + \param 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. diff --git a/src/modules/SX126x/SX1268.h b/src/modules/SX126x/SX1268.h index 7b454bac..2d4b90d9 100644 --- a/src/modules/SX126x/SX1268.h +++ b/src/modules/SX126x/SX1268.h @@ -38,7 +38,7 @@ class SX1268: public SX126x { \param cr LoRa coding rate denominator. Defaults to 7 (coding rate 4/7). - \param syncWord 2-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12). + \param syncWord 1-byte LoRa sync word. Defaults to RADIOLIB_SX126X_SYNC_WORD_PRIVATE (0x12). \param power Output power in dBm. Defaults to 10 dBm. @@ -46,6 +46,8 @@ class SX1268: public SX126x { \param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip. + \param useRegulatorLDO Whether to use only LDO regulator (true) or DC-DC regulator (false). Defaults to false. + \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 = RADIOLIB_SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 8, float tcxoVoltage = 1.6, bool useRegulatorLDO = false); @@ -63,7 +65,7 @@ class SX1268: public SX126x { \param power Output power in dBm. Defaults to 10 dBm. - \parma preambleLength FSK preamble length in bits. Defaults to 16 bits. + \param 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. diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index 8e80bebf..a1c0eeaf 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -391,7 +391,7 @@ class SX126x: public PhysicalLayer { \param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip. - \param useRegulatorLDO use the LDO instead of DC-DC converter (default false). This is necessary for some modules such as the LAMBDA from RF solutions. + \param useRegulatorLDO Whether to use only LDO regulator (true) or DC-DC regulator (false). Defaults to false. \returns \ref status_codes */ @@ -410,7 +410,7 @@ class SX126x: public PhysicalLayer { \param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip. - \param useRegulatorLDO use the LDO instead of DC-DC converter (default false). This is necessary for some modules such as the LAMBDA from RF solutions. + \param useRegulatorLDO Whether to use only LDO regulator (true) or DC-DC regulator (false). Defaults to false. \returns \ref status_codes */ diff --git a/src/modules/SX128x/SX128x.h b/src/modules/SX128x/SX128x.h index 5c169fe2..c367013f 100644 --- a/src/modules/SX128x/SX128x.h +++ b/src/modules/SX128x/SX128x.h @@ -398,7 +398,7 @@ class SX128x: public PhysicalLayer { \param power Output power in dBm. Defaults to 10 dBm. - \parma preambleLength FSK preamble length in bits. Defaults to 16 bits. + \param preambleLength FSK preamble length in bits. Defaults to 16 bits. \returns \ref status_codes */ @@ -432,7 +432,7 @@ class SX128x: public PhysicalLayer { \param power Output power in dBm. Defaults to 10 dBm. - \parma preambleLength FLRC preamble length in bits. Defaults to 16 bits. + \param preambleLength FLRC preamble length in bits. Defaults to 16 bits. \param dataShaping Time-bandwidth product of the Gaussian filter to be used for shaping. Defaults to 0.5. From dfbe6934bb452d7745acc3cf41fab0e4a6315881 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 20 Dec 2022 21:03:40 +0100 Subject: [PATCH 2/2] [SX126x] Set DIO2 to RF switch by default for FSK too In commit a1f94d9f ([SX126x] Set DIO2 to RF switch by default), this was changed for LoRa modulation in begin(), but since this is really a board-specific attribute, independent of the modulation used, there is no reason to have a different default for FSK (so this was probably just forgotten). --- src/modules/SX126x/SX126x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index e77e4028..f5de00b3 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -150,7 +150,7 @@ int16_t SX126x::beginFSK(float br, float freqDev, float rxBw, uint16_t preambleL state = setCRC(2); RADIOLIB_ASSERT(state); - state = setDio2AsRfSwitch(false); + state = setDio2AsRfSwitch(true); RADIOLIB_ASSERT(state); return(state);