5 /* Firefly2_2 hardware */
10 #define SPI_SS 0 // PB.0 - Output: SPI Slave Select
11 #define SCK 1 // PB.1 - Output: SPI Serial Clock
12 #define MOSI 2 // PB.2
13 #define CSN 0 // PC.0 - Output: SPI Chip Select (CS_N)
18 #define LED_PORT PORTE
19 #define LED_ORANGE 2 // PE.2
20 #define LED_BLUE 3 // PE.3
21 #define LED_GREEN 4 // PE.4
22 #define LED_RED 5 // PE.5
24 #define BUTTON_DDR DDRA
25 #define BUTTON_PORT PINA
26 #define BUTTON_PIN 7 // PA.7
29 #define DEBUG_0 3 // PA.3
30 #define DEBUG_1 4 // PA.4
31 #define DEBUG_2 0 // PD.0
32 #define DEBUG_3 1 // PD.1
38 /* use sbi() and cbi() instead */
39 #define SET(port, pin) port |= (1<<(pin))
40 #define CLR(port, pin) port &= ~(1<<(pin))
42 /* test of bit (pin) of (port)
43 * Substitutes as 1 if pin is set, or 0 if not */
44 #define TST(port, pin) ((port & (1<<(pin)))>>(pin))
46 /* To set leds you have to clear the bit (yeah, I know...) */
47 #define LED_SET(led) cbi(LED_PORT, (led))
48 #define LED_CLR(led) sbi(LED_PORT, (led))