[Si443x] Cleanup private/protected members

This commit is contained in:
jgromes 2024-01-12 20:12:45 +01:00
parent 34d80faaf0
commit d31b4836e1
4 changed files with 14 additions and 12 deletions

View file

@ -32,7 +32,8 @@ int16_t Si4430::setOutputPower(int8_t power) {
RADIOLIB_CHECK_RANGE(power, -8, 13, RADIOLIB_ERR_INVALID_OUTPUT_POWER);
// set output power
return(this->mod->SPIsetRegValue(RADIOLIB_SI443X_REG_TX_POWER, (uint8_t)((power + 8) / 3), 2, 0));
Module* mod = this->getMod();
return(mod->SPIsetRegValue(RADIOLIB_SI443X_REG_TX_POWER, (uint8_t)((power + 8) / 3), 2, 0));
}
#endif

View file

@ -25,7 +25,8 @@ int16_t Si4431::setOutputPower(int8_t power) {
RADIOLIB_CHECK_RANGE(power, -8, 13, RADIOLIB_ERR_INVALID_OUTPUT_POWER);
// set output power
return(this->mod->SPIsetRegValue(RADIOLIB_SI443X_REG_TX_POWER, (uint8_t)((power + 8) / 3), 2, 0));
Module* mod = this->getMod();
return(mod->SPIsetRegValue(RADIOLIB_SI443X_REG_TX_POWER, (uint8_t)((power + 8) / 3), 2, 0));
}
#endif

View file

@ -32,7 +32,8 @@ int16_t Si4432::setOutputPower(int8_t power) {
RADIOLIB_CHECK_RANGE(power, -1, 20, RADIOLIB_ERR_INVALID_OUTPUT_POWER);
// set output power
return(this->mod->SPIsetRegValue(RADIOLIB_SI443X_REG_TX_POWER, (uint8_t)((power + 1) / 3), 2, 0));
Module* mod = this->getMod();
return(mod->SPIsetRegValue(RADIOLIB_SI443X_REG_TX_POWER, (uint8_t)((power + 1) / 3), 2, 0));
}
#endif

View file

@ -566,8 +566,6 @@ class Si443x: public PhysicalLayer {
*/
Si443x(Module* mod);
Module* getMod();
// basic methods
/*!
@ -828,11 +826,17 @@ class Si443x: public PhysicalLayer {
#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
protected:
#endif
Module* mod;
Module* getMod();
#if !RADIOLIB_GODMODE
protected:
#endif
int16_t setFrequencyRaw(float newFreq);
#if !RADIOLIB_GODMODE
private:
#endif
Module* mod;
float bitRate = 0;
float frequencyDev = 0;
@ -842,18 +846,13 @@ class Si443x: public PhysicalLayer {
bool packetLengthQueried = false;
uint8_t packetLengthConfig = RADIOLIB_SI443X_FIXED_PACKET_LENGTH_ON;
int16_t setFrequencyRaw(float newFreq);
int16_t setPacketMode(uint8_t mode, uint8_t len);
#if !RADIOLIB_GODMODE
private:
#endif
bool findChip();
void clearIRQFlags();
void clearFIFO(size_t count);
int16_t config();
int16_t updateClockRecovery();
int16_t directMode();
int16_t setPacketMode(uint8_t mode, uint8_t len);
};
#endif