DIGILIGHT
hardware.h
См. документацию.
1 
10 #ifndef HARDWARE_H_
11 #define HARDWARE_H_
12 
13 #include <avr/io.h>
14 
15 // ============ PORTA ===============
17 #define ADC_PORT A
18 #define ADC_PIN 0
20 
22 #define DEBUG_LED_PORT A
23 #define DEBUG_LED_PIN0 6
24 
25 #define WS_LOCK_PORT A
26 #define WS_LOCK_PIN _BV(7)
27 
28 // ============ PORTB ===============
30 #define PORT_SPI B
31 #define PIN_MOSI 5
33 #define PIN_SS 4
35 #define PIN_SCK 7
37 #define PIN_MISO 6
38 
40 #define BTN_PORT B
41 #define BTN_UP _BV(0)
43 #define BTN_DN _BV(1)
45 #define BTN_CHANGE _BV(2)
47 #define BTN_MENU _BV(3)
49 #define BTN_ANY (BTN_MENU | BTN_UP | BTN_DN | BTN_CHANGE)
51 #define BTN_NONE 0
52 
53 // ============ PORTC ===============
55 #define LCD_PORT PORTC
57 #define LCD_DATA0_PORT LCD_PORT
58 #define LCD_DATA1_PORT LCD_PORT
59 #define LCD_DATA2_PORT LCD_PORT
60 #define LCD_DATA3_PORT LCD_PORT
61 #define LCD_DATA0_PIN 0
62 #define LCD_DATA1_PIN 1
63 #define LCD_DATA2_PIN 2
64 #define LCD_DATA3_PIN 3
65 #define LCD_RS_PORT LCD_PORT
66 #define LCD_RS_PIN 6
67 #define LCD_RW_PORT LCD_PORT
68 #define LCD_RW_PIN 5
69 #define LCD_E_PORT LCD_PORT
70 #define LCD_E_PIN 4
72 #define BKLIGHT_PORT C
74 #define BKLIGHT_PIN _BV(7)
76 
77 // ============ PORTD ===============
79 #define OC2_PORT D
80 #define OC2_PIN _BV(7)
82 
84 #define IR_CAP_PORT D
85 #define IR_CAP_PIN _BV(6)
87 
88 #endif /* HARDWARE_H_ */