pub trait Configuration {
type Inner: Device;
Show 19 methods
// Required method
fn device(&mut self) -> &mut Self::Inner;
// Provided methods
async fn flush_rx(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error> { ... }
async fn flush_tx(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error> { ... }
async fn get_frequency(
&mut self,
) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error> { ... }
async fn set_frequency(
&mut self,
freq_offset: 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> { ... }
async fn set_crc(
&mut self,
mode: CrcMode,
) -> 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> { ... }
async fn set_pipes_rx_enable(
&mut self,
bools: &[bool; 6],
) -> 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> { ... }
async fn set_tx_addr(
&mut self,
addr: &[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> { ... }
async fn get_auto_ack(
&mut self,
) -> Result<[bool; 6], <<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> { ... }
async fn get_address_width(
&mut self,
) -> Result<u8, <<Self as Configuration>::Inner as Device>::Error> { ... }
async fn set_address_width(
&mut self,
width: u8,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error> { ... }
async fn get_interrupts(
&mut self,
) -> Result<(bool, bool, bool), <<Self as Configuration>::Inner as Device>::Error> { ... }
async fn clear_interrupts(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error> { ... }
async fn set_pipes_rx_lengths(
&mut self,
lengths: &[Option<u8>; 6],
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error> { ... }
}
Expand description
Configuration methods
These seem to work in all modes
Required Associated Types§
Sourcetype Inner: Device
type Inner: Device
Underlying trait Device
Required Methods§
Provided Methods§
Sourceasync 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>
Flush RX queue
Discards all received packets that have not yet been read from the RX FIFO
Sourceasync 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>
Flush TX queue, discarding any unsent packets
Sourceasync 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>
Get frequency offset (channel)
Sourceasync 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>
Set frequency offset (channel)
Sourceasync 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>
power: 0
: -18 dBm, 3
: 0 dBm
Sourceasync 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>
Set CRC mode
Sourceasync 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>
Sets the interrupt mask
When an interrupt mask is set to true, the interrupt is masked and will not fire on the IRQ pin. When set to false, it will trigger the IRQ pin.
Sourceasync 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>
Configure which RX pipes to enable
Sourceasync 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>
Set address addr
of pipe number pipe_no
Sourceasync 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>
Set address of the TX pipe
Sourceasync 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>
Configure auto-retransmit
To disable, call as set_auto_retransmit(0, 0)
.
Sourceasync 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>
Obtain auto-acknowledgment configuration for all pipes
Sourceasync 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>
Configure auto-acknowledgment for all RX pipes
Auto ack is handled by the nrf24 if:
- Auto ack feature is enabled on Feature Register
- Auto ack is enabled for the pipe the packet was received on
Sourceasync 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>
Get address width configuration
Sourceasync 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>
Set address width configuration
Sourceasync 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>
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.
Sourceasync fn clear_interrupts(
&mut self,
) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
async fn clear_interrupts( &mut self, ) -> Result<(), <<Self as Configuration>::Inner as Device>::Error>
Clear all interrupts
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.