diff --git a/boards/nucleo32-f303/Makefile.dep b/boards/nucleo32-f303/Makefile.dep index 5472bf8b8d..76e2dc17b4 100644 --- a/boards/nucleo32-f303/Makefile.dep +++ b/boards/nucleo32-f303/Makefile.dep @@ -1,3 +1 @@ -ifneq (,$(filter saul_default,$(USEMODULE))) - USEMODULE += saul_gpio -endif +include $(RIOTBOARD)/nucleo-common/Makefile.dep diff --git a/boards/nucleo32-f303/Makefile.features b/boards/nucleo32-f303/Makefile.features index 60442ac5e2..afe8834277 100644 --- a/boards/nucleo32-f303/Makefile.features +++ b/boards/nucleo32-f303/Makefile.features @@ -5,8 +5,8 @@ FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart -# Various common features of Nucleo boards -FEATURES_PROVIDED += cpp +# load the common Makefile.features for Nucleo-32 boards +include $(RIOTBOARD)/nucleo32-common/Makefile.features # The board MPU family (used for grouping by the CI system) FEATURES_MCU_GROUP = cortex_m4_2 diff --git a/boards/nucleo32-f303/Makefile.include b/boards/nucleo32-f303/Makefile.include index fd60898e78..b3b90180d9 100644 --- a/boards/nucleo32-f303/Makefile.include +++ b/boards/nucleo32-f303/Makefile.include @@ -2,12 +2,5 @@ export CPU = stm32f3 export CPU_MODEL = stm32f303k8 -# define the default port depending on the host OS -PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - -# setup serial terminal -include $(RIOTBOARD)/Makefile.include.serial - -# this board uses openocd -include $(RIOTBOARD)/Makefile.include.openocd +# load the common Makefile.include for Nucleo-32 boards +include $(RIOTBOARD)/nucleo32-common/Makefile.include diff --git a/boards/nucleo32-f303/include/board.h b/boards/nucleo32-f303/include/board.h index 485663bcc4..435982eaba 100644 --- a/boards/nucleo32-f303/include/board.h +++ b/boards/nucleo32-f303/include/board.h @@ -21,28 +21,12 @@ #ifndef BOARD_H #define BOARD_H +#include "board_common.h" + #ifdef __cplusplus extern "C" { #endif -/** - * @name Macros for controlling the on-board LED. - * @{ - */ -#define LED0_PIN GPIO_PIN(PORT_B, 3) - -#define LED0_MASK (1 << 3) - -#define LED0_ON (GPIOB->BSRR = LED0_MASK) -#define LED0_OFF (GPIOB->BSRR = (LED0_MASK << 16)) -#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK) -/** @} */ - -/** - * @brief Initialize board specific hardware, including clock, LEDs and std-IO - */ -void board_init(void); - #ifdef __cplusplus } #endif diff --git a/boards/nucleo32-f303/include/gpio_params.h b/boards/nucleo32-f303/include/gpio_params.h deleted file mode 100644 index b9e0d9dabb..0000000000 --- a/boards/nucleo32-f303/include/gpio_params.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2017 Inria - * - * 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_nucleo32-f303 - * @{ - * - * @file - * @brief Board specific configuration of direct mapped GPIOs - * - * @author Alexandre Abadie - */ - -#ifndef GPIO_PARAMS_H -#define GPIO_PARAMS_H - -#include "board.h" -#include "saul/periph.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief GPIO pin configuration - */ -static const saul_gpio_params_t saul_gpio_params[] = -{ - { - .name = "LD3", - .pin = LED0_PIN, - .mode = GPIO_OUT - }, -}; - -#ifdef __cplusplus -} -#endif - -#endif /* GPIO_PARAMS_H */ -/** @} */ diff --git a/boards/nucleo32-l031/Makefile.dep b/boards/nucleo32-l031/Makefile.dep index 5472bf8b8d..76e2dc17b4 100644 --- a/boards/nucleo32-l031/Makefile.dep +++ b/boards/nucleo32-l031/Makefile.dep @@ -1,3 +1 @@ -ifneq (,$(filter saul_default,$(USEMODULE))) - USEMODULE += saul_gpio -endif +include $(RIOTBOARD)/nucleo-common/Makefile.dep diff --git a/boards/nucleo32-l031/Makefile.features b/boards/nucleo32-l031/Makefile.features index 15648797fe..2076a87669 100644 --- a/boards/nucleo32-l031/Makefile.features +++ b/boards/nucleo32-l031/Makefile.features @@ -5,8 +5,8 @@ FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart -# Various common features of Nucleo boards -FEATURES_PROVIDED += cpp +# load the common Makefile.features for Nucleo-32 boards +include $(RIOTBOARD)/nucleo32-common/Makefile.features # The board MPU family (used for grouping by the CI system) FEATURES_MCU_GROUP = cortex_m0_1 diff --git a/boards/nucleo32-l031/Makefile.include b/boards/nucleo32-l031/Makefile.include index ac09741b51..7c63ee8907 100644 --- a/boards/nucleo32-l031/Makefile.include +++ b/boards/nucleo32-l031/Makefile.include @@ -2,12 +2,5 @@ export CPU = stm32l0 export CPU_MODEL = stm32l031k6 -# define the default port depending on the host OS -PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - -# setup serial terminal -include $(RIOTBOARD)/Makefile.include.serial - -# this board uses openocd -include $(RIOTBOARD)/Makefile.include.openocd +# load the common Makefile.include for Nucleo-32 boards +include $(RIOTBOARD)/nucleo32-common/Makefile.include diff --git a/boards/nucleo32-l031/include/board.h b/boards/nucleo32-l031/include/board.h index f520bc1c22..8698f53375 100644 --- a/boards/nucleo32-l031/include/board.h +++ b/boards/nucleo32-l031/include/board.h @@ -23,41 +23,10 @@ #ifndef BOARD_H #define BOARD_H -#include +#include "board_common.h" #ifdef __cplusplus -extern "C" { -#endif - -/** - * @name xtimer configuration - * @{ - */ -#define XTIMER_DEV TIMER_DEV(0) -#define XTIMER_CHAN (0) -#define XTIMER_WIDTH (16) -/** @} */ - -/** - * @name Macros for controlling the on-board LED. - * @{ - */ -#define LED0_PIN GPIO_PIN(PORT_B, 3) - -#define LED0_MASK (1 << 3) - -#define LED0_ON (GPIOB->BSRR = LED0_MASK) -#define LED0_OFF (GPIOB->BRR = LED0_MASK) -#define LED0_TOGGLE (GPIOB->ODR ^= LED0_MASK) -/** @} */ - -/** - * @brief Initialize board specific hardware, including clock, LEDs and std-IO - */ -void board_init(void); - -#ifdef __cplusplus -} +extern "C" {} #endif #endif /* BOARD_H */ diff --git a/boards/nucleo32-l031/include/gpio_params.h b/boards/nucleo32-l031/include/gpio_params.h deleted file mode 100644 index 89d7278dd5..0000000000 --- a/boards/nucleo32-l031/include/gpio_params.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2017 Inria - * 2017 OTA keys - * - * 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_nucleo32-l031 - * @{ - * - * @file - * @brief Board specific configuration of direct mapped GPIOs - * - * @author Alexandre Abadie - * @author Vincent Dupont - */ - -#ifndef GPIO_PARAMS_H -#define GPIO_PARAMS_H - -#include "board.h" -#include "saul/periph.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief GPIO pin configuration - */ -static const saul_gpio_params_t saul_gpio_params[] = -{ - { - .name = "LED(green)", - .pin = LED0_PIN, - .mode = GPIO_OUT - }, -}; - -#ifdef __cplusplus -} -#endif - -#endif /* GPIO_PARAMS_H */ -/** @} */