diff options
-rw-r--r-- | include/driver/nrf24l01.h | 7 | ||||
-rw-r--r-- | src/driver/nrf24l01.cc | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/driver/nrf24l01.h b/include/driver/nrf24l01.h index ecf4bc2..3a1f145 100644 --- a/include/driver/nrf24l01.h +++ b/include/driver/nrf24l01.h @@ -193,6 +193,13 @@ public: */ uint8_t flushRx(void); + /** + * Get observe value. + * + * @return Current Observe TX value. 7:4 counts lost packets since last channel change, 3:0 gives retransmission count of latest packet. + */ + uint8_t getObserveTx(void); + void setup(); /** * Set Power Amplifier (PA) level to one of four levels: diff --git a/src/driver/nrf24l01.cc b/src/driver/nrf24l01.cc index 937831b..9433534 100644 --- a/src/driver/nrf24l01.cc +++ b/src/driver/nrf24l01.cc @@ -135,6 +135,11 @@ void Nrf24l01::powerDown(void) writeRegister(NRF_CONFIG, readRegister(NRF_CONFIG) & ~(1 << PWR_UP)); } +uint8_t Nrf24l01::getObserveTx(void) +{ + return readRegister(OBSERVE_TX); +} + void Nrf24l01::setRetries(uint8_t delay, uint8_t count) { writeRegister(SETUP_RETR, (delay & 0xf) << ARD | (count & 0xf) << ARC); |