[SX126x] Added option to control XTAL/TCXO via member variable
This commit is contained in:
parent
8174c58250
commit
8bf15941c7
2 changed files with 8 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
SX126x::SX126x(Module* mod) : PhysicalLayer(RADIOLIB_SX126X_FREQUENCY_STEP_SIZE, RADIOLIB_SX126X_MAX_PACKET_LENGTH) {
|
SX126x::SX126x(Module* mod) : PhysicalLayer(RADIOLIB_SX126X_FREQUENCY_STEP_SIZE, RADIOLIB_SX126X_MAX_PACKET_LENGTH) {
|
||||||
_mod = mod;
|
_mod = mod;
|
||||||
|
this->XTAL = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Module* SX126x::getMod() {
|
Module* SX126x::getMod() {
|
||||||
|
@ -57,7 +58,7 @@ int16_t SX126x::begin(uint8_t cr, uint8_t syncWord, uint16_t preambleLength, flo
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// set TCXO control, if requested
|
// set TCXO control, if requested
|
||||||
if(tcxoVoltage > 0.0) {
|
if(!this->XTAL && tcxoVoltage > 0.0) {
|
||||||
state = setTCXO(tcxoVoltage);
|
state = setTCXO(tcxoVoltage);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
}
|
}
|
||||||
|
@ -131,7 +132,7 @@ int16_t SX126x::beginFSK(float br, float freqDev, float rxBw, uint16_t preambleL
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
|
|
||||||
// set TCXO control, if requested
|
// set TCXO control, if requested
|
||||||
if(tcxoVoltage > 0.0) {
|
if(!this->XTAL && tcxoVoltage > 0.0) {
|
||||||
state = setTCXO(tcxoVoltage);
|
state = setTCXO(tcxoVoltage);
|
||||||
RADIOLIB_ASSERT(state);
|
RADIOLIB_ASSERT(state);
|
||||||
}
|
}
|
||||||
|
|
|
@ -439,6 +439,11 @@ class SX126x: public PhysicalLayer {
|
||||||
|
|
||||||
Module* getMod();
|
Module* getMod();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Whether the module has an XTAL (true) or TCXO (false). Defaults to false.
|
||||||
|
*/
|
||||||
|
bool XTAL;
|
||||||
|
|
||||||
// basic methods
|
// basic methods
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Add table
Reference in a new issue