The friendly Operating System for the Internet of Things
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 
23 #ifndef PERIPH_CONF_H
24 #define PERIPH_CONF_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #define CLOCK_CORECLOCK (16000000L)
35 
50 #ifdef CPU_ATMEGA328P
51 #define TIMER_NUMOF (2U)
52 
53 #define TIMER_0 MEGA_TIMER1
54 #define TIMER_0_MASK &TIMSK1
55 #define TIMER_0_FLAG &TIFR1
56 #define TIMER_0_ISRA TIMER1_COMPA_vect
57 #define TIMER_0_ISRB TIMER1_COMPB_vect
58 #endif
59 
60 #ifdef CPU_ATMEGA2560
61 #define TIMER_NUMOF (2U)
62 
63 #define TIMER_0 MEGA_TIMER1
64 #define TIMER_0_MASK &TIMSK1
65 #define TIMER_0_FLAG &TIFR1
66 #define TIMER_0_ISRA TIMER1_COMPA_vect
67 #define TIMER_0_ISRB TIMER1_COMPB_vect
68 #define TIMER_0_ISRC TIMER1_COMPC_vect
69 
70 #define TIMER_1 MEGA_TIMER4
71 #define TIMER_1_MASK &TIMSK4
72 #define TIMER_1_FLAG &TIFR4
73 #define TIMER_1_ISRA TIMER4_COMPA_vect
74 #define TIMER_1_ISRB TIMER4_COMPB_vect
75 #define TIMER_1_ISRC TIMER4_COMPC_vect
76 #endif
77 
78 
90 #ifdef CPU_ATMEGA328P
91 #define UART_NUMOF (1U)
92 
93 #define UART_0 MEGA_UART0
94 #define UART_0_ISR USART_RX_vect
95 #endif
96 
97 #ifdef CPU_ATMEGA2560
98 #define UART_NUMOF (4U)
99 
100 #define UART_0 MEGA_UART0
101 #define UART_0_ISR USART0_RX_vect
102 
103 #define UART_1 MEGA_UART1
104 #define UART_1_ISR USART1_RX_vect
105 
106 #define UART_2 MEGA_UART2
107 #define UART_2_ISR USART2_RX_vect
108 
109 #define UART_3 MEGA_UART3
110 #define UART_3_ISR USART3_RX_vect
111 #endif
112 
134 #define SPI_NUMOF 1 /* set to 0 to disable SPI */
135 
136 #ifdef CPU_ATMEGA328P
137 #define MEGA_PRR PRR /* Power Reduction Register is PRR */
138 #endif
139 
140 #ifdef CPU_ATMEGA2560
141 #define MEGA_PRR PRR0 /* Power Reduction Register is PRR0 */
142 #endif
143 
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif /* PERIPH_CONF_H */