pub struct RxMode<D: Device> { /* private fields */ }
Expand description
Represents RX Mode
Implementations§
Source§impl<D: Device> RxMode<D>
impl<D: Device> RxMode<D>
Sourcepub fn standby(self) -> StandbyMode<D>
pub fn standby(self) -> StandbyMode<D>
Disable CE
so that you can switch into TX mode.
Sourcepub async fn can_read(&mut self) -> Result<Option<u8>, D::Error>
pub async fn can_read(&mut self) -> Result<Option<u8>, D::Error>
Is there any incoming data to read? Return the pipe number.
This function acknowledges all interrupts even if there are more received packets, so the caller must repeat the call until the function returns None before waiting for the next RX interrupt.
Sourcepub async fn has_carrier(&mut self) -> Result<bool, D::Error>
pub async fn has_carrier(&mut self) -> Result<bool, D::Error>
Is an in-band RF signal detected?
The internal carrier detect signal must be high for 40μs (NRF24L01+) or 128μs (NRF24L01) before the carrier detect register is set. Note that changing from standby to receive mode also takes 130μs.
Trait Implementations§
Source§impl<D: Device> Configuration for RxMode<D>
impl<D: Device> Configuration for RxMode<D>
Source§type Inner = D
type Inner = D
Underlying
trait Device
Source§async fn flush_rx(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn flush_rx( &mut self, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Flush RX queue Read more
Source§async fn flush_tx(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn flush_tx( &mut self, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Flush TX queue, discarding any unsent packets
Source§async fn get_frequency(
&mut self,
) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error>
async fn get_frequency( &mut self, ) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error>
Get frequency offset (channel)
Source§async fn set_frequency(
&mut self,
freq_offset: u8,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_frequency( &mut self, freq_offset: u8, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Set frequency offset (channel)
Source§async fn set_rf(
&mut self,
rate: &DataRate,
power: u8,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_rf( &mut self, rate: &DataRate, power: u8, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
power:
0
: -18 dBm, 3
: 0 dBmSource§async fn set_crc(
&mut self,
mode: CrcMode,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_crc( &mut self, mode: CrcMode, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Set CRC mode
Source§async fn set_interrupt_mask(
&mut self,
data_ready_rx: bool,
data_sent_tx: bool,
max_retransmits_tx: bool,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_interrupt_mask( &mut self, data_ready_rx: bool, data_sent_tx: bool, max_retransmits_tx: bool, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Sets the interrupt mask Read more
Source§async fn set_pipes_rx_enable(
&mut self,
bools: &[bool; 6],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_pipes_rx_enable( &mut self, bools: &[bool; 6], ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Configure which RX pipes to enable
Source§async fn set_rx_addr(
&mut self,
pipe_no: usize,
addr: &[u8],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_rx_addr( &mut self, pipe_no: usize, addr: &[u8], ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Set address
addr
of pipe number pipe_no
Source§async fn set_tx_addr(
&mut self,
addr: &[u8],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_tx_addr( &mut self, addr: &[u8], ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Set address of the TX pipe
Source§async fn set_auto_retransmit(
&mut self,
delay: u8,
count: u8,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_auto_retransmit( &mut self, delay: u8, count: u8, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Configure auto-retransmit Read more
Source§async fn get_auto_ack(
&mut self,
) -> Result<[bool; 6], <<Self as Configuration>::Inner as Device>::Error>
async fn get_auto_ack( &mut self, ) -> Result<[bool; 6], <<Self as Configuration>::Inner as Device>::Error>
Obtain auto-acknowledgment configuration for all pipes
Source§async fn set_auto_ack(
&mut self,
bools: &[bool; 6],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_auto_ack( &mut self, bools: &[bool; 6], ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Configure auto-acknowledgment for all RX pipes Read more
Source§async fn get_address_width(
&mut self,
) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error>
async fn get_address_width( &mut self, ) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error>
Get address width configuration
Source§async fn set_address_width(
&mut self,
width: u8,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn set_address_width( &mut self, width: u8, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Set address width configuration
Source§async fn get_interrupts(
&mut self,
) -> Result<(bool, bool, bool), <<Self as Configuration>::Inner as Device>::Error>
async fn get_interrupts( &mut self, ) -> Result<(bool, bool, bool), <<Self as Configuration>::Inner as Device>::Error>
Obtain interrupt pending status as
(RX_DR, TX_DR, MAX_RT)
where RX_DR
indicates new data in the RX FIFO, TX_DR
indicates that a packet has been sent, and MAX_RT
indicates
maximum retransmissions without auto-ack.Source§async fn clear_interrupts(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn clear_interrupts( &mut self, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Clear all interrupts
Auto Trait Implementations§
impl<D> Freeze for RxMode<D>where
D: Freeze,
impl<D> RefUnwindSafe for RxMode<D>where
D: RefUnwindSafe,
impl<D> Send for RxMode<D>where
D: Send,
impl<D> Sync for RxMode<D>where
D: Sync,
impl<D> Unpin for RxMode<D>where
D: Unpin,
impl<D> UnwindSafe for RxMode<D>where
D: UnwindSafe,
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