pub struct TxMode<D: Device> { /* private fields */ }
Expand description
Represents TX Mode and the associated TX Settling and Standby-II states
§Timing
The datasheet states the follwing:
It is important to never keep the nRF24L01 in TX mode for more than 4ms at a time.
No effects have been observed when exceeding this limit. The warranty could get void.
Implementations§
Source§impl<D: Device> TxMode<D>
impl<D: Device> TxMode<D>
Sourcepub fn standby(self) -> Result<StandbyMode<D>, D::Error>
pub fn standby(self) -> Result<StandbyMode<D>, D::Error>
Disable CE
so that you can switch into RX mode.
Sourcepub fn poll_send(&mut self) -> Result<bool, D::Error>
pub fn poll_send(&mut self) -> Result<bool, D::Error>
Poll completion of one or multiple send operations and check whether transmission was successful.
This function behaves like wait_empty()
, except that it returns whether sending was
successful and that it provides an asynchronous interface.
Sourcepub fn wait_empty(&mut self) -> Result<(), D::Error>
pub fn wait_empty(&mut self) -> Result<(), D::Error>
Wait until TX FIFO is empty
If any packet cannot be delivered and the maximum amount of retries is reached, the TX FIFO is flushed and all other packets in the FIFO are lost.
Trait Implementations§
Source§impl<D: Device> Configuration for TxMode<D>
impl<D: Device> Configuration for TxMode<D>
Source§type Inner = D
type Inner = D
Underlying
trait Device
Source§fn flush_rx(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
fn flush_rx( &mut self, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Flush RX queue Read more
Source§fn flush_tx(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
fn flush_tx( &mut self, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Flush TX queue, discarding any unsent packets
Source§fn get_frequency(
&mut self,
) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error>
fn get_frequency( &mut self, ) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error>
Get frequency offset (channel)
Source§fn set_frequency(
&mut self,
freq_offset: u8,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
fn set_frequency( &mut self, freq_offset: u8, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Set frequency offset (channel)
Source§fn set_rf(
&mut self,
rate: &DataRate,
power: u8,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
fn set_rf( &mut self, rate: &DataRate, power: u8, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
power:
0
: -18 dBm, 3
: 0 dBmSource§fn set_crc(
&mut self,
mode: CrcMode,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
fn set_crc( &mut self, mode: CrcMode, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Set CRC mode
Source§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>
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§fn set_pipes_rx_enable(
&mut self,
bools: &[bool; 6],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
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§fn set_rx_addr(
&mut self,
pipe_no: usize,
addr: &[u8],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
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§fn set_tx_addr(
&mut self,
addr: &[u8],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
fn set_tx_addr( &mut self, addr: &[u8], ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Set address of the TX pipe
Source§fn set_auto_retransmit(
&mut self,
delay: u8,
count: u8,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
fn set_auto_retransmit( &mut self, delay: u8, count: u8, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Configure auto-retransmit Read more
Source§fn get_auto_ack(
&mut self,
) -> Result<[bool; 6], <<Self as Configuration>::Inner as Device>::Error>
fn get_auto_ack( &mut self, ) -> Result<[bool; 6], <<Self as Configuration>::Inner as Device>::Error>
Obtain auto-acknowledgment configuration for all pipes
Source§fn set_auto_ack(
&mut self,
bools: &[bool; 6],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
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§fn get_address_width(
&mut self,
) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error>
fn get_address_width( &mut self, ) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error>
Get address width configuration
Source§fn get_interrupts(
&mut self,
) -> Result<(bool, bool, bool), <<Self as Configuration>::Inner as Device>::Error>
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§fn clear_interrupts(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
fn clear_interrupts( &mut self, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Clear all interrupts
Auto Trait Implementations§
impl<D> Freeze for TxMode<D>where
D: Freeze,
impl<D> RefUnwindSafe for TxMode<D>where
D: RefUnwindSafe,
impl<D> Send for TxMode<D>where
D: Send,
impl<D> Sync for TxMode<D>where
D: Sync,
impl<D> Unpin for TxMode<D>where
D: Unpin,
impl<D> UnwindSafe for TxMode<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