boards/common/arduino-atmega/include/periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin, Hinnerk van Bruinehsen
3  * 2016 Laurent Navet <laurent.navet@gmail.com>
4  * 2017 HAW Hamburg, Dimitri Nahm
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
24 #ifndef PERIPH_CONF_H
25 #define PERIPH_CONF_H
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define CLOCK_CORECLOCK (16000000UL)
36 
51 #ifdef CPU_ATMEGA328P
52 #define TIMER_NUMOF (2U)
53 
54 #define TIMER_0 MEGA_TIMER1
55 #define TIMER_0_MASK &TIMSK1
56 #define TIMER_0_FLAG &TIFR1
57 #define TIMER_0_ISRA TIMER1_COMPA_vect
58 #define TIMER_0_ISRB TIMER1_COMPB_vect
59 #endif
60 
61 #ifdef CPU_ATMEGA2560
62 #define TIMER_NUMOF (2U)
63 
64 #define TIMER_0 MEGA_TIMER1
65 #define TIMER_0_MASK &TIMSK1
66 #define TIMER_0_FLAG &TIFR1
67 #define TIMER_0_ISRA TIMER1_COMPA_vect
68 #define TIMER_0_ISRB TIMER1_COMPB_vect
69 #define TIMER_0_ISRC TIMER1_COMPC_vect
70 
71 #define TIMER_1 MEGA_TIMER4
72 #define TIMER_1_MASK &TIMSK4
73 #define TIMER_1_FLAG &TIFR4
74 #define TIMER_1_ISRA TIMER4_COMPA_vect
75 #define TIMER_1_ISRB TIMER4_COMPB_vect
76 #define TIMER_1_ISRC TIMER4_COMPC_vect
77 #endif
78 
89 #ifdef CPU_ATMEGA328P
90 #define UART_NUMOF (1U)
91 
92 #define UART_0 MEGA_UART0
93 #define UART_0_ISR USART_RX_vect
94 #endif
95 
96 #ifdef CPU_ATMEGA2560
97 #define UART_NUMOF (4U)
98 
99 #define UART_0 MEGA_UART0
100 #define UART_0_ISR USART0_RX_vect
101 
102 #define UART_1 MEGA_UART1
103 #define UART_1_ISR USART1_RX_vect
104 
105 #define UART_2 MEGA_UART2
106 #define UART_2_ISR USART2_RX_vect
107 
108 #define UART_3 MEGA_UART3
109 #define UART_3_ISR USART3_RX_vect
110 #endif
111 
137 #define SPI_NUMOF 1 /* set to 0 to disable SPI */
138 
144 #define I2C_NUMOF 1
145 
158 #if defined (CPU_ATMEGA328P) || defined (CPU_ATMEGA1281)
159 #define ADC_NUMOF (8U)
160 #elif defined (CPU_ATMEGA2560)
161 #define ADC_NUMOF (16U)
162 #endif
163 
165 #ifdef __cplusplus
166 }
167 #endif
168 
169 #endif /* PERIPH_CONF_H */