pub struct Feature(/* private fields */);Expand description
§FEATURE register
Enable features Dynamic Payload Length, Payload with ACK and W_TX_PAYLOAD_NO_ACK command.
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 const fn set_en_dpl(&mut self, value: bool)
pub const fn set_en_dpl(&mut self, value: bool)
Enables Dynamic Payload Length.
Bits: 2..3
Sourcepub const fn set_en_dpl_checked(&mut self, value: bool) -> Result<(), ()>
pub const 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 const fn set_en_ack_pay(&mut self, value: bool)
pub const fn set_en_ack_pay(&mut self, value: bool)
Enables Payload with ACK.
Bits: 1..2
Sourcepub const fn set_en_ack_pay_checked(&mut self, value: bool) -> Result<(), ()>
pub const 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 const fn set_en_dyn_ack(&mut self, value: bool)
pub const 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
Mutably borrows from an owned value. Read more