sx126x-rx-boosted-gain: add support for setting Rx gain mode on SX126x chipsets

This commit is contained in:
Andrew Moroz
2023-01-16 23:35:56 -05:00
parent cc0cccbd1b
commit 0a2539650e
3 changed files with 11 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
#include "configuration.h"
#include "SX126xInterface.h"
#include "mesh/NodeDB.h"
#include "error.h"
// Particular boards might define a different max power based on what their hardware can do
@@ -73,6 +74,14 @@ bool SX126xInterface<T>::init()
res = lora.setDio2AsRfSwitch(true);
#endif
if (config.lora.sx126x_rx_boosted_gain) {
uint16_t result = lora.setRxBoostedGainMode(true);
LOG_INFO("Set Rx Boosted Gain mode; result: %d\n", result);
} else {
uint16_t result = lora.setRxBoostedGainMode(false);
LOG_INFO("Set Rx Power Saving Gain mode; result: %d\n", result);
}
#if 0
// Read/write a register we are not using (only used for FSK mode) to test SPI comms
uint8_t crcLSB = 0;