Merge pull request #8794 from basilfx/feature/efm32_fix_style
boards: efm32: adapt pr feedback for other boards
This commit is contained in:
commit
2a594b644b
@ -20,9 +20,15 @@
|
|||||||
|
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
|
|
||||||
|
#ifdef MODULE_SILABS_AEM
|
||||||
#include "aem.h"
|
#include "aem.h"
|
||||||
|
#endif
|
||||||
|
#ifdef MODULE_SILABS_BC
|
||||||
#include "bc.h"
|
#include "bc.h"
|
||||||
|
#endif
|
||||||
|
#ifdef MODULE_SILABS_PIC
|
||||||
#include "pic.h"
|
#include "pic.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
void board_common_init(void)
|
void board_common_init(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||||
USEMODULE += saul_gpio
|
USEMODULE += saul_gpio
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(RIOTCPU)/efm32/Makefile.dep
|
include $(RIOTCPU)/efm32/Makefile.dep
|
||||||
|
|||||||
@ -9,4 +9,4 @@ FEATURES_PROVIDED += periph_uart
|
|||||||
# The board MPU family (used for grouping by the CI system)
|
# The board MPU family (used for grouping by the CI system)
|
||||||
FEATURES_MCU_GROUP = cortex_m4_2
|
FEATURES_MCU_GROUP = cortex_m4_2
|
||||||
|
|
||||||
include $(RIOTCPU)/efm32/Makefile.features
|
-include $(RIOTCPU)/efm32/Makefile.features
|
||||||
|
|||||||
@ -22,7 +22,6 @@
|
|||||||
#define BOARD_H
|
#define BOARD_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#include "periph_conf.h"
|
#include "periph_conf.h"
|
||||||
#include "periph/gpio.h"
|
#include "periph/gpio.h"
|
||||||
#include "periph/spi.h"
|
#include "periph/spi.h"
|
||||||
|
|||||||
@ -20,9 +20,7 @@
|
|||||||
#define PERIPH_CONF_H
|
#define PERIPH_CONF_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#include "periph_cpu.h"
|
#include "periph_cpu.h"
|
||||||
|
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@ -31,7 +31,7 @@ void board_init(void)
|
|||||||
/* perform common board initialization */
|
/* perform common board initialization */
|
||||||
board_common_init();
|
board_common_init();
|
||||||
|
|
||||||
#ifdef MODULE_SI70XX
|
#ifdef MODULE_SI7021
|
||||||
/* initialize the Si7021 sensor */
|
/* initialize the Si7021 sensor */
|
||||||
gpio_init(SI7021_EN_PIN, GPIO_OUT);
|
gpio_init(SI7021_EN_PIN, GPIO_OUT);
|
||||||
gpio_set(SI7021_EN_PIN);
|
gpio_set(SI7021_EN_PIN);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||||
USEMODULE += saul_gpio
|
USEMODULE += saul_gpio
|
||||||
USEMODULE += bmp280
|
USEMODULE += bmp280
|
||||||
USEMODULE += si7021
|
USEMODULE += si7021
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# include board common dependencies
|
# include board common dependencies
|
||||||
|
|||||||
@ -11,4 +11,4 @@ FEATURES_PROVIDED += periph_uart
|
|||||||
# The board MPU family (used for grouping by the CI system)
|
# The board MPU family (used for grouping by the CI system)
|
||||||
FEATURES_MCU_GROUP = cortex_m4_2
|
FEATURES_MCU_GROUP = cortex_m4_2
|
||||||
|
|
||||||
include $(RIOTCPU)/efm32/Makefile.features
|
-include $(RIOTCPU)/efm32/Makefile.features
|
||||||
|
|||||||
@ -21,10 +21,12 @@
|
|||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
#include "pic.h"
|
|
||||||
|
|
||||||
#include "periph/gpio.h"
|
#include "periph/gpio.h"
|
||||||
|
|
||||||
|
#ifdef MODULE_SILABS_PIC
|
||||||
|
#include "pic.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
void board_init(void)
|
void board_init(void)
|
||||||
{
|
{
|
||||||
/* initialize the CPU */
|
/* initialize the CPU */
|
||||||
@ -34,23 +36,23 @@ void board_init(void)
|
|||||||
board_common_init();
|
board_common_init();
|
||||||
|
|
||||||
#ifdef MODULE_SILABS_PIC
|
#ifdef MODULE_SILABS_PIC
|
||||||
/* enable the CCS811 air quality/gas sensor */
|
|
||||||
#if CCS811_ENABLED
|
#if CCS811_ENABLED
|
||||||
|
/* enable the CCS811 air quality/gas sensor */
|
||||||
pic_write(CCS811_PIC_ADDR, (1 << CCS811_PIC_EN_BIT) | (1 << CCS811_PIC_WAKE_BIT));
|
pic_write(CCS811_PIC_ADDR, (1 << CCS811_PIC_EN_BIT) | (1 << CCS811_PIC_WAKE_BIT));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* enable the IMU sensor */
|
|
||||||
#if ICM_20648_ENABLED
|
#if ICM_20648_ENABLED
|
||||||
|
/* enable the IMU sensor */
|
||||||
pic_write(ICM20648_PIC_ADDR, 1 << ICM20648_PIC_EN_BIT);
|
pic_write(ICM20648_PIC_ADDR, 1 << ICM20648_PIC_EN_BIT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(MODULE_BMP280) || defined(MODULE_SI7021) || SI1133_ENABLED || SI7210A_ENABLED
|
||||||
/* enable the environmental sensors */
|
/* enable the environmental sensors */
|
||||||
#if BMP280_ENABLED || SI1133_ENABLED || SI7021_ENABLED || SI7210A_ENABLED
|
|
||||||
pic_write(ENV_SENSE_PIC_ADDR, 1 << ENV_SENSE_PIC_BIT);
|
pic_write(ENV_SENSE_PIC_ADDR, 1 << ENV_SENSE_PIC_BIT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* enable the RGB leds */
|
|
||||||
#if RGB_LED1_ENABLED || RGB_LED2_ENABLED || RGB_LED3_ENABLED || RGB_LED4_ENABLED
|
#if RGB_LED1_ENABLED || RGB_LED2_ENABLED || RGB_LED3_ENABLED || RGB_LED4_ENABLED
|
||||||
|
/* enable the RGB leds */
|
||||||
pic_write(RGB_LED_ADDR,
|
pic_write(RGB_LED_ADDR,
|
||||||
(1 << RGB_LED_EN_BIT) |
|
(1 << RGB_LED_EN_BIT) |
|
||||||
(RGB_LED1_ENABLED << RGB_LED1_EN_BIT) |
|
(RGB_LED1_ENABLED << RGB_LED1_EN_BIT) |
|
||||||
|
|||||||
@ -23,7 +23,6 @@
|
|||||||
#define BOARD_H
|
#define BOARD_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#include "periph_conf.h"
|
#include "periph_conf.h"
|
||||||
#include "periph/gpio.h"
|
#include "periph/gpio.h"
|
||||||
#include "periph/spi.h"
|
#include "periph/spi.h"
|
||||||
@ -86,9 +85,6 @@ extern "C" {
|
|||||||
* Connection to the on-board pressure sensor (BMP280).
|
* Connection to the on-board pressure sensor (BMP280).
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#ifndef BMP280_ENABLED
|
|
||||||
#define BMP280_ENABLED (1)
|
|
||||||
#endif
|
|
||||||
#define BMP280_I2C I2C_DEV(0)
|
#define BMP280_I2C I2C_DEV(0)
|
||||||
|
|
||||||
#define BMX280_PARAM_I2C_DEV BMP280_I2C
|
#define BMX280_PARAM_I2C_DEV BMP280_I2C
|
||||||
@ -178,9 +174,6 @@ extern "C" {
|
|||||||
* Connection to the on-board temperature/humidity sensor (Si7021).
|
* Connection to the on-board temperature/humidity sensor (Si7021).
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#ifndef SI7021_ENABLED
|
|
||||||
#define SI7021_ENABLED (1)
|
|
||||||
#endif
|
|
||||||
#define SI7021_I2C I2C_DEV(0)
|
#define SI7021_I2C I2C_DEV(0)
|
||||||
|
|
||||||
#define SI70XX_PARAM_I2C_DEV SI7021_I2C
|
#define SI70XX_PARAM_I2C_DEV SI7021_I2C
|
||||||
|
|||||||
@ -21,9 +21,7 @@
|
|||||||
#define PERIPH_CONF_H
|
#define PERIPH_CONF_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#include "periph_cpu.h"
|
#include "periph_cpu.h"
|
||||||
|
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||||
USEMODULE += saul_gpio
|
USEMODULE += saul_gpio
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# include board common dependencies
|
# include board common dependencies
|
||||||
|
|||||||
@ -13,4 +13,4 @@ FEATURES_PROVIDED += periph_uart
|
|||||||
# The board MPU family (used for grouping by the CI system)
|
# The board MPU family (used for grouping by the CI system)
|
||||||
FEATURES_MCU_GROUP = cortex_m3_2
|
FEATURES_MCU_GROUP = cortex_m3_2
|
||||||
|
|
||||||
include $(RIOTCPU)/efm32/Makefile.features
|
-include $(RIOTCPU)/efm32/Makefile.features
|
||||||
|
|||||||
@ -23,7 +23,6 @@
|
|||||||
#define BOARD_H
|
#define BOARD_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#include "periph_conf.h"
|
#include "periph_conf.h"
|
||||||
#include "periph/gpio.h"
|
#include "periph/gpio.h"
|
||||||
#include "periph/spi.h"
|
#include "periph/spi.h"
|
||||||
|
|||||||
@ -21,9 +21,7 @@
|
|||||||
#define PERIPH_CONF_H
|
#define PERIPH_CONF_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#include "periph_cpu.h"
|
#include "periph_cpu.h"
|
||||||
|
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
ifneq (,$(filter saul_default,$(USEMODULE)))
|
ifneq (,$(filter saul_default,$(USEMODULE)))
|
||||||
USEMODULE += saul_gpio
|
USEMODULE += saul_gpio
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# include board common dependencies
|
# include board common dependencies
|
||||||
|
|||||||
@ -13,4 +13,4 @@ FEATURES_PROVIDED += periph_uart
|
|||||||
# The board MPU family (used for grouping by the CI system)
|
# The board MPU family (used for grouping by the CI system)
|
||||||
FEATURES_MCU_GROUP = cortex_m3_2
|
FEATURES_MCU_GROUP = cortex_m3_2
|
||||||
|
|
||||||
include $(RIOTCPU)/efm32/Makefile.features
|
-include $(RIOTCPU)/efm32/Makefile.features
|
||||||
|
|||||||
@ -23,7 +23,6 @@
|
|||||||
#define BOARD_H
|
#define BOARD_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#include "periph_conf.h"
|
#include "periph_conf.h"
|
||||||
#include "periph/gpio.h"
|
#include "periph/gpio.h"
|
||||||
#include "periph/spi.h"
|
#include "periph/spi.h"
|
||||||
|
|||||||
@ -21,9 +21,7 @@
|
|||||||
#define PERIPH_CONF_H
|
#define PERIPH_CONF_H
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#include "periph_cpu.h"
|
#include "periph_cpu.h"
|
||||||
|
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user