[SX127x/RF69] Added setFifoThreshold (#1309)

* [SX127x] Added setFifoThreshold

* [SX127x] Added setFifoThreshold

* Add setFifoThreshold to RF69 class.

* Documentation update, about setFifoThreshold.
This commit is contained in:
SzczepanLeon 2024-11-03 18:25:44 +01:00 committed by GitHub
parent 49868938d6
commit cb45f4fe5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 0 deletions

View file

@ -321,6 +321,10 @@ void RF69::clearFifoEmptyAction() {
clearDio1Action(); clearDio1Action();
} }
void RF69::setFifoThreshold(uint8_t threshold) {
this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_FIFO_THRESH, threshold, 6, 0);
}
void RF69::setFifoFullAction(void (*func)(void)) { void RF69::setFifoFullAction(void (*func)(void)) {
// set the interrupt // set the interrupt
this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_FIFO_THRESH, RADIOLIB_RF69_FIFO_THRESH, 6, 0); this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_FIFO_THRESH, RADIOLIB_RF69_FIFO_THRESH, 6, 0);

View file

@ -648,6 +648,14 @@ class RF69: public PhysicalLayer {
*/ */
void clearFifoEmptyAction(); void clearFifoEmptyAction();
/*!
\brief Set FIFO threshold level.
Be aware that threshold is also set in setFifoFullAction method.
setFifoThreshold method must be called AFTER calling setFifoFullAction!
\param Threshold level.
*/
void setFifoThreshold(uint8_t threshold);
/*! /*!
\brief Set interrupt service routine function to call when FIFO is full. \brief Set interrupt service routine function to call when FIFO is full.
\param func Pointer to interrupt service routine. \param func Pointer to interrupt service routine.

View file

@ -504,6 +504,10 @@ void SX127x::clearFifoEmptyAction() {
clearDio1Action(); clearDio1Action();
} }
void SX127x::setFifoThreshold(uint8_t threshold) {
this->mod->SPIsetRegValue(RADIOLIB_SX127X_REG_FIFO_THRESH, threshold, 5, 0);
}
void SX127x::setFifoFullAction(void (*func)(void)) { void SX127x::setFifoFullAction(void (*func)(void)) {
// set the interrupt // set the interrupt
this->mod->SPIsetRegValue(RADIOLIB_SX127X_REG_FIFO_THRESH, RADIOLIB_SX127X_FIFO_THRESH, 5, 0); this->mod->SPIsetRegValue(RADIOLIB_SX127X_REG_FIFO_THRESH, RADIOLIB_SX127X_FIFO_THRESH, 5, 0);

View file

@ -761,6 +761,14 @@ class SX127x: public PhysicalLayer {
*/ */
void clearFifoEmptyAction(); void clearFifoEmptyAction();
/*!
\brief Set FIFO threshold level.
Be aware that threshold is also set in setFifoFullAction method.
setFifoThreshold method must be called AFTER calling setFifoFullAction!
\param Threshold level.
*/
void setFifoThreshold(uint8_t threshold);
/*! /*!
\brief Set interrupt service routine function to call when FIFO is full. \brief Set interrupt service routine function to call when FIFO is full.
\param func Pointer to interrupt service routine. \param func Pointer to interrupt service routine.