Loading...
Searching...
No Matches
periph_conf.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 INRIA
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/* This board provides an HSE */
23#ifndef CONFIG_BOARD_HAS_HSE
24#define CONFIG_BOARD_HAS_HSE 1
25#endif
26
27#include "periph_cpu.h"
28#include "clk_conf.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
38static const timer_conf_t timer_config[] = {
39 {
40 .dev = TIM2,
41 .max = 0x0000ffff,
42 .rcc_mask = RCC_APB1ENR_TIM2EN,
43 .bus = APB1,
44 .irqn = TIM2_IRQn
45 },
46 {
47 .dev = TIM3,
48 .max = 0x0000ffff,
49 .rcc_mask = RCC_APB1ENR_TIM3EN,
50 .bus = APB1,
51 .irqn = TIM3_IRQn
52 }
53};
54
55#define TIMER_0_ISR isr_tim2
56#define TIMER_1_ISR isr_tim3
57
58#define TIMER_NUMOF ARRAY_SIZE(timer_config)
65static const uart_conf_t uart_config[] = {
66 {
67 .dev = USART2,
68 .rcc_mask = RCC_APB1ENR_USART2EN,
69 .rx_pin = GPIO_PIN(PORT_A, 3),
70 .tx_pin = GPIO_PIN(PORT_A, 2),
71 .bus = APB1,
72 .irqn = USART2_IRQn
73 },
74 {
75 .dev = USART1,
76 .rcc_mask = RCC_APB2ENR_USART1EN,
77 .rx_pin = GPIO_PIN(PORT_B, 7),
78 .tx_pin = GPIO_PIN(PORT_B, 6),
79 .bus = APB2,
80 .irqn = USART1_IRQn
81 },
82 {
83 .dev = USART3,
84 .rcc_mask = RCC_APB1ENR_USART3EN,
85 .rx_pin = GPIO_PIN(PORT_B, 11),
86 .tx_pin = GPIO_PIN(PORT_B, 10),
87 .bus = APB1,
88 .irqn = USART3_IRQn
89 }
90};
91
92#define UART_0_ISR isr_usart2
93#define UART_1_ISR isr_usart1
94#define UART_2_ISR isr_usart3
95
96#define UART_NUMOF ARRAY_SIZE(uart_config)
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* PERIPH_CONF_H */
@ PORT_B
port B
Definition periph_cpu.h:48
@ 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
@ APB1
Advanced Peripheral Bus 1
Definition periph_cpu.h:79
@ APB2
Advanced Peripheral Bus 2
Definition periph_cpu.h:80
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