pub struct RxAddrP1<const N: usize>(/* private fields */);Expand description
§RX_ADDR_P1 register
RX address data pipe 1.
Address = 0x0B
Const parameter N: address width in bytes.
N must be of {3, 4, 5}.
§Fields
§rx_addr_p1 | bits 39:0
RX address data pipe 1. Default value: 0xC2C2C2C2C2.
§Example
use nrf24l01_commands::{registers, registers::AddressRegister};
// Default value
let reg = registers::RxAddrP1::<4>::new();
assert_eq!(reg.into_bits(), 0xC2C2C2C2C2);
// Write fields
let reg = registers::RxAddrP1::<5>::new().with_rx_addr_p1(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::RxAddrP1::<3>::new().with_rx_addr_p1(0xC2840DF659);
assert_eq!(reg.into_bytes(), [0x59, 0xF6, 0x0D]);Implementations§
Source§impl<const N: usize> RxAddrP1<N>
impl<const N: usize> RxAddrP1<N>
Sourcepub const fn rx_addr_p1(&self) -> u64
pub const fn rx_addr_p1(&self) -> u64
RX address data pipe 1. Default value: 0xC2C2C2C2C2.
Sourcepub const fn with_rx_addr_p1(self, value: u64) -> Self
pub const fn with_rx_addr_p1(self, value: u64) -> Self
RX address data pipe 1. Default value: 0xC2C2C2C2C2.
Trait Implementations§
Source§impl<const N: usize> AddressRegister<N> for RxAddrP1<N>
impl<const N: usize> AddressRegister<N> for RxAddrP1<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 RxAddrP1<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for RxAddrP1<N>
impl<const N: usize> RefUnwindSafe for RxAddrP1<N>
impl<const N: usize> Send for RxAddrP1<N>
impl<const N: usize> Sync for RxAddrP1<N>
impl<const N: usize> Unpin for RxAddrP1<N>
impl<const N: usize> UnwindSafe for RxAddrP1<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