RxAddrP0

Struct RxAddrP0 

Source
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>

Source

pub const fn rx_addr_p0(&self) -> u64

RX address data pipe 0. Default value: 0xE7E7E7E7E7.

Source

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>

Source§

const ADDRESS: u8 = 10u8

Register address.
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.
Source§

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

Source§

fn clone(&self) -> RxAddrP0<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.