Loading...
Searching...
No Matches
cfg_uart_default.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014-2016 Freie Universität Berlin
3 * 2015 Zolertia SL
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
22#ifndef CFG_UART_DEFAULT_H
23#define CFG_UART_DEFAULT_H
24
25#include "periph_cpu.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
35static const uart_conf_t uart_config[] = {
36 /* UART0 is mapped to debug usb */
37 {
39 .rx_pin = GPIO_PIN(PORT_A, 0),
40 .tx_pin = GPIO_PIN(PORT_A, 1),
41#ifdef MODULE_PERIPH_UART_HW_FC
42 .cts_pin = GPIO_UNDEF,
43 .rts_pin = GPIO_UNDEF
44#endif
45 },
46 {
47 .dev = UART1_BASEADDR,
48 .rx_pin = GPIO_PIN(PORT_C, 1),
49 .tx_pin = GPIO_PIN(PORT_C, 0),
50#ifdef MODULE_PERIPH_UART_HW_FC
51 .cts_pin = GPIO_UNDEF,
52 .rts_pin = GPIO_UNDEF
53#endif
54 }
55};
56
57/* interrupt function name mapping */
58#define UART_0_ISR isr_uart0
59#define UART_1_ISR isr_uart1
60
61/* macros common across all UARTs */
62#define UART_NUMOF ARRAY_SIZE(uart_config)
65#ifdef __cplusplus
66} /* end extern "C" */
67#endif
68
69#endif /* CFG_UART_DEFAULT_H */
@ PORT_C
port C
Definition periph_cpu.h:49
@ PORT_A
port A
Definition periph_cpu.h:47
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
#define UART1_BASEADDR
UART1 Instance.
#define UART0_BASEADDR
UART0 Instance.
UART device configuration.
Definition periph_cpu.h:218
USART_t * dev
pointer to the used UART device
Definition periph_cpu.h:219