Add enableOOK param to RF69::begin, false by default, mirrors SX127x

This commit is contained in:
James Smith 2022-03-26 14:45:54 -07:00
parent 361eba8ebc
commit 2b99b6ec86
2 changed files with 6 additions and 2 deletions

View file

@ -9,7 +9,7 @@ Module* RF69::getMod() {
return(_mod); return(_mod);
} }
int16_t RF69::begin(float freq, float br, float freqDev, float rxBw, int8_t power, uint8_t preambleLen) { int16_t RF69::begin(float freq, float br, float freqDev, float rxBw, int8_t power, uint8_t preambleLen, bool enableOOK) {
// set module properties // set module properties
_mod->init(); _mod->init();
_mod->pinMode(_mod->getIrq(), INPUT); _mod->pinMode(_mod->getIrq(), INPUT);
@ -54,6 +54,10 @@ int16_t RF69::begin(float freq, float br, float freqDev, float rxBw, int8_t powe
int16_t state = config(); int16_t state = config();
RADIOLIB_ASSERT(state); RADIOLIB_ASSERT(state);
// enable/disable OOK
state = setOOK(enableOOK);
RADIOLIB_ASSERT(state);
// configure publicly accessible settings // configure publicly accessible settings
state = setFrequency(freq); state = setFrequency(freq);
RADIOLIB_ASSERT(state); RADIOLIB_ASSERT(state);

View file

@ -473,7 +473,7 @@ class RF69: public PhysicalLayer {
\returns \ref status_codes \returns \ref status_codes
*/ */
int16_t begin(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 125.0, int8_t power = 10, uint8_t preambleLen = 16); int16_t begin(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 125.0, int8_t power = 10, uint8_t preambleLen = 16, bool enableOOK = false);
/*! /*!
\brief Reset method. Will reset the chip to the default state using RST pin. \brief Reset method. Will reset the chip to the default state using RST pin.