From 68ebbf59b7ed0b20e81738a373a089823d69668f Mon Sep 17 00:00:00 2001 From: Szczepan Date: Sun, 3 Nov 2024 15:20:24 +0100 Subject: [PATCH] Add setFifoThreshold to RF69 class. --- src/modules/RF69/RF69.cpp | 4 ++++ src/modules/RF69/RF69.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/modules/RF69/RF69.cpp b/src/modules/RF69/RF69.cpp index 2bbfeb57..f87270be 100644 --- a/src/modules/RF69/RF69.cpp +++ b/src/modules/RF69/RF69.cpp @@ -321,6 +321,10 @@ void RF69::clearFifoEmptyAction() { clearDio1Action(); } +void RF69::setFifoThreshold(uint8_t threshold) { + this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_FIFO_THRESH, threshold, 6, 0); +} + void RF69::setFifoFullAction(void (*func)(void)) { // set the interrupt this->mod->SPIsetRegValue(RADIOLIB_RF69_REG_FIFO_THRESH, RADIOLIB_RF69_FIFO_THRESH, 6, 0); diff --git a/src/modules/RF69/RF69.h b/src/modules/RF69/RF69.h index a7a25e49..ecee7546 100644 --- a/src/modules/RF69/RF69.h +++ b/src/modules/RF69/RF69.h @@ -648,6 +648,12 @@ class RF69: public PhysicalLayer { */ void clearFifoEmptyAction(); + /*! + \brief Set FIFO threshold level. + \param Threshold level. + */ + void setFifoThreshold(uint8_t threshold); + /*! \brief Set interrupt service routine function to call when FIFO is full. \param func Pointer to interrupt service routine.