pub struct RfSetup(/* private fields */);Expand description
§RF_SETUP register
Set RF air data rate and output power.
Address = 0x06
§Fields
§cont_wave | bit 7
Enables continuous carrier transmit.
§rf_dr_low | bit 5
Set RF data rate to 250kbps. See rf_dr_high.
§pll_lock | bit 4
Force PLL lock signal. Only used in test.
§rf_dr_high | bit 3
Select between the high speed data rates. This bit
is don’t care if rf_dr_low is set. Enum: RfDrHigh.
Default value: 1 (2 Mbps).
Encoding [RF_DR_LOW, RF_DR_HIGH]:
00 - 1Mbps
01 - 2Mbps
10 - 250kbps
11 - Reserved
§rf_pwr | bits 2:1
RF output power in TX mode. Enum: RfPower.
Default value: 11 (0 dBm).
§Example
use nrf24l01_commands::{fields, registers};
// Default value
let reg = registers::RfSetup::new();
assert_eq!(reg.into_bits(), 0b0000_1110);
// Write fields
let reg = registers::RfSetup::new()
.with_pll_lock(false)
.with_rf_dr_low(true)
.with_rf_dr_high(fields::RfDrHigh::Mbps1)
.with_rf_pwr(fields::RfPower::Neg6Dbm);
assert_eq!(reg.into_bits(), 0b0010_0100);
// Read fields
assert_eq!(reg.rf_pwr(), fields::RfPower::Neg6Dbm);Implementations§
Source§impl RfSetup
impl RfSetup
Sourcepub const fn with_cont_wave_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_cont_wave_checked(self, value: bool) -> Result<Self, ()>
Enables continuous carrier transmit.
Bits: 7..8
Sourcepub const fn with_cont_wave(self, value: bool) -> Self
pub const fn with_cont_wave(self, value: bool) -> Self
Enables continuous carrier transmit.
Bits: 7..8
Sourcepub const fn set_cont_wave(&mut self, value: bool)
pub const fn set_cont_wave(&mut self, value: bool)
Enables continuous carrier transmit.
Bits: 7..8
Sourcepub const fn set_cont_wave_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_cont_wave_checked(&mut self, value: bool) -> Result<(), ()>
Enables continuous carrier transmit.
Bits: 7..8
Sourcepub const fn with_rf_dr_low_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_rf_dr_low_checked(self, value: bool) -> Result<Self, ()>
Set RF data rate to 250kbps. See rf_dr_high.
Bits: 5..6
Sourcepub const fn with_rf_dr_low(self, value: bool) -> Self
pub const fn with_rf_dr_low(self, value: bool) -> Self
Set RF data rate to 250kbps. See rf_dr_high.
Bits: 5..6
Sourcepub const fn set_rf_dr_low(&mut self, value: bool)
pub const fn set_rf_dr_low(&mut self, value: bool)
Set RF data rate to 250kbps. See rf_dr_high.
Bits: 5..6
Sourcepub const fn set_rf_dr_low_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_rf_dr_low_checked(&mut self, value: bool) -> Result<(), ()>
Set RF data rate to 250kbps. See rf_dr_high.
Bits: 5..6
Sourcepub const fn with_pll_lock_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_pll_lock_checked(self, value: bool) -> Result<Self, ()>
Force PLL lock signal. Only used in test.
Bits: 4..5
Sourcepub const fn with_pll_lock(self, value: bool) -> Self
pub const fn with_pll_lock(self, value: bool) -> Self
Force PLL lock signal. Only used in test.
Bits: 4..5
Sourcepub const fn set_pll_lock(&mut self, value: bool)
pub const fn set_pll_lock(&mut self, value: bool)
Force PLL lock signal. Only used in test.
Bits: 4..5
Sourcepub const fn set_pll_lock_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_pll_lock_checked(&mut self, value: bool) -> Result<(), ()>
Force PLL lock signal. Only used in test.
Bits: 4..5
Sourcepub const fn rf_dr_high(&self) -> RfDrHigh
pub const fn rf_dr_high(&self) -> RfDrHigh
Select between the high speed data rates. This bit
is don’t care if rf_dr_low is set. Enum: RfDrHigh.
Default value: 1 (2 Mbps).
Encoding [RF_DR_LOW, RF_DR_HIGH]:
00 - 1Mbps
01 - 2Mbps
10 - 250kbps
11 - Reserved
Bits: 3..4
Sourcepub const fn with_rf_dr_high_checked(self, value: RfDrHigh) -> Result<Self, ()>
pub const fn with_rf_dr_high_checked(self, value: RfDrHigh) -> Result<Self, ()>
Select between the high speed data rates. This bit
is don’t care if rf_dr_low is set. Enum: RfDrHigh.
Default value: 1 (2 Mbps).
Encoding [RF_DR_LOW, RF_DR_HIGH]:
00 - 1Mbps
01 - 2Mbps
10 - 250kbps
11 - Reserved
Bits: 3..4
Sourcepub const fn with_rf_dr_high(self, value: RfDrHigh) -> Self
pub const fn with_rf_dr_high(self, value: RfDrHigh) -> Self
Select between the high speed data rates. This bit
is don’t care if rf_dr_low is set. Enum: RfDrHigh.
Default value: 1 (2 Mbps).
Encoding [RF_DR_LOW, RF_DR_HIGH]:
00 - 1Mbps
01 - 2Mbps
10 - 250kbps
11 - Reserved
Bits: 3..4
Sourcepub const fn set_rf_dr_high(&mut self, value: RfDrHigh)
pub const fn set_rf_dr_high(&mut self, value: RfDrHigh)
Select between the high speed data rates. This bit
is don’t care if rf_dr_low is set. Enum: RfDrHigh.
Default value: 1 (2 Mbps).
Encoding [RF_DR_LOW, RF_DR_HIGH]:
00 - 1Mbps
01 - 2Mbps
10 - 250kbps
11 - Reserved
Bits: 3..4
Sourcepub const fn set_rf_dr_high_checked(
&mut self,
value: RfDrHigh,
) -> Result<(), ()>
pub const fn set_rf_dr_high_checked( &mut self, value: RfDrHigh, ) -> Result<(), ()>
Select between the high speed data rates. This bit
is don’t care if rf_dr_low is set. Enum: RfDrHigh.
Default value: 1 (2 Mbps).
Encoding [RF_DR_LOW, RF_DR_HIGH]:
00 - 1Mbps
01 - 2Mbps
10 - 250kbps
11 - Reserved
Bits: 3..4
Sourcepub const fn rf_pwr(&self) -> RfPower
pub const fn rf_pwr(&self) -> RfPower
RF output power in TX mode. Enum: RfPower.
Default value: 11 (0 dBm).
Bits: 1..3
Sourcepub const fn with_rf_pwr_checked(self, value: RfPower) -> Result<Self, ()>
pub const fn with_rf_pwr_checked(self, value: RfPower) -> Result<Self, ()>
RF output power in TX mode. Enum: RfPower.
Default value: 11 (0 dBm).
Bits: 1..3
Sourcepub const fn with_rf_pwr(self, value: RfPower) -> Self
pub const fn with_rf_pwr(self, value: RfPower) -> Self
RF output power in TX mode. Enum: RfPower.
Default value: 11 (0 dBm).
Bits: 1..3
Sourcepub const fn set_rf_pwr(&mut self, value: RfPower)
pub const fn set_rf_pwr(&mut self, value: RfPower)
RF output power in TX mode. Enum: RfPower.
Default value: 11 (0 dBm).
Bits: 1..3