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 timer_conf_t timer_config[] = {
30 {
31 .dev = TIM3,
32 .max = 0x0000ffff,
33 .rcc_mask = RCC_APBENR1_TIM3EN,
34 .bus = APB1,
35 .irqn = TIM3_IRQn
36 }
37};
38
39#define TIMER_0_ISR isr_tim3
40
41#define TIMER_NUMOF ARRAY_SIZE(timer_config)
43
48static const uart_conf_t uart_config[] = {
49 { /* Connected to the ST-Link */
50 .dev = USART2,
51 .rcc_mask = RCC_APBENR1_USART2EN,
52 .rx_pin = GPIO_PIN(PORT_A, 3),
53 .tx_pin = GPIO_PIN(PORT_A, 2),
54 .rx_af = GPIO_AF1,
55 .tx_af = GPIO_AF1,
56 .bus = APB1,
57 .irqn = USART2_IRQn,
58 },
59 { /* Arduino pinout on D0/D1 */
60 .dev = USART1,
61 .rcc_mask = RCC_APBENR2_USART1EN,
62 .rx_pin = GPIO_PIN(PORT_B, 7),
63 .tx_pin = GPIO_PIN(PORT_B, 6),
64 .rx_af = GPIO_AF0,
65 .tx_af = GPIO_AF0,
66 .bus = APB12,
67 .irqn = USART1_IRQn,
68 }
69};
70
71#define UART_0_ISR (isr_usart2)
72#define UART_1_ISR (isr_usart1)
73
74#define UART_NUMOF ARRAY_SIZE(uart_config)
76
77#ifdef __cplusplus
78}
79#endif
80
@ 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
Timer device configuration.
Definition periph_cpu.h:260
UART device configuration.
Definition periph_cpu.h:214