Rev Author Line No. Line
3516 miho 1 #ifndef __CONFIG_H_
2 #define __CONFIG_H_
3  
4 // Define USB pin names
5 // --------------------
6  
7 #if! defined (__AVR_ATtiny45__)
8 #define CONFIG_USB_PORT D
9 #define CONFIG_USB_DPLUS 2
10 #define CONFIG_USB_DMINUS 4
11 #else
12 #define CONFIG_USB_PORT B
13 #define CONFIG_USB_DPLUS 2
14 #define CONFIG_USB_DMINUS 0
15 #endif
16  
17  
18 // SPI Config
19 // ----------
20  
21 #define ENABLE_SCL_EXPAND // wait for slow target device (SCL L state hold in L state)
22  
23 // CPU Compatibility
24 // -----------------
25  
26 // ATmega88 --> ATmega8 (USART0 Registers to USART Registers)
27 #ifdef UDR0
28 #define UDR UDR0
29 #endif
30  
31 #ifdef UDRE0
32 #define UDRE UDRE0
33 #endif
34  
35 #ifdef UCSR0A
36 #define UCSRA UCSR0A
37 #endif
38  
39 // Macros for Port (enables to easily define IO signals)
40 // ---------------
41 #define GLUE(A,B) A##B
42 #define DDR(PORT_LETTER) GLUE(DDR, PORT_LETTER) // Makes DDRC from DDR(C) etc.
43 #define PORT(PORT_LETTER) GLUE(PORT,PORT_LETTER) // Makes PORTC from PORT(C)
44 #define PIN(PORT_LETTER) GLUE(PIN, PORT_LETTER) // Makes PINC from PIN(C)
45  
46 #endif