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 
19 #ifndef PERIPH_CONF_H
20 #define PERIPH_CONF_H
21 
22 #include "periph_cpu.h"
23 #include "clk_conf.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 static const timer_conf_t timer_config[] = {
34  {
35  .dev = TIM2,
36  .max = 0x0000ffff,
37  .rcc_mask = RCC_APB1ENR_TIM2EN,
38  .bus = APB1,
39  .irqn = TIM2_IRQn
40  },
41  {
42  .dev = TIM3,
43  .max = 0x0000ffff,
44  .rcc_mask = RCC_APB1ENR_TIM3EN,
45  .bus = APB1,
46  .irqn = TIM3_IRQn
47  }
48 };
49 
50 #define TIMER_0_ISR isr_tim2
51 #define TIMER_1_ISR isr_tim3
52 
53 #define TIMER_NUMOF ARRAY_SIZE(timer_config)
54 
60 static const uart_conf_t uart_config[] = {
61  {
62  .dev = USART2,
63  .rcc_mask = RCC_APB1ENR_USART2EN,
64  .rx_pin = GPIO_PIN(PORT_A, 3),
65  .tx_pin = GPIO_PIN(PORT_A, 2),
66  .bus = APB1,
67  .irqn = USART2_IRQn
68  }
69 };
70 
71 #define UART_0_ISR (isr_usart2)
72 
73 #define UART_NUMOF ARRAY_SIZE(uart_config)
74 
80 static const spi_conf_t spi_config[] = {
81  {
82  .dev = SPI1,
83  .mosi_pin = GPIO_PIN(PORT_B, 17),
84  .miso_pin = GPIO_PIN(PORT_B, 16),
85  .sclk_pin = GPIO_PIN(PORT_B, 15),
86  .cs_pin = GPIO_UNDEF,
87  .rccmask = RCC_APB2ENR_SPI1EN,
88  .apbbus = APB2
89  }
90 };
91 
92 #define SPI_NUMOF ARRAY_SIZE(spi_config)
93 
95 #ifdef __cplusplus
96 } /* end extern "C" */
97 #endif
98 
99 #endif /* PERIPH_CONF_H */
100 
PORT_A
@ PORT_A
port A
Definition: periph_cpu.h:36
GPIO_UNDEF
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
Definition: periph_cpu_common.h:52
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
spi_conf_t::dev
SPI_Type * dev
SPI device to use.
Definition: periph_cpu.h:465
spi_conf_t
SPI configuration structure type.
Definition: periph_cpu.h:273
APB1
@ APB1
APB1 bus.
Definition: periph_cpu.h:176