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  {
70  .dev = (Uart *)UART,
71  .rx_pin = GPIO_PIN(PA, 8),
72  .tx_pin = GPIO_PIN(PA, 9),
73  .mux = GPIO_MUX_A,
74  .pmc_id = ID_UART,
75  .irqn = UART_IRQn
76  },
77  {
78  .dev = (Uart *)USART0,
79  .rx_pin = GPIO_PIN(PA, 10),
80  .tx_pin = GPIO_PIN(PA, 11),
81  .mux = GPIO_MUX_A,
82  .pmc_id = ID_USART0,
83  .irqn = USART0_IRQn
84  },
85  {
86  .dev = (Uart *)USART1,
87  .rx_pin = GPIO_PIN(PA, 12),
88  .tx_pin = GPIO_PIN(PA, 13),
89  .mux = GPIO_MUX_A,
90  .pmc_id = ID_USART1,
91  .irqn = USART1_IRQn
92  },
93  {
94  .dev = (Uart *)USART3,
95  .rx_pin = GPIO_PIN(PD, 5),
96  .tx_pin = GPIO_PIN(PD, 4),
97  .mux = GPIO_MUX_B,
98  .pmc_id = ID_USART3,
99  .irqn = USART3_IRQn
100  }
101 };
102 
103 /* define interrupt vectors */
104 #define UART_0_ISR isr_uart
105 #define UART_1_ISR isr_usart0
106 #define UART_2_ISR isr_usart1
107 #define UART_3_ISR isr_usart3
108 
109 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
110 
116 static const spi_conf_t spi_config[] = {
117  {
118  .dev = SPI0,
119  .id = ID_SPI0,
120  .clk = GPIO_PIN(PA, 25),
121  .mosi = GPIO_PIN(PA, 26),
122  .miso = GPIO_PIN(PA, 27),
123  .mux = GPIO_MUX_A
124  }
125 };
126 
127 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
128 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif /* PERIPH_CONF_H */
135 
USART_TypeDef * dev
USART device used.
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 module configuration options.
Timer configuration.
cc2538_ssi_t * dev
SSI device.