Optimized high speed nRF24L01+ driver class documentation v1.5.0
TMRh20 2020 - Optimized fork of the nRF24L01+ driver
Loading...
Searching...
No Matches
Status flags

Enumerations

enum  rf24_irq_flags_e {
  RF24_IRQ_NONE = 0 , RF24_TX_DF = 1 << MASK_MAX_RT , RF24_TX_DS = 1 << TX_DS , RF24_RX_DR = 1 << RX_DR ,
  RF24_IRQ_ALL = (1 << MASK_MAX_RT) | (1 << TX_DS) | (1 << RX_DR)
}
 An enumeration of constants used to configure Status flags. More...
 

Advanced Operation

Methods you can use to drive the chip in more advanced ways

uint8_t RF24::clearStatusFlags (uint8_t flags=RF24_IRQ_ALL)
 
void RF24::setStatusFlags (uint8_t flags=RF24_IRQ_NONE)
 
uint8_t RF24::getStatusFlags ()
 
uint8_t RF24::update ()
 

Detailed Description

Enumeration Type Documentation

◆ rf24_irq_flags_e

An enumeration of constants used to configure Status flags.

Enumerator
RF24_IRQ_NONE 

An alias of 0 to describe no IRQ events enabled.

RF24_TX_DF 

Represents an event where TX Data Failed to send.

RF24_TX_DS 

Represents an event where TX Data Sent successfully.

RF24_RX_DR 

Represents an event where RX Data is Ready to RF24::read().

RF24_IRQ_ALL 

Equivalent to RF24_RX_DR | RF24_TX_DS | RF24_TX_DF.

Definition at line 140 of file RF24.h.

Function Documentation

◆ clearStatusFlags()

uint8_t RF24::clearStatusFlags ( uint8_t flags = RF24_IRQ_ALL)

Clear the Status flags that caused an interrupt event.

Remarks
This function is similar to whatHappened() because it also returns the Status flags that caused the interrupt event. However, this function returns a STATUS byte instead of bit-banging into 3 1-byte booleans passed by reference.
Note
When used in an ISR (Interrupt Service routine), there is a chance that the returned bits 0b1110 (rx_pipe number) is inaccurate. See available(uint8_t*) (or the datasheet) for more detail.
Parameters
flagsThe IRQ flags to clear. Default value is all of them (RF24_IRQ_ALL). Multiple flags can be cleared by OR-ing rf24_irq_flags_e values together.
Returns
The STATUS byte from the radio's register before it was modified. Use enumerations of rf24_irq_flags_e as masks to interpret the STATUS byte's meaning(s).

Definition at line 1576 of file RF24.cpp.

◆ setStatusFlags()

void RF24::setStatusFlags ( uint8_t flags = RF24_IRQ_NONE)

Set which flags shall be reflected on the radio's IRQ pin.

Remarks
This function is similar to maskIRQ() but with less confusing parameters.
Parameters
flagsA value of rf24_irq_flags_e to influence the radio's IRQ pin. The default value (RF24_IRQ_NONE) will disable the radio's IRQ pin. Multiple events can be enabled by OR-ing rf24_irq_flags_e values together.
radio.setStatusFlags(RF24_IRQ_ALL);
// is equivalent to
radio.setStatusFlags(RF24_RX_DR | RF24_TX_DS | RF24_TX_DF);
@ RF24_TX_DS
Represents an event where TX Data Sent successfully.
Definition RF24.h:277
@ RF24_TX_DF
Represents an event where TX Data Failed to send.
Definition RF24.h:275
@ RF24_RX_DR
Represents an event where RX Data is Ready to RF24::read().
Definition RF24.h:279
@ RF24_IRQ_ALL
Equivalent to RF24_RX_DR | RF24_TX_DS | RF24_TX_DF.
Definition RF24.h:281

Definition at line 1584 of file RF24.cpp.

◆ getStatusFlags()

uint8_t RF24::getStatusFlags ( )

Get the latest STATUS byte returned from the last SPI transaction.

Note
This does not actually perform any SPI transaction with the radio. Use RF24::update() instead to get a fresh copy of the Status flags at the slight cost of performance.
Returns
The STATUS byte from the radio's register as the latest SPI transaction. Use enumerations of rf24_irq_flags_e as masks to interpret the STATUS byte's meaning(s).

Definition at line 1593 of file RF24.cpp.

◆ update()

uint8_t RF24::update ( )

Get an updated STATUS byte from the radio.

Returns
The STATUS byte fetched from the radio's register. Use enumerations of rf24_irq_flags_e as masks to interpret the STATUS byte's meaning(s).

Definition at line 1600 of file RF24.cpp.