blob: 6b925246b1a306aded63e5559ed51ccc6e23a0f4 [file] [log] [blame]
/*
* Copyright (c) 2018 Marcio Montenegro
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include "board.h"
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
static int efm32hg_slstk3400a_init(const struct device *dev)
{
const struct device *bce_dev; /* Board Controller Enable Gpio Device */
ARG_UNUSED(dev);
/* Enable the board controller to be able to use the serial port */
bce_dev = DEVICE_DT_GET(BC_ENABLE_GPIO_NODE);
if (!device_is_ready(bce_dev)) {
printk("Board controller gpio port is not ready!\n");
return -ENODEV;
}
gpio_pin_configure(bce_dev, BC_ENABLE_GPIO_PIN, GPIO_OUTPUT_HIGH);
return 0;
}
/* needs to be done after GPIO driver init */
SYS_INIT(efm32hg_slstk3400a_init, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE);