pub struct SetupAw(/* private fields */);Expand description
§SETUP_AW register
Set up address width. This applies to TxAddr and all RX addresses for data pipes.
Address = 0x03
§Fields
§aw | bits 1:0
Address width. Default value: 11 (5 byte address).
Enum: AddressWidth.
§Example
use nrf24l01_commands::{fields, registers};
// Default value
let reg = registers::SetupAw::new();
assert_eq!(reg.into_bits(), 0b0000_0011);
// Write fields
let reg = registers::SetupAw::new().with_aw(fields::AddressWidth::FourByte);
assert_eq!(reg.into_bits(), 0b0000_0010);Implementations§
Source§impl SetupAw
impl SetupAw
Sourcepub const fn aw(&self) -> AddressWidth
pub const fn aw(&self) -> AddressWidth
Address width. Default value: 11 (5 byte address).
Enum: AddressWidth.
Bits: 0..2
Sourcepub const fn with_aw_checked(self, value: AddressWidth) -> Result<Self, ()>
pub const fn with_aw_checked(self, value: AddressWidth) -> Result<Self, ()>
Address width. Default value: 11 (5 byte address).
Enum: AddressWidth.
Bits: 0..2
Sourcepub const fn with_aw(self, value: AddressWidth) -> Self
pub const fn with_aw(self, value: AddressWidth) -> Self
Address width. Default value: 11 (5 byte address).
Enum: AddressWidth.
Bits: 0..2
Sourcepub const fn set_aw(&mut self, value: AddressWidth)
pub const fn set_aw(&mut self, value: AddressWidth)
Address width. Default value: 11 (5 byte address).
Enum: AddressWidth.
Bits: 0..2
Sourcepub const fn set_aw_checked(&mut self, value: AddressWidth) -> Result<(), ()>
pub const fn set_aw_checked(&mut self, value: AddressWidth) -> Result<(), ()>
Address width. Default value: 11 (5 byte address).
Enum: AddressWidth.
Bits: 0..2
Trait Implementations§
impl Copy for SetupAw
Auto Trait Implementations§
impl Freeze for SetupAw
impl RefUnwindSafe for SetupAw
impl Send for SetupAw
impl Sync for SetupAw
impl Unpin for SetupAw
impl UnwindSafe for SetupAw
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