diff --git a/boards/arduino-due/Makefile b/boards/arduino-due/Makefile index f8fcbb53a06595771dae356338a7bf2c0673734d..79bf3aee0da0dd8426dab05f01ab2021cde36adc 100644 --- a/boards/arduino-due/Makefile +++ b/boards/arduino-due/Makefile @@ -1,3 +1,4 @@ MODULE = board +DIRS = $(RIOTBOARD)/common/arduino-due include $(RIOTBASE)/Makefile.base diff --git a/boards/arduino-due/Makefile.dep b/boards/arduino-due/Makefile.dep index 5472bf8b8d8fd463a18815c0f10e5d348f90fe51..a679e76f6d439e3033ece952bf976773d86a6567 100644 --- a/boards/arduino-due/Makefile.dep +++ b/boards/arduino-due/Makefile.dep @@ -1,3 +1 @@ -ifneq (,$(filter saul_default,$(USEMODULE))) - USEMODULE += saul_gpio -endif +include $(RIOTBOARD)/common/arduino-due/Makefile.dep diff --git a/boards/arduino-due/Makefile.features b/boards/arduino-due/Makefile.features index 16dda014751d7ab46cd1e0ee3485a97071b7e68b..05ebfea91ed2a140062cc119b85c52dbc044145b 100644 --- a/boards/arduino-due/Makefile.features +++ b/boards/arduino-due/Makefile.features @@ -1,16 +1 @@ -# Put defined MCU peripherals here (in alphabetical order) -FEATURES_PROVIDED += periph_adc -FEATURES_PROVIDED += periph_dac -FEATURES_PROVIDED += periph_gpio -FEATURES_PROVIDED += periph_pwm -FEATURES_PROVIDED += periph_spi -FEATURES_PROVIDED += periph_timer -FEATURES_PROVIDED += periph_uart - -# Various other features (if any) -FEATURES_PROVIDED += arduino - -# The board MPU family (used for grouping by the CI system) -FEATURES_MCU_GROUP = cortex_m3_1 - --include $(RIOTCPU)/sam3/Makefile.features +include $(RIOTBOARD)/common/arduino-due/Makefile.features diff --git a/boards/arduino-due/Makefile.include b/boards/arduino-due/Makefile.include index ddc00645084279f13420a8a4fed0a2658549bfc6..2eb2108d8b07e2603cc337daad41a2af5cc4819c 100644 --- a/boards/arduino-due/Makefile.include +++ b/boards/arduino-due/Makefile.include @@ -1,14 +1 @@ -# define the cpu used by the arduino due board -export CPU = sam3 -export CPU_MODEL = sam3x8e - -# 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 $(RIOTMAKE)/tools/serial.inc.mk - -# setup flasher (using BOSSA) -export BOSSA_ARDUINO_PREFLASH = yes -include $(RIOTMAKE)/tools/bossa.inc.mk +include $(RIOTBOARD)/common/arduino-due/Makefile.include diff --git a/boards/arduino-due/board.c b/boards/arduino-due/board.c deleted file mode 100644 index b19ed2c5802983fd513afaa8c2ef494bbfe90747..0000000000000000000000000000000000000000 --- a/boards/arduino-due/board.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2014 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-due - * @{ - * - * @file - * @brief Board specific implementations for the Arduino Due board - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - * - * @} - */ - -#include "cpu.h" -#include "board.h" -#include "periph/gpio.h" - -void board_init(void) -{ - /* initialize the CPU */ - cpu_init(); - /* initialize the on-board Amber "L" LED @ pin PB27 */ - gpio_init(LED0_PIN, GPIO_OUT); -} diff --git a/boards/arduino-due/doc.txt b/boards/arduino-due/doc.txt new file mode 100644 index 0000000000000000000000000000000000000000..331cfbe3d6dd0c7b1340d7c34b68787c4f887247 --- /dev/null +++ b/boards/arduino-due/doc.txt @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2017 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. + */ + +/** + * @defgroup boards_arduino-due Arduino Due + * @ingroup boards + * @brief Support for the Arduino Due board + */ diff --git a/boards/common/arduino-due/Makefile b/boards/common/arduino-due/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f4c41bf9a040bc14f76f04912386834e13f90158 --- /dev/null +++ b/boards/common/arduino-due/Makefile @@ -0,0 +1,3 @@ +MODULE = boards_common_arduino_due + +include $(RIOTBASE)/Makefile.base diff --git a/boards/common/arduino-due/Makefile.dep b/boards/common/arduino-due/Makefile.dep new file mode 100644 index 0000000000000000000000000000000000000000..5472bf8b8d8fd463a18815c0f10e5d348f90fe51 --- /dev/null +++ b/boards/common/arduino-due/Makefile.dep @@ -0,0 +1,3 @@ +ifneq (,$(filter saul_default,$(USEMODULE))) + USEMODULE += saul_gpio +endif diff --git a/boards/common/arduino-due/Makefile.features b/boards/common/arduino-due/Makefile.features new file mode 100644 index 0000000000000000000000000000000000000000..16dda014751d7ab46cd1e0ee3485a97071b7e68b --- /dev/null +++ b/boards/common/arduino-due/Makefile.features @@ -0,0 +1,16 @@ +# Put defined MCU peripherals here (in alphabetical order) +FEATURES_PROVIDED += periph_adc +FEATURES_PROVIDED += periph_dac +FEATURES_PROVIDED += periph_gpio +FEATURES_PROVIDED += periph_pwm +FEATURES_PROVIDED += periph_spi +FEATURES_PROVIDED += periph_timer +FEATURES_PROVIDED += periph_uart + +# Various other features (if any) +FEATURES_PROVIDED += arduino + +# The board MPU family (used for grouping by the CI system) +FEATURES_MCU_GROUP = cortex_m3_1 + +-include $(RIOTCPU)/sam3/Makefile.features diff --git a/boards/common/arduino-due/Makefile.include b/boards/common/arduino-due/Makefile.include new file mode 100644 index 0000000000000000000000000000000000000000..bdd1e97809e5acb320a6700413ee88f2daee7ca6 --- /dev/null +++ b/boards/common/arduino-due/Makefile.include @@ -0,0 +1,18 @@ +# define the cpu used by the arduino due based boards +export CPU = sam3 +export CPU_MODEL = sam3x8e + +# export this module and its includes +USEMODULE += boards_common_arduino_due +INCLUDES += -I$(RIOTBOARD)/common/arduino-due/include + +# 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 $(RIOTMAKE)/tools/serial.inc.mk + +# setup flasher (using BOSSA) +export BOSSA_ARDUINO_PREFLASH = yes +include $(RIOTMAKE)/tools/bossa.inc.mk diff --git a/boards/udoo/board.c b/boards/common/arduino-due/board.c similarity index 76% rename from boards/udoo/board.c rename to boards/common/arduino-due/board.c index e5298c6a4005960ea12150df0a5ee18d618bda1c..86b5d19c65fb5e1a5b3f1060a023cdafbce9c0a8 100644 --- a/boards/udoo/board.c +++ b/boards/common/arduino-due/board.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014-2016 Freie Universität Berlin + * Copyright (C) 2014-2017 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,11 +7,11 @@ */ /** - * @ingroup boards_udoo + * @ingroup boards_common_arduino_due * @{ * * @file - * @brief Board specific implementations for the UDOO board + * @brief Board specific for Arduino-due-based boards * * @author Hauke Petersen <hauke.petersen@fu-berlin.de> * @@ -24,8 +24,8 @@ void board_init(void) { - /* initialize the on-board Amber "L" LED @ pin PB27 */ - gpio_init(LED0_PIN, GPIO_OUT); /* initialize the CPU */ cpu_init(); + /* initialize the on-board Amber "L" LED @ pin PB27 */ + gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/arduino-due/include/arduino_board.h b/boards/common/arduino-due/include/arduino_board.h similarity index 96% rename from boards/arduino-due/include/arduino_board.h rename to boards/common/arduino-due/include/arduino_board.h index e9a8657351a6fd12461f8211597fff707d2ba036..c0e434b123b97dc042856674d8f5b5c524e37d3f 100644 --- a/boards/arduino-due/include/arduino_board.h +++ b/boards/common/arduino-due/include/arduino_board.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Freie Universität Berlin + * Copyright (C) 2016,2017 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 boards_arduino-due + * @ingroup boards_common_arduino_due * @{ * * @file diff --git a/boards/arduino-due/include/arduino_pinmap.h b/boards/common/arduino-due/include/arduino_pinmap.h similarity index 97% rename from boards/arduino-due/include/arduino_pinmap.h rename to boards/common/arduino-due/include/arduino_pinmap.h index 4b2197919f2780588052fdad9ea4b445453e474d..7d03b50545e2fdcce3fd30ad6036043b9364dec0 100644 --- a/boards/arduino-due/include/arduino_pinmap.h +++ b/boards/common/arduino-due/include/arduino_pinmap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Freie Universität Berlin + * Copyright (C) 2015,2017 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 boards_arduino-due + * @ingroup boards_common_arduino_due * @{ * * @file @@ -43,7 +43,7 @@ extern "C" { #define ARDUINO_PIN_7 GPIO_PIN(PC, 23) #define ARDUINO_PIN_8 GPIO_PIN(PC, 22) #define ARDUINO_PIN_9 GPIO_PIN(PC, 21) -#define ARDUINO_PIN_10 GPIO_PIN(PA, 2) +#define ARDUINO_PIN_10 GPIO_PIN(PC, 29) #define ARDUINO_PIN_11 GPIO_PIN(PD, 7) #define ARDUINO_PIN_12 GPIO_PIN(PD, 8) #define ARDUINO_PIN_13 GPIO_PIN(PB, 27) diff --git a/boards/arduino-due/include/board.h b/boards/common/arduino-due/include/board.h similarity index 83% rename from boards/arduino-due/include/board.h rename to boards/common/arduino-due/include/board.h index 2415aa7d933b63d84a852d4e04628ce13fd69e65..a5e86a5ab4c1a69cc7ab169d34aa844b9d47f891 100644 --- a/boards/arduino-due/include/board.h +++ b/boards/common/arduino-due/include/board.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Freie Universität Berlin + * Copyright (C) 2014,2017 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,13 +7,13 @@ */ /** - * @defgroup boards_arduino-due Arduino Due + * @defgroup boards_common_arduino_due Shared Arduino Due Code * @ingroup boards - * @brief Support for the Arduino Due board. + * @brief Shared code for Arduino Due based boards * @{ * * @file - * @brief Board specific definitions for the Arduino Due board. + * @brief Board specific definitions for the Arduino Due based boards * * @author Hauke Petersen <hauke.petersen@fu-berlin.de> */ diff --git a/boards/arduino-due/include/gpio_params.h b/boards/common/arduino-due/include/gpio_params.h similarity index 88% rename from boards/arduino-due/include/gpio_params.h rename to boards/common/arduino-due/include/gpio_params.h index 2fe7c3e8432a7184d61aa5f91d07780a8e9c36f4..f3c7d9d165e027f8366d64be591d77518b642052 100644 --- a/boards/arduino-due/include/gpio_params.h +++ b/boards/common/arduino-due/include/gpio_params.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Freie Universität Berlin + * Copyright (C) 2016-2017 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 boards_boards_arduino-due + * @ingroup boards_common_arduino_due * @{ * * @file diff --git a/boards/arduino-due/include/periph_conf.h b/boards/common/arduino-due/include/periph_conf.h similarity index 93% rename from boards/arduino-due/include/periph_conf.h rename to boards/common/arduino-due/include/periph_conf.h index e833c5abc5bf8163a2f2afee70475fa03deec6df..2c94b12a31d768eba66395479856bad89265e294 100644 --- a/boards/arduino-due/include/periph_conf.h +++ b/boards/common/arduino-due/include/periph_conf.h @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2014-2015 Freie Universität Berlin + /* + * Copyright (C) 2014-2015,2017 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,13 +7,13 @@ */ /** - * @ingroup boards_arduino-due + * @ingroup boards_common_arduino_due * @{ * * @file - * @brief Peripheral MCU configuration for the Arduino Due board + * @brief Peripheral MCU configuration for Arduino Due based boards * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> + * @author Hauke Petersen <hauke.petersen@fu-berlin.de> * @author Peter Kietzmann <peter.kietzmann@haw-hamburg.de> * @author Andreas "Paul" Pauli <andreas.pauli@haw-hamburg.de> */ diff --git a/boards/arduino-due/include/sdcard_spi_params.h b/boards/common/arduino-due/include/sdcard_spi_params.h similarity index 82% rename from boards/arduino-due/include/sdcard_spi_params.h rename to boards/common/arduino-due/include/sdcard_spi_params.h index cd3c77eb2bb424fa709147f3e8085dc496dc2709..608a4726dc13717e61e456eb73c3c04deff6bf7d 100644 --- a/boards/arduino-due/include/sdcard_spi_params.h +++ b/boards/common/arduino-due/include/sdcard_spi_params.h @@ -8,11 +8,11 @@ */ /** - * @ingroup boards_arduino-due + * @ingroup boards_common_arduino_due * @{ * * @file - * @brief SD card configuration for the Arduino due + * @brief SD card configuration for the Arduino SD card shields * * @author Michel Rottleuthner <michel.rottleuthner@haw-hamburg.de> * @author Hauke Petersen <hauke.petersen@fu-berlin.de> @@ -21,7 +21,7 @@ #ifndef SDCARD_SPI_PARAMS_H #define SDCARD_SPI_PARAMS_H -#include "board.h" +#include "arduino_pinmap.h" #ifdef __cplusplus extern "C" { @@ -35,16 +35,16 @@ extern "C" { #define SDCARD_SPI_PARAM_SPI (SPI_DEV(0)) #endif #ifndef SDCARD_SPI_PARAM_CS -#define SDCARD_SPI_PARAM_CS (GPIO_PIN(PA, 29)) +#define SDCARD_SPI_PARAM_CS (ARDUINO_PIN_4) #endif #ifndef SDCARD_SPI_PARAM_CLK -#define SDCARD_SPI_PARAM_CLK (GPIO_PIN(PA, 27)) +#define SDCARD_SPI_PARAM_CLK (ARDUINO_PIN_76) #endif #ifndef SDCARD_SPI_PARAM_MOSI -#define SDCARD_SPI_PARAM_MOSI (GPIO_PIN(PA, 26)) +#define SDCARD_SPI_PARAM_MOSI (ARDUINO_PIN_75) #endif #ifndef SDCARD_SPI_PARAM_MISO -#define SDCARD_SPI_PARAM_MISO (GPIO_PIN(PA, 25)) +#define SDCARD_SPI_PARAM_MISO (ARDUINO_PIN_74) #endif #ifndef SDCARD_SPI_PARAM_POWER #define SDCARD_SPI_PARAM_POWER (GPIO_UNDEF) diff --git a/boards/arduino-due/include/w5100_params.h b/boards/common/arduino-due/include/w5100_params.h similarity index 82% rename from boards/arduino-due/include/w5100_params.h rename to boards/common/arduino-due/include/w5100_params.h index fbd550fa851880ef9810cec602a17bf247167a1e..032291900f9fa2bc65702234e1e2f1006fb2d29e 100644 --- a/boards/arduino-due/include/w5100_params.h +++ b/boards/common/arduino-due/include/w5100_params.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Freie Universität Berlin + * Copyright (C) 2016-2017 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 boards_arduino-due + * @ingroup boards_common_arduino_due * @{ * * @file @@ -19,6 +19,8 @@ #ifndef W5100_PARAMS_H #define W5100_PARAMS_H +#include "arduino_pinmap.h" + #ifdef __cplusplus extern "C" { #endif @@ -34,10 +36,10 @@ extern "C" { #define W5100_PARAM_SPI_CLK (SPI_CLK_5MHZ) #endif #ifndef W5100_PARAM_CS -#define W5100_PARAM_CS (GPIO_PIN(2, 29)) +#define W5100_PARAM_CS (ARDUINO_PIN_10) #endif #ifndef W5100_PARAM_EVT -#define W5100_PARAM_EVT (GPIO_PIN(1, 25)) +#define W5100_PARAM_EVT (ARDUINO_PIN_2) #endif /** @} */ diff --git a/boards/udoo/Makefile b/boards/udoo/Makefile index f8fcbb53a06595771dae356338a7bf2c0673734d..79bf3aee0da0dd8426dab05f01ab2021cde36adc 100644 --- a/boards/udoo/Makefile +++ b/boards/udoo/Makefile @@ -1,3 +1,4 @@ MODULE = board +DIRS = $(RIOTBOARD)/common/arduino-due include $(RIOTBASE)/Makefile.base diff --git a/boards/udoo/Makefile.dep b/boards/udoo/Makefile.dep new file mode 100644 index 0000000000000000000000000000000000000000..a679e76f6d439e3033ece952bf976773d86a6567 --- /dev/null +++ b/boards/udoo/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTBOARD)/common/arduino-due/Makefile.dep diff --git a/boards/udoo/Makefile.features b/boards/udoo/Makefile.features index 674d4be97dd627cba5297769579cfa6244e60c43..05ebfea91ed2a140062cc119b85c52dbc044145b 100644 --- a/boards/udoo/Makefile.features +++ b/boards/udoo/Makefile.features @@ -1,10 +1 @@ -# Put defined MCU peripherals here (in alphabetical order) -FEATURES_PROVIDED += periph_gpio -FEATURES_PROVIDED += periph_spi -FEATURES_PROVIDED += periph_timer -FEATURES_PROVIDED += periph_uart - -# The board MPU family (used for grouping by the CI system) -FEATURES_MCU_GROUP = cortex_m3_2 - --include $(RIOTCPU)/sam3/Makefile.features +include $(RIOTBOARD)/common/arduino-due/Makefile.features diff --git a/boards/udoo/Makefile.include b/boards/udoo/Makefile.include index de164e968de38d07c16ec8db02b6b74b6d57b840..2eb2108d8b07e2603cc337daad41a2af5cc4819c 100644 --- a/boards/udoo/Makefile.include +++ b/boards/udoo/Makefile.include @@ -1,14 +1 @@ -# define the cpu used by the udoo board -export CPU = sam3 -export CPU_MODEL = sam3x8e - -# define the default port depending on host OS -PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk - -# setup the flash tool (BOSSA) -export BOSSA_ARDUINO_PREFLASH = yes -include $(RIOTMAKE)/tools/bossa.inc.mk +include $(RIOTBOARD)/common/arduino-due/Makefile.include diff --git a/boards/udoo/doc.txt b/boards/udoo/doc.txt new file mode 100644 index 0000000000000000000000000000000000000000..019735f844c6830302cc285ec4910c93aa475b94 --- /dev/null +++ b/boards/udoo/doc.txt @@ -0,0 +1,13 @@ +/* + * Copyright (C) 2017 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. + */ + +/** + * @defgroup boards_udoo UDOO + * @ingroup boards + * @brief Support for the UDOO board + */ diff --git a/boards/udoo/include/board.h b/boards/udoo/include/board.h deleted file mode 100644 index f5712a7ae296b7f3845dc8d9cca154f95a4717ad..0000000000000000000000000000000000000000 --- a/boards/udoo/include/board.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2014 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. - */ - -/** - * @defgroup boards_udoo UDOO - * @ingroup boards - * @brief Support for the UDOO board. - * @{ - * - * @file - * @brief Board specific definitions for the UDOO board. - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - */ - -#ifndef BOARD_H -#define BOARD_H - -#include "cpu.h" -#include "cpu_conf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name LED pin definitions and handlers - * @{ - */ -#define LED0_PIN GPIO_PIN(PB, 27) - -#define LED_PORT PIOB -#define LED0_MASK PIO_PB27 - -#define LED0_ON (LED_PORT->PIO_SODR = LED0_MASK) -#define LED0_OFF (LED_PORT->PIO_CODR = LED0_MASK) -#define LED0_TOGGLE ((PIOB->PIO_ODSR & LED0_MASK) ? LED0_OFF : LED0_ON) -/** @} */ - -/** - * @brief Initialize board specific hardware, including clock, LEDs and std-IO - */ -void board_init(void); - -#ifdef __cplusplus -} -#endif - -#endif /* BOARD_H */ -/** @} */ diff --git a/boards/udoo/include/periph_conf.h b/boards/udoo/include/periph_conf.h deleted file mode 100644 index 2dbc5770efcc0fb3593295ddbf38a16d5f3c8905..0000000000000000000000000000000000000000 --- a/boards/udoo/include/periph_conf.h +++ /dev/null @@ -1,135 +0,0 @@ - /* - * Copyright (C) 2014-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 boards_udoo - * @{ - * - * @file - * @brief Peripheral MCU configuration for the UDOO board - * - * @author Hauke Petersen <hauke.petersen@fu-berlin.de> - */ - -#ifndef PERIPH_CONF_H -#define PERIPH_CONF_H - -#include "periph_cpu.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @name Clock configuration - * @{ - */ -/* targeted system core clock */ -#define CLOCK_CORECLOCK (84000000UL) -/* external oscillator clock */ -#define CLOCK_EXT_OSC (12000000UL) -/* define PLL configuration - * - * The values must fulfill this equation: - * CORECLOCK = (EXT_OCS / PLL_DIV) * (PLL_MUL + 1) - */ -#define CLOCK_PLL_MUL (83) -#define CLOCK_PLL_DIV (12) - -/* number of wait states before flash read and write operations */ -#define CLOCK_FWS (4) /* 4 is save for 84MHz */ -/** @} */ - -/** - * @name Timer peripheral configuration - * @{ - */ -static const timer_conf_t timer_config[] = { - /* dev, channel 0 ID */ - { TC0, ID_TC0 }, - { TC1, ID_TC3 }, -}; - -#define TIMER_0_ISR isr_tc0 -#define TIMER_1_ISR isr_tc3 - -#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0])) -/** @} */ - -/** - * @name UART configuration - * @{ - */ -static const uart_conf_t uart_config[] = { - { - .dev = (Uart *)UART, - .rx_pin = GPIO_PIN(PA, 8), - .tx_pin = GPIO_PIN(PA, 9), - .mux = GPIO_MUX_A, - .pmc_id = ID_UART, - .irqn = UART_IRQn - }, - { - .dev = (Uart *)USART0, - .rx_pin = GPIO_PIN(PA, 10), - .tx_pin = GPIO_PIN(PA, 11), - .mux = GPIO_MUX_A, - .pmc_id = ID_USART0, - .irqn = USART0_IRQn - }, - { - .dev = (Uart *)USART1, - .rx_pin = GPIO_PIN(PA, 12), - .tx_pin = GPIO_PIN(PA, 13), - .mux = GPIO_MUX_A, - .pmc_id = ID_USART1, - .irqn = USART1_IRQn - }, - { - .dev = (Uart *)USART3, - .rx_pin = GPIO_PIN(PD, 5), - .tx_pin = GPIO_PIN(PD, 4), - .mux = GPIO_MUX_B, - .pmc_id = ID_USART3, - .irqn = USART3_IRQn - } -}; - -/* define interrupt vectors */ -#define UART_0_ISR isr_uart -#define UART_1_ISR isr_usart0 -#define UART_2_ISR isr_usart1 -#define UART_3_ISR isr_usart3 - -#define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0])) -/** @} */ - -/** -* @name SPI configuration -* @{ -*/ -static const spi_conf_t spi_config[] = { - { - .dev = SPI0, - .id = ID_SPI0, - .clk = GPIO_PIN(PA, 25), - .mosi = GPIO_PIN(PA, 26), - .miso = GPIO_PIN(PA, 27), - .mux = GPIO_MUX_A - } -}; - -#define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0])) -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* PERIPH_CONF_H */ -/** @} */