Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 ML!PA Consulting GmbH
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include <stdint.h>
19
20#include "cpu.h"
21#include "periph_cpu.h"
22#include "clk_conf.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
32static const timer_conf_t timer_config[] = {
33 {
34 .dev = TIM1,
35 .max = 0x0000ffff,
36 .rcc_mask = RCC_APBENR2_TIM1EN,
37 .bus = APB12,
38 .irqn = TIM1_CC_IRQn
39 }
40};
41
42#define TIMER_0_ISR isr_tim1_cc
43#define TIMER_0_MAX_VALUE 0xffff
44
45#define TIMER_NUMOF ARRAY_SIZE(timer_config)
47
52static const uart_conf_t uart_config[] = {
53 {
54 .dev = USART2,
55 .rcc_mask = RCC_APBENR1_USART2EN,
56 .rx_pin = GPIO_PIN(PORT_A, 3),
57 .tx_pin = GPIO_PIN(PORT_A, 2),
58 .rx_af = GPIO_AF1,
59 .tx_af = GPIO_AF1,
60 .bus = APB1,
61 .irqn = USART2_IRQn,
62 },
63};
64
65#define UART_0_ISR (isr_usart2)
66
67#define UART_NUMOF ARRAY_SIZE(uart_config)
69
70#ifdef __cplusplus
71}
72#endif
73
@ 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:102
@ APB1
Advanced Peripheral Bus 1.
Definition periph_cpu.h:78
Timer device configuration.
Definition periph_cpu.h:260
UART device configuration.
Definition periph_cpu.h:214