mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 14:44:32 +00:00
Merge pull request #3837 from klownfish/nrf-reg0
nRF52833: configure internal LDO
This commit is contained in:
commit
8c5e34604c
@ -314,14 +314,14 @@ pub mod config {
|
|||||||
#[cfg(feature = "nrf52840")]
|
#[cfg(feature = "nrf52840")]
|
||||||
pub reg0: bool,
|
pub reg0: bool,
|
||||||
/// Configure the voltage of the first stage DCDC. It is stored in non-volatile memory (UICR.REGOUT0 register); pass None to not touch it.
|
/// Configure the voltage of the first stage DCDC. It is stored in non-volatile memory (UICR.REGOUT0 register); pass None to not touch it.
|
||||||
#[cfg(feature = "nrf52840")]
|
#[cfg(any(feature = "nrf52840", feature = "nrf52833"))]
|
||||||
pub reg0_voltage: Option<Reg0Voltage>,
|
pub reg0_voltage: Option<Reg0Voltage>,
|
||||||
/// Config for the second stage DCDC (VDD -> DEC4), if disabled LDO will be used.
|
/// Config for the second stage DCDC (VDD -> DEC4), if disabled LDO will be used.
|
||||||
pub reg1: bool,
|
pub reg1: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Output voltage setting for REG0 regulator stage.
|
/// Output voltage setting for REG0 regulator stage.
|
||||||
#[cfg(feature = "nrf52840")]
|
#[cfg(any(feature = "nrf52840", feature = "nrf52833"))]
|
||||||
pub enum Reg0Voltage {
|
pub enum Reg0Voltage {
|
||||||
/// 1.8 V
|
/// 1.8 V
|
||||||
_1V8 = 0,
|
_1V8 = 0,
|
||||||
@ -388,7 +388,7 @@ pub mod config {
|
|||||||
dcdc: DcdcConfig {
|
dcdc: DcdcConfig {
|
||||||
#[cfg(feature = "nrf52840")]
|
#[cfg(feature = "nrf52840")]
|
||||||
reg0: false,
|
reg0: false,
|
||||||
#[cfg(feature = "nrf52840")]
|
#[cfg(any(feature = "nrf52840", feature = "nrf52833"))]
|
||||||
reg0_voltage: None,
|
reg0_voltage: None,
|
||||||
reg1: false,
|
reg1: false,
|
||||||
},
|
},
|
||||||
@ -664,7 +664,7 @@ pub fn init(config: config::Config) -> Peripherals {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "nrf52840")]
|
#[cfg(any(feature = "nrf52840", feature = "nrf52833"))]
|
||||||
unsafe {
|
unsafe {
|
||||||
if let Some(value) = config.dcdc.reg0_voltage {
|
if let Some(value) = config.dcdc.reg0_voltage {
|
||||||
let value = value as u32;
|
let value = value as u32;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user