pub struct Interrupts(/* private fields */);
Expand description
A bitfield representing multiple nRF24L01 interrupts.
This structure allows for the manipulation and checking of interrupt flags as they appear in the STATUS register. Multiple interrupts can be combined using the builder pattern methods.
§Examples
// Create an interrupt set with RX data ready and max retries
let interrupts = Interrupts::new().rx_data_ready().max_retries();
// Check if a specific interrupt is set
if interrupts.contains(InterruptKind::RxDataReady) {
// Handle RX data ready interrupt
}
Implementations§
Source§impl Interrupts
impl Interrupts
Sourcepub fn max_retries(self) -> Self
pub fn max_retries(self) -> Self
Adds the Maximum Retries interrupt to this set.
This interrupt is triggered when the maximum number of retransmits has been reached on a packet.
Sourcepub fn tx_data_sent(self) -> Self
pub fn tx_data_sent(self) -> Self
Adds the TX Data Sent interrupt to this set.
This interrupt is triggered when a packet has been successfully transmitted.
Sourcepub fn rx_data_ready(self) -> Self
pub fn rx_data_ready(self) -> Self
Adds the RX Data Ready interrupt to this set.
This interrupt is triggered when new data has arrived in the RX FIFO.
Sourcepub fn contains(&self, irq: InterruptKind) -> bool
pub fn contains(&self, irq: InterruptKind) -> bool
Checks if the given interrupt kind is set in this interrupt set.
Returns true
if the interrupt is set, false
otherwise.
Trait Implementations§
Source§impl Clone for Interrupts
impl Clone for Interrupts
Source§fn clone(&self) -> Interrupts
fn clone(&self) -> Interrupts
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl From<u8> for Interrupts
impl From<u8> for Interrupts
impl Copy for Interrupts
Auto Trait Implementations§
impl Freeze for Interrupts
impl RefUnwindSafe for Interrupts
impl Send for Interrupts
impl Sync for Interrupts
impl Unpin for Interrupts
impl UnwindSafe for Interrupts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more