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 
9 #pragma once
10 
21 #include <stdint.h>
22 
23 #include "cpu.h"
24 #include "periph_cpu.h"
25 #include "clk_conf.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 static const timer_conf_t timer_config[] = {
36  {
37  .dev = TIM1,
38  .max = 0x0000ffff,
39  .rcc_mask = RCC_APBENR2_TIM1EN,
40  .bus = APB12,
41  .irqn = TIM1_CC_IRQn
42  }
43 };
44 
45 #define TIMER_0_ISR isr_tim1_cc
46 #define TIMER_0_MAX_VALUE 0xffff
47 
48 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
55 static const uart_conf_t uart_config[] = {
56  {
57  .dev = USART2,
58  .rcc_mask = RCC_APBENR1_USART2EN,
59  .rx_pin = GPIO_PIN(PORT_A, 3),
60  .tx_pin = GPIO_PIN(PORT_A, 2),
61  .rx_af = GPIO_AF1,
62  .tx_af = GPIO_AF1,
63  .bus = APB1,
64  .irqn = USART2_IRQn,
65  },
66 };
67 
68 #define UART_0_ISR (isr_usart2)
69 
70 #define UART_NUMOF ARRAY_SIZE(uart_config)
73 #ifdef __cplusplus
74 }
75 #endif
76 
@ 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
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:38
static const timer_conf_t timer_config[]
All timers on board.
Definition: periph_conf.h:39
@ 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:263
TC0_t * dev
Pointer to the used as Timer device.
Definition: periph_cpu.h:264
UART device configuration.
Definition: periph_cpu.h:217
USART_t * dev
pointer to the used UART device
Definition: periph_cpu.h:218