aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-02-03 00:33:34 +0000
committerGitHub <[email protected]>2025-02-03 00:33:34 +0000
commit8c5e34604c8b7c934259ba991433ae8e9f1ca61d (patch)
tree4260407675ef26dfb5bc22a1dae1ff9a7a40225e
parent81e2d12cc287a7682e576890d248f5ad0349b532 (diff)
parent640612a47f1d574ed22a8713b26b938ff54f9655 (diff)
Merge pull request #3837 from klownfish/nrf-reg0
nRF52833: configure internal LDO
-rw-r--r--embassy-nrf/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs
index faef44d1b..9a9485f04 100644
--- a/embassy-nrf/src/lib.rs
+++ b/embassy-nrf/src/lib.rs
@@ -314,14 +314,14 @@ pub mod config {
314 #[cfg(feature = "nrf52840")] 314 #[cfg(feature = "nrf52840")]
315 pub reg0: bool, 315 pub reg0: bool,
316 /// Configure the voltage of the first stage DCDC. It is stored in non-volatile memory (UICR.REGOUT0 register); pass None to not touch it. 316 /// Configure the voltage of the first stage DCDC. It is stored in non-volatile memory (UICR.REGOUT0 register); pass None to not touch it.
317 #[cfg(feature = "nrf52840")] 317 #[cfg(any(feature = "nrf52840", feature = "nrf52833"))]
318 pub reg0_voltage: Option<Reg0Voltage>, 318 pub reg0_voltage: Option<Reg0Voltage>,
319 /// Config for the second stage DCDC (VDD -> DEC4), if disabled LDO will be used. 319 /// Config for the second stage DCDC (VDD -> DEC4), if disabled LDO will be used.
320 pub reg1: bool, 320 pub reg1: bool,
321 } 321 }
322 322
323 /// Output voltage setting for REG0 regulator stage. 323 /// Output voltage setting for REG0 regulator stage.
324 #[cfg(feature = "nrf52840")] 324 #[cfg(any(feature = "nrf52840", feature = "nrf52833"))]
325 pub enum Reg0Voltage { 325 pub enum Reg0Voltage {
326 /// 1.8 V 326 /// 1.8 V
327 _1V8 = 0, 327 _1V8 = 0,
@@ -388,7 +388,7 @@ pub mod config {
388 dcdc: DcdcConfig { 388 dcdc: DcdcConfig {
389 #[cfg(feature = "nrf52840")] 389 #[cfg(feature = "nrf52840")]
390 reg0: false, 390 reg0: false,
391 #[cfg(feature = "nrf52840")] 391 #[cfg(any(feature = "nrf52840", feature = "nrf52833"))]
392 reg0_voltage: None, 392 reg0_voltage: None,
393 reg1: false, 393 reg1: false,
394 }, 394 },
@@ -664,7 +664,7 @@ pub fn init(config: config::Config) -> Peripherals {
664 } 664 }
665 } 665 }
666 666
667 #[cfg(feature = "nrf52840")] 667 #[cfg(any(feature = "nrf52840", feature = "nrf52833"))]
668 unsafe { 668 unsafe {
669 if let Some(value) = config.dcdc.reg0_voltage { 669 if let Some(value) = config.dcdc.reg0_voltage {
670 let value = value as u32; 670 let value = value as u32;