14 #if RUUVI_NRF5_SDK15_POWER_ENABLED
16 #include "nrf_bootloader_info.h"
17 #include "nrfx_power.h"
22 #include "sdk_errors.h"
25 static bool m_is_init =
false;
29 ret_code_t err_code = NRF_SUCCESS;
30 nrfx_power_config_t config = {0};
39 #if NRF_POWER_HAS_VDDH
40 config.dcdcenhv =
true;
52 err_code |= nrfx_power_init (&config);
59 if (nrf_sdh_is_enabled())
61 sd_nvic_SystemReset();
71 if (nrf_sdh_is_enabled())
73 sd_power_gpregret_clr (0, 0xffffffff);
74 sd_power_gpregret_set (0, BOOTLOADER_DFU_START);
75 sd_nvic_SystemReset();
79 NRF_POWER->GPREGRET = BOOTLOADER_DFU_START;
uint32_t rd_status_t
bitfield for representing errors
rd_status_t ruuvi_nrf5_sdk15_to_ruuvi_error(const ret_code_t error)
convert nrf5 sdk15 error code into Ruuvi error code.
#define RD_ERROR_NOT_SUPPORTED
Not supported.
Header to enable and disable module compilation.
Ruuvi error codes and error check function.
rd_status_t ri_power_regulators_enable(const ri_power_regulators_t regulators)
Enable given regulators.
void ri_power_enter_bootloader(void)
Enter bootloader.
void ri_power_reset(void)
Reset IC.
Enable implementation selected by application.
unsigned int DCDC_HV
DC/DC for high voltage, i.e. nRF52840 USB.
unsigned int DCDC_INTERNAL
DC/DC for internal circuitry, i.e. nRF52832 radio.