boards/udoo/include/periph_conf.h
Go to the documentation of this file.
1  /*
2  * Copyright (C) 2014-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 "periph_cpu.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 /* targeted system core clock */
33 #define CLOCK_CORECLOCK (84000000UL)
34 /* external oscillator clock */
35 #define CLOCK_EXT_OSC (12000000UL)
36 /* define PLL configuration
37  *
38  * The values must fulfill this equation:
39  * CORECLOCK = (EXT_OCS / PLL_DIV) * (PLL_MUL + 1)
40  */
41 #define CLOCK_PLL_MUL (83)
42 #define CLOCK_PLL_DIV (12)
43 
44 /* number of wait states before flash read and write operations */
45 #define CLOCK_FWS (4) /* 4 is save for 84MHz */
46 
52 static const timer_conf_t timer_config[] = {
53  /* dev, channel 0 ID */
54  { TC0, ID_TC0 },
55  { TC1, ID_TC3 },
56 };
57 
58 #define TIMER_0_ISR isr_tc0
59 #define TIMER_1_ISR isr_tc3
60 
61 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
62 
68 static const uart_conf_t uart_config[] = {
69  /* device, rx port, tx port, rx pin, tx pin, mux, PMC bit, IRGn line */
70  {(Uart *)UART, PIOA, PIOA, 8, 9, GPIO_MUX_A, ID_UART, UART_IRQn},
71  {(Uart *)USART0, PIOA, PIOA, 10, 11, GPIO_MUX_A, ID_USART0, USART0_IRQn},
72  {(Uart *)USART1, PIOA, PIOA, 12, 13, GPIO_MUX_A, ID_USART1, USART1_IRQn},
73  {(Uart *)USART3, PIOD, PIOD, 4, 5, GPIO_MUX_B, ID_USART3, USART3_IRQn}
74 };
75 
76 /* define interrupt vectors */
77 #define UART_0_ISR isr_uart
78 #define UART_1_ISR isr_usart0
79 #define UART_2_ISR isr_usart1
80 #define UART_3_ISR isr_usart3
81 
82 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
83 
89 static const spi_conf_t spi_config[] = {
90  {
91  .dev = SPI0,
92  .id = ID_SPI0,
93  .clk = GPIO_PIN(PA, 25),
94  .mosi = GPIO_PIN(PA, 26),
95  .miso = GPIO_PIN(PA, 27),
96  .mux = GPIO_MUX_A
97  }
98 };
99 
100 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
101 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif /* PERIPH_CONF_H */
108 
select peripheral function B
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
#define UART
UART register bank.
Definition: cc26x0_uart.h:126
select peripheral function A
UART device configuration.
SPI configuration data structure.
Timer configuration data.
cc2538_ssi_t * dev
SSI device.