Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 ML!PA Consulting GmbH
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
19#ifndef PERIPH_CONF_H
20#define PERIPH_CONF_H
21
22#include <stdint.h>
23
24#include "cpu.h"
25#include "periph_cpu.h"
26#include "clk_conf.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
36static const timer_conf_t timer_config[] = {
37 {
38 .dev = TIM1,
39 .max = 0x0000ffff,
40 .rcc_mask = RCC_APBENR2_TIM1EN,
41 .bus = APB12,
42 .irqn = TIM1_CC_IRQn
43 }
44};
45
46#define TIMER_0_ISR isr_tim1_cc
47#define TIMER_0_MAX_VALUE 0xffff
48
49#define TIMER_NUMOF ARRAY_SIZE(timer_config)
56static const uart_conf_t uart_config[] = {
57 {
58 .dev = USART2,
59 .rcc_mask = RCC_APBENR1_USART2EN,
60 .rx_pin = GPIO_PIN(PORT_A, 3),
61 .tx_pin = GPIO_PIN(PORT_A, 2),
62 .rx_af = GPIO_AF1,
63 .tx_af = GPIO_AF1,
64 .bus = APB1,
65 .irqn = USART2_IRQn,
66 },
67};
68
69#define UART_0_ISR (isr_usart2)
70
71#define UART_NUMOF ARRAY_SIZE(uart_config)
74#ifdef __cplusplus
75}
76#endif
77
78#endif /* PERIPH_CONF_H */
@ PORT_A
port A
Definition periph_cpu.h:47
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
@ GPIO_AF1
use alternate function 1
Definition cpu_gpio.h:103
@ APB1
Advanced Peripheral Bus 1
Definition periph_cpu.h:79
Timer device configuration.
Definition periph_cpu.h:264
TC0_t * dev
Pointer to the used as Timer device.
Definition periph_cpu.h:265
UART device configuration.
Definition periph_cpu.h:218
USART_t * dev
pointer to the used UART device
Definition periph_cpu.h:219