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 
21 #include "periph_cpu.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
31 static const uart_conf_t uart_config[] = {
32  /* UART0 is mapped to debug usb */
33  {
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)
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.
Definition: cc2538_uart.h:183
#define UART0_BASEADDR
UART0 Instance.
Definition: cc2538_uart.h:182
UART device configuration.
Definition: periph_cpu.h:217
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:218