Struct embedded_nrf24l01::TxMode
[−]
[src]
pub struct TxMode<D: Device> { /* fields omitted */ }
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.
Methods
impl<D: Device> TxMode<D>
[src]
pub fn standby(self) -> Result<StandbyMode<D>, D::Error>
[src]
Disable CE
so that you can switch into RX mode.
pub fn is_empty(&mut self) -> Result<bool, D::Error>
[src]
Is TX FIFO empty?
pub fn is_full(&mut self) -> Result<bool, D::Error>
[src]
Is TX FIFO full?
pub fn can_send(&mut self) -> Result<bool, D::Error>
[src]
Does the TX FIFO have space?
pub fn send(&mut self, packet: &[u8]) -> Result<(), D::Error>
[src]
Send asynchronously
pub fn wait_empty(&mut self) -> Result<(), D::Error>
[src]
Wait until FX FIFO is empty
pub fn observe(&mut self) -> Result<ObserveTx, D::Error>
[src]
Read the OBSERVE_TX
register
Trait Implementations
impl<D: Device> Debug for TxMode<D>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<D: Device> Configuration for TxMode<D>
[src]
type Inner = D
Underlying trait Device
fn device(&mut self) -> &mut Self::Inner
[src]
Get a mutable reference to the underlying device
fn flush_rx(&mut self) -> Result<(), <Self::Inner as Device>::Error>
[src]
Flush RX queue Read more
fn flush_tx(&mut self) -> Result<(), <Self::Inner as Device>::Error>
[src]
Flush TX queue, discarding any unsent packets
fn get_channel(&mut self) -> Result<u8, <Self::Inner as Device>::Error>
[src]
Get the channel number, as offset in MHz to 2.4 GHz
fn set_channel(
&mut self,
freq_offset: u8
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
freq_offset: u8
) -> Result<(), <Self::Inner as Device>::Error>
Set the channel number, as offset in MHz to 2.4 GHz
fn set_rf(
&mut self,
rate: &DataRate,
power: u8
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
rate: &DataRate,
power: u8
) -> Result<(), <Self::Inner as Device>::Error>
power: 0
: -18 dBm, 3
: 0 dBm
fn set_crc(
&mut self,
mode: &CrcMode
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
mode: &CrcMode
) -> Result<(), <Self::Inner as Device>::Error>
Set CRC mode
fn set_pipes_rx_enable(
&mut self,
bools: &[bool; 6]
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
bools: &[bool; 6]
) -> Result<(), <Self::Inner as Device>::Error>
Configure which RX pipes to enable
fn set_rx_addr(
&mut self,
pipe_no: usize,
addr: &[u8]
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
pipe_no: usize,
addr: &[u8]
) -> Result<(), <Self::Inner as Device>::Error>
Set address addr
of pipe number pipe_no
fn set_tx_addr(
&mut self,
addr: &[u8]
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
addr: &[u8]
) -> Result<(), <Self::Inner as Device>::Error>
Set address of the TX pipe
fn set_auto_retransmit(
&mut self,
delay: u8,
count: u8
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
delay: u8,
count: u8
) -> Result<(), <Self::Inner as Device>::Error>
Configure auto-retransmit Read more
fn get_auto_ack(&mut self) -> Result<[bool; 6], <Self::Inner as Device>::Error>
[src]
Obtain auto-acknowledgment configuration for all pipes
fn set_auto_ack(
&mut self,
bools: &[bool; 6]
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
bools: &[bool; 6]
) -> Result<(), <Self::Inner as Device>::Error>
Configure auto-acknowledgment for all RX pipes Read more
fn get_address_width(&mut self) -> Result<u8, <Self::Inner as Device>::Error>
[src]
Get address width configuration
fn get_interrupts(
&mut self
) -> Result<(bool, bool, bool), <Self::Inner as Device>::Error>
[src]
&mut self
) -> Result<(bool, bool, bool), <Self::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. Read more
fn clear_interrupts(&mut self) -> Result<(), <Self::Inner as Device>::Error>
[src]
Clear all interrupts
fn set_pipes_rx_lengths(
&mut self,
lengths: &[Option<u8>; 6]
) -> Result<(), <Self::Inner as Device>::Error>
[src]
&mut self,
lengths: &[Option<u8>; 6]
) -> Result<(), <Self::Inner as Device>::Error>
bools
* None
: Dynamic payload length * Some(len)
: Static payload length len
Read more