Loading...
Searching...
No Matches
cfg_uart_default.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014-2016 Freie Universität Berlin
3 * SPDX-FileCopyrightText: 2015 Zolertia SL
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
20
21#include "periph_cpu.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
31static const uart_conf_t uart_config[] = {
32 /* UART0 is mapped to debug usb */
33 {
34 .dev = UART0_BASEADDR,
35 .rx_pin = GPIO_PIN(PORT_A, 0),
36 .tx_pin = GPIO_PIN(PORT_A, 1),
37#ifdef MODULE_PERIPH_UART_HW_FC
38 .cts_pin = GPIO_UNDEF,
39 .rts_pin = GPIO_UNDEF
40#endif
41 },
42 {
43 .dev = UART1_BASEADDR,
44 .rx_pin = GPIO_PIN(PORT_C, 1),
45 .tx_pin = GPIO_PIN(PORT_C, 0),
46#ifdef MODULE_PERIPH_UART_HW_FC
47 .cts_pin = GPIO_UNDEF,
48 .rts_pin = GPIO_UNDEF
49#endif
50 }
51};
52
53/* interrupt function name mapping */
54#define UART_0_ISR isr_uart0
55#define UART_1_ISR isr_uart1
56
57/* macros common across all UARTs */
58#define UART_NUMOF ARRAY_SIZE(uart_config)
60
61#ifdef __cplusplus
62} /* end extern "C" */
63#endif
64
@ PORT_C
port C
Definition periph_cpu.h:48
@ PORT_A
port A
Definition periph_cpu.h:46
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:45
#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:217