[SX126x] Added option to select standby mode (#1008)

pull/1014/head
jgromes 2024-03-12 21:52:17 +01:00
rodzic 24ffbfc284
commit b288485d6c
2 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -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) {

Wyświetl plik

@ -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
/*!