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 async fn standby(self) -> Result<StandbyMode<D>, D::Error>
pub async fn standby(self) -> Result<StandbyMode<D>, D::Error>
Disable CE
so that you can switch into RX mode.
Sourcepub async fn poll_send(&mut self) -> Result<bool, D::Error>
pub async 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.
Automatic retransmission (set_auto_retransmit) and acks (set_auto_ack) have to be enabled if you actually want to know if transmission was successful. Else the nrf24 just transmits the packet once and assumes it was received.
Sourcepub async fn wait_empty(&mut self) -> Result<(), D::Error>
pub async 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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
(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.