From 3b193b99b5feeda76238bdca31df86bb0bd761de Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 17 Oct 2014 00:34:11 +0200 Subject: [PATCH] board/arduino-due: added missing UART defines - added port defines to periph_conf.h - added feature to Makefile.features --- boards/arduino-due/Makefile.features | 2 +- boards/arduino-due/include/periph_conf.h | 42 +++++++++++++++++++----- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/boards/arduino-due/Makefile.features b/boards/arduino-due/Makefile.features index 9be17cbb4b..4f578052e2 100644 --- a/boards/arduino-due/Makefile.features +++ b/boards/arduino-due/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED += periph_gpio periph_spi periph_random +FEATURES_PROVIDED += periph_uart periph_gpio periph_spi periph_random diff --git a/boards/arduino-due/include/periph_conf.h b/boards/arduino-due/include/periph_conf.h index 83a1c23168..70f922344b 100644 --- a/boards/arduino-due/include/periph_conf.h +++ b/boards/arduino-due/include/periph_conf.h @@ -60,15 +60,17 @@ extern "C" { * @name UART configuration * @{ */ -#define UART_NUMOF (1U) +#define UART_NUMOF (4U) #define UART_0_EN 1 -#define UART_1_EN 0 -#define UART_2_EN 0 -#define UART_3_EN 0 +#define UART_1_EN 1 +#define UART_2_EN 1 +#define UART_3_EN 1 #define UART_IRQ_PRIO 1 /* UART 0 device configuration */ #define UART_0_DEV UART +#define UART_0_CLKEN() (PMC->PMC_PCER0 |= (1 << ID_UART)) +#define UART_0_CLKDIS() (PMC->PMC_PCER0 &= ~(1 << ID_UART)) #define UART_0_IRQ UART_IRQn #define UART_0_ISR isr_uart /* UART 0 pin configuration */ @@ -76,12 +78,34 @@ extern "C" { #define UART_0_PINS (PIO_PA8 | PIO_PA9) /* UART 1 device configuration */ -#define UART_1_DEV -#define UART_1_IRQ -#define UART_1_ISR +#define UART_1_DEV USART0 +#define UART_1_CLKEN() (PMC->PMC_PCER0 |= (1 << ID_USART0)) +#define UART_1_CLKDIS() (PMC->PMC_PCER0 &= ~(1 << ID_USART0)) +#define UART_1_IRQ USART0_IRQn +#define UART_1_ISR isr_usart0 /* UART 1 pin configuration */ -#define UART_1_PORT -#define UART_1_PINS +#define UART_1_PORT PIOA +#define UART_1_PINS (PIO_PA10 | PIO_PA11) + +/* UART 1 device configuration */ +#define UART_2_DEV USART1 +#define UART_2_CLKEN() (PMC->PMC_PCER0 |= (1 << ID_USART1)) +#define UART_2_CLKDIS() (PMC->PMC_PCER0 &= ~(1 << ID_USART1)) +#define UART_2_IRQ USART1_IRQn +#define UART_2_ISR isr_usart1 +/* UART 1 pin configuration */ +#define UART_2_PORT PIOA +#define UART_2_PINS (PIO_PA12 | PIO_PA13) + +/* UART 1 device configuration */ +#define UART_3_DEV USART3 +#define UART_3_CLKEN() (PMC->PMC_PCER0 |= (1 << ID_USART3)) +#define UART_3_CLKDIS() (PMC->PMC_PCER0 &= ~(1 << ID_USART3)) +#define UART_3_IRQ USART3_IRQn +#define UART_3_ISR isr_usart3 +/* UART 1 pin configuration */ +#define UART_3_PORT PIOD +#define UART_3_PINS (PIO_PD4 | PIO_PD5) /** @} */ /**