pub struct RxAddrP0<const N: usize>(/* private fields */);Expand description
§RX_ADDR_P0 register
RX address data pipe 0.
Address = 0x0A
Const parameter N: address width in bytes.
N must be of {3, 4, 5}.
§Fields
§rx_addr_p0 | bits 39:0
RX address data pipe 0. Default value: 0xE7E7E7E7E7.
§Example
use nrf24l01_commands::registers::{self, AddressRegister};
// Default value
let reg = registers::RxAddrP0::<4>::new();
assert_eq!(reg.into_bits(), 0xE7E7E7E7E7);
// Write fields
let reg = registers::RxAddrP0::<5>::new().with_rx_addr_p0(0xC2840DF659);
assert_eq!(reg.into_bits(), 0xC2840DF659);
// Convert to little-endian bytes
assert_eq!(reg.into_bytes(), [0x59, 0xF6, 0x0D, 0x84, 0xC2]);
// 3 byte address width
let reg = registers::RxAddrP0::<3>::new().with_rx_addr_p0(0xC2840DF659);
assert_eq!(reg.into_bytes(), [0x59, 0xF6, 0x0D]);Implementations§
Source§impl<const N: usize> RxAddrP0<N>
impl<const N: usize> RxAddrP0<N>
Sourcepub const fn rx_addr_p0(&self) -> u64
pub const fn rx_addr_p0(&self) -> u64
RX address data pipe 0. Default value: 0xE7E7E7E7E7.
Sourcepub const fn with_rx_addr_p0(self, value: u64) -> Self
pub const fn with_rx_addr_p0(self, value: u64) -> Self
RX address data pipe 0. Default value: 0xE7E7E7E7E7.
Trait Implementations§
Source§impl<const N: usize> AddressRegister<N> for RxAddrP0<N>
impl<const N: usize> AddressRegister<N> for RxAddrP0<N>
Source§fn into_bytes(self) -> [u8; N]
fn into_bytes(self) -> [u8; N]
Convert into bytes ordered by LSByte first.
impl<const N: usize> Copy for RxAddrP0<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for RxAddrP0<N>
impl<const N: usize> RefUnwindSafe for RxAddrP0<N>
impl<const N: usize> Send for RxAddrP0<N>
impl<const N: usize> Sync for RxAddrP0<N>
impl<const N: usize> Unpin for RxAddrP0<N>
impl<const N: usize> UnwindSafe for RxAddrP0<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more