Pinconfig für Endbadge.
[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 #define HOB_BTN_UP (1, 11)
7 #define HOB_BTN_RIGHT (1, 7)
8 #define HOB_BTN_DOWN (1, 6)
9 #define HOB_BTN_LEFT (1, 5)
10 #define HOB_BTN_A (1, 8)
11 #define HOB_BTN_B (1, 9)
12
13 #define HOB_LCD_CS (3, 0)
14 #define HOB_LCD_RST (3, 1)
15 #define HOB_LCD_BACKLIGHT (0, 1)
16
17 #define HOB_DATAFLASH_CS (0, 7)
18
19 #define HOB_RADIO_CE (2, 2)
20 #define HOB_RADIO_CS (2, 10)
21 #define HOB_RADIO_IRQ (2, 9)
22
23 #define HOB_USB_CONNECT (0, 6)
24
25 #define HOB_LED_LEFT (2, 8)
26 #define HOB_LED_RIGHT (2, 6)
27
28 #define HOB_PIO0_0 nRESET_PIO0_0
29 #define HOB_PIO0_1 PIO0_1
30 #define HOB_PIO0_2 PIO0_2
31 #define HOB_PIO0_3 PIO0_3
32 #define HOB_PIO0_4 PIO0_4
33 #define HOB_PIO0_5 PIO0_5
34 #define HOB_PIO0_6 PIO0_6
35 #define HOB_PIO0_7 PIO0_7
36 #define HOB_PIO0_8 PIO0_8
37 #define HOB_PIO0_9 PIO0_9
38 #define HOB_PIO0_10 JTAG_TCK_PIO0_10
39 #define HOB_PIO0_11 JTAG_TDI_PIO0_11
40
41 #define HOB_PIO1_0 JTAG_TMS_PIO1_0
42 #define HOB_PIO1_1 JTAG_TDO_PIO1_1
43 #define HOB_PIO1_2 JTAG_nTRST_PIO1_2
44 #define HOB_PIO1_3 SWDIO_PIO1_3
45 #define HOB_PIO1_4 PIO1_4
46 #define HOB_PIO1_5 PIO1_5
47 #define HOB_PIO1_6 PIO1_6
48 #define HOB_PIO1_7 PIO1_7
49 #define HOB_PIO1_8 PIO1_8
50 #define HOB_PIO1_9 PIO1_9
51 #define HOB_PIO1_10 PIO1_10
52 #define HOB_PIO1_11 PIO1_11
53
54 #define HOB_PIO2_0 PIO2_0
55 #define HOB_PIO2_1 PIO2_1
56 #define HOB_PIO2_2 PIO2_2
57 #define HOB_PIO2_3 PIO2_3
58 #define HOB_PIO2_4 PIO2_4
59 #define HOB_PIO2_5 PIO2_5
60 #define HOB_PIO2_6 PIO2_6
61 #define HOB_PIO2_7 PIO2_7
62 #define HOB_PIO2_8 PIO2_8
63 #define HOB_PIO2_9 PIO2_9
64 #define HOB_PIO2_10 PIO2_10
65 #define HOB_PIO2_11 PIO2_11
66
67 #define HOB_PIO3_0 PIO3_0
68 #define HOB_PIO3_1 PIO3_1
69 #define HOB_PIO3_2 PIO3_2
70 #define HOB_PIO3_3 PIO3_3
71 #define HOB_PIO3_4 PIO3_4
72 #define HOB_PIO3_5 PIO3_5
73
74 #define HOB_EXPAND(foo) foo
75
76 #define HOB_PORT_I(port, pin) port
77 #define HOB_PIN_I(port, pin) pin
78 #define HOB_PORT(spec) HOB_EXPAND(HOB_PORT_I spec)
79 #define HOB_PIN(spec) HOB_EXPAND(HOB_PIN_I spec)
80
81 #define HOB_BUILD_PIO_SUFFIX_I(port, pin) HOB_PIO ## port ## _ ## pin
82 #define HOB_BUILD_PIO_SUFFIX(port, pin) HOB_BUILD_PIO_SUFFIX_I(port, pin)
83 #define HOB_PIO_SUFFIX(spec) HOB_BUILD_PIO_SUFFIX(HOB_PORT(spec), HOB_PIN(spec))
84
85 #define HOB_BUILD_IOCON_NAME_I(pio) IOCON_ ## pio
86 #define HOB_BUILD_IOCON_NAME(pio) HOB_BUILD_IOCON_NAME_I(pio)
87 #define HOB_IOCON(spec) HOB_BUILD_IOCON_NAME(HOB_PIO_SUFFIX(spec))
88
89 #define HOB_BUILD_IOCON_MASK_I(pio, flag) IOCON_ ## pio ## _ ## flag
90 #define HOB_BUILD_IOCON_MASK(pio, flag) HOB_BUILD_IOCON_MASK_I(pio, flag)
91 #define HOB_IOCON_MASK(spec, flag) HOB_BUILD_IOCON_MASK(HOB_PIO_SUFFIX(spec), flag)
92
93 #define HOB_SET_PIN_FUNC(spec, func) do { \
94 HOB_IOCON(spec) = \
95 (HOB_IOCON(spec) & ~HOB_IOCON_MASK(spec, FUNC_MASK)) \
96 | HOB_IOCON_MASK(spec, FUNC_ ## func); \
97 } while(0)
98
99 #endif
This page took 0.054685 seconds and 5 git commands to generate.