SX127x::setOokPeakThresholdDecrement

This commit is contained in:
Christophe Painchaud 2021-03-18 22:21:04 +01:00
parent 17a2979062
commit f049a4bc98
2 changed files with 22 additions and 1 deletions

View file

@ -860,6 +860,18 @@ int16_t SX127x::setOokFixedOrFloorThreshold(short int value) {
return(state); return(state);
} }
int16_t SX127x::setOokPeakThresholdDecrement(short int value) {
// check active modem
if(getActiveModem() != SX127X_FSK_OOK) {
return(ERR_WRONG_MODEM);
}
int16_t state = ERR_NONE;
state = _mod->SPIsetRegValue(SX127X_REG_OOK_AVG, value, 7, 5, 5);
return(state);
}
int16_t SX127x::setOOK(bool enableOOK) { int16_t SX127x::setOOK(bool enableOOK) {

View file

@ -862,12 +862,21 @@ class SX127x: public PhysicalLayer {
/*! /*!
\brief Selects the type of threshold in the OOK data slicer \brief Selects the type of threshold in the OOK data slicer
\param SX127X_OOK_THRESH_FIXED, SX127X_OOK_THRESH_PEAK(default), SX127X_OOK_THRESH_AVERAGE \param type SX127X_OOK_THRESH_FIXED, SX127X_OOK_THRESH_PEAK(default), SX127X_OOK_THRESH_AVERAGE
\returns \ref status_codes \returns \ref status_codes
*/ */
int16_t setOokThresholdType(uint8_t type); int16_t setOokThresholdType(uint8_t type);
/*!
\brief Period of decrement of the RSSI threshold in the OOK demodulator
\param value use defines SX127X_OOK_PEAK_THRESH_DEC_X_X_CHIP
\returns \ref status_codes
*/
int16_t setOokPeakThresholdDecrement(short int value);
/*! /*!
\brief Fixed threshold for the Data Slicer in OOK mode \brief Fixed threshold for the Data Slicer in OOK mode
Floor threshold for the Data Slicer in OOK when Peak mode is used Floor threshold for the Data Slicer in OOK when Peak mode is used