Struct StandbyMode

Source
pub struct StandbyMode<D: Device> { /* private fields */ }
Expand description

Represents Standby-I mode

This represents the state the device is in inbetween TX or RX mode.

Implementations§

Source§

impl<D: Device> StandbyMode<D>

Source

pub async fn power_up(device: D) -> Result<Self, (D, D::Error)>

Constructor

Puts the device into standy mode

Source

pub async fn power_down(self) -> Result<D, (Self, D::Error)>

Should be a no-op

Source

pub async fn rx(self) -> Result<RxMode<D>, (D, D::Error)>

Go into RX mode

Source

pub async fn tx(self) -> Result<TxMode<D>, (D, D::Error)>

Go into TX mode

Trait Implementations§

Source§

impl<D: Device> Configuration for StandbyMode<D>

Source§

type Inner = D

Underlying trait Device
Source§

fn device(&mut self) -> &mut Self::Inner

Get a mutable reference to the underlying device
Source§

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>

Flush TX queue, discarding any unsent packets
Source§

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>

Set frequency offset (channel)
Source§

async fn set_rf( &mut self, rate: &DataRate, power: u8, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>

power: 0: -18 dBm, 3: 0 dBm
Source§

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>

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>

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>

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>

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>

Configure auto-retransmit Read more
Source§

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>

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>

Get address width configuration
Source§

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>

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>

Clear all interrupts
Source§

async fn set_pipes_rx_lengths( &mut self, lengths: &[Option<u8>; 6], ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>

bools Read more
Source§

impl<D: Device> Debug for StandbyMode<D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D: Device> Send for StandbyMode<D>

Auto Trait Implementations§

§

impl<D> Freeze for StandbyMode<D>
where D: Freeze,

§

impl<D> RefUnwindSafe for StandbyMode<D>
where D: RefUnwindSafe,

§

impl<D> Sync for StandbyMode<D>
where D: Sync,

§

impl<D> Unpin for StandbyMode<D>
where D: Unpin,

§

impl<D> UnwindSafe for StandbyMode<D>
where D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.