[SX126x] Added option to select standby mode (#1008)
This commit is contained in:
parent
24ffbfc284
commit
b288485d6c
2 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
|||
SX126x::SX126x(Module* mod) : PhysicalLayer(RADIOLIB_SX126X_FREQUENCY_STEP_SIZE, RADIOLIB_SX126X_MAX_PACKET_LENGTH) {
|
||||
this->mod = mod;
|
||||
this->XTAL = false;
|
||||
this->standbyXOSC = false;
|
||||
}
|
||||
|
||||
int16_t SX126x::begin(uint8_t cr, uint8_t syncWord, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) {
|
||||
|
@ -463,7 +464,7 @@ int16_t SX126x::sleep(bool retainConfig) {
|
|||
}
|
||||
|
||||
int16_t SX126x::standby() {
|
||||
return(SX126x::standby(RADIOLIB_SX126X_STANDBY_RC));
|
||||
return(SX126x::standby(this->standbyXOSC ? RADIOLIB_SX126X_STANDBY_XOSC : RADIOLIB_SX126X_STANDBY_RC));
|
||||
}
|
||||
|
||||
int16_t SX126x::standby(uint8_t mode, bool wakeup) {
|
||||
|
|
|
@ -447,6 +447,11 @@ class SX126x: public PhysicalLayer {
|
|||
*/
|
||||
bool XTAL;
|
||||
|
||||
/*!
|
||||
\brief Whether to use XOSC (true) or RC (false) oscillator in standby mode. Defaults to false.
|
||||
*/
|
||||
bool standbyXOSC;
|
||||
|
||||
// basic methods
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Add table
Reference in a new issue