Trait embedded_nrf24l01::Configuration [] [src]

pub trait Configuration {
    type Inner: Device;
    fn device(&mut self) -> &mut Self::Inner;

    fn flush_rx(&mut self) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn flush_tx(&mut self) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn get_channel(&mut self) -> Result<u8, <Self::Inner as Device>::Error> { ... }
fn set_channel(
        &mut self,
        freq_offset: u8
    ) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn set_rf(
        &mut self,
        rate: &DataRate,
        power: u8
    ) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn set_crc(
        &mut self,
        mode: &CrcMode
    ) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn set_pipes_rx_enable(
        &mut self,
        bools: &[bool; 6]
    ) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn set_rx_addr(
        &mut self,
        pipe_no: usize,
        addr: &[u8]
    ) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn set_tx_addr(
        &mut self,
        addr: &[u8]
    ) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn set_auto_retransmit(
        &mut self,
        delay: u8,
        count: u8
    ) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn get_auto_ack(
        &mut self
    ) -> Result<[bool; 6], <Self::Inner as Device>::Error> { ... }
fn set_auto_ack(
        &mut self,
        bools: &[bool; 6]
    ) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn get_address_width(
        &mut self
    ) -> Result<u8, <Self::Inner as Device>::Error> { ... }
fn get_interrupts(
        &mut self
    ) -> Result<(bool, bool, bool), <Self::Inner as Device>::Error> { ... }
fn clear_interrupts(&mut self) -> Result<(), <Self::Inner as Device>::Error> { ... }
fn set_pipes_rx_lengths(
        &mut self,
        lengths: &[Option<u8>; 6]
    ) -> Result<(), <Self::Inner as Device>::Error> { ... } }

Configuration methods

These seem to work in all modes

Associated Types

Underlying trait Device

Required Methods

Get a mutable reference to the underlying device

Provided Methods

Flush RX queue

Discards all received packets that have not yet been read from the RX FIFO

Flush TX queue, discarding any unsent packets

Get the channel number, as offset in MHz to 2.4 GHz

Set the channel number, as offset in MHz to 2.4 GHz

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

Set CRC mode

Configure which RX pipes to enable

Set address addr of pipe number pipe_no

Set address of the TX pipe

Configure auto-retransmit

To disable, call as set_auto_retransmit(0, 0).

Obtain auto-acknowledgment configuration for all pipes

Configure auto-acknowledgment for all RX pipes

TODO: handle switching tx/rx modes when auto-retransmit is enabled

Get address width configuration

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.

Clear all interrupts

bools

  • None: Dynamic payload length
  • Some(len): Static payload length len

Implementors