| Line 34... |
Line 34... |
| 34 |
#define GPS PD4 |
34 |
#define GPS PD4 |
| 35 |
#define GPS_DDR DDRD |
35 |
#define GPS_DDR DDRD |
| 36 |
#define GPS_PORT PORTD |
36 |
#define GPS_PORT PORTD |
| 37 |
|
37 |
|
| 38 |
// UART SW |
38 |
// UART SW |
| 39 |
#define RX PD2 // input |
39 |
#define USB PD5 // input |
| 40 |
#define RX_DDR DDRD |
40 |
#define USB_DDR DDRD |
| 41 |
#define RX_PORT PORTD |
41 |
#define USB_PORT PORTD |
| 42 |
#define RX_PIN PIND |
42 |
#define USB_PIN PIND |
| 43 |
|
43 |
|
| 44 |
// i2C SW |
44 |
// i2C SW |
| 45 |
#define SDA PC1 |
45 |
#define SDA PC1 |
| 46 |
#define SDA_PORT PORTC |
46 |
#define SDA_PORT PORTC |
| 47 |
#define SDA_DDR DDRC |
47 |
#define SDA_DDR DDRC |
| Line 77... |
Line 77... |
| 77 |
#define GPS_OFF GPS_PORT |= _BV(GPS) |
77 |
#define GPS_OFF GPS_PORT |= _BV(GPS) |
| 78 |
#define GPS_ON GPS_PORT &= (~(_BV(GPS))) |
78 |
#define GPS_ON GPS_PORT &= (~(_BV(GPS))) |
| 79 |
#define GPS_INIT GPS_DDR |= _BV(GPS) |
79 |
#define GPS_INIT GPS_DDR |= _BV(GPS) |
| 80 |
#define GPS_INPUT (!(GPS_PORT & _BV(GPS))) |
80 |
#define GPS_INPUT (!(GPS_PORT & _BV(GPS))) |
| 81 |
|
81 |
|
| 82 |
#define RX_INIT RX_DDR &= ~(_BV(RX)) |
82 |
#define USB_INIT USB_DDR &= ~(_BV(USB)) |
| 83 |
#define RX_INPUT (RX_PIN & _BV(RX)) |
83 |
#define USB_INPUT (USB_PIN & _BV(USB)) |
| 84 |
#define RX_PULLUP RX_PORT |= _BV(RX) |
84 |
#define USB_PULLUP USB_PORT |= _BV(USB) |
| 85 |
|
85 |
|
| 86 |
#define SCL_INIT SCL_DDR |= _BV(SCL) |
86 |
#define SCL_INIT SCL_DDR |= _BV(SCL) |
| 87 |
#define SCL_L SCL_PORT &= ~(_BV(SCL)) |
87 |
#define SCL_L SCL_PORT &= ~(_BV(SCL)) |
| 88 |
#define SCL_H SCL_PORT |= _BV(SCL) |
88 |
#define SCL_H SCL_PORT |= _BV(SCL) |
| 89 |
|
89 |
|
| Line 106... |
Line 106... |
| 106 |
#define ADC_ON ADCSRA |= _BV(ADEN) |
106 |
#define ADC_ON ADCSRA |= _BV(ADEN) |
| 107 |
#define ADC_OFF ADCSRA &= ~(_BV(ADEN)) |
107 |
#define ADC_OFF ADCSRA &= ~(_BV(ADEN)) |
| 108 |
|
108 |
|
| 109 |
#define KEY1 0 |
109 |
#define KEY1 0 |
| 110 |
#define KEY2 1 |
110 |
#define KEY2 1 |
| 111 |
#define KEY3 3 |
111 |
#define KEY3 2 |
| - |
|
112 |
|
| - |
|
113 |
#define KEY1_LONG 1 |
| - |
|
114 |
#define KEY2_LONG 2 |
| - |
|
115 |
#define KEY3_LONG 3 |
| - |
|
116 |
#define KEY1_SHORT 4 |
| - |
|
117 |
#define KEY2_SHORT 5 |
| - |
|
118 |
#define KEY3_SHORT 6 |
| 112 |
|
119 |
|
| 113 |
#define ID_OFF 100 |
120 |
#define ID_OFF 100 |
| 114 |
#define ID_START 101 |
121 |
#define ID_START 101 |
| 115 |
#define ID_SETUP 102 |
122 |
#define ID_SETUP 102 |
| 116 |
|
123 |
|