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