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_pin = GPIO_PIN(PA, 8),
73  .tx_pin = GPIO_PIN(PA, 9),
74  .mux = GPIO_MUX_A,
75  .pmc_id = ID_UART,
76  .irqn = UART_IRQn
77  },
78  {
79  .dev = (Uart *)USART0,
80  .rx_pin = GPIO_PIN(PA, 10),
81  .tx_pin = GPIO_PIN(PA, 11),
82  .mux = GPIO_MUX_A,
83  .pmc_id = ID_USART0,
84  .irqn = USART0_IRQn
85  },
86  {
87  .dev = (Uart *)USART1,
88  .rx_pin = GPIO_PIN(PA, 12),
89  .tx_pin = GPIO_PIN(PA, 13),
90  .mux = GPIO_MUX_A,
91  .pmc_id = ID_USART1,
92  .irqn = USART1_IRQn
93  },
94  {
95  .dev = (Uart *)USART3,
96  .rx_pin = GPIO_PIN(PD, 5),
97  .tx_pin = GPIO_PIN(PD, 4),
98  .mux = GPIO_MUX_B,
99  .pmc_id = ID_USART3,
100  .irqn = USART3_IRQn
101  }
102 };
103 
104 /* define interrupt vectors */
105 #define UART_0_ISR isr_uart
106 #define UART_1_ISR isr_usart0
107 #define UART_2_ISR isr_usart1
108 #define UART_3_ISR isr_usart3
109 
110 #define UART_NUMOF (sizeof(uart_config) / sizeof(uart_config[0]))
111 
117 static const spi_conf_t spi_config[] = {
118  {
119  .dev = SPI0,
120  .id = ID_SPI0,
121  .clk = GPIO_PIN(PA, 27),
122  .mosi = GPIO_PIN(PA, 26),
123  .miso = GPIO_PIN(PA, 25),
124  .mux = GPIO_MUX_A
125  }
126 };
127 
128 #define SPI_NUMOF (sizeof(spi_config) / sizeof(spi_config[0]))
129 
135 static const pwm_chan_conf_t pwm_chan[] = {
136  { .pin = GPIO_PIN(PC, 21), .hwchan = 4 },
137  { .pin = GPIO_PIN(PC, 22), .hwchan = 5 },
138  { .pin = GPIO_PIN(PC, 23), .hwchan = 6 },
139  { .pin = GPIO_PIN(PC, 24), .hwchan = 7 }
140 };
141 
142 #define PWM_NUMOF (1U)
143 #define PWM_CHAN_NUMOF (sizeof(pwm_chan) / sizeof(pwm_chan[0]))
144 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* PERIPH_CONF_H */
151 
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
NRF_TIMER_Type * dev
timer device
select peripheral function A
gpio_t pin
GPIO pin connected to the channel.
UART device configuration.
SPI module configuration options.
Timer configuration.
cc2538_ssi_t * dev
SSI device.