Skip to content
Snippets Groups Projects
Commit bc3745b6 authored by Daniel Friesel's avatar Daniel Friesel
Browse files

nrf24: Add observe tx accessor

parent b47295e3
No related branches found
No related tags found
No related merge requests found
...@@ -193,6 +193,13 @@ public: ...@@ -193,6 +193,13 @@ public:
*/ */
uint8_t flushRx(void); 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(); void setup();
/** /**
* Set Power Amplifier (PA) level to one of four levels: * Set Power Amplifier (PA) level to one of four levels:
......
...@@ -135,6 +135,11 @@ void Nrf24l01::powerDown(void) ...@@ -135,6 +135,11 @@ void Nrf24l01::powerDown(void)
writeRegister(NRF_CONFIG, readRegister(NRF_CONFIG) & ~(1 << PWR_UP)); 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) void Nrf24l01::setRetries(uint8_t delay, uint8_t count)
{ {
writeRegister(SETUP_RETR, (delay & 0xf) << ARD | (count & 0xf) << ARC); writeRegister(SETUP_RETR, (delay & 0xf) << ARD | (count & 0xf) << ARC);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment