zephyr/boards/arm/efm32hg_slstk3400a/board.c
Gerard Marull-Paretas db508379c2 boards: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all boards code to the
new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:57:15 +02:00

34 lines
788 B
C

/*
* 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_get_binding(BC_ENABLE_GPIO_NAME);
if (!bce_dev) {
printk("Board controller gpio port was not found!\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);