diff --git a/src/modules/Si443x/Si443x.cpp b/src/modules/Si443x/Si443x.cpp index b8641aee..efc01c6d 100644 --- a/src/modules/Si443x/Si443x.cpp +++ b/src/modules/Si443x/Si443x.cpp @@ -134,10 +134,13 @@ int16_t Si443x::sleep() { } int16_t Si443x::standby() { + return(standby(RADIOLIB_SI443X_XTAL_ON)); +} + +int16_t Si443x::standby(uint8_t mode) { // set RF switch (if present) _mod->setRfSwitchState(Module::MODE_IDLE); - - return(_mod->SPIsetRegValue(RADIOLIB_SI443X_REG_OP_FUNC_CONTROL_1, RADIOLIB_SI443X_XTAL_ON, 7, 0, 10)); + return(_mod->SPIsetRegValue(RADIOLIB_SI443X_REG_OP_FUNC_CONTROL_1, mode, 7, 0, 10)); } int16_t Si443x::transmitDirect(uint32_t frf) { diff --git a/src/modules/Si443x/Si443x.h b/src/modules/Si443x/Si443x.h index 6945e510..454214be 100644 --- a/src/modules/Si443x/Si443x.h +++ b/src/modules/Si443x/Si443x.h @@ -627,12 +627,21 @@ class Si443x: public PhysicalLayer { int16_t sleep(); /*! - \brief Sets the module to standby. + \brief Sets the module to standby (with XTAL on). \returns \ref status_codes */ int16_t standby() override; + /*! + \brief Sets the module to standby. + + \param mode Standby mode to be used. + + \returns \ref status_codes + */ + int16_t standby(uint8_t mode) override; + /*! \brief Enables direct transmission mode. While in direct mode, the module will not be able to transmit or receive packets.