pub struct TxAddr<const N: usize>(/* private fields */);Expand description
§TX_ADDR register
TX address. Set RxAddrP0 equal to this address to handle ACK automatically.
Address = 0x10
Const parameter N: address width in bytes.
N must be of {3, 4, 5}.
§Fields
§tx_addr | bits 39:0
TX address. Default value: 0xE7E7E7E7E7.
§Example
use nrf24l01_commands::{registers, registers::AddressRegister};
// Default value
let reg = registers::TxAddr::<4>::new();
assert_eq!(reg.into_bits(), 0xE7E7E7E7E7);
// Write fields
let reg = registers::TxAddr::<5>::new().with_tx_addr(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::TxAddr::<3>::new().with_tx_addr(0xC2840DF659);
assert_eq!(reg.into_bytes(), [0x59, 0xF6, 0x0D]);Implementations§
Trait Implementations§
Source§impl<const N: usize> AddressRegister<N> for TxAddr<N>
impl<const N: usize> AddressRegister<N> for TxAddr<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 TxAddr<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for TxAddr<N>
impl<const N: usize> RefUnwindSafe for TxAddr<N>
impl<const N: usize> Send for TxAddr<N>
impl<const N: usize> Sync for TxAddr<N>
impl<const N: usize> Unpin for TxAddr<N>
impl<const N: usize> UnwindSafe for TxAddr<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