From f1f3336e5995b4c76e059c9f84b1ff94c13c2998 Mon Sep 17 00:00:00 2001 From: jgromes Date: Fri, 20 Oct 2023 19:37:44 +0200 Subject: [PATCH] [SX126x] Make setPaConfig public (#852) --- keywords.txt | 1 + src/modules/SX126x/SX126x.h | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/keywords.txt b/keywords.txt index a7d5d12e..73568a89 100644 --- a/keywords.txt +++ b/keywords.txt @@ -222,6 +222,7 @@ spectralScanStart KEYWORD2 spectralScanAbort KEYWORD2 spectralScanGetStatus KEYWORD2 spectralScanGetResult KEYWORD2 +setPaConfig KEYWORD2 # nRF24 setIrqAction KEYWORD2 diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index 21db66eb..13efeadd 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -1070,6 +1070,19 @@ class SX126x: public PhysicalLayer { */ int16_t spectralScanGetResult(uint16_t* results); + /*! + \brief Set the PA configuration. Allows user to optimize PA for a specific output power + and matching network. Any calls to this method must be done after calling begin/beginFSK and/or setOutputPower. + WARNING: Use at your own risk! Setting invalid values can and will lead to permanent damage! + \param paDutyCycle PA duty cycle raw value. + \param deviceSel Device select, usually RADIOLIB_SX126X_PA_CONFIG_SX1261, + RADIOLIB_SX126X_PA_CONFIG_SX1262 or RADIOLIB_SX126X_PA_CONFIG_SX1268. + \param hpMax hpMax raw value. + \param paLut paLut PA lookup table raw value. + \returns \ref status_codes + */ + int16_t setPaConfig(uint8_t paDutyCycle, uint8_t deviceSel, uint8_t hpMax = RADIOLIB_SX126X_PA_CONFIG_HP_MAX, uint8_t paLut = RADIOLIB_SX126X_PA_CONFIG_PA_LUT); + #if !defined(RADIOLIB_GODMODE) protected: #endif