Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PA ramp up time configurable for SX1262 #1054

Closed
wants to merge 13 commits into from
Prev Previous commit
Next Next commit
Update SX1262.cpp
  • Loading branch information
S5NC authored Apr 5, 2024
commit 954e1ff9302890382f9aef68c3db28d950e3baf6
9 changes: 4 additions & 5 deletions src/modules/SX126x/SX1262.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int16_t SX1262::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t sync
state = SX126x::fixPaClamping();
RADIOLIB_ASSERT(state);

state = setOutputPower(power);
state = setOutputPower(power, rampTime);
RADIOLIB_ASSERT(state);

return(state);
Expand Down Expand Up @@ -97,7 +97,7 @@ int16_t SX1262::setFrequency(float freq, bool calibrate) {
return(SX126x::setFrequencyRaw(freq));
}

int16_t SX1262::setOutputPower(int8_t power) {
int16_t SX1262::setOutputPower(int8_t power, uint8_t rampTime) {
RADIOLIB_CHECK_RANGE(power, -9, 22, RADIOLIB_ERR_INVALID_OUTPUT_POWER);

// get current OCP configuration
Expand All @@ -109,9 +109,8 @@ int16_t SX1262::setOutputPower(int8_t power) {
state = SX126x::setPaConfig(0x04, RADIOLIB_SX126X_PA_CONFIG_SX1262);
RADIOLIB_ASSERT(state);

// set output power
/// \todo power ramp time configuration
state = SX126x::setTxParams(power);
// set output power and PA ramp time
state = SX126x::setTxParams(power, rampTime);
RADIOLIB_ASSERT(state);

// restore OCP configuration
Expand Down