The friendly Operating System for the Internet of Things
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 #define CLOCK_HSE (16000000U) /* external oscillator */
35 #define CLOCK_CORECLOCK (168000000U) /* desired core clock frequency */
36 
37 /* the actual PLL values are automatically generated */
38 #define CLOCK_PLL_M (CLOCK_HSE / 1000000)
39 #define CLOCK_PLL_N ((CLOCK_CORECLOCK / 1000000) * 2)
40 #define CLOCK_PLL_P (2U)
41 #define CLOCK_PLL_Q (CLOCK_PLL_N / 48)
42 #define CLOCK_AHB_DIV RCC_CFGR_HPRE_DIV1
43 #define CLOCK_APB2_DIV RCC_CFGR_PPRE2_DIV2
44 #define CLOCK_APB1_DIV RCC_CFGR_PPRE1_DIV4
45 #define CLOCK_FLASH_LATENCY FLASH_ACR_LATENCY_5WS
46 
47 /* bus clocks for simplified peripheral initialization, UPDATE MANUALLY! */
48 #define CLOCK_AHB (CLOCK_CORECLOCK / 1)
49 #define CLOCK_APB2 (CLOCK_CORECLOCK / 2)
50 #define CLOCK_APB1 (CLOCK_CORECLOCK / 4)
51 
57 static const timer_conf_t timer_config[] = {
58  {
59  .dev = TIM2,
60  .max = 0xffffffff,
61  .rcc_mask = RCC_APB1ENR_TIM2EN,
62  .bus = APB1,
63  .irqn = TIM2_IRQn
64  },
65  {
66  .dev = TIM5,
67  .max = 0xffffffff,
68  .rcc_mask = RCC_APB1ENR_TIM5EN,
69  .bus = APB1,
70  .irqn = TIM5_IRQn
71  }
72 };
73 
74 #define TIMER_0_ISR isr_tim2
75 #define TIMER_1_ISR isr_tim5
76 
77 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
78 
84 static const uart_conf_t uart_config[] = {
85  {
86  .dev = USART6,
87  .rcc_mask = RCC_APB2ENR_USART6EN,
88  .rx_pin = GPIO_PIN(PORT_C, 7),
89  .tx_pin = GPIO_PIN(PORT_C, 6),
90  .rx_af = GPIO_AF8,
91  .tx_af = GPIO_AF8,
92  .bus = APB2,
93  .irqn = USART6_IRQn
94 #ifdef UART_USE_DMA
95  .dma_stream = 14,
96  .dma_chan = 5
97 #endif
98  }
99 };
100 
101 #define UART_0_ISR (isr_usart6)
102 #define UART_0_DMA_ISR (isr_dma2_stream6)
103 
104 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
105 
111 #define ADC_NUMOF (0)
112 
118 #define DAC_NUMOF (0)
119 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* PERIPH_CONF_H */
126 
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.