Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Hudson C. Dalpra
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include "periph_cpu.h"
19#include "clk_conf.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
29static const uart_conf_t uart_config[] = {
30 { /* Connected to the ST-Link */
31 .dev = USART2,
32 .rcc_mask = RCC_APBENR1_USART2EN,
33 .rx_pin = GPIO_PIN(PORT_A, 3),
34 .tx_pin = GPIO_PIN(PORT_A, 2),
35 .rx_af = GPIO_AF1,
36 .tx_af = GPIO_AF1,
37 .bus = APB1,
38 .irqn = USART2_IRQn,
39 },
40 { /* Arduino pinout on D0/D1 */
41 .dev = USART1,
42 .rcc_mask = RCC_APBENR2_USART1EN,
43 .rx_pin = GPIO_PIN(PORT_B, 7),
44 .tx_pin = GPIO_PIN(PORT_B, 6),
45 .rx_af = GPIO_AF0,
46 .tx_af = GPIO_AF0,
47 .bus = APB12,
48 .irqn = USART1_IRQn,
49 }
50};
51
52#define UART_0_ISR (isr_usart2)
53#define UART_1_ISR (isr_usart1)
54
55#define UART_NUMOF ARRAY_SIZE(uart_config)
57
58#ifdef __cplusplus
59}
60#endif
61
@ PORT_B
port B
Definition periph_cpu.h:44
@ PORT_A
port A
Definition periph_cpu.h:43
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:42
@ GPIO_AF1
use alternate function 1
Definition cpu_gpio.h:99
@ GPIO_AF0
use alternate function 0
Definition cpu_gpio.h:98
@ APB1
Advanced Peripheral Bus 1.
Definition periph_cpu.h:75
UART device configuration.
Definition periph_cpu.h:214