Eingabetaster.
[hackover2013-badge-firmware.git] / r0ketports.h
1 #ifndef INCLUDED_R0KET_PORTS_H
2 #define INCLUDED_R0KET_PORTS_H
3
4 #define HW_IS_PROTOTYPE 1
5
6 // LED
7 #define RB_LED0 0,11
8 #define RB_LED0_IO IOCON_PIO0_11
9 #define RB_LED1 1,7
10 #define RB_LED1_IO IOCON_PIO1_7
11 #define RB_LED2 1,6
12 #define RB_LED2_IO IOCON_PIO1_6
13 #define RB_LED3 1,11
14 #define RB_LED3_IO IOCON_PIO1_11
15
16 // Infrared
17 //#define RB_IROUT 1,5
18
19 //#define RB_IRIN 1,8
20 //#define RB_IRIN_IO IOCON_PIO1_8
21
22
23 // Buttons
24 #if HW_IS_PROTOTYPE
25
26 // TODO
27 // FIXME:
28 // order of buttons is without sense!
29 #define RB_BTN1 1,5
30 #define RB_BTN1_IO IOCON_PIO1_5
31
32 #define RB_BTN2 1,6
33 #define RB_BTN2_IO IOCON_PIO1_6
34
35 #define RB_BTN3 3,2
36 #define RB_BTN3_IO IOCON_PIO3_2
37
38 #define RB_BTN0 3,3
39 #define RB_BTN0_IO IOCON_PIO3_3
40
41 #define RB_BTN4 1,7
42 #define RB_BTN4_IO IOCON_PIO1_7
43
44 // A and B buttons on the hackover badge only
45 #define RB_BTN_A 1,11
46 #define RB_BTN_A_IO IOCON_PIO1_11
47
48 #define RB_BTN_B 1,4
49 #define RB_BTN_B_IO IOCON_PIO1_4
50
51 #else
52
53 // TODO: XXX
54 // use alternate buttons for the board
55
56 #define RB_BTN0 0,1
57 #define RB_BTN0_IO IOCON_PIO0_1
58
59 #define RB_BTN1 2,9
60 #define RB_BTN1_IO IOCON_PIO2_9
61
62 #define RB_BTN2 2,6
63 #define RB_BTN2_IO IOCON_PIO2_6
64
65 #define RB_BTN3 3,3
66 #define RB_BTN3_IO IOCON_PIO3_3
67
68 #define RB_BTN4 2,7
69 #define RB_BTN4_IO IOCON_PIO2_7
70
71
72 #endif
73
74
75 // LCD
76 #if HW_IS_PROTOTYPE
77
78 // backlight pin is used in another way for prototype
79 #define RB_LCD_CS 1,0
80 #define RB_LCD_RST 1,1
81
82 #define RB_SPI_CS_DF 0,7
83
84 #else
85
86 #define RB_LCD_BL 1,9
87 #define RB_LCD_CS 2,1
88 #define RB_LCD_RST 2,2
89
90 #define RB_SPI_CS_DF 2,0
91
92 #endif
93
94
95 // I2C
96 #define RB_I2C_SCL 0,4
97
98 #define RB_I2C_SCA 0,5
99
100
101 // SPI
102 #define RB_SPI_MISO 0,8
103
104 #define RB_SPI_MOSI 0,9
105
106 #define RB_SPI_SCK 2,11
107
108 #define RB_SPI_SS0 2,5
109
110 #define RB_SPI_SS1 2,4
111
112 #define RB_SPI_SS2 2,8
113
114 #define RB_SPI_SS3 3,2
115
116 #define RB_SPI_SS4 3,1
117
118 #define RB_SPI_SS5 2,10
119
120
121 // Power
122 #define RB_PWR_VOLT 1,0
123
124 #define RB_PWR_GOOD 1,8
125
126 #define RB_PWR_CHRG 2,3
127 #define RB_PWR_CHRG_IO IOCON_PIO2_3
128
129 #define RB_PWR_LCDBL 0,0
130 #define RB_PWR_LCDBL_IO IOCON_nRESET_PIO0_0
131 #define RB_PWR_LCDBL_IO_FUNC_MASK IOCON_nRESET_PIO0_0_FUNC_MASK
132 #define RB_PWR_LCDBL_IO_FUNC_GPIO IOCON_nRESET_PIO0_0_FUNC_GPIO
133
134 // Hackerbus
135 #define RB_HB0 1,3
136 #define RB_HB0_IO IOCON_SWDIO_PIO1_3
137
138 #define RB_HB1 0,10
139 #define RB_HB1_IO IOCON_JTAG_TCK_PIO0_10
140
141 #define RB_HB2 1,1
142 #define RB_HB2_IO IOCON_PIO1_1
143
144 #define RB_HB3 0,2
145 #define RB_HB3_IO IOCON_PIO0_2
146
147 #define RB_HB4 1,4
148 #define RB_HB4_IO IOCON_PIO1_4
149
150 #define RB_HB5 1,2
151 #define RB_HB5_IO IOCON_PIO1_2
152
153 // Funk
154 #if HW_IS_PROTOTYPE
155
156 #define RB_NRF_CE 2,10
157 #define RB_NRF_CE_IO IOCON_PIO2_10
158 #define RB_SPI_NRF_CS 2,9
159 #define RB_SPI_NRF_CS_IO IOCON_PIO2_9
160
161 // TODO: this pin is new. support must be added for configuration in main.c
162 #define RB_SPI_NRF_IRQ 2,2
163 #define RB_SPI_NRF_IRQ_IO IOCON_PIO2_2
164
165 #else
166
167 #define RB_NRF_CE 1,5
168 #define RB_NRF_CE_IO IOCON_PIO1_5
169 #define RB_SPI_NRF_CS 1,10
170 #define RB_SPI_NRF_CS_IO IOCON_PIO1_10
171
172 #endif
173
174 // Misc
175 #define RB_BUSINT 3,0
176 #define RB_BUSINT_IO IOCON_PIO3_0
177
178 #define RB_USB_VBUS 0,3
179
180 #define RB_EEPROM_ADDR 0xA0
181
182 #define USB_CONNECT 0,6
183
184
185 #define BTN_NONE 0
186 #define BTN_UP (1<<0)
187 #define BTN_DOWN (1<<1)
188 #define BTN_LEFT (1<<2)
189 #define BTN_RIGHT (1<<3)
190 #define BTN_ENTER (1<<4)
191
192 #endif
193
This page took 0.055641 seconds and 5 git commands to generate.