2017-11-13 16:09:23 +01:00
|
|
|
/*
|
2020-10-27 00:03:23 +01:00
|
|
|
* Copyright (C) 2015-2020 Freie Universität Berlin
|
2017-11-13 16:09:23 +01:00
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup boards_sltb001a
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Board specific implementations SLTB001A board
|
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
* @author Bas Stottelaar <basstottelaar@gmail.com>
|
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "board.h"
|
2018-02-05 23:42:21 +01:00
|
|
|
#include "board_common.h"
|
2017-11-13 16:09:23 +01:00
|
|
|
#include "periph/gpio.h"
|
2018-03-16 22:17:54 +01:00
|
|
|
|
|
|
|
#ifdef MODULE_SILABS_PIC
|
2018-03-16 19:41:33 +01:00
|
|
|
#include "pic.h"
|
2018-03-16 22:17:54 +01:00
|
|
|
#endif
|
2017-11-13 16:09:23 +01:00
|
|
|
|
|
|
|
void board_init(void)
|
|
|
|
{
|
2019-09-26 23:32:26 +02:00
|
|
|
#ifndef RIOTBOOT
|
2018-02-05 23:42:21 +01:00
|
|
|
/* perform common board initialization */
|
|
|
|
board_common_init();
|
2017-11-13 16:09:23 +01:00
|
|
|
|
2018-02-05 23:42:21 +01:00
|
|
|
#ifdef MODULE_SILABS_PIC
|
2020-06-28 22:42:32 +02:00
|
|
|
#ifdef MODULE_CCS811
|
2018-03-16 19:37:54 +01:00
|
|
|
/* enable the CCS811 air quality/gas sensor */
|
2018-02-05 23:42:21 +01:00
|
|
|
pic_write(CCS811_PIC_ADDR, (1 << CCS811_PIC_EN_BIT) | (1 << CCS811_PIC_WAKE_BIT));
|
2017-11-13 16:09:23 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ICM_20648_ENABLED
|
2018-03-16 19:37:54 +01:00
|
|
|
/* enable the IMU sensor */
|
2018-02-05 23:42:21 +01:00
|
|
|
pic_write(ICM20648_PIC_ADDR, 1 << ICM20648_PIC_EN_BIT);
|
2017-11-13 16:09:23 +01:00
|
|
|
#endif
|
|
|
|
|
2020-06-28 22:57:29 +02:00
|
|
|
#if defined(MODULE_BMP280) || defined(MODULE_SI7021) || SI1133_ENABLED || SI7210_ENABLED
|
2017-11-13 16:09:23 +01:00
|
|
|
/* enable the environmental sensors */
|
2018-02-05 23:42:21 +01:00
|
|
|
pic_write(ENV_SENSE_PIC_ADDR, 1 << ENV_SENSE_PIC_BIT);
|
2017-11-13 16:09:23 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if RGB_LED1_ENABLED || RGB_LED2_ENABLED || RGB_LED3_ENABLED || RGB_LED4_ENABLED
|
2018-03-16 19:37:54 +01:00
|
|
|
/* enable the RGB leds */
|
2018-02-05 23:42:21 +01:00
|
|
|
pic_write(RGB_LED_ADDR,
|
|
|
|
(1 << RGB_LED_EN_BIT) |
|
|
|
|
(RGB_LED1_ENABLED << RGB_LED1_EN_BIT) |
|
|
|
|
(RGB_LED2_ENABLED << RGB_LED2_EN_BIT) |
|
|
|
|
(RGB_LED3_ENABLED << RGB_LED3_EN_BIT) |
|
|
|
|
(RGB_LED4_ENABLED << RGB_LED4_EN_BIT));
|
|
|
|
#endif
|
2017-11-13 16:09:23 +01:00
|
|
|
#endif
|
2019-09-26 23:32:26 +02:00
|
|
|
#endif
|
2017-11-13 16:09:23 +01:00
|
|
|
}
|