zephyr/boards/arm/efm32pg_stk3402a/board.c
Anas Nashif 6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00

33 lines
788 B
C

/*
* Copyright (c) 2018 Christian Taedcke
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <init.h>
#include "board.h"
#include <drivers/gpio.h>
#include <misc/printk.h>
static int efm32pg_stk3402a_init(struct device *dev)
{
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_DIR_OUT);
gpio_pin_write(bce_dev, BC_ENABLE_GPIO_PIN, 1);
return 0;
}
/* needs to be done after GPIO driver init */
SYS_INIT(efm32pg_stk3402a_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY);