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 
9 #pragma once
10 
23 /* This board provides an HSE */
24 #ifndef CONFIG_BOARD_HAS_HSE
25 #define CONFIG_BOARD_HAS_HSE 1
26 #endif
27 
28 /* The HSE provides a 16MHz clock */
29 #ifndef CONFIG_CLOCK_HSE
30 #define CONFIG_CLOCK_HSE MHZ(16)
31 #endif
32 
33 #include "periph_cpu.h"
34 #include "clk_conf.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
44 static const timer_conf_t timer_config[] = {
45  {
46  .dev = TIM2,
47  .max = 0xffffffff,
48  .rcc_mask = RCC_APB1ENR_TIM2EN,
49  .bus = APB1,
50  .irqn = TIM2_IRQn
51  },
52  {
53  .dev = TIM5,
54  .max = 0xffffffff,
55  .rcc_mask = RCC_APB1ENR_TIM5EN,
56  .bus = APB1,
57  .irqn = TIM5_IRQn
58  }
59 };
60 
61 #define TIMER_0_ISR isr_tim2
62 #define TIMER_1_ISR isr_tim5
63 
64 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
71 static const uart_conf_t uart_config[] = {
72  {
73  .dev = USART6,
74  .rcc_mask = RCC_APB2ENR_USART6EN,
75  .rx_pin = GPIO_PIN(PORT_C, 7),
76  .tx_pin = GPIO_PIN(PORT_C, 6),
77  .rx_af = GPIO_AF8,
78  .tx_af = GPIO_AF8,
79  .bus = APB2,
80  .irqn = USART6_IRQn,
81 #ifdef MODULE_PERIPH_DMA
82  .dma = DMA_STREAM_UNDEF,
83  .dma_chan = UINT8_MAX,
84 #endif
85  }
86 };
87 
88 #define UART_0_ISR (isr_usart6)
89 
90 #define UART_NUMOF ARRAY_SIZE(uart_config)
93 #ifdef __cplusplus
94 }
95 #endif
96 
@ PORT_C
port C
Definition: periph_cpu.h:48
#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_AF8
use alternate function 8
Definition: cpu_gpio.h:110
@ APB1
Advanced Peripheral Bus 1
Definition: periph_cpu.h:78
@ APB2
Advanced Peripheral Bus 2
Definition: periph_cpu.h:79
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