boards/arduino-due/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 
21 #ifndef PERIPH_CONF_H
22 #define PERIPH_CONF_H
23 
24 #include "periph_cpu.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 /* targeted system core clock */
35 #define CLOCK_CORECLOCK (84000000UL)
36 /* external oscillator clock */
37 #define CLOCK_EXT_OSC (12000000UL)
38 /* define PLL configuration
39  *
40  * The values must fulfill this equation:
41  * CORECLOCK = (EXT_OCS / PLL_DIV) * (PLL_MUL + 1)
42  */
43 #define CLOCK_PLL_MUL (83)
44 #define CLOCK_PLL_DIV (12)
45 
46 /* number of wait states before flash read and write operations */
47 #define CLOCK_FWS (4) /* 4 is save for 84MHz */
48 
54 static const timer_conf_t timer_config[] = {
55  { .dev = TC0, .id_ch0 = ID_TC0 },
56  { .dev = TC1, .id_ch0 = ID_TC3 }
57 };
58 
59 #define TIMER_0_ISR isr_tc0
60 #define TIMER_1_ISR isr_tc3
61 
62 #define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))
63 
69 static const uart_conf_t uart_config[] = {
70  {
71  .dev = (Uart *)UART,
72  .rx_port = PIOA,
73  .tx_port = PIOA,
74  .rx_pin = 8,
75  .tx_pin = 9,
76  .mux = GPIO_MUX_A,
77  .pmc_id = ID_UART,
78  .irqn = UART_IRQn
79  },
80  {
81  .dev = (Uart *)USART0,
82  .rx_port = PIOA,
83  .tx_port = PIOA,
84  .rx_pin = 10,
85  .tx_pin = 11,
86  .mux = GPIO_MUX_A,
87  .pmc_id = ID_USART0,
88  .irqn = USART0_IRQn
89  },
90  {
91  .dev = (Uart *)USART1,
92  .rx_port = PIOA,
93  .tx_port = PIOA,
94  .rx_pin = 12,
95  .tx_pin = 13,
96  .mux = GPIO_MUX_A,
97  .pmc_id = ID_USART1,
98  .irqn = USART1_IRQn
99  },
100  {
101  .dev = (Uart *)USART3,
102  .rx_port = PIOD,
103  .tx_port = PIOD,
104  .rx_pin = 4,
105  .tx_pin = 5,
106  .mux = GPIO_MUX_B,
107  .pmc_id = ID_USART3,
108  .irqn = USART3_IRQn
109  },
110 };
111 
112 /* define interrupt vectors */
113 #define UART_0_ISR isr_uart
114 #define UART_1_ISR isr_usart0
115 #define UART_2_ISR isr_usart1
116 #define UART_3_ISR isr_usart3
117 
118 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
119 
125 static const spi_conf_t spi_config[] = {
126  {
127  .dev = SPI0,
128  .id = ID_SPI0,
129  .clk = GPIO_PIN(PA, 27),
130  .mosi = GPIO_PIN(PA, 26),
131  .miso = GPIO_PIN(PA, 25),
132  .mux = GPIO_MUX_A
133  }
134 };
135 
136 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
137 
143 static const pwm_chan_conf_t pwm_chan[] = {
144  { .pin = GPIO_PIN(PC, 21), .hwchan = 4 },
145  { .pin = GPIO_PIN(PC, 22), .hwchan = 5 },
146  { .pin = GPIO_PIN(PC, 23), .hwchan = 6 },
147  { .pin = GPIO_PIN(PC, 24), .hwchan = 7 }
148 };
149 
150 #define PWM_NUMOF (1U)
151 #define PWM_CHAN_NUMOF (sizeof(pwm_chan) / sizeof(pwm_chan[0]))
152 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif /* PERIPH_CONF_H */
159 
USART_TypeDef * dev
USART device used.
PWM channel configuration data.
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
gpio_t pin
GPIO pin connected to the channel.
UART device configuration.
SPI module configuration options.
cc2538_gptimer_t * dev
timer device
Timer configuration data.
cc2538_ssi_t * dev
SSI device.