periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
21 #ifndef PERIPH_CONF_H
22 #define PERIPH_CONF_H
23 
24 /* This board provides an HSE */
25 #ifndef CONFIG_BOARD_HAS_HSE
26 #define CONFIG_BOARD_HAS_HSE 1
27 #endif
28 
29 /* The HSE provides a 16MHz clock */
30 #ifndef CONFIG_CLOCK_HSE
31 #define CONFIG_CLOCK_HSE MHZ(16)
32 #endif
33 
34 #include "periph_cpu.h"
35 #include "clk_conf.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
45 static const timer_conf_t timer_config[] = {
46  {
47  .dev = TIM2,
48  .max = 0xffffffff,
49  .rcc_mask = RCC_APB1ENR_TIM2EN,
50  .bus = APB1,
51  .irqn = TIM2_IRQn
52  },
53  {
54  .dev = TIM5,
55  .max = 0xffffffff,
56  .rcc_mask = RCC_APB1ENR_TIM5EN,
57  .bus = APB1,
58  .irqn = TIM5_IRQn
59  }
60 };
61 
62 #define TIMER_0_ISR isr_tim2
63 #define TIMER_1_ISR isr_tim5
64 
65 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
72 static const uart_conf_t uart_config[] = {
73  {
74  .dev = USART6,
75  .rcc_mask = RCC_APB2ENR_USART6EN,
76  .rx_pin = GPIO_PIN(PORT_C, 7),
77  .tx_pin = GPIO_PIN(PORT_C, 6),
78  .rx_af = GPIO_AF8,
79  .tx_af = GPIO_AF8,
80  .bus = APB2,
81  .irqn = USART6_IRQn,
82 #ifdef MODULE_PERIPH_DMA
83  .dma = DMA_STREAM_UNDEF,
84  .dma_chan = UINT8_MAX,
85 #endif
86  }
87 };
88 
89 #define UART_0_ISR (isr_usart6)
90 
91 #define UART_NUMOF ARRAY_SIZE(uart_config)
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* PERIPH_CONF_H */
@ PORT_C
port C
Definition: periph_cpu.h:49
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:46
static const uart_conf_t uart_config[]
UART configuration.
Definition: periph_conf.h:39
static const timer_conf_t timer_config[]
All timers on board.
Definition: periph_conf.h:40
@ GPIO_AF8
use alternate function 8
Definition: cpu_gpio.h:111
@ 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