diff --git a/cpu/nrf51/include/periph_cpu.h b/cpu/nrf51/include/periph_cpu.h deleted file mode 100644 index 21d2e60205dc8859e546fbb7aa12fc42db7c4373..0000000000000000000000000000000000000000 --- a/cpu/nrf51/include/periph_cpu.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2015 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 cpu_nrf51822 - * @{ - * - * @file - * @brief CPU specific definitions for handling peripherals - * - * @author Hauke Petersen <hauke.peterse@fu-berlin.de> - */ - -#ifndef CPU_PERIPH_H_ -#define CPU_PERIPH_H_ - -#include "periph/dev_enums.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Mandatory macro for defining GPIO pins - * - * The port definition is used (and zeroed) to suppress compiler warnings - */ -#define GPIO_PIN(x,y) ((x & 0) | y) - -/** - * @brief Length of the CPU_ID in octets - */ -#define CPUID_LEN (8U) - -/** - * @brief Override GPIO pull register select values - * @{ - */ -#define HAVE_GPIO_PP_T -typedef enum { - GPIO_NOPULL = 0, /**< do not use internal pull resistors */ - GPIO_PULLUP = 2, /**< enable internal pull-up resistor */ - GPIO_PULLDOWN = 1 /**< enable internal pull-down resistor */ -} gpio_pp_t; -/** @} */ - -/** - * @brief Override GPIO active flank values - * @{ - */ -#define HAVE_GPIO_FLANK_T -typedef enum { - GPIO_FALLING = 2, /**< emit interrupt on falling flank */ - GPIO_RISING = 1, /**< emit interrupt on rising flank */ - GPIO_BOTH = 3 /**< emit interrupt on both flanks */ -} gpio_flank_t; -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* CPU_PERIPH_H_ */ -/** @} */ diff --git a/cpu/nrf5x_common/Makefile b/cpu/nrf5x_common/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..e09377cd1e39133b4c074e32202ae74443211203 --- /dev/null +++ b/cpu/nrf5x_common/Makefile @@ -0,0 +1,3 @@ +DIRS = periph + +include $(RIOTBASE)/Makefile.base diff --git a/cpu/nrf5x_common/Makefile.include b/cpu/nrf5x_common/Makefile.include new file mode 100644 index 0000000000000000000000000000000000000000..2992156ed46c77383b4b0c74d7e696538bb7751c --- /dev/null +++ b/cpu/nrf5x_common/Makefile.include @@ -0,0 +1,6 @@ +# export the CPU family so we can differentiate between them in the code +FAM = $(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_') +export CFLAGS += -DCPU_FAM_$(FAM) + +# export the common include directory +export INCLUDES += -I$(RIOTCPU)/nrf5x_common/include diff --git a/cpu/nrf5x_common/doc.txt b/cpu/nrf5x_common/doc.txt new file mode 100644 index 0000000000000000000000000000000000000000..41687f42312eabb3a7cc6fba86e27191f21941df --- /dev/null +++ b/cpu/nrf5x_common/doc.txt @@ -0,0 +1,5 @@ +/** + * @defgroup cpu_nrf5x_common + * @ingroup cpu + * @brief Common implementations for the nRF5x family of CPUs + */ diff --git a/cpu/nrf52/include/periph_cpu.h b/cpu/nrf5x_common/include/periph_cpu.h similarity index 94% rename from cpu/nrf52/include/periph_cpu.h rename to cpu/nrf5x_common/include/periph_cpu.h index 31e3728565026aa8425c61a39a5642d076734c2e..17eeb16be6bed3f9afe13e15d34aaa34f37b0e0f 100644 --- a/cpu/nrf52/include/periph_cpu.h +++ b/cpu/nrf5x_common/include/periph_cpu.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Freie Universität Berlin + * Copyright (C) 2015-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 @@ -7,7 +7,7 @@ */ /** - * @ingroup cpu_nrf52 + * @ingroup cpu_nrf5x_common * @{ * * @file diff --git a/cpu/nrf5x_common/periph/Makefile b/cpu/nrf5x_common/periph/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..6d1887b640099d130c5a6400e3f878f0c65aa6f1 --- /dev/null +++ b/cpu/nrf5x_common/periph/Makefile @@ -0,0 +1,3 @@ +MODULE = periph + +include $(RIOTBASE)/Makefile.base