boards/arduino-atmega-common/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  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
22 #ifndef PERIPH_CONF_H
23 #define PERIPH_CONF_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #define CLOCK_CORECLOCK (16000000L)
34 
49 #ifdef CPU_ATMEGA328P
50 #define TIMER_NUMOF (2U)
51 
52 #define TIMER_0 MEGA_TIMER1
53 #define TIMER_0_MASK &TIMSK1
54 #define TIMER_0_FLAG &TIFR1
55 #define TIMER_0_ISRA TIMER1_COMPA_vect
56 #define TIMER_0_ISRB TIMER1_COMPB_vect
57 #endif
58 
59 #ifdef CPU_ATMEGA2560
60 #define TIMER_NUMOF (2U)
61 
62 #define TIMER_0 MEGA_TIMER1
63 #define TIMER_0_MASK &TIMSK1
64 #define TIMER_0_FLAG &TIFR1
65 #define TIMER_0_ISRA TIMER1_COMPA_vect
66 #define TIMER_0_ISRB TIMER1_COMPB_vect
67 #define TIMER_0_ISRC TIMER1_COMPC_vect
68 
69 #define TIMER_1 MEGA_TIMER4
70 #define TIMER_1_MASK &TIMSK4
71 #define TIMER_1_FLAG &TIFR4
72 #define TIMER_1_ISRA TIMER4_COMPA_vect
73 #define TIMER_1_ISRB TIMER4_COMPB_vect
74 #define TIMER_1_ISRC TIMER4_COMPC_vect
75 #endif
76 
87 #ifdef CPU_ATMEGA328P
88 #define UART_NUMOF (1U)
89 
90 #define UART_0 MEGA_UART0
91 #define UART_0_ISR USART_RX_vect
92 #endif
93 
94 #ifdef CPU_ATMEGA2560
95 #define UART_NUMOF (4U)
96 
97 #define UART_0 MEGA_UART0
98 #define UART_0_ISR USART0_RX_vect
99 
100 #define UART_1 MEGA_UART1
101 #define UART_1_ISR USART1_RX_vect
102 
103 #define UART_2 MEGA_UART2
104 #define UART_2_ISR USART2_RX_vect
105 
106 #define UART_3 MEGA_UART3
107 #define UART_3_ISR USART3_RX_vect
108 #endif
109 
135 #define SPI_NUMOF 1 /* set to 0 to disable SPI */
136 
141 #define I2C_NUMOF 1
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif /* PERIPH_CONF_H */