[SX126x] Added setModem implementation

This commit is contained in:
jgromes 2024-10-25 20:49:50 +01:00
parent 0fd4bc493b
commit e5d280718c
4 changed files with 46 additions and 0 deletions

View file

@ -145,4 +145,19 @@ int16_t SX1262::checkOutputPower(int8_t power, int8_t* clipped) {
return(RADIOLIB_ERR_NONE);
}
int16_t SX1262::setModem(ModemType_t modem) {
switch(modem) {
case(ModemType_t::LoRa): {
return(this->begin());
} break;
case(ModemType_t::FSK): {
return(this->beginFSK());
} break;
case(ModemType_t::LRFHSS): {
return(this->beginLRFHSS());
} break;
}
return(RADIOLIB_ERR_WRONG_MODEM);
}
#endif

View file

@ -110,6 +110,14 @@ class SX1262: public SX126x {
*/
int16_t checkOutputPower(int8_t power, int8_t* clipped) override;
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
\param modem Modem type to set - FSK, LoRa or LR-FHSS.
\returns \ref status_codes
*/
int16_t setModem(ModemType_t modem) override;
#if !RADIOLIB_GODMODE
private:
#endif

View file

@ -140,4 +140,19 @@ int16_t SX1268::checkOutputPower(int8_t power, int8_t* clipped) {
return(RADIOLIB_ERR_NONE);
}
int16_t SX1268::setModem(ModemType_t modem) {
switch(modem) {
case(ModemType_t::LoRa): {
return(this->begin());
} break;
case(ModemType_t::FSK): {
return(this->beginFSK());
} break;
case(ModemType_t::LRFHSS): {
return(this->beginLRFHSS());
} break;
}
return(RADIOLIB_ERR_WRONG_MODEM);
}
#endif

View file

@ -108,6 +108,14 @@ class SX1268: public SX126x {
*/
int16_t checkOutputPower(int8_t power, int8_t* clipped) override;
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
\param modem Modem type to set - FSK, LoRa or LR-FHSS.
\returns \ref status_codes
*/
int16_t setModem(ModemType_t modem) override;
#if !RADIOLIB_GODMODE
private:
#endif