periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef PERIPH_CONF_H
20 #define PERIPH_CONF_H
21 
22 /* Add specific clock configuration (HSE, LSE) for this board here */
23 #ifndef CONFIG_BOARD_HAS_LSE
24 #define CONFIG_BOARD_HAS_LSE 1
25 #endif
26 
27 #include "periph_cpu.h"
28 #include "clk_conf.h"
29 #include "cfg_rtt_default.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
39 static const timer_conf_t timer_config[] = {
40  {
41  .dev = TIM5,
42  .max = 0xffffffff,
43  .rcc_mask = RCC_APB1ENR1_TIM5EN,
44  .bus = APB1,
45  .irqn = TIM5_IRQn
46  }
47 };
48 
49 #define TIMER_0_ISR isr_tim5
50 
51 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
52 
58 static const uart_conf_t uart_config[] = {
59  {
60  .dev = USART2,
61  .rcc_mask = RCC_APB1ENR1_USART2EN,
62  .rx_pin = GPIO_PIN(PORT_D, 6),
63  .tx_pin = GPIO_PIN(PORT_D, 5),
64  .rx_af = GPIO_AF7,
65  .tx_af = GPIO_AF7,
66  .bus = APB1,
67  .irqn = USART2_IRQn,
68  .type = STM32_USART,
69  .clk_src = 0, /* Use APB clock */
70 #ifdef UART_USE_DMA
71  .dma_stream = 6,
72  .dma_chan = 4
73 #endif
74  }
75 };
76 
77 #define UART_0_ISR (isr_usart2)
78 
79 #define UART_NUMOF ARRAY_SIZE(uart_config)
80 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif /* PERIPH_CONF_H */
87 
PORT_D
@ PORT_D
port D
Definition: periph_cpu.h:39
uart_conf_t
UART device configuration.
Definition: periph_cpu.h:166
STM32_USART
@ STM32_USART
STM32 USART module type.
Definition: periph_cpu.h:583
uart_conf_t::dev
cc2538_uart_t * dev
pointer to the used UART device
Definition: periph_cpu.h:167
timer_conf_t
Timer configuration.
Definition: periph_cpu.h:288
GPIO_AF7
@ GPIO_AF7
use alternate function 7
Definition: periph_cpu_common.h:93
GPIO_PIN
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
timer_conf_t::dev
uint32_t dev
Address of timer base.
Definition: periph_cpu.h:112
APB1
@ APB1
APB1 bus.
Definition: periph_cpu.h:176