2020-05-15 17:44:20 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020 Christian Taedcke
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <init.h>
|
|
|
|
#include "board.h"
|
|
|
|
#include <drivers/gpio.h>
|
|
|
|
#include <sys/printk.h>
|
|
|
|
|
2020-04-30 20:33:38 +02:00
|
|
|
static int efr32mg_sltb004a_init(const struct device *dev)
|
2020-05-15 17:44:20 +02:00
|
|
|
{
|
2020-04-30 20:33:38 +02:00
|
|
|
const struct device *cur_dev;
|
2020-05-15 17:44:20 +02:00
|
|
|
|
|
|
|
ARG_UNUSED(dev);
|
|
|
|
|
|
|
|
#ifdef CONFIG_CCS811
|
|
|
|
/* Enable the CCS811 power */
|
|
|
|
cur_dev = device_get_binding(CCS811_PWR_ENABLE_GPIO_NAME);
|
|
|
|
if (!cur_dev) {
|
|
|
|
printk("CCS811 power gpio port was not found!\n");
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
gpio_pin_configure(cur_dev, CCS811_PWR_ENABLE_GPIO_PIN, GPIO_OUTPUT);
|
|
|
|
gpio_pin_set(cur_dev, CCS811_PWR_ENABLE_GPIO_PIN, 1);
|
|
|
|
|
|
|
|
#endif /* CONFIG_CCS811 */
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* needs to be done after GPIO driver init */
|
|
|
|
SYS_INIT(efr32mg_sltb004a_init, PRE_KERNEL_1, CONFIG_BOARD_INIT_PRIORITY);
|