pub struct Feature(/* private fields */);Expand description
§FEATURE register
Enable features ‘Dynamic Payload Length’, ‘Payload with ACK’ and ‘W_TX_PAYLOAD_NO_ACK’ command. To activate this register, use the ACTIVATE command. To deactivate this register, use the ACTIVATE command again.
Address = 0x01D
§Fields
§en_dpl | bit 2
Enables Dynamic Payload Length.
§en_ack_pay | bit 1
Enables Payload with ACK.
§en_dyn_ack | bit 0
Enables ‘W_TX_PAYLOAD_NO_ACK’ command.
§Example
use nrf24l01_commands::registers;
// Default value
let reg = registers::Feature::new();
assert_eq!(reg.into_bits(), 0);
// Write fields
let reg = registers::Feature::new()
.with_en_dpl(false)
.with_en_ack_pay(true)
.with_en_dyn_ack(true);
assert_eq!(reg.into_bits(), 0b0000_0011);Implementations§
source§impl Feature
impl Feature
sourcepub const fn with_en_dpl_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_en_dpl_checked(self, value: bool) -> Result<Self, ()>
Enables Dynamic Payload Length.
Bits: 2..3
sourcepub const fn with_en_dpl(self, value: bool) -> Self
pub const fn with_en_dpl(self, value: bool) -> Self
Enables Dynamic Payload Length.
Bits: 2..3
sourcepub fn set_en_dpl(&mut self, value: bool)
pub fn set_en_dpl(&mut self, value: bool)
Enables Dynamic Payload Length.
Bits: 2..3
sourcepub fn set_en_dpl_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_en_dpl_checked(&mut self, value: bool) -> Result<(), ()>
Enables Dynamic Payload Length.
Bits: 2..3
sourcepub const fn en_ack_pay(&self) -> bool
pub const fn en_ack_pay(&self) -> bool
Enables Payload with ACK.
Bits: 1..2
sourcepub const fn with_en_ack_pay_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_en_ack_pay_checked(self, value: bool) -> Result<Self, ()>
Enables Payload with ACK.
Bits: 1..2
sourcepub const fn with_en_ack_pay(self, value: bool) -> Self
pub const fn with_en_ack_pay(self, value: bool) -> Self
Enables Payload with ACK.
Bits: 1..2
sourcepub fn set_en_ack_pay(&mut self, value: bool)
pub fn set_en_ack_pay(&mut self, value: bool)
Enables Payload with ACK.
Bits: 1..2
sourcepub fn set_en_ack_pay_checked(&mut self, value: bool) -> Result<(), ()>
pub fn set_en_ack_pay_checked(&mut self, value: bool) -> Result<(), ()>
Enables Payload with ACK.
Bits: 1..2
sourcepub const fn en_dyn_ack(&self) -> bool
pub const fn en_dyn_ack(&self) -> bool
Enables ‘W_TX_PAYLOAD_NO_ACK’ command.
Bits: 0..1
sourcepub const fn with_en_dyn_ack_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_en_dyn_ack_checked(self, value: bool) -> Result<Self, ()>
Enables ‘W_TX_PAYLOAD_NO_ACK’ command.
Bits: 0..1
sourcepub const fn with_en_dyn_ack(self, value: bool) -> Self
pub const fn with_en_dyn_ack(self, value: bool) -> Self
Enables ‘W_TX_PAYLOAD_NO_ACK’ command.
Bits: 0..1
sourcepub fn set_en_dyn_ack(&mut self, value: bool)
pub fn set_en_dyn_ack(&mut self, value: bool)
Enables ‘W_TX_PAYLOAD_NO_ACK’ command.
Bits: 0..1
Trait Implementations§
impl Copy for Feature
Auto Trait Implementations§
impl Freeze for Feature
impl RefUnwindSafe for Feature
impl Send for Feature
impl Sync for Feature
impl Unpin for Feature
impl UnwindSafe for Feature
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)