SetPowerLevel() fix & ATC refactoring

Fixes #61
This commit is contained in:
Felix Rusu 2021-08-30 16:52:42 -04:00
parent dc18675cd8
commit b4f3f11b90
4 changed files with 123 additions and 154 deletions

130
RFM69.cpp
View File

@ -38,14 +38,13 @@ uint8_t RFM69::ACK_RECEIVED; // should be polled immediately after sending a pac
int16_t RFM69::RSSI; // most accurate RSSI during reception (closest to the reception)
volatile bool RFM69::_haveData;
RFM69::RFM69(uint8_t slaveSelectPin, uint8_t interruptPin, bool isRFM69HW, SPIClass *spi)
{
RFM69::RFM69(uint8_t slaveSelectPin, uint8_t interruptPin, bool isRFM69HW_HCW, SPIClass *spi) {
_slaveSelectPin = slaveSelectPin;
_interruptPin = interruptPin;
_mode = RF69_MODE_STANDBY;
_spyMode = false;
_powerLevel = 31;
_isRFM69HW = isRFM69HW;
_isRFM69HW = isRFM69HW_HCW;
_spi = spi;
#if defined(RF69_LISTENMODE_ENABLE)
_isHighSpeed = true;
@ -101,7 +100,7 @@ bool RFM69::initialize(uint8_t freqBand, uint16_t nodeID, uint8_t networkID)
/* 0x38 */ { REG_PAYLOADLENGTH, 66 }, // in variable length mode: the max frame size, not used in TX
///* 0x39 */ { REG_NODEADRS, nodeID }, // turned off because we're not using address filtering
/* 0x3C */ { REG_FIFOTHRESH, RF_FIFOTHRESH_TXSTART_FIFONOTEMPTY | RF_FIFOTHRESH_VALUE }, // TX on FIFO not empty
/* 0x3D */ { REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_2BITS | RF_PACKET2_AUTORXRESTART_ON | RF_PACKET2_AES_OFF }, // RXRESTARTDELAY must match transmitter PA ramp-down time (bitrate dependent)
/* 0x3D */ { REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_2BITS | RF_PACKET2_AUTORXRESTART_OFF | RF_PACKET2_AES_OFF }, // RXRESTARTDELAY must match transmitter PA ramp-down time (bitrate dependent)
//for BR-19200: /* 0x3D */ { REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_NONE | RF_PACKET2_AUTORXRESTART_ON | RF_PACKET2_AES_OFF }, // RXRESTARTDELAY must match transmitter PA ramp-down time (bitrate dependent)
/* 0x6F */ { REG_TESTDAGC, RF_DAGC_IMPROVED_LOWBETA0 }, // run DAGC continuously in RX mode for Fading Margin Improvement, recommended default for AfcLowBetaOn=0
{255, 0}
@ -136,7 +135,7 @@ bool RFM69::initialize(uint8_t freqBand, uint16_t nodeID, uint8_t networkID)
// Disable it during initialization so we always start from a known state.
encrypt(0);
setHighPower(_isRFM69HW); // called regardless if it's a RFM69W or RFM69HW
setHighPower(_isRFM69HW); // called regardless if it's a RFM69W or RFM69HW (at this point _isRFM69HW may not be explicitly set by constructor and setHighPower() may not have been called yet (ie called after initialize() call)
setMode(RF69_MODE_STANDBY);
start = millis();
while (((readReg(REG_IRQFLAGS1) & RF_IRQFLAGS1_MODEREADY) == 0x00) && millis()-start < timeout); // wait for ModeReady
@ -228,26 +227,72 @@ void RFM69::setNetwork(uint8_t networkID)
writeReg(REG_SYNCVALUE2, networkID);
}
// set *transmit/TX* output power: 0=min, 31=max
// this results in a "weaker" transmitted signal, and directly results in a lower RSSI at the receiver
// Control transmitter output power (this is NOT a dBm value!)
// the power configurations are explained in the SX1231H datasheet (Table 10 on p21; RegPaLevel p66): http://www.semtech.com/images/datasheet/sx1231h.pdf
// valid powerLevel parameter values are 0-31 and result in a directly proportional effect on the output/transmission power
// this function implements 2 modes as follows:
// - for RFM69W the range is from 0-31 [-18dBm to 13dBm] (PA0 only on RFIO pin)
// - for RFM69HW the range is from 0-31 [5dBm to 20dBm] (PA1 & PA2 on PA_BOOST pin & high Power PA settings - see section 3.3.7 in datasheet, p22)
void RFM69::setPowerLevel(uint8_t powerLevel)
{
_powerLevel = (powerLevel > 31 ? 31 : powerLevel);
if (_isRFM69HW) _powerLevel /= 2;
writeReg(REG_PALEVEL, (readReg(REG_PALEVEL) & 0xE0) | _powerLevel);
// - for RFM69 W/CW the range is from 0-31 [-18dBm to 13dBm] (PA0 only on RFIO pin)
// - for RFM69 HW/HCW the range is from 0-22 [-2dBm to 20dBm] (PA1 & PA2 on PA_BOOST pin & high Power PA settings - see section 3.3.7 in datasheet, p22)
// - the HW/HCW 0-24 range is split into 3 REG_PALEVEL parts:
// - 0-15 = REG_PALEVEL 16-31, ie [-2 to 13dBm] & PA1 only
// - 16-19 = REG_PALEVEL 26-29, ie [12 to 15dBm] & PA1+PA2
// - 20-23 = REG_PALEVEL 28-31, ie [17 to 20dBm] & PA1+PA2+HiPower (HiPower is only enabled before going in TX mode, ie by setMode(RF69_MODE_TX)
// The HW/HCW range overlaps are to smooth out transitions between the 3 PA domains, based on actual current/RSSI measurements
// Any changes to this function also demand changes in dependent function setPowerDBm()
void RFM69::setPowerLevel(uint8_t powerLevel) {
uint8_t PA_SETTING;
if (_isRFM69HW) {
if (powerLevel>23) powerLevel = 23;
_powerLevel = powerLevel;
//now set Pout value & active PAs based on _powerLevel range as outlined in summary above
if (_powerLevel < 16) {
powerLevel += 16;
PA_SETTING = RF_PALEVEL_PA1_ON; // enable PA1 only
} else {
if (_powerLevel < 20)
powerLevel += 10;
else
powerLevel += 8;
PA_SETTING = RF_PALEVEL_PA1_ON | RF_PALEVEL_PA2_ON; // enable PA1+PA2
}
setHighPowerRegs(true); //always call this in case we're crossing power boundaries in TX mode
} else { //this is a W/CW, register value is the same as _powerLevel
if (powerLevel>31) powerLevel = 31;
_powerLevel = powerLevel;
PA_SETTING = RF_PALEVEL_PA0_ON; // enable PA0 only
}
//write value to REG_PALEVEL
writeReg(REG_PALEVEL, PA_SETTING | powerLevel);
}
uint8_t RFM69::getPowerLevel() // get powerLevel
{
// return stored _powerLevel
uint8_t RFM69::getPowerLevel() {
return _powerLevel;
}
bool RFM69::canSend()
//Set TX Output power in dBm:
// [-18..+13]dBm in RFM69 W/CW
// [ -2..+20]dBm in RFM69 HW/HCW
int8_t RFM69::setPowerDBm(int8_t dBm) {
if (_isRFM69HW) {
//fix any out of bounds
if (dBm<-2) dBm=-2;
else if (dBm>20) dBm=20;
//map dBm to _powerLevel according to implementation in setPowerLevel()
if (dBm<17) setPowerLevel(2+dBm);
//else if (dBm<16) setPowerLevel(4+dBm);
else setPowerLevel(3+dBm);
} else { //W/CW
if (dBm<-18) dBm=-18;
else if (dBm>13) dBm=13;
}
return dBm;
}
bool RFM69::canSend()
{
if (_mode == RF69_MODE_RX && PAYLOADLEN == 0 && readRSSI() < CSMA_LIMIT) // if signal stronger than -100dBm is detected assume channel activity
{
@ -376,13 +421,15 @@ void RFM69::interruptHandler() {
DATALEN = PAYLOADLEN - 3;
ACK_RECEIVED = CTLbyte & RFM69_CTL_SENDACK; // extract ACK-received flag
ACK_REQUESTED = CTLbyte & RFM69_CTL_REQACK; // extract ACK-requested flag
interruptHook(CTLbyte); // TWS: hook to derived class interrupt function
uint8_t _pl = _powerLevel; //interruptHook() can change _powerLevel so remember it
interruptHook(CTLbyte); // TWS: hook to derived class interrupt function
for (uint8_t i = 0; i < DATALEN; i++) DATA[i] = _spi->transfer(0);
DATA[DATALEN] = 0; // add null at end of string // add null at end of string
unselect();
setMode(RF69_MODE_RX);
if (_pl != _powerLevel) setPowerLevel(_powerLevel); //set new _powerLevel if changed
}
RSSI = readRSSI();
}
@ -526,20 +573,20 @@ void RFM69::spyMode(bool onOff) {
//writeReg(REG_PACKETCONFIG1, (readReg(REG_PACKETCONFIG1) & 0xF9) | (onOff ? RF_PACKET1_ADRSFILTERING_OFF : RF_PACKET1_ADRSFILTERING_NODEBROADCAST));
}
// for RFM69HW only: you must call setHighPower(true) after initialize() or else transmission won't work
void RFM69::setHighPower(bool onOff) {
_isRFM69HW = onOff;
writeReg(REG_OCP, _isRFM69HW ? RF_OCP_OFF : RF_OCP_ON);
if (_isRFM69HW) // turning ON
writeReg(REG_PALEVEL, (readReg(REG_PALEVEL) & 0x1F) | RF_PALEVEL_PA1_ON | RF_PALEVEL_PA2_ON); // enable P1 & P2 amplifier stages
else
writeReg(REG_PALEVEL, RF_PALEVEL_PA0_ON | RF_PALEVEL_PA1_OFF | RF_PALEVEL_PA2_OFF | _powerLevel); // enable P0 only
// for RFM69 HW/HCW only: you must call setHighPower(true) after initialize() or else transmission won't work
void RFM69::setHighPower(bool _isRFM69HW_HCW) {
_isRFM69HW = _isRFM69HW_HCW;
writeReg(REG_OCP, _isRFM69HW ? RF_OCP_OFF : RF_OCP_ON); //disable OverCurrentProtection for HW/HCW
setPowerLevel(_powerLevel);
}
// internal function
void RFM69::setHighPowerRegs(bool onOff) {
writeReg(REG_TESTPA1, onOff ? 0x5D : 0x55);
writeReg(REG_TESTPA2, onOff ? 0x7C : 0x70);
// internal function - for HW/HCW only:
// enables HiPower for 18-20dBm output
// should only be used with PA1+PA2
void RFM69::setHighPowerRegs(bool enable) {
if (!_isRFM69HW || _powerLevel<20) enable=false;
writeReg(REG_TESTPA1, enable ? 0x5D : 0x55);
writeReg(REG_TESTPA2, enable ? 0x7C : 0x70);
}
// set the slave select (CS) pin
@ -903,6 +950,27 @@ void RFM69::set300KBPS() {
// ** DC: 00 none, 01 manchester, 10, whitening
}
//=============================================================================
// setLNA() - disable the AGC and set a manual gain to attenuate input signal
// Makes receiver hear a "weaker" signal.
// Use this function to simulate a receiver "distance" from a transmitter
// newReg should be: (see table 26 RegLna 0x18 values)
// 000 - gain set by the internal AGC loop (when bits
// 001 - G1 = highest gain
// 010 - G2 = highest gain 6 dB
// 011 - G3 = highest gain 12 dB
// 100 - G4 = highest gain 24 dB
// 101 - G5 = highest gain 36 dB
// 110 - G6 = highest gain 48 dB
// 111 - reserved
//=============================================================================
uint8_t RFM69::setLNA(uint8_t newReg) {
byte oldReg;
oldReg = readReg(REG_LNA);
writeReg(REG_LNA, ((newReg & 7) | (oldReg & ~7))); // just control the LNA Gain bits for now
return oldReg; // return the original value in case we need to restore it
}
// ListenMode sleep/timer - see ListenModeSleep example for proper usage!
void RFM69::listenModeSleep(uint16_t millisInterval)
{
@ -1237,4 +1305,4 @@ void RFM69::listenModeSendBurst( uint8_t targetNode, const void* buffer, uint8_t
setMode(RF69_MODE_STANDBY);
reinitRadio();
}
#endif
#endif

22
RFM69.h
View File

@ -198,7 +198,7 @@ class RFM69 {
RFM69(uint8_t slaveSelectPin, uint8_t interruptPin, bool isRFM69HW, uint8_t interruptNum __attribute__((unused))) //interruptNum is now deprecated
: RFM69(slaveSelectPin, interruptPin, isRFM69HW){};
RFM69(uint8_t slaveSelectPin=RF69_SPI_CS, uint8_t interruptPin=RF69_IRQ_PIN, bool isRFM69HW=false, SPIClass *spi=nullptr);
RFM69(uint8_t slaveSelectPin=RF69_SPI_CS, uint8_t interruptPin=RF69_IRQ_PIN, bool isRFM69HW_HCW=false, SPIClass *spi=nullptr);
bool initialize(uint8_t freqBand, uint16_t ID, uint8_t networkID=1);
void setAddress(uint16_t addr);
@ -218,13 +218,16 @@ class RFM69 {
int16_t readRSSI(bool forceTrigger=false); // *current* signal strength indicator; e.g. < -90dBm says the frequency channel is free + ready to transmit
void spyMode(bool onOff=true);
//void promiscuous(bool onOff=true); //replaced with spyMode()
virtual void setHighPower(bool onOFF=true); // has to be called after initialize() for RFM69HW
virtual void setHighPower(bool _isRFM69HW_HCW=true); // has to be called after initialize() for RFM69 HW/HCW
virtual void setPowerLevel(uint8_t level); // reduce/increase transmit power level
uint8_t getPowerLevel(); // get powerLevel
virtual int8_t setPowerDBm(int8_t dBm); // reduce/increase transmit power level, in dBm
virtual uint8_t getPowerLevel(); // get powerLevel
void sleep();
uint8_t readTemperature(uint8_t calFactor=0); // get CMOS temperature (8bit)
void rcCalibration(); // calibrate the internal RC oscillator for use in wide temperature variations - see datasheet section [4.3.5. RC Timer Accuracy]
void set300KBPS();
uint8_t setLNA(uint8_t newReg);
// allow hacking registers by making these public
uint8_t readReg(uint8_t addr);
@ -235,6 +238,9 @@ class RFM69 {
// ListenMode sleep/timer
void listenModeSleep(uint16_t millisInterval);
void endListenModeSleep();
virtual void setMode(uint8_t mode);
virtual void select();
virtual void unselect();
protected:
static void isr0();
@ -245,7 +251,7 @@ class RFM69 {
// for ListenMode sleep/timer
static void delayIrq();
uint8_t _slaveSelectPin;
uint8_t _interruptPin;
uint8_t _interruptNum;
@ -263,10 +269,10 @@ class RFM69 {
#endif
virtual void receiveBegin();
virtual void setMode(uint8_t mode);
virtual void setHighPowerRegs(bool onOff);
virtual void select();
virtual void unselect();
//virtual void setMode(uint8_t mode);
virtual void setHighPowerRegs(bool enable);
//virtual void select();
//virtual void unselect();
#if defined(RF69_LISTENMODE_ENABLE)
static RFM69* selfPointer;

View File

@ -40,27 +40,10 @@ bool RFM69_ATC::initialize(uint8_t freqBand, uint16_t nodeID, uint8_t networkID)
_targetRSSI = 0; // TomWS1: default to disabled
_ackRSSI = 0; // TomWS1: no existing response at init time
ACK_RSSI_REQUESTED = 0; // TomWS1: init to none
//_powerBoost = false; // TomWS1: require someone to explicitly turn boost on!
_transmitLevel = 31; // TomWS1: match default value in PA Level register
_transmitLevelStep = 1; //increment 1 step at a time by default
return RFM69::initialize(freqBand, nodeID, networkID); // use base class to initialize most everything
}
//=============================================================================
// setMode() - got to set updated transmit power level before switching to TX mode
//=============================================================================
void RFM69_ATC::setMode(uint8_t newMode) {
if (newMode == _mode) return;
//_powerBoost = (_transmitLevel >= 50); // this needs to be set before changing mode just in case setHighPowerRegs is called
RFM69::setMode(newMode); // call base class first
if (newMode == RF69_MODE_TX) // special stuff if switching to TX mode
{
if (_targetRSSI) setPowerLevel(_transmitLevel); // TomWS1: apply most recent transmit level if auto power
//if (_isRFM69HW) setHighPowerRegs(true);
}
}
//=============================================================================
// sendAck() - updated to call new sendFrame with additional parameters
//=============================================================================
@ -145,18 +128,12 @@ void RFM69_ATC::interruptHook(uint8_t CTLbyte) {
DATALEN -= 1; // and compensate data length accordingly
// TomWS1: Now dither transmitLevel value (register update occurs later when transmitting);
if (_targetRSSI != 0) {
// if (_isRFM69HW) {
// if (_ackRSSI < _targetRSSI && _transmitLevel < 51) _transmitLevel++;
// else if (_ackRSSI > _targetRSSI && _transmitLevel > 32) _transmitLevel--;
// } else {
if (_ackRSSI < _targetRSSI && _transmitLevel < 31)
{
_transmitLevel += _transmitLevelStep;
if (_transmitLevel > 31) _transmitLevel = 31;
uint8_t maxLevel = _isRFM69HW ? 23 : 31;
if (_ackRSSI < _targetRSSI && _powerLevel < maxLevel) {
_powerLevel += _transmitLevelStep;
}
else if (_ackRSSI > _targetRSSI && _transmitLevel > 0)
_transmitLevel--;
//}
else if (_ackRSSI > _targetRSSI && _powerLevel > 0)
_powerLevel--;
}
}
}
@ -167,15 +144,14 @@ void RFM69_ATC::interruptHook(uint8_t CTLbyte) {
//=============================================================================
bool RFM69_ATC::sendWithRetry(uint16_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries, uint8_t retryWaitTime) {
uint32_t sentTime;
for (uint8_t i = 0; i <= retries; i++)
{
for (uint8_t i = 0; i <= retries; i++) {
send(toAddress, buffer, bufferSize, true);
sentTime = millis();
uint8_t maxLevel = _isRFM69HW ? 23 : 31;
while (millis() - sentTime < retryWaitTime)
if (ACKReceived(toAddress)) return true;
if (_transmitLevel < 31) {
_transmitLevel += _transmitLevelStep;
if (_transmitLevel > 31) _transmitLevel = 31;
if (_powerLevel < maxLevel) {
setPowerLevel(_powerLevel + _transmitLevelStep);
}
}
@ -190,70 +166,6 @@ void RFM69_ATC::receiveBegin() {
RFM69::receiveBegin();
}
//=============================================================================
// setPowerLevel() - outright replacement for base class. Provides finer granularity for RFM69HW.
//=============================================================================
// set output power: 0=min, 31=max (for RFM69W or RFM69CW), 0-31 or 32->51 for RFM69HW (see below)
// this results in a "weaker" transmitted signal, and directly results in a lower RSSI at the receiver
// allows power level selections above 31 (as in original base RFM69 lib) & selects appropriate PA based on the value
// more discussion and details in this forum post: https://lowpowerlab.com/forum/index.php/topic,688.0.html
// void RFM69_ATC::setPowerLevel(uint8_t powerLevel) {
// _transmitLevel = powerLevel; // save this for later in case we do auto power control.
// _powerBoost = (powerLevel >= 50);
// if (!_isRFM69HW || powerLevel < 32) { // use original code without change
// _powerLevel = powerLevel;
// writeReg(REG_PALEVEL, (readReg(REG_PALEVEL) & 0xE0) | (_powerLevel > 31 ? 31 : _powerLevel));
// } else {
// // the allowable range of power level value, if >31 is: 32 -> 51, where...
// // 32->47 use PA2 only and sets powerLevel register 0-15,
// // 48->49 uses both PAs, and sets powerLevel register 14-15,
// // 50->51 uses both PAs, sets powerBoost, and sets powerLevel register 14-15.
// if (powerLevel < 48) {
// _powerLevel = powerLevel & 0x0f; // just use 4 lower bits when in high power mode
// _PA_Reg = 0x20;
// } else {
// _PA_Reg = 0x60;
// if (powerLevel < 50) {
// _powerLevel = powerLevel - 34; // leaves 14-15
// } else {
// if (powerLevel > 51)
// powerLevel = 51; // saturate
// _powerLevel = powerLevel - 36; // leaves 14-15
// }
// }
// writeReg(REG_OCP, (_PA_Reg==0x60) ? RF_OCP_OFF : RF_OCP_ON);
// writeReg(REG_PALEVEL, _powerLevel | _PA_Reg);
// }
// }
//=============================================================================
// setHighPower() - only set High power bits on RFM69HW IFF the power level is set to MAX. Otherwise it is kept off.
//=============================================================================
// void RFM69_ATC::setHighPower(bool onOff, byte PA_ctl) {
// _isRFM69HW = onOff;
// writeReg(REG_OCP, (_isRFM69HW && PA_ctl==0x60) ? RF_OCP_OFF : RF_OCP_ON);
// if (_isRFM69HW) { //turning ON based on module type
// _powerLevel = readReg(REG_PALEVEL) & 0x1F; // make sure internal value matches reg
// _powerBoost = (PA_ctl == 0x60);
// _PA_Reg = PA_ctl;
// writeReg(REG_PALEVEL, _powerLevel | PA_ctl ); //TomWS1: enable selected P1 & P2 amplifier stages
// }
// else {
// _PA_Reg = RF_PALEVEL_PA0_ON; // TomWS1: save to reflect register value
// writeReg(REG_PALEVEL, RF_PALEVEL_PA0_ON | RF_PALEVEL_PA1_OFF | RF_PALEVEL_PA2_OFF | _powerLevel); //enable P0 only
// }
// }
//=============================================================================
// ditto from above.
//=============================================================================
// void RFM69_ATC::setHighPowerRegs(bool onOff) {
// if ((0x60 != (readReg(REG_PALEVEL) & 0xe0)) || !_powerBoost) // TomWS1: only set to high power if we are using both PAs... and boost range is requested.
// onOff = false;
// writeReg(REG_TESTPA1, onOff ? 0x5D : 0x55);
// writeReg(REG_TESTPA2, onOff ? 0x7C : 0x70);
// }
//=============================================================================
// enableAutoPower() - call with target RSSI, use 0 to disable (default), any other value with turn on autotransmit control.
//=============================================================================
@ -267,14 +179,4 @@ void RFM69_ATC::enableAutoPower(int16_t targetRSSI){ // TomWS1: New method t
//=============================================================================
int16_t RFM69_ATC::getAckRSSI(void){ // TomWS1: New method to retrieve the ack'd RSSI (if any)
return (_targetRSSI==0?0:_ackRSSI);
}
//=============================================================================
// setLNA() - used for power level testing.
//=============================================================================
byte RFM69_ATC::setLNA(byte newReg) { // TomWS1: New method used to disable LNA AGC for testing purposes
byte oldReg;
oldReg = readReg(REG_LNA);
writeReg(REG_LNA, ((newReg & 7) | (oldReg & ~7))); // just control the LNA Gain bits for now
return oldReg; // return the original value in case we need to restore it
}
}

View File

@ -42,16 +42,11 @@ class RFM69_ATC: public RFM69 {
bool initialize(uint8_t freqBand, uint16_t ID, uint8_t networkID=1);
void sendACK(const void* buffer = "", uint8_t bufferSize=0);
//void setHighPower(bool onOFF=true, uint8_t PA_ctl=0x60); //have to call it after initialize for RFM69HW
//void setPowerLevel(uint8_t level); // reduce/increase transmit power level
bool sendWithRetry(uint16_t toAddress, const void* buffer, uint8_t bufferSize, uint8_t retries=2, uint8_t retryWaitTime=RFM69_ACK_TIMEOUT);
void enableAutoPower(int16_t targetRSSI=-90); // TWS: New method to enable/disable auto Power control
void setMode(uint8_t mode); // TWS: moved from protected to try to build block()/unblock() wrapper
int16_t getAckRSSI(void); // TWS: New method to retrieve the ack'd RSSI (if any)
uint8_t setLNA(uint8_t newReg); // TWS: function to control LNA reg for power testing purposes
int16_t _targetRSSI; // if non-zero then this is the desired end point RSSI for our transmission
uint8_t _transmitLevel; // saved powerLevel in case we do auto power adjustment, this value gets dithered
uint8_t _transmitLevelStep; // saved powerLevel in case we do auto power adjustment, this value gets dithered
protected:
@ -59,10 +54,8 @@ class RFM69_ATC: public RFM69 {
void sendFrame(uint16_t toAddress, const void* buffer, uint8_t size, bool requestACK=false, bool sendACK=false); // Need this one to match the RFM69 prototype.
void sendFrame(uint16_t toAddress, const void* buffer, uint8_t size, bool requestACK, bool sendACK, bool sendRSSI, int16_t lastRSSI);
void receiveBegin();
//void setHighPowerRegs(bool onOff);
int16_t _ackRSSI; // this contains the RSSI our destination Ack'd back to us (if we enabledAutoPower)
//bool _powerBoost; // this controls whether we need to turn on the highpower regs based on the setPowerLevel input
uint8_t _PA_Reg; // saved and derived PA control bits so we don't have to spend time reading back from SPI port
};