bird_dip: inertia.y nach Kollision übernehmen. Damit der Möglichkeit, dass
[hackover2013-badge-firmware.git] / badge / pinconfig.h
1 #ifndef INCLUDED_HACKOVER_2013_BADGE_PINCONFIG_H
2 #define INCLUDED_HACKOVER_2013_BADGE_PINCONFIG_H
3
4 #include <lpc134x.h>
5
6 #ifdef HOB_REV2
7
8 #define HOB_BTN_UP (1, 11)
9 #define HOB_BTN_RIGHT (1, 7)
10 #define HOB_BTN_DOWN (1, 6)
11 #define HOB_BTN_LEFT (1, 5)
12 #define HOB_BTN_A (1, 9)
13 #define HOB_BTN_B (1, 8)
14
15 #define HOB_LCD_CS (3, 0)
16 #define HOB_LCD_RST (3, 1)
17 #define HOB_LCD_BACKLIGHT (0, 1)
18
19 #define HOB_DATAFLASH_CS (0, 7)
20
21 #define HOB_RADIO_CE (2, 2)
22 #define HOB_RADIO_CS (2, 10)
23 #define HOB_RADIO_IRQ (2, 9)
24
25 #define HOB_USB_CONNECT (0, 6)
26
27
28 #define HOB_LED_LEFT (2, 8)
29 #define HOB_LED_RIGHT (2, 6)
30
31 #else
32
33 #define HOB_BTN_UP (3, 2)
34 #define HOB_BTN_RIGHT (1, 5)
35 #define HOB_BTN_DOWN (1, 6)
36 #define HOB_BTN_LEFT (3, 3)
37 #define HOB_BTN_CENTER (1, 7)
38 #define HOB_BTN_A (1, 11)
39 #define HOB_BTN_B (1, 4)
40
41 #define HOB_LCD_CS (1, 0)
42 #define HOB_LCD_RST (1, 1)
43 #define HOB_LCD_BACKLIGHT (0, 1)
44
45 #define HOB_DATAFLASH_CS (0, 7)
46
47 #define HOB_RADIO_CE (2, 10)
48 #define HOB_RADIO_CS (2, 9)
49 #define HOB_RADIO_IRQ (2, 2)
50
51 #define HOB_USB_CONNECT (0, 6)
52
53 #endif
54
55 #define HOB_PIO0_0 nRESET_PIO0_0
56 #define HOB_PIO0_1 PIO0_1
57 #define HOB_PIO0_2 PIO0_2
58 #define HOB_PIO0_3 PIO0_3
59 #define HOB_PIO0_4 PIO0_4
60 #define HOB_PIO0_5 PIO0_5
61 #define HOB_PIO0_6 PIO0_6
62 #define HOB_PIO0_7 PIO0_7
63 #define HOB_PIO0_8 PIO0_8
64 #define HOB_PIO0_9 PIO0_9
65 #define HOB_PIO0_10 JTAG_TCK_PIO0_10
66 #define HOB_PIO0_11 JTAG_TDI_PIO0_11
67
68 #define HOB_PIO1_0 JTAG_TMS_PIO1_0
69 #define HOB_PIO1_1 JTAG_TDO_PIO1_1
70 #define HOB_PIO1_2 JTAG_nTRST_PIO1_2
71 #define HOB_PIO1_3 SWDIO_PIO1_3
72 #define HOB_PIO1_4 PIO1_4
73 #define HOB_PIO1_5 PIO1_5
74 #define HOB_PIO1_6 PIO1_6
75 #define HOB_PIO1_7 PIO1_7
76 #define HOB_PIO1_8 PIO1_8
77 #define HOB_PIO1_9 PIO1_9
78 #define HOB_PIO1_10 PIO1_10
79 #define HOB_PIO1_11 PIO1_11
80
81 #define HOB_PIO2_0 PIO2_0
82 #define HOB_PIO2_1 PIO2_1
83 #define HOB_PIO2_2 PIO2_2
84 #define HOB_PIO2_3 PIO2_3
85 #define HOB_PIO2_4 PIO2_4
86 #define HOB_PIO2_5 PIO2_5
87 #define HOB_PIO2_6 PIO2_6
88 #define HOB_PIO2_7 PIO2_7
89 #define HOB_PIO2_8 PIO2_8
90 #define HOB_PIO2_9 PIO2_9
91 #define HOB_PIO2_10 PIO2_10
92 #define HOB_PIO2_11 PIO2_11
93
94 #define HOB_PIO3_0 PIO3_0
95 #define HOB_PIO3_1 PIO3_1
96 #define HOB_PIO3_2 PIO3_2
97 #define HOB_PIO3_3 PIO3_3
98 #define HOB_PIO3_4 PIO3_4
99 #define HOB_PIO3_5 PIO3_5
100
101 #define HOB_EXPAND(foo) foo
102
103 #define HOB_PORT_I(port, pin) port
104 #define HOB_PIN_I(port, pin) pin
105 #define HOB_PORT(spec) HOB_EXPAND(HOB_PORT_I spec)
106 #define HOB_PIN(spec) HOB_EXPAND(HOB_PIN_I spec)
107
108 #define HOB_BUILD_PIO_SUFFIX_I(port, pin) HOB_PIO ## port ## _ ## pin
109 #define HOB_BUILD_PIO_SUFFIX(port, pin) HOB_BUILD_PIO_SUFFIX_I(port, pin)
110 #define HOB_PIO_SUFFIX(spec) HOB_BUILD_PIO_SUFFIX(HOB_PORT(spec), HOB_PIN(spec))
111
112 #define HOB_BUILD_IOCON_NAME_I(pio) IOCON_ ## pio
113 #define HOB_BUILD_IOCON_NAME(pio) HOB_BUILD_IOCON_NAME_I(pio)
114 #define HOB_IOCON(spec) HOB_BUILD_IOCON_NAME(HOB_PIO_SUFFIX(spec))
115
116 #define HOB_BUILD_IOCON_MASK_I(pio, flag) IOCON_ ## pio ## _ ## flag
117 #define HOB_BUILD_IOCON_MASK(pio, flag) HOB_BUILD_IOCON_MASK_I(pio, flag)
118 #define HOB_IOCON_MASK(spec, flag) HOB_BUILD_IOCON_MASK(HOB_PIO_SUFFIX(spec), flag)
119
120 #define HOB_SET_PIN_FUNC(spec, func) do { \
121 HOB_IOCON(spec) = \
122 (HOB_IOCON(spec) & ~HOB_IOCON_MASK(spec, FUNC_MASK)) \
123 | HOB_IOCON_MASK(spec, FUNC_ ## func); \
124 } while(0)
125
126 #endif
This page took 0.053288 seconds and 5 git commands to generate.