diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/button.h | 127 |
1 files changed, 6 insertions, 121 deletions
diff --git a/firmware/export/button.h b/firmware/export/button.h index 9c0fe639a6..102d542d27 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h | |||
@@ -22,11 +22,8 @@ | |||
22 | 22 | ||
23 | #include <stdbool.h> | 23 | #include <stdbool.h> |
24 | #include "config.h" | 24 | #include "config.h" |
25 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | 25 | #include "button-target.h" |
26 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | 26 | |
27 | #define HAS_BUTTON_HOLD | ||
28 | #define HAS_REMOTE_BUTTON_HOLD | ||
29 | #endif | ||
30 | extern struct event_queue button_queue; | 27 | extern struct event_queue button_queue; |
31 | 28 | ||
32 | void button_init (void); | 29 | void button_init (void); |
@@ -44,12 +41,6 @@ void set_remote_backlight_filter_keypress(bool value); | |||
44 | #endif | 41 | #endif |
45 | #endif | 42 | #endif |
46 | 43 | ||
47 | #ifdef HAS_BUTTON_HOLD | ||
48 | bool button_hold(void); | ||
49 | #endif | ||
50 | #ifdef HAS_REMOTE_BUTTON_HOLD | ||
51 | bool remote_button_hold(void); | ||
52 | #endif | ||
53 | #ifdef HAVE_HEADPHONE_DETECTION | 44 | #ifdef HAVE_HEADPHONE_DETECTION |
54 | bool headphones_inserted(void); | 45 | bool headphones_inserted(void); |
55 | #endif | 46 | #endif |
@@ -58,116 +49,10 @@ int wheel_status(void); | |||
58 | void wheel_send_events(bool send); | 49 | void wheel_send_events(bool send); |
59 | #endif | 50 | #endif |
60 | 51 | ||
61 | #define BUTTON_NONE 0x00000000 | 52 | #define BUTTON_NONE 0x00000000 |
62 | |||
63 | /* Button modifiers */ | ||
64 | #define BUTTON_REL 0x02000000 | ||
65 | #define BUTTON_REPEAT 0x04000000 | ||
66 | |||
67 | |||
68 | #ifdef TARGET_TREE | ||
69 | #include "button-target.h" | ||
70 | #else | ||
71 | |||
72 | /* Target specific button codes */ | ||
73 | #if CONFIG_KEYPAD == RECORDER_PAD | ||
74 | |||
75 | /* Recorder specific button codes */ | ||
76 | |||
77 | /* Main unit's buttons */ | ||
78 | #define BUTTON_ON 0x00000001 | ||
79 | #define BUTTON_OFF 0x00000002 | ||
80 | |||
81 | #define BUTTON_LEFT 0x00000004 | ||
82 | #define BUTTON_RIGHT 0x00000008 | ||
83 | #define BUTTON_UP 0x00000010 | ||
84 | #define BUTTON_DOWN 0x00000020 | ||
85 | |||
86 | #define BUTTON_PLAY 0x00000040 | ||
87 | |||
88 | #define BUTTON_F1 0x00000080 | ||
89 | #define BUTTON_F2 0x00000100 | ||
90 | #define BUTTON_F3 0x00000200 | ||
91 | |||
92 | #define BUTTON_MAIN (BUTTON_ON|BUTTON_OFF|BUTTON_LEFT|BUTTON_RIGHT\ | ||
93 | |BUTTON_UP|BUTTON_DOWN|BUTTON_PLAY\ | ||
94 | |BUTTON_F1|BUTTON_F2|BUTTON_F3) | ||
95 | |||
96 | /* Remote control's buttons */ | ||
97 | #define BUTTON_RC_PLAY 0x00100000 | ||
98 | #define BUTTON_RC_STOP 0x00080000 | ||
99 | |||
100 | #define BUTTON_RC_LEFT 0x00040000 | ||
101 | #define BUTTON_RC_RIGHT 0x00020000 | ||
102 | #define BUTTON_RC_VOL_UP 0x00010000 | ||
103 | #define BUTTON_RC_VOL_DOWN 0x00008000 | ||
104 | |||
105 | #define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\ | ||
106 | |BUTTON_RC_LEFT|BUTTON_RC_RIGHT\ | ||
107 | |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN) | ||
108 | |||
109 | #elif CONFIG_KEYPAD == PLAYER_PAD | ||
110 | 53 | ||
111 | /* Main unit's buttons */ | 54 | /* Button modifiers */ |
112 | #define BUTTON_ON 0x00000001 | 55 | #define BUTTON_REL 0x02000000 |
113 | #define BUTTON_STOP 0x00000002 | 56 | #define BUTTON_REPEAT 0x04000000 |
114 | |||
115 | #define BUTTON_LEFT 0x00000004 | ||
116 | #define BUTTON_RIGHT 0x00000008 | ||
117 | #define BUTTON_PLAY 0x00000010 | ||
118 | #define BUTTON_MENU 0x00000020 | ||
119 | |||
120 | #define BUTTON_MAIN (BUTTON_ON|BUTTON_STOP|BUTTON_LEFT|BUTTON_RIGHT\ | ||
121 | |BUTTON_PLAY|BUTTON_MENU) | ||
122 | |||
123 | /* Remote control's buttons */ | ||
124 | #define BUTTON_RC_PLAY 0x00100000 | ||
125 | #define BUTTON_RC_STOP 0x00080000 | ||
126 | |||
127 | #define BUTTON_RC_LEFT 0x00040000 | ||
128 | #define BUTTON_RC_RIGHT 0x00020000 | ||
129 | #define BUTTON_RC_VOL_UP 0x00010000 | ||
130 | #define BUTTON_RC_VOL_DOWN 0x00008000 | ||
131 | |||
132 | #define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\ | ||
133 | |BUTTON_RC_LEFT|BUTTON_RC_RIGHT\ | ||
134 | |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN) | ||
135 | |||
136 | |||
137 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
138 | |||
139 | /* Ondio specific button codes */ | ||
140 | |||
141 | #define BUTTON_OFF 0x00000001 | ||
142 | #define BUTTON_MENU 0x00000002 | ||
143 | |||
144 | #define BUTTON_LEFT 0x00000004 | ||
145 | #define BUTTON_RIGHT 0x00000008 | ||
146 | #define BUTTON_UP 0x00000010 | ||
147 | #define BUTTON_DOWN 0x00000020 | ||
148 | |||
149 | #define BUTTON_MAIN (BUTTON_OFF|BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT\ | ||
150 | |BUTTON_UP|BUTTON_DOWN) | ||
151 | |||
152 | #define BUTTON_REMOTE 0 | ||
153 | |||
154 | #elif 0 | ||
155 | |||
156 | /* | ||
157 | * Please, add the next Rockbox target's button defines here, | ||
158 | * using: | ||
159 | * - bits 0 and up: for main unit's buttons | ||
160 | * - bits 20 (0x00100000) and downwards for the remote buttons (if applicable) | ||
161 | * Don't forget to add BUTTON_MAIN and BUTTON_REMOTE masks | ||
162 | * Currently, main buttons on all targets are up to bit 9 (0x00000200), | ||
163 | * and remote buttons are down to bit 10 (0x00000400) | ||
164 | */ | ||
165 | |||
166 | |||
167 | |||
168 | #endif /* RECORDER/PLAYER/ONDIO KEYPAD */ | ||
169 | |||
170 | #endif /* TARGET_TREE */ | ||
171 | 57 | ||
172 | #endif /* _BUTTON_H_ */ | 58 | #endif /* _BUTTON_H_ */ |
173 | |||