diff options
Diffstat (limited to 'firmware/target/arm/tcc77x/logikdax/button-target.h')
-rw-r--r-- | firmware/target/arm/tcc77x/logikdax/button-target.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/firmware/target/arm/tcc77x/logikdax/button-target.h b/firmware/target/arm/tcc77x/logikdax/button-target.h new file mode 100644 index 0000000000..2925a423b6 --- /dev/null +++ b/firmware/target/arm/tcc77x/logikdax/button-target.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Dave Chapman | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef _BUTTON_TARGET_H_ | ||
21 | #define _BUTTON_TARGET_H_ | ||
22 | |||
23 | #include <stdbool.h> | ||
24 | #include "config.h" | ||
25 | |||
26 | /* | ||
27 | |||
28 | Results of button testing: | ||
29 | |||
30 | HOLD: GPIOA & 0x0002 (0=pressed, 0x0002 = released) | ||
31 | POWER: GPIOA & 0x8000 (0=pressed, 0x8000 = released) | ||
32 | |||
33 | ADC[0]: (approx values) | ||
34 | |||
35 | RIGHT - 0x37 | ||
36 | LEFT - 0x7f | ||
37 | JOYSTICK PRESS - 0xc7 | ||
38 | UP - 0x11e | ||
39 | DOWN - 0x184 | ||
40 | MODE - 0x1f0/0x1ff | ||
41 | PRESET - 0x268/0x269 | ||
42 | TIMESHIFT - 0x2dd | ||
43 | |||
44 | Values of ADC[0] tested in OF disassembly: 0x50, 0x96, 0xdc, 0x208, 0x384 | ||
45 | |||
46 | */ | ||
47 | |||
48 | |||
49 | void button_init_device(void); | ||
50 | int button_read_device(void); | ||
51 | |||
52 | /* Main unit's buttons */ | ||
53 | #define BUTTON_POWERPLAY 0x00000001 | ||
54 | #define BUTTON_MODE 0x00000002 | ||
55 | #define BUTTON_HOLD 0x00000004 | ||
56 | #define BUTTON_REC 0x00000008 | ||
57 | #define BUTTON_PRESET 0x00000010 | ||
58 | #define BUTTON_LEFT 0x00000020 | ||
59 | #define BUTTON_RIGHT 0x00000040 | ||
60 | #define BUTTON_UP 0x00000080 | ||
61 | #define BUTTON_DOWN 0x00000100 | ||
62 | #define BUTTON_SELECT 0x00000200 | ||
63 | |||
64 | #define BUTTON_MAIN (BUTTON_POWERPLAY|BUTTON_MODE|BUTTON_HOLD\ | ||
65 | |BUTTON_REC|BUTTON_PRESET|BUTTON_LEFT\ | ||
66 | |BUTTON_RIGHT|BUTTON_UP|BUTTON_DOWN|BUTTON_SELECT) | ||
67 | |||
68 | #define BUTTON_REMOTE 0 | ||
69 | |||
70 | #endif /* _BUTTON_TARGET_H_ */ | ||