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 
37 /* give the target core clock (HCLK) frequency [in Hz],
38  * maximum: 168MHz */
39 #define CLOCK_CORECLOCK (168000000U)
40 /* 0: no external high speed crystal available
41  * else: actual crystal frequency [in Hz] */
42 #define CLOCK_HSE (16000000U)
43 /* 0: no external low speed crystal available,
44  * 1: external crystal available (always 32.768kHz) */
45 #define CLOCK_LSE (0)
46 /* peripheral clock setup */
47 #define CLOCK_AHB_DIV RCC_CFGR_HPRE_DIV1
48 #define CLOCK_AHB (CLOCK_CORECLOCK / 1)
49 #define CLOCK_APB1_DIV RCC_CFGR_PPRE1_DIV4 /* max 42MHz */
50 #define CLOCK_APB1 (CLOCK_CORECLOCK / 4)
51 #define CLOCK_APB2_DIV RCC_CFGR_PPRE2_DIV2 /* max 84MHz */
52 #define CLOCK_APB2 (CLOCK_CORECLOCK / 2)
53 
54 /* Main PLL factors */
55 #define CLOCK_PLL_M (8)
56 #define CLOCK_PLL_N (168)
57 #define CLOCK_PLL_P (2)
58 #define CLOCK_PLL_Q (7)
59 
65 static const timer_conf_t timer_config[] = {
66  {
67  .dev = TIM2,
68  .max = 0xffffffff,
69  .rcc_mask = RCC_APB1ENR_TIM2EN,
70  .bus = APB1,
71  .irqn = TIM2_IRQn
72  },
73  {
74  .dev = TIM5,
75  .max = 0xffffffff,
76  .rcc_mask = RCC_APB1ENR_TIM5EN,
77  .bus = APB1,
78  .irqn = TIM5_IRQn
79  }
80 };
81 
82 #define TIMER_0_ISR isr_tim2
83 #define TIMER_1_ISR isr_tim5
84 
85 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
86 
92 static const uart_conf_t uart_config[] = {
93  {
94  .dev = USART6,
95  .rcc_mask = RCC_APB2ENR_USART6EN,
96  .rx_pin = GPIO_PIN(PORT_C, 7),
97  .tx_pin = GPIO_PIN(PORT_C, 6),
98  .rx_af = GPIO_AF8,
99  .tx_af = GPIO_AF8,
100  .bus = APB2,
101  .irqn = USART6_IRQn
102 #ifdef UART_USE_DMA
103  .dma_stream = 14,
104  .dma_chan = 5
105 #endif
106  }
107 };
108 
109 #define UART_0_ISR (isr_usart6)
110 #define UART_0_DMA_ISR (isr_dma2_stream6)
111 
112 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
113 
119 #define ADC_NUMOF (0)
120 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* PERIPH_CONF_H */
127 
void * dev
UART, USART or LEUART device used.
use alternate function 8
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
NRF_TIMER_Type * dev
timer device
UART device configuration.
Timer configuration.