periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 /* This board provides an HSE */
23 #ifndef CONFIG_BOARD_HAS_HSE
24 #define CONFIG_BOARD_HAS_HSE 1
25 #endif
26 
27 #include "periph_cpu.h"
28 #include "clk_conf.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
38 static const timer_conf_t timer_config[] = {
39  {
40  .dev = TIM2,
41  .max = 0x0000ffff,
42  .rcc_mask = RCC_APB1ENR_TIM2EN,
43  .bus = APB1,
44  .irqn = TIM2_IRQn
45  },
46  {
47  .dev = TIM3,
48  .max = 0x0000ffff,
49  .rcc_mask = RCC_APB1ENR_TIM3EN,
50  .bus = APB1,
51  .irqn = TIM3_IRQn
52  }
53 };
54 
55 #define TIMER_0_ISR isr_tim2
56 #define TIMER_1_ISR isr_tim3
57 
58 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
59 
65 static const uart_conf_t uart_config[] = {
66  {
67  .dev = USART2,
68  .rcc_mask = RCC_APB1ENR_USART2EN,
69  .rx_pin = GPIO_PIN(PORT_A, 3),
70  .tx_pin = GPIO_PIN(PORT_A, 2),
71  .bus = APB1,
72  .irqn = USART2_IRQn
73  },
74  {
75  .dev = USART1,
76  .rcc_mask = RCC_APB2ENR_USART1EN,
77  .rx_pin = GPIO_PIN(PORT_B, 7),
78  .tx_pin = GPIO_PIN(PORT_B, 6),
79  .bus = APB2,
80  .irqn = USART1_IRQn
81  },
82  {
83  .dev = USART3,
84  .rcc_mask = RCC_APB1ENR_USART3EN,
85  .rx_pin = GPIO_PIN(PORT_B, 11),
86  .tx_pin = GPIO_PIN(PORT_B, 10),
87  .bus = APB1,
88  .irqn = USART3_IRQn
89  }
90 };
91 
92 #define UART_0_ISR isr_usart2
93 #define UART_1_ISR isr_usart1
94 #define UART_2_ISR isr_usart3
95 
96 #define UART_NUMOF ARRAY_SIZE(uart_config)
97 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* PERIPH_CONF_H */
PORT_A
@ PORT_A
port A
Definition: periph_cpu.h:36
uart_conf_t
UART device configuration.
Definition: periph_cpu.h:166
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_PIN
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition: periph_cpu.h:35
APB2
@ APB2
APB2 bus.
Definition: periph_cpu.h:177
timer_conf_t::dev
uint32_t dev
Address of timer base.
Definition: periph_cpu.h:112
PORT_B
@ PORT_B
port B
Definition: periph_cpu.h:37
APB1
@ APB1
APB1 bus.
Definition: periph_cpu.h:176