boards/f4vi1/include/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 #include "periph_cpu.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 /* 0: no external high speed crystal available
35  * else: actual crystal frequency [in Hz] */
36 #define CLOCK_HSE (16000000U)
37 /* 0: no external low speed crystal available,
38  * 1: external crystal available (always 32.768kHz) */
39 #define CLOCK_LSE (0)
40 /* give the target core clock (HCLK) frequency [in Hz],
41  * maximum: 168MHz */
42 #define CLOCK_CORECLOCK (168000000U)
43 /* peripheral clock setup */
44 #define CLOCK_AHB_DIV RCC_CFGR_HPRE_DIV1 /* min 25MHz */
45 #define CLOCK_AHB (CLOCK_CORECLOCK / 1)
46 #define CLOCK_APB1_DIV RCC_CFGR_PPRE1_DIV4 /* max 42MHz */
47 #define CLOCK_APB1 (CLOCK_CORECLOCK / 4)
48 #define CLOCK_APB2_DIV RCC_CFGR_PPRE2_DIV2 /* max 84MHz */
49 #define CLOCK_APB2 (CLOCK_CORECLOCK / 2)
50 
56 static const timer_conf_t timer_config[] = {
57  {
58  .dev = TIM2,
59  .max = 0xffffffff,
60  .rcc_mask = RCC_APB1ENR_TIM2EN,
61  .bus = APB1,
62  .irqn = TIM2_IRQn
63  },
64  {
65  .dev = TIM5,
66  .max = 0xffffffff,
67  .rcc_mask = RCC_APB1ENR_TIM5EN,
68  .bus = APB1,
69  .irqn = TIM5_IRQn
70  }
71 };
72 
73 #define TIMER_0_ISR isr_tim2
74 #define TIMER_1_ISR isr_tim5
75 
76 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
77 
83 static const uart_conf_t uart_config[] = {
84  {
85  .dev = USART6,
86  .rcc_mask = RCC_APB2ENR_USART6EN,
87  .rx_pin = GPIO_PIN(PORT_C, 7),
88  .tx_pin = GPIO_PIN(PORT_C, 6),
89  .rx_af = GPIO_AF8,
90  .tx_af = GPIO_AF8,
91  .bus = APB2,
92  .irqn = USART6_IRQn
93 #ifdef UART_USE_DMA
94  .dma_stream = 14,
95  .dma_chan = 5
96 #endif
97  }
98 };
99 
100 #define UART_0_ISR (isr_usart6)
101 #define UART_0_DMA_ISR (isr_dma2_stream6)
102 
103 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
104 
110 #define ADC_NUMOF (0)
111 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif /* PERIPH_CONF_H */
118 
USART_TypeDef * dev
USART device used.
use alternate function 8
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
UART device configuration.
cc2538_gptimer_t * dev
timer device
Timer configuration data.