[SX127x/RF69] Added setFifoThreshold (#1309)

* [SX127x] Added setFifoThreshold

* [SX127x] Added setFifoThreshold

* Add setFifoThreshold to RF69 class.

* Documentation update, about setFifoThreshold.
pull/1310/head
SzczepanLeon 2024-11-03 18:25:44 +01:00 zatwierdzone przez GitHub
rodzic 49868938d6
commit cb45f4fe5e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
4 zmienionych plików z 24 dodań i 0 usunięć

Wyświetl plik

@ -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);

Wyświetl plik

@ -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.

Wyświetl plik

@ -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);

Wyświetl plik

@ -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.