1 /* 2 * Copyright (c) 2022 Blues Inc. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <zephyr/drivers/gpio.h> 8 #include <zephyr/init.h> 9 board_swan_init(void)10static int board_swan_init(void) 11 { 12 const struct gpio_dt_spec dischrg = 13 GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), dischrg_gpios); 14 15 16 if (!gpio_is_ready_dt(&dischrg)) { 17 return -ENODEV; 18 } 19 20 (void)gpio_pin_configure_dt(&dischrg, GPIO_OUTPUT_INACTIVE); 21 22 return 0; 23 } 24 25 SYS_INIT(board_swan_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); 26