Skip to content

Add optimal PA settings for LLCC68 #19

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void setup() {
Serial.println("Set frequency to 915 Mhz");
LoRa.setFrequency(915000000);

// Set TX power, default power for SX1262 and SX1268 are +22 dBm and for SX1261 is +14 dBm
// Set TX power, default power for SX1262, SX1268 and LLCC68 are +22 dBm and for SX1261 is +14 dBm
// This function will set PA config with optimal setting for requested TX power
Serial.println("Set TX power to +17 dBm");
LoRa.setTxPower(17, SX126X_TX_POWER_SX1262); // TX power +17 dBm for SX1262
Expand Down
1 change: 1 addition & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ SX126X_FSK_MODEM LITERAL1
SX126X_LORA_MODEM LITERAL1
SX126X_TX_POWER_SX1261 LITERAL1
SX126X_TX_POWER_SX1262 LITERAL1
SX126X_TX_POWER_LLCC68 LITERAL1
SX126X_TX_POWER_SX1268 LITERAL1
SX126X_RX_GAIN_POWER_SAVING LITERAL1
SX126X_RX_GAIN_BOOSTED LITERAL1
Expand Down
4 changes: 2 additions & 2 deletions src/SX126x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void SX126x::setTxPower(uint8_t txPower, uint8_t version)
paDutyCycle = 0x04;
hpMax = 0x00;
power = 0x0E;
} else if (txPower >= 14 && version == SX126X_TX_POWER_SX1262) {
} else if (txPower >= 14 && (version == SX126X_TX_POWER_SX1262 || version == SX126X_TX_POWER_LLCC68)) {
paDutyCycle = 0x02;
hpMax = 0x02;
power = 0x16;
Expand All @@ -250,7 +250,7 @@ void SX126x::setTxPower(uint8_t txPower, uint8_t version)
paDutyCycle = 0x01;
hpMax = 0x00;
power = 0x0D;
} else if (txPower >= 10 && version == SX126X_TX_POWER_SX1268) {
} else if (txPower >= 10 && (version == SX126X_TX_POWER_SX1268 || version == SX126X_TX_POWER_LLCC68)) {
paDutyCycle = 0x00;
hpMax = 0x03;
power = 0x0F;
Expand Down
1 change: 1 addition & 0 deletions src/SX126x_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
// SetPaConfig
#define SX126X_TX_POWER_SX1261 0x01 // device version for TX power: SX1261
#define SX126X_TX_POWER_SX1262 0x02 // : SX1262
#define SX126X_TX_POWER_LLCC68 0x06 // : LLCC68
#define SX126X_TX_POWER_SX1268 0x08 // : SX1268

// SetRxTxFallbackMode
Expand Down