1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 23:12:45 +01:00

board/udoo: adjusted UART configuration

This commit is contained in:
Hauke Petersen 2015-10-27 13:35:39 +01:00
parent 8c38ccdb99
commit aa216b585e
2 changed files with 14 additions and 43 deletions

View File

@ -37,7 +37,7 @@ extern "C" {
* @name Define UART device and baudrate for stdio * @name Define UART device and baudrate for stdio
* @{ * @{
*/ */
#define STDIO UART_0 #define STDIO UART_DEV(0)
#define STDIO_BAUDRATE (115200U) #define STDIO_BAUDRATE (115200U)
#define STDIO_RX_BUFSIZE (64U) #define STDIO_RX_BUFSIZE (64U)
/** @} */ /** @} */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2014 Freie Universität Berlin * Copyright (C) 2014-2015 Freie Universität Berlin
* *
* This file is subject to the terms and conditions of the GNU Lesser * 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 * General Public License v2.1. See the file LICENSE in the top level
@ -19,6 +19,8 @@
#ifndef PERIPH_CONF_H_ #ifndef PERIPH_CONF_H_
#define PERIPH_CONF_H_ #define PERIPH_CONF_H_
#include "periph_cpu.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -58,52 +60,21 @@ extern "C" {
* @name UART configuration * @name UART configuration
* @{ * @{
*/ */
#define UART_NUMOF (4U) static const uart_conf_t uart_config[] = {
#define UART_0_EN 1 /* device, rx port, tx port, rx pin, tx pin, mux, PMC bit, IRGn line */
#define UART_1_EN 1 {(Uart *)UART, PIOA, PIOA, 8, 9, GPIO_MUX_A, ID_UART, UART_IRQn},
#define UART_2_EN 1 {(Uart *)USART0, PIOA, PIOA, 10, 11, GPIO_MUX_A, ID_USART0, USART0_IRQn},
#define UART_3_EN 1 {(Uart *)USART1, PIOA, PIOA, 12, 13, GPIO_MUX_A, ID_USART1, USART1_IRQn},
#define UART_IRQ_PRIO 1 {(Uart *)USART3, PIOD, PIOD, 4, 5, GPIO_MUX_B, ID_USART3, USART3_IRQn}
};
/* UART 0 device configuration */ /* define interrupt vectors */
#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 #define UART_0_ISR isr_uart
/* UART 0 pin configuration */
#define UART_0_PORT PIOA
#define UART_0_PINS (PIO_PA8 | PIO_PA9)
/* UART 1 device configuration */
#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 #define UART_1_ISR isr_usart0
/* UART 1 pin configuration */
#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 #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 #define UART_3_ISR isr_usart3
/* UART 1 pin configuration */
#define UART_3_PORT PIOD #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
#define UART_3_PINS (PIO_PD4 | PIO_PD5)
/** @} */ /** @} */
/** /**