1 /* 2 * Copyright (c) 2018 Phytec Messtechnik GmbH 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <zephyr/init.h> 8 #include <soc.h> 9 10 /* Peripheral voltage ON/OFF GPIO */ 11 #define PERIPH_PON_PIN 0 12 board_reel_board_init(void)13static int board_reel_board_init(void) 14 { 15 volatile NRF_GPIO_Type *gpio = NRF_P1; 16 17 /* 18 * Workaround to enable peripheral voltage. 19 */ 20 gpio->PIN_CNF[PERIPH_PON_PIN] = 21 (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos) | 22 (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos); 23 24 gpio->OUTSET = BIT(PERIPH_PON_PIN); 25 26 return 0; 27 } 28 29 SYS_INIT(board_reel_board_init, PRE_KERNEL_2, 30 CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); 31