Skip to content

Commit

Permalink
[CC1101] Cleanup private/protected members
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Jan 12, 2024
1 parent 1575e37 commit 3096196
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/modules/CC1101/CC1101.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ CC1101::CC1101(Module* module) : PhysicalLayer(RADIOLIB_CC1101_FREQUENCY_STEP_SI
this->mod = module;
}

Module* CC1101::getMod() {
return(this->mod);
}

int16_t CC1101::begin(float freq, float br, float freqDev, float rxBw, int8_t pwr, uint8_t preambleLength) {
// set module properties
this->mod->SPIreadCommand = RADIOLIB_CC1101_CMD_READ;
Expand Down Expand Up @@ -1050,6 +1046,10 @@ int16_t CC1101::setPacketMode(uint8_t mode, uint16_t len) {
return(state);
}

Module* CC1101::getMod() {
return(this->mod);
}

int16_t CC1101::SPIgetRegValue(uint8_t reg, uint8_t msb, uint8_t lsb) {
// status registers require special command
if((reg > RADIOLIB_CC1101_REG_TEST0) && (reg < RADIOLIB_CC1101_REG_PATABLE)) {
Expand Down
23 changes: 11 additions & 12 deletions src/modules/CC1101/CC1101.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,6 @@ class CC1101: public PhysicalLayer {
*/
CC1101(Module* module);

Module* getMod();

// basic methods

/*!
Expand Down Expand Up @@ -947,21 +945,22 @@ class CC1101: public PhysicalLayer {
#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
protected:
#endif
Module* mod;
Module* getMod();

// SPI read overrides to set bit for burst write and status registers access
int16_t SPIgetRegValue(uint8_t reg, uint8_t msb = 7, uint8_t lsb = 0);
int16_t SPIsetRegValue(uint8_t reg, uint8_t value, uint8_t msb = 7, uint8_t lsb = 0, uint8_t checkInterval = 2);
void SPIreadRegisterBurst(uint8_t reg, uint8_t numBytes, uint8_t* inBytes);
uint8_t SPIreadRegister(uint8_t reg);
void SPIwriteRegisterBurst(uint8_t reg, uint8_t* data, size_t len);
void SPIwriteRegister(uint8_t reg, uint8_t data);
// SPI read overrides to set bit for burst write and status registers access
int16_t SPIgetRegValue(uint8_t reg, uint8_t msb = 7, uint8_t lsb = 0);
int16_t SPIsetRegValue(uint8_t reg, uint8_t value, uint8_t msb = 7, uint8_t lsb = 0, uint8_t checkInterval = 2);
void SPIreadRegisterBurst(uint8_t reg, uint8_t numBytes, uint8_t* inBytes);
uint8_t SPIreadRegister(uint8_t reg);
void SPIwriteRegisterBurst(uint8_t reg, uint8_t* data, size_t len);
void SPIwriteRegister(uint8_t reg, uint8_t data);

void SPIsendCommand(uint8_t cmd);
void SPIsendCommand(uint8_t cmd);

#if !RADIOLIB_GODMODE
protected:
private:
#endif
Module* mod;

float frequency = RADIOLIB_CC1101_DEFAULT_FREQ;
float bitRate = RADIOLIB_CC1101_DEFAULT_BR;
Expand Down

0 comments on commit 3096196

Please sign in to comment.