Browse Source

boards/nucleo32-f031: adapt to common nucleo32 code

pr/rotary
Alexandre Abadie 6 years ago
parent
commit
dd4e0ea6a3
  1. 4
      boards/nucleo32-f031/Makefile.dep
  2. 4
      boards/nucleo32-f031/Makefile.features
  3. 11
      boards/nucleo32-f031/Makefile.include
  4. 20
      boards/nucleo32-f031/include/board.h
  5. 48
      boards/nucleo32-f031/include/gpio_params.h

4
boards/nucleo32-f031/Makefile.dep

@ -1,3 +1 @@
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/nucleo-common/Makefile.dep

4
boards/nucleo32-f031/Makefile.features

@ -6,8 +6,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

11
boards/nucleo32-f031/Makefile.include

@ -2,12 +2,5 @@
export CPU = stm32f0
export CPU_MODEL = stm32f031k6
# 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

20
boards/nucleo32-f031/include/board.h

@ -23,28 +23,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->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
}
#endif

48
boards/nucleo32-f031/include/gpio_params.h

@ -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-f031
* @{
*
* @file
* @brief Board specific configuration of direct mapped GPIOs
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @author Vincent Dupont <vincent@otakeys.com>
*/
#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 */
/** @} */
Loading…
Cancel
Save