Also implement LR11x10 AGC reset
Similar to SX126x but simpler.
This commit is contained in:
committed by
Wessel Nieboer
parent
cb2ebbf2f8
commit
b90da8e1c0
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
#include "CustomLR1110.h"
|
#include "CustomLR1110.h"
|
||||||
#include "RadioLibWrappers.h"
|
#include "RadioLibWrappers.h"
|
||||||
|
#include "LR11x0Reset.h"
|
||||||
|
|
||||||
class CustomLR1110Wrapper : public RadioLibWrapper {
|
class CustomLR1110Wrapper : public RadioLibWrapper {
|
||||||
public:
|
public:
|
||||||
CustomLR1110Wrapper(CustomLR1110& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { }
|
CustomLR1110Wrapper(CustomLR1110& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { }
|
||||||
|
void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio); }
|
||||||
bool isReceivingPacket() override {
|
bool isReceivingPacket() override {
|
||||||
return ((CustomLR1110 *)_radio)->isReceiving();
|
return ((CustomLR1110 *)_radio)->isReceiving();
|
||||||
}
|
}
|
||||||
|
|||||||
17
src/helpers/radiolib/LR11x0Reset.h
Normal file
17
src/helpers/radiolib/LR11x0Reset.h
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <RadioLib.h>
|
||||||
|
|
||||||
|
// Full receiver reset for LR11x0-family chips (LR1110, LR1120, LR1121).
|
||||||
|
// Warm sleep powers down analog, calibrate(0x3F) refreshes all calibration blocks,
|
||||||
|
// then re-applies RX settings that calibration may reset.
|
||||||
|
inline void lr11x0ResetAGC(LR11x0* radio) {
|
||||||
|
radio->sleep(true, 0);
|
||||||
|
radio->standby(RADIOLIB_LR11X0_STANDBY_RC, true);
|
||||||
|
|
||||||
|
radio->calibrate(RADIOLIB_LR11X0_CALIBRATE_ALL);
|
||||||
|
|
||||||
|
#ifdef RX_BOOSTED_GAIN
|
||||||
|
radio->setRxBoostedGainMode(RX_BOOSTED_GAIN);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user