|
@@ -10,42 +10,52 @@
|
10
|
10
|
|
11
|
11
|
#ifdef DEBUG
|
12
|
12
|
|
13
|
|
-// Arduino D2
|
14
|
|
-#define SCK_on PORTD |= PD2
|
15
|
|
-#define SCK_off PORTD &= ~(PD2)
|
16
|
|
-
|
17
|
|
-// Arduino D4
|
18
|
|
-#define MO_on PORTD |= PD4
|
19
|
|
-#define MO_off PORTD &= ~(PD4)
|
20
|
|
-
|
21
|
|
-// Arduino D7
|
22
|
|
-#define CS_on PORTD |= PD7
|
23
|
|
-#define CS_off PORTD &= ~(PD7)
|
24
|
|
-
|
25
|
|
-// Arduino D8
|
26
|
|
-#define MI_1 (PINB & PB0) == PB0
|
27
|
|
-#define MI_0 (PINB & PB0) != PB0
|
28
|
|
-
|
29
|
|
-// Arduino D12
|
30
|
|
-#define GDO_1 (PINB & PB4) == PB4
|
31
|
|
-#define GDO_0 (PINB & PB4) != PB4
|
|
13
|
+// Arduino D3 = PD3
|
|
14
|
+#define SCK_on PORTD |= PD3
|
|
15
|
+#define SCK_off PORTD &= ~(PD3)
|
|
16
|
+#define SCK_dir DDRD |= (1 << PD3)
|
|
17
|
+
|
|
18
|
+// Arduino D2 = PD2
|
|
19
|
+#define MO_on PORTD |= PD2
|
|
20
|
+#define MO_off PORTD &= ~(PD2)
|
|
21
|
+#define MO_dir DDRD &= ~(1 << PD2)
|
|
22
|
+
|
|
23
|
+// Arduino D8 = PB0
|
|
24
|
+#define CS_on PORTB |= PB0
|
|
25
|
+#define CS_off PORTB &= ~(PB0)
|
|
26
|
+#define CS_dir DDRB |= (1 << PB0)
|
|
27
|
+
|
|
28
|
+// Arduino D7 = PD7
|
|
29
|
+#define MI_1 (PIND & PD7) == PD7
|
|
30
|
+#define MI_0 (PIND & PD7) != PD7
|
|
31
|
+#define MI_dir DDRD |= (1 << PD7)
|
|
32
|
+
|
|
33
|
+// Arduino D9 = PB1
|
|
34
|
+#define GDO_1 (PINB & PB1) == PB1
|
|
35
|
+#define GDO_0 (PINB & PB1) != PB1
|
|
36
|
+#define GDO_dir DDRB &= ~(1 << PB1)
|
32
|
37
|
|
33
|
38
|
#else
|
34
|
39
|
|
35
|
40
|
#define SCK_on PORTB |= PB4
|
36
|
41
|
#define SCK_off PORTB &= ~(PB4)
|
|
42
|
+#define SCK_dir DDRB |= (1 << PB4)
|
37
|
43
|
|
38
|
44
|
#define MO_on PORTB |= PB3
|
39
|
45
|
#define MO_off PORTB &= ~(PB3)
|
|
46
|
+#define MO_dir DDRB &= ~(1 << PB3)
|
40
|
47
|
|
41
|
48
|
#define CS_on PORTB |= PB1
|
42
|
49
|
#define CS_off PORTB &= ~(PB1)
|
|
50
|
+#define CS_dir DDRB |= (1 << PB1)
|
43
|
51
|
|
44
|
52
|
#define MI_1 (PINB & PB2) == PB2
|
45
|
53
|
#define MI_0 (PINB & PB2) != PB2
|
|
54
|
+#define MI_dir DDRB |= (1 << PB2)
|
46
|
55
|
|
47
|
56
|
#define GDO_1 (PINB & PB0) == PB0
|
48
|
57
|
#define GDO_0 (PINB & PB0) != PB0
|
|
58
|
+#define GDO_dir DDRB &= ~(1 << PB0)
|
49
|
59
|
|
50
|
60
|
#endif
|
51
|
61
|
|