AddressRegister

Trait AddressRegister 

Source
pub trait AddressRegister<const N: usize>: Copy {
    const ADDRESS: u8;

    // Required methods
    fn new() -> Self;
    fn from_bits(bits: u64) -> Self;
    fn into_bits(self) -> u64;
    fn into_bytes(self) -> [u8; N];
}
Expand description

A trait for nRF24L01+ address registers which can be 3-5 bytes.

  • RxAddrP0
  • RxAddrP1
  • TxAddr

Required Associated Constants§

Source

const ADDRESS: u8

Register address.

Required Methods§

Source

fn new() -> Self

Creates a new default initialized bitfield.

Source

fn from_bits(bits: u64) -> Self

Convert from bits.

Source

fn into_bits(self) -> u64

Convert into bits.

Source

fn into_bytes(self) -> [u8; N]

Convert into bytes ordered by LSByte first.

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.

Implementors§

Source§

impl<const N: usize> AddressRegister<N> for RxAddrP0<N>

Source§

const ADDRESS: u8 = 10u8

Source§

impl<const N: usize> AddressRegister<N> for RxAddrP1<N>

Source§

const ADDRESS: u8 = 11u8

Source§

impl<const N: usize> AddressRegister<N> for TxAddr<N>

Source§

const ADDRESS: u8 = 16u8