From 9d7a37a571ed6847fac185a3d6dbd1a223b3949c Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Wed, 20 Jan 2021 12:41:32 +0100 Subject: [PATCH] cpu/nrf5x: also enable DCDC for REG0 if used --- cpu/nrf5x_common/include/nrfx.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cpu/nrf5x_common/include/nrfx.h b/cpu/nrf5x_common/include/nrfx.h index 9a3a2519db..8b43fab5cb 100644 --- a/cpu/nrf5x_common/include/nrfx.h +++ b/cpu/nrf5x_common/include/nrfx.h @@ -42,6 +42,15 @@ static inline void nrfx_dcdc_init(void) { #ifdef NRF5X_ENABLE_DCDC NRF_POWER->DCDCEN = 1; + + /* on CPUs that support high voltage power supply via VDDH and thus use a + * two stage regulator, we also enable the DC/DC converter for the first + * state. */ +#ifdef POWER_MAINREGSTATUS_MAINREGSTATUS_High + if (NRF_POWER->MAINREGSTATUS == POWER_MAINREGSTATUS_MAINREGSTATUS_High) { + NRF_POWER->DCDCEN0 = 1; + } +#endif #endif }