The friendly Operating System for the Internet of Things
boards/slwstk6220a/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
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 #include <stdint.h>
23 #include "cpu.h"
24 #include "periph_cpu.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #define CLOCK_RCOSC (14000000) /* internal RC oscillator speed */
35 /* external oscillator speed, comment out if you want to use the internal RC
36  * oscillator circuit as a clock source */
37 #define CLOCK_HFXO (48000000U)
38 /* define clock dividers */
39 #define CLOCK_HFCORECLKDIV (1U) /* core clock divider */
40 #define CLOCK_HFPERCLKDIV (1U) /* peripheral clock divider */
41 
42 /* generate the actual clock values */
43 #ifdef CLOCK_HFXO
44 #define CLOCK_CORECLOCK (CLOCK_HFXO / CLOCK_HFCORECLKDIV)
45 #else
46 #define CLOCK_CORECLOCK (CLOCK_RCOSC / CLOCK_HFCORECLKDIV)
47 #endif
48 #define CLOCK_HFPERCLK (CLOCK_CORECLOCK / CLOCK_HFPERCLKDIV)
49 
55 static const timer_conf_t timer_config[] = {
56  {
57  TIMER0, /* lower numbered timer, used as pre-scaler */
58  TIMER1, /* higher numbered timer, this is the one */
59  5, /* pre-scaler bit in the CMU register */
60  TIMER1_IRQn, /* IRQn of the higher numbered driver */
61  }
62 };
63 
64 #define TIMER_0_ISR isr_timer1
65 #define TIMER_0_MAX_VALUE (0xffff) /* 16-bit timer */
66 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
67 
73 static const uart_conf_t uart_config[] = {
74  {
75  USART2, /* device */
76  GPIO_PIN(PB,4), /* RX pin */
77  GPIO_PIN(PB,3), /* TX pin */
78  1, /* AF location */
79  2, /* bit in CMU enable register */
80  USART2_RX_IRQn /* IRQ base channel */
81  },
82 };
83 
84 #define UART_0_ISR_RX isr_usart2_rx
85 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
86 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* PERIPH_CONF_H */
93 
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
UART device configuration.
Timer configuration data.