From 4fa214a0fd6eefe31b00e1d92bf6a1763576659c Mon Sep 17 00:00:00 2001 From: jgromes Date: Tue, 11 Feb 2020 14:29:19 +0100 Subject: [PATCH] [SX126x] Added data encoding method --- src/modules/SX126x/SX126x.cpp | 4 ++++ src/modules/SX126x/SX126x.h | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index 2a9e4423..b089f247 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -1124,6 +1124,10 @@ int16_t SX126x::setRegulatorDCDC() { return(setRegulatorMode(SX126X_REGULATOR_DC_DC)); } +int16_t SX126x::setEncoding(uint8_t encoding) { + return(setWhitening(encoding)); +} + int16_t SX126x::setTCXO(float voltage, uint32_t delay) { // set mode to standby standby(); diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index f28e7d92..df6e8028 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -833,6 +833,16 @@ class SX126x: public PhysicalLayer { \returns \ref status_codes */ int16_t setRegulatorDCDC(); + + /*! + \brief Sets transmission encoding. Available in FSK mode only. Serves only as alias for PhysicalLayer compatibility. + + \param encoding Encoding to be used. Set to 0 for NRZ, and 2 for whitening. + + \returns \ref status_codes + */ + int16_t setEncoding(uint8_t encoding); + #ifndef RADIOLIB_GODMODE protected: #endif