3#ifdef USE_NRF52_REG0_VOUT
4#include <zephyr/init.h>
5#include <hal/nrf_power.h>
6#include <zephyr/sys/printk.h>
23 a =
static_cast<StatusFlags>(
static_cast<uint8_t
>(a) |
static_cast<uint8_t
>(b));
28 return (
static_cast<uint8_t
>(a) &
static_cast<uint8_t
>(b)) != 0;
31static bool regout0_ok() {
32 return (NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) == (USE_NRF52_REG0_VOUT << UICR_REGOUT0_VOUT_Pos);
42 (NRF_UICR->REGOUT0 & ~((uint32_t) UICR_REGOUT0_VOUT_Msk)) | (USE_NRF52_REG0_VOUT << UICR_REGOUT0_VOUT_Pos);
50#ifndef USE_BOOTLOADER_MCUBOOT
55static bool bootloader_ok() {
60 if (!bootloader_ok()) {
72#define BOOTLOADER_VERSION_REGISTER NRF_TIMER2->CC[0]
76#ifndef USE_BOOTLOADER_MCUBOOT
77 if (BOOTLOADER_VERSION_REGISTER <= 0x902) {
79 printk(
"cannot control regout0 for %#x\n", BOOTLOADER_VERSION_REGISTER);
86#ifndef USE_BOOTLOADER_MCUBOOT
87 status |= fix_bootloader();
92static int board_esphome_init() {
95#ifdef USE_NRF52_UICR_ERASE
98 if (ret != NRFX_SUCCESS) {
100 printk(
"nrfx_nvmc_uicr_erase failed %d\n", ret);
117static int board_esphome_init() {
return esphome::nrf52::board_esphome_init(); }
119SYS_INIT(board_esphome_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
BedjetMode mode
BedJet operating mode.
constexpr StatusFlags & operator|=(StatusFlags &a, StatusFlags b)
constexpr bool operator&(StatusFlags a, StatusFlags b)
constexpr uint32_t BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS
constexpr uint32_t BOOTLOADER_REGION_START
void nvmc_config(uint32_t mode)
nrfx_err_t nrfx_nvmc_uicr_erase()
SYS_INIT(board_esphome_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT)