pub struct Status(/* private fields */);Expand description
§STATUS register
Address = 0x07
§Fields
§rx_dr | bit 6
Data ready RX FIFO interrupt. Asserted when new data arrives in RX FIFO. Write 1 to clear bit.
§tx_ds | bit 5
Data sent TX FIFO interrupt. Asserted when packet is transmitted. If AUTO_ACK is activated, ACK must be received before interrupt goes high. Write 1 to clear bit.
§max_rt | bit 4
Maximum number of TX retransmits interrupt. If MAX_RT is asserted it must be cleared before communication can continue. Write 1 to clear bit.
§rx_p_no | bits 3:1
Data pipe number for the payload available from reading RX FIFO. This field is read-only.
Enum: RxPipeNo.
§tx_full | bit 0
TX FIFO full flag. This field is read-only.
0: Not full
1: TX FIFO full
§Example
use nrf24l01_commands::{fields, registers};
// Default value
let reg = registers::Status::new();
assert_eq!(reg.into_bits(), 0);
// Read fields
let reg = registers::Status::from_bits(0b0011_0101);
assert!(!reg.rx_dr());
assert!(reg.tx_ds());
assert!(reg.max_rt());
assert_eq!(reg.rx_p_no(), fields::RxPipeNo::Pipe2);
assert!(reg.tx_full());
// Write fields
let reg = registers::Status::new()
.with_rx_dr(false)
.with_tx_ds(true)
.with_max_rt(false);
assert_eq!(reg.into_bits(), 0b0010_0000);Implementations§
Source§impl Status
impl Status
Sourcepub const fn rx_dr(&self) -> bool
pub const fn rx_dr(&self) -> bool
Data ready RX FIFO interrupt. Asserted when new data arrives in RX FIFO. Write 1 to clear bit.
Bits: 6..7
Sourcepub const fn with_rx_dr_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_rx_dr_checked(self, value: bool) -> Result<Self, ()>
Data ready RX FIFO interrupt. Asserted when new data arrives in RX FIFO. Write 1 to clear bit.
Bits: 6..7
Sourcepub const fn with_rx_dr(self, value: bool) -> Self
pub const fn with_rx_dr(self, value: bool) -> Self
Data ready RX FIFO interrupt. Asserted when new data arrives in RX FIFO. Write 1 to clear bit.
Bits: 6..7
Sourcepub const fn set_rx_dr(&mut self, value: bool)
pub const fn set_rx_dr(&mut self, value: bool)
Data ready RX FIFO interrupt. Asserted when new data arrives in RX FIFO. Write 1 to clear bit.
Bits: 6..7
Sourcepub const fn set_rx_dr_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_rx_dr_checked(&mut self, value: bool) -> Result<(), ()>
Data ready RX FIFO interrupt. Asserted when new data arrives in RX FIFO. Write 1 to clear bit.
Bits: 6..7
Sourcepub const fn tx_ds(&self) -> bool
pub const fn tx_ds(&self) -> bool
Data sent TX FIFO interrupt. Asserted when packet is transmitted. If AUTO_ACK is activated, ACK must be received before interrupt goes high. Write 1 to clear bit.
Bits: 5..6
Sourcepub const fn with_tx_ds_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_tx_ds_checked(self, value: bool) -> Result<Self, ()>
Data sent TX FIFO interrupt. Asserted when packet is transmitted. If AUTO_ACK is activated, ACK must be received before interrupt goes high. Write 1 to clear bit.
Bits: 5..6
Sourcepub const fn with_tx_ds(self, value: bool) -> Self
pub const fn with_tx_ds(self, value: bool) -> Self
Data sent TX FIFO interrupt. Asserted when packet is transmitted. If AUTO_ACK is activated, ACK must be received before interrupt goes high. Write 1 to clear bit.
Bits: 5..6
Sourcepub const fn set_tx_ds(&mut self, value: bool)
pub const fn set_tx_ds(&mut self, value: bool)
Data sent TX FIFO interrupt. Asserted when packet is transmitted. If AUTO_ACK is activated, ACK must be received before interrupt goes high. Write 1 to clear bit.
Bits: 5..6
Sourcepub const fn set_tx_ds_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_tx_ds_checked(&mut self, value: bool) -> Result<(), ()>
Data sent TX FIFO interrupt. Asserted when packet is transmitted. If AUTO_ACK is activated, ACK must be received before interrupt goes high. Write 1 to clear bit.
Bits: 5..6
Sourcepub const fn max_rt(&self) -> bool
pub const fn max_rt(&self) -> bool
Maximum number of TX retransmits interrupt. If MAX_RT is asserted it must be cleared before communication can continue. Write 1 to clear bit.
Bits: 4..5
Sourcepub const fn with_max_rt_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_max_rt_checked(self, value: bool) -> Result<Self, ()>
Maximum number of TX retransmits interrupt. If MAX_RT is asserted it must be cleared before communication can continue. Write 1 to clear bit.
Bits: 4..5
Sourcepub const fn with_max_rt(self, value: bool) -> Self
pub const fn with_max_rt(self, value: bool) -> Self
Maximum number of TX retransmits interrupt. If MAX_RT is asserted it must be cleared before communication can continue. Write 1 to clear bit.
Bits: 4..5
Sourcepub const fn set_max_rt(&mut self, value: bool)
pub const fn set_max_rt(&mut self, value: bool)
Maximum number of TX retransmits interrupt. If MAX_RT is asserted it must be cleared before communication can continue. Write 1 to clear bit.
Bits: 4..5
Sourcepub const fn set_max_rt_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_max_rt_checked(&mut self, value: bool) -> Result<(), ()>
Maximum number of TX retransmits interrupt. If MAX_RT is asserted it must be cleared before communication can continue. Write 1 to clear bit.
Bits: 4..5