diff --git a/keywords.txt b/keywords.txt index 8548153e..17bb7acd 100644 --- a/keywords.txt +++ b/keywords.txt @@ -154,7 +154,8 @@ enableAES KEYWORD2 disableAES KEYWORD2 getTemperature KEYWORD2 setAmbientTemperature KEYWORD2 -setLnaTestBoost KEYWORD2 +setLnaTestBoost KEYWORD2 +setOokFixedThreshold KEYWORD2 # CC1101-specific getLQI KEYWORD2 diff --git a/src/modules/RF69/RF69.cpp b/src/modules/RF69/RF69.cpp index 9b96143a..3a509772 100644 --- a/src/modules/RF69/RF69.cpp +++ b/src/modules/RF69/RF69.cpp @@ -388,6 +388,10 @@ int16_t RF69::setOokThresholdType(uint8_t type) { return(_mod->SPIsetRegValue(RF69_REG_OOK_PEAK, type, 7, 3, 5)); } +int16_t RF69::setOokFixedThreshold(uint8_t value) { + return(_mod->SPIsetRegValue(RF69_REG_OOK_FIX, value, 7, 0, 5)); +} + int16_t RF69::setFrequency(float freq) { // check allowed frequency range if(!(((freq > 290.0) && (freq < 340.0)) || diff --git a/src/modules/RF69/RF69.h b/src/modules/RF69/RF69.h index d2acc5e8..de230933 100644 --- a/src/modules/RF69/RF69.h +++ b/src/modules/RF69/RF69.h @@ -757,6 +757,15 @@ class RF69: public PhysicalLayer { */ int16_t setOokThresholdType(uint8_t type); + /*! + \brief Fixed threshold for the Data Slicer in OOK mode or floor threshold for the Data Slicer in OOK when Peak mode is used. + + \param value Fixed threshold value (in dB) in the OOK demodulator. Used when OokThresType = RF69_OOK_THRESH_FIXED. + + \returns \ref status_codes + */ + int16_t setOokFixedThreshold(uint8_t value); + /*! \brief Set modem in fixed packet length mode.