From 200916ab334abc411aed7425f0491b290058d5d8 Mon Sep 17 00:00:00 2001 From: Laurent Navet <laurent.navet@gmail.com> Date: Sat, 15 Oct 2016 23:52:49 +0200 Subject: [PATCH] boards/arduino-common: export led via saul expose on-board led to saul interface. --- boards/arduino-common/Makefile.dep | 3 ++ boards/arduino-common/Makefile.include | 3 ++ boards/arduino-common/include/gpio_params.h | 46 +++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 boards/arduino-common/Makefile.dep create mode 100644 boards/arduino-common/include/gpio_params.h diff --git a/boards/arduino-common/Makefile.dep b/boards/arduino-common/Makefile.dep new file mode 100644 index 0000000000..5472bf8b8d --- /dev/null +++ b/boards/arduino-common/Makefile.dep @@ -0,0 +1,3 @@ +ifneq (,$(filter saul_default,$(USEMODULE))) + USEMODULE += saul_gpio +endif diff --git a/boards/arduino-common/Makefile.include b/boards/arduino-common/Makefile.include index 3b357838c7..e41cc78bed 100644 --- a/boards/arduino-common/Makefile.include +++ b/boards/arduino-common/Makefile.include @@ -1,6 +1,9 @@ # define the cpu used by the arduino uno and duemilanove boards export CPU = atmega328p +# include optional dependencies +include $(RIOTBOARD)/arduino-common/Makefile.dep + # define port used to flash the board OS = $(shell uname) ifeq ($(OS),Linux) diff --git a/boards/arduino-common/include/gpio_params.h b/boards/arduino-common/include/gpio_params.h new file mode 100644 index 0000000000..bb502a0c2e --- /dev/null +++ b/boards/arduino-common/include/gpio_params.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2016 Freie Universität Berlin + * + * 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_arduino-common + * @{ + * + * @file + * @brief Board specific configuration of direct mapped GPIOs + * + * @author Hauke Petersen <hauke.petersen@fu-berlin.de> + */ + +#ifndef GPIO_PARAMS_H +#define GPIO_PARAMS_H + +#include "board.h" +#include "saul/periph.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief LED configuration + */ +static const saul_gpio_params_t saul_gpio_params[] = +{ + { + .name = "LED", + .pin = LED0_PIN, + .mode = GPIO_OUT + } +}; + +#ifdef __cplusplus +} +#endif + +#endif /* GPIO_PARAMS_H */ +/** @} */ -- GitLab