summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHristo Kovachev <bger@rockbox.org>2006-03-21 09:36:13 +0000
committerHristo Kovachev <bger@rockbox.org>2006-03-21 09:36:13 +0000
commitf53f64a6159c0f17f09d18fad64ab2b09f7c0d36 (patch)
tree9e6cc6c2628fdf70b1d555ad589f25d8440acc33
parent16f7aa76d049681f1aa3b3ca778b1d2be77d2231 (diff)
downloadrockbox-f53f64a6159c0f17f09d18fad64ab2b09f7c0d36.tar.gz
rockbox-f53f64a6159c0f17f09d18fad64ab2b09f7c0d36.zip
button.h cleanup, with the future "button action" thing in mind:
1) Main unit's button defines are from the LSB to the MSB (currently bits 0-9, 0x00000200), remote ones are from the 20th bit (0x00100000) downards to 10th(0x00000400); 2) Removed the BUTTON_REMOTE modifier, replaced with a bitmask of all of the remote buttons (where applicable, otherwise with 0), added a complementary BUTTON_MAIN bitmask; 3) Moved button modifiers: - BUTTON_REPEAT: to bit 26 (0x04000000) - BUTTON_REL: to bit 25 (0x02000000) There are at least 4 bits free on all targets now: 21-24. If we really need more free bits, it's possible to SHR remote buttons 1 bit more (freeing bit 20 too), and to change the SYS_EVENT bit with a bitmask (+2 bits). 4) Bumped up the min. plugin ver. (and sorted the plugin api struct), because the binary plugins with key input won't understand the new values git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9149 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.c10
-rw-r--r--apps/plugin.h21
-rw-r--r--firmware/export/button.h389
3 files changed, 264 insertions, 156 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 7aa30c9ea2..4395195d0f 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -179,7 +179,7 @@ static const struct plugin_api rockbox_api = {
179 button_get_w_tmo, 179 button_get_w_tmo,
180 button_status, 180 button_status,
181 button_clear_queue, 181 button_clear_queue,
182#if CONFIG_KEYPAD == IRIVER_H100_PAD 182#ifdef HAS_BUTTON_HOLD
183 button_hold, 183 button_hold,
184#endif 184#endif
185 185
@@ -357,6 +357,7 @@ static const struct plugin_api rockbox_api = {
357 menu_draw, 357 menu_draw,
358 menu_insert, 358 menu_insert,
359 menu_set_cursor, 359 menu_set_cursor,
360 set_option,
360 361
361 /* power */ 362 /* power */
362 battery_level, 363 battery_level,
@@ -411,13 +412,6 @@ static const struct plugin_api rockbox_api = {
411 /* new stuff at the end, sort into place next time 412 /* new stuff at the end, sort into place next time
412 the API gets incompatible */ 413 the API gets incompatible */
413 414
414#if CONFIG_KEYPAD == IRIVER_H300_PAD || CONFIG_KEYPAD == IPOD_4G_PAD
415 /* NOTE: This is already in the plugin api for the H100 - but we put it
416 at the end for other targets to keep the plugin api compatible */
417 button_hold,
418#endif
419 /* options */
420 set_option,
421}; 415};
422 416
423int plugin_load(const char* plugin, void* parameter) 417int plugin_load(const char* plugin, void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index bf58542729..6584dbeed7 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -99,12 +99,12 @@
99#define PLUGIN_MAGIC 0x526F634B /* RocK */ 99#define PLUGIN_MAGIC 0x526F634B /* RocK */
100 100
101/* increase this every time the api struct changes */ 101/* increase this every time the api struct changes */
102#define PLUGIN_API_VERSION 12 102#define PLUGIN_API_VERSION 13
103 103
104/* update this to latest version if a change to the api struct breaks 104/* update this to latest version if a change to the api struct breaks
105 backwards compatibility (and please take the opportunity to sort in any 105 backwards compatibility (and please take the opportunity to sort in any
106 new function which are "waiting" at the end of the function table) */ 106 new function which are "waiting" at the end of the function table) */
107#define PLUGIN_MIN_API_VERSION 11 107#define PLUGIN_MIN_API_VERSION 13
108 108
109/* plugin return codes */ 109/* plugin return codes */
110enum plugin_status { 110enum plugin_status {
@@ -229,7 +229,7 @@ struct plugin_api {
229 long (*button_get_w_tmo)(int ticks); 229 long (*button_get_w_tmo)(int ticks);
230 int (*button_status)(void); 230 int (*button_status)(void);
231 void (*button_clear_queue)(void); 231 void (*button_clear_queue)(void);
232#if CONFIG_KEYPAD == IRIVER_H100_PAD 232#ifdef HAS_BUTTON_HOLD
233 bool (*button_hold)(void); 233 bool (*button_hold)(void);
234#endif 234#endif
235 235
@@ -414,6 +414,11 @@ struct plugin_api {
414 void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void)); 414 void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void));
415 void (*menu_set_cursor)(int menu, int position); 415 void (*menu_set_cursor)(int menu, int position);
416 416
417 bool (*set_option)(const char* string, void* variable,
418 enum optiontype type, const struct opt_items* options,
419 int numoptions, void (*function)(int));
420
421
417 /* power */ 422 /* power */
418 int (*battery_level)(void); 423 int (*battery_level)(void);
419 bool (*battery_level_safe)(void); 424 bool (*battery_level_safe)(void);
@@ -476,16 +481,6 @@ struct plugin_api {
476 /* new stuff at the end, sort into place next time 481 /* new stuff at the end, sort into place next time
477 the API gets incompatible */ 482 the API gets incompatible */
478 483
479#if CONFIG_KEYPAD == IRIVER_H300_PAD || CONFIG_KEYPAD == IPOD_4G_PAD
480 /* NOTE: This is already in the plugin api for the H100 - but we put it
481 at the end for other targets to keep the plugin api compatible */
482 bool (*button_hold)(void);
483#endif
484 /* options */
485 bool (*set_option)(const char* string, void* variable,
486 enum optiontype type, const struct opt_items* options,
487 int numoptions, void (*function)(int));
488
489}; 484};
490 485
491/* plugin header */ 486/* plugin header */
diff --git a/firmware/export/button.h b/firmware/export/button.h
index be1efa7001..90edd05d51 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -28,7 +28,8 @@
28#define HAS_BUTTON_HOLD 28#define HAS_BUTTON_HOLD
29#define HAS_REMOTE_BUTTON_HOLD 29#define HAS_REMOTE_BUTTON_HOLD
30#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ 30#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
31 (CONFIG_KEYPAD == IPOD_3G_PAD) 31 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
32 (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
32#define HAS_BUTTON_HOLD 33#define HAS_BUTTON_HOLD
33#endif 34#endif
34extern struct event_queue button_queue; 35extern struct event_queue button_queue;
@@ -49,174 +50,292 @@ bool button_hold(void);
49bool remote_button_hold(void); 50bool remote_button_hold(void);
50#endif 51#endif
51 52
52#if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
53bool button_hold(void);
54#endif
55 53
56#define BUTTON_NONE 0x0000 54#define BUTTON_NONE 0x00000000
57 55
58/* Shared button codes */ 56 /* Button modifiers */
59#define BUTTON_LEFT 0x0040 57#define BUTTON_REL 0x02000000
60#define BUTTON_RIGHT 0x0080 58#define BUTTON_REPEAT 0x04000000
61 59
62/* Button modifiers */ 60
63#define BUTTON_REMOTE 0x2000 61 /* Target specific button codes */
64#define BUTTON_REPEAT 0x4000 62
65#define BUTTON_REL 0x8000 63#if (CONFIG_KEYPAD == IRIVER_H100_PAD)\
66 64 || (CONFIG_KEYPAD == IRIVER_H300_PAD)
67/* remote control buttons */ 65
68#define BUTTON_RC_VOL_UP (0x0008 | BUTTON_REMOTE) 66/* iRiver H100/H300 specific button codes */
69#define BUTTON_RC_VOL_DOWN (0x0800 | BUTTON_REMOTE) 67
70#define BUTTON_RC_LEFT (BUTTON_LEFT | BUTTON_REMOTE) 68 /* Main unit's buttons */
71#define BUTTON_RC_RIGHT (BUTTON_RIGHT| BUTTON_REMOTE) 69#define BUTTON_ON 0x00000001
72 70#define BUTTON_OFF 0x00000002
73#if CONFIG_KEYPAD == IRIVER_H100_PAD 71
74 72#define BUTTON_LEFT 0x00000004
75/* iRiver H100 specific button codes */ 73#define BUTTON_RIGHT 0x00000008
76#define BUTTON_SELECT 0x0100 74#define BUTTON_UP 0x00000010
77#define BUTTON_MODE 0x0200 75#define BUTTON_DOWN 0x00000020
78#define BUTTON_REC 0x0400 76
79#define BUTTON_ON 0x0001 77#define BUTTON_REC 0x00000040
80#define BUTTON_OFF 0x0002 78#define BUTTON_MODE 0x00000080
81#define BUTTON_UP 0x0010 79
82#define BUTTON_DOWN 0x0020 80#define BUTTON_SELECT 0x00000100
83 81
84#define BUTTON_RC_ON (BUTTON_REMOTE | 0x00010000) 82#define BUTTON_MAIN (BUTTON_ON|BUTTON_OFF|BUTTON_LEFT|BUTTON_RIGHT|\
85#define BUTTON_RC_STOP (BUTTON_REMOTE | 0x00020000) 83 BUTTON_UP|BUTTON_DOWN|BUTTON_REC|BUTTON_MODE|BUTTON_SELECT)
86#define BUTTON_RC_MODE (BUTTON_REMOTE | 0x00040000) 84
87#define BUTTON_RC_BITRATE (BUTTON_REMOTE | 0x00200000) 85 /* Remote control's buttons */
88#define BUTTON_RC_REC (BUTTON_REMOTE | 0x00400000) 86#define BUTTON_RC_ON 0x00100000
89#define BUTTON_RC_SOURCE (BUTTON_REMOTE | 0x00800000) 87#define BUTTON_RC_STOP 0x00080000
90#define BUTTON_RC_MENU (BUTTON_REMOTE | 0x01000000) 88
91#define BUTTON_RC_FF (BUTTON_REMOTE | 0x02000000) 89#define BUTTON_RC_REW 0x00040000
92#define BUTTON_RC_REW (BUTTON_REMOTE | 0x04000000) 90#define BUTTON_RC_FF 0x00020000
93 91#define BUTTON_RC_VOL_UP 0x00010000
94#elif CONFIG_KEYPAD == IRIVER_H300_PAD 92#define BUTTON_RC_VOL_DOWN 0x00008000
95 93
96/* iRiver H300 specific button codes */ 94#define BUTTON_RC_REC 0x00004000
97#define BUTTON_SELECT 0x0100 95#define BUTTON_RC_MODE 0x00002000
98#define BUTTON_MODE 0x0200 96
99#define BUTTON_REC 0x0400 97#define BUTTON_RC_MENU 0x00001000
100#define BUTTON_ON 0x0001 98
101#define BUTTON_OFF 0x0002 99#define BUTTON_RC_BITRATE 0x00000800
102#define BUTTON_UP 0x0010 100#define BUTTON_RC_SOURCE 0x00000400
103#define BUTTON_DOWN 0x0020 101
104 102#define BUTTON_REMOTE (BUTTON_RC_ON|BUTTON_RC_STOP|BUTTON_RC_REW|BUTTON_RC_FF\
105#define BUTTON_RC_ON (BUTTON_REMOTE | 0x00010000) 103 |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN|BUTTON_RC_REC\
106#define BUTTON_RC_STOP (BUTTON_REMOTE | 0x00020000) 104 |BUTTON_RC_MODE|BUTTON_RC_MENU|BUTTON_RC_BITRATE\
107#define BUTTON_RC_MODE (BUTTON_REMOTE | 0x00040000) 105 |BUTTON_RC_SOURCE)
108#define BUTTON_RC_BITRATE (BUTTON_REMOTE | 0x00200000)
109#define BUTTON_RC_REC (BUTTON_REMOTE | 0x00400000)
110#define BUTTON_RC_SOURCE (BUTTON_REMOTE | 0x00800000)
111#define BUTTON_RC_MENU (BUTTON_REMOTE | 0x01000000)
112#define BUTTON_RC_FF (BUTTON_REMOTE | 0x02000000)
113#define BUTTON_RC_REW (BUTTON_REMOTE | 0x04000000)
114 106
115#elif CONFIG_KEYPAD == RECORDER_PAD 107#elif CONFIG_KEYPAD == RECORDER_PAD
116 108
117/* Recorder specific button codes */ 109 /* Recorder specific button codes */
118#define BUTTON_ON 0x0001 110
119#define BUTTON_OFF 0x0002 111 /* Main unit's buttons */
120#define BUTTON_PLAY 0x0004 112#define BUTTON_ON 0x00000001
121#define BUTTON_UP 0x0010 113#define BUTTON_OFF 0x00000002
122#define BUTTON_DOWN 0x0020 114
123#define BUTTON_F1 0x0100 115#define BUTTON_LEFT 0x00000004
124#define BUTTON_F2 0x0200 116#define BUTTON_RIGHT 0x00000008
125#define BUTTON_F3 0x0400 117#define BUTTON_UP 0x00000010
118#define BUTTON_DOWN 0x00000020
119
120#define BUTTON_PLAY 0x00000040
121
122#define BUTTON_F1 0x00000080
123#define BUTTON_F2 0x00000100
124#define BUTTON_F3 0x00000200
126 125
127#define BUTTON_RC_PLAY (BUTTON_PLAY | BUTTON_REMOTE) 126#define BUTTON_MAIN (BUTTON_ON|BUTTON_OFF|BUTTON_LEFT|BUTTON_RIGHT\
128#define BUTTON_RC_STOP (BUTTON_OFF | BUTTON_REMOTE) 127 |BUTTON_UP|BUTTON_DOWN|BUTTON_PLAY\
128 |BUTTON_F1|BUTTON_F2|BUTTON_F3)
129
130 /* Remote control's buttons */
131#define BUTTON_RC_PLAY 0x00100000
132#define BUTTON_RC_STOP 0x00080000
133
134#define BUTTON_RC_LEFT 0x00040000
135#define BUTTON_RC_RIGHT 0x00020000
136#define BUTTON_RC_VOL_UP 0x00010000
137#define BUTTON_RC_VOL_DOWN 0x00008000
138
139#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\
140 |BUTTON_RC_LEFT|BUTTON_RC_RIGHT\
141 |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
129 142
130#elif CONFIG_KEYPAD == PLAYER_PAD 143#elif CONFIG_KEYPAD == PLAYER_PAD
131 144
132/* Jukebox 6000 and Studio specific button codes */ 145/* Jukebox 6000 and Studio specific button codes */
133#define BUTTON_ON 0x0001
134#define BUTTON_MENU 0x0002
135#define BUTTON_PLAY 0x0010
136#define BUTTON_STOP 0x0020
137 146
138#define BUTTON_RC_PLAY (BUTTON_PLAY | BUTTON_REMOTE) 147 /* Main unit's buttons */
139#define BUTTON_RC_STOP (BUTTON_STOP | BUTTON_REMOTE) 148#define BUTTON_ON 0x00000001
149#define BUTTON_STOP 0x00000002
150
151#define BUTTON_LEFT 0x00000004
152#define BUTTON_RIGHT 0x00000008
153#define BUTTON_PLAY 0x00000010
154#define BUTTON_MENU 0x00000020
155
156#define BUTTON_MAIN (BUTTON_ON|BUTTON_STOP|BUTTON_LEFT|BUTTON_RIGHT\
157 |BUTTON_PLAY|BUTTON_MENU)
158
159 /* Remote control's buttons */
160#define BUTTON_RC_PLAY 0x00100000
161#define BUTTON_RC_STOP 0x00080000
162
163#define BUTTON_RC_LEFT 0x00040000
164#define BUTTON_RC_RIGHT 0x00020000
165#define BUTTON_RC_VOL_UP 0x00010000
166#define BUTTON_RC_VOL_DOWN 0x00008000
167
168#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\
169 |BUTTON_RC_LEFT|BUTTON_RC_RIGHT\
170 |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
171
140 172
141#elif CONFIG_KEYPAD == ONDIO_PAD 173#elif CONFIG_KEYPAD == ONDIO_PAD
142 174
143/* Ondio specific button codes */ 175 /* Ondio specific button codes */
144#define BUTTON_OFF 0x0002 176
145#define BUTTON_UP 0x0010 177#define BUTTON_OFF 0x00000001
146#define BUTTON_DOWN 0x0020 178#define BUTTON_MENU 0x00000002
147#define BUTTON_MENU 0x0100 179
180#define BUTTON_LEFT 0x00000004
181#define BUTTON_RIGHT 0x00000008
182#define BUTTON_UP 0x00000010
183#define BUTTON_DOWN 0x00000020
184
185#define BUTTON_MAIN (BUTTON_OFF|BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT\
186 |BUTTON_UP|BUTTON_DOWN)
187
188#define BUTTON_REMOTE 0
148 189
149#elif CONFIG_KEYPAD == GMINI100_PAD 190#elif CONFIG_KEYPAD == GMINI100_PAD
150 191
151#define BUTTON_ON 0x0001 192 /* Gmini specific button codes */
152#define BUTTON_OFF 0x0002
153#define BUTTON_PLAY 0x0004
154#define BUTTON_UP 0x0010
155#define BUTTON_DOWN 0x0020
156#define BUTTON_MENU 0x0100
157 193
158#elif (CONFIG_KEYPAD == IPOD_4G_PAD) 194#define BUTTON_ON 0x00000001
195#define BUTTON_OFF 0x00000002
159 196
160/* TODO: These codes should relate to the hardware */ 197#define BUTTON_LEFT 0x00000004
198#define BUTTON_RIGHT 0x00000008
199#define BUTTON_UP 0x00000010
200#define BUTTON_DOWN 0x00000020
161 201
162#define BUTTON_MENU 0x0002 202#define BUTTON_PLAY 0x00000040
163#define BUTTON_PLAY 0x0004 203#define BUTTON_MENU 0x00000080
164#define BUTTON_SELECT 0x0008 204
165#define BUTTON_SCROLL_FWD 0x0010 205#define BUTTON_MAIN (BUTTON_ON|BUTTON_OFF|BUTTON_LEFT|BUTTON_RIGHT\
166#define BUTTON_SCROLL_BACK 0x0020 206 |BUTTON_UP|BUTTON_DOWN|BUTTON_PLAY|BUTTON_MENU)
167/* This is for later 207
168#define BUTTON_SCROLL_TOUCH 0x0100*/ 208#define BUTTON_REMOTE 0
209
210#elif ((CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD))
211
212 /* iPod specific button codes */
169 213
170#elif CONFIG_KEYPAD == IPOD_3G_PAD 214#define BUTTON_SELECT 0x00000001
215#define BUTTON_MENU 0x00000002
171 216
172/* TODO: These codes should relate to the hardware */ 217#define BUTTON_LEFT 0x00000004
218#define BUTTON_RIGHT 0x00000008
219#define BUTTON_SCROLL_FWD 0x00000010
220#define BUTTON_SCROLL_BACK 0x00000020
173 221
174#define BUTTON_MENU 0x0002 222#define BUTTON_PLAY 0x00000040
175#define BUTTON_PLAY 0x0004 223
176#define BUTTON_SELECT 0x0008 224#if CONFIG_KEYPAD == IPOD_3G_PAD
177#define BUTTON_SCROLL_FWD 0x0010 225#define BUTTON_HOLD 0x00000100
178#define BUTTON_SCROLL_BACK 0x0020 226/* TODO Does the BUTTON_HOLD need to be here? */
179#define BUTTON_HOLD 0x0100 227#define BUTTON_MAIN (BUTTON_SELECT|BUTTON_MENU\
228 |BUTTON_LEFT|BUTTON_RIGHT\
229 |BUTTON_SCROLL_FWD|BUTTON_SCROLL_BACK\
230 |BUTTON_PLAY|BUTTON_HOLD)
231#else
232#define BUTTON_MAIN (BUTTON_SELECT|BUTTON_MENU\
233 |BUTTON_LEFT|BUTTON_RIGHT|BUTTON_SCROLL_FWD\
234 |BUTTON_SCROLL_BACK|BUTTON_PLAY)
235#endif
236
237#define BUTTON_REMOTE 0
238
239/* This is for later
240#define BUTTON_SCROLL_TOUCH 0x00000200
241*/
180 242
181#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD 243#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
182 244
183#define BUTTON_PLAY 0x0001 245/* iriver IFP7XX specific button codes */
184#define BUTTON_EQ 0x0002 246
185#define BUTTON_MODE 0x0004 247#define BUTTON_PLAY 0x00000001
186#define BUTTON_UP 0x0010 248#define BUTTON_SELECT 0x00000002
187#define BUTTON_DOWN 0x0020 249
188#define BUTTON_SELECT 0x0100 250#define BUTTON_LEFT 0x00000004
251#define BUTTON_RIGHT 0x00000008
252#define BUTTON_UP 0x00000010
253#define BUTTON_DOWN 0x00000020
254
255#define BUTTON_MODE 0x00000040
256#define BUTTON_EQ 0x00000080
257
258#define BUTTON_MAIN (BUTTON_PLAY|BUTTON_SELECT\
259 |BUTTON_LEFT|BUTTON_RIGHT|BUTTON_UP|BUTTON_DOWN\
260 |BUTTON_MODE|BUTTON_EQ)
261
262#define BUTTON_REMOTE 0
189 263
190#elif CONFIG_KEYPAD == IAUDIO_X5_PAD 264#elif CONFIG_KEYPAD == IAUDIO_X5_PAD
191 265
192/* TODO: These codes should relate to the hardware */ 266/* iaudio X5 specific button codes */
267
268 /* Main unit's buttons */
269#define BUTTON_POWER 0x00000001
270#define BUTTON_PLAY 0x00000002
271
272#define BUTTON_LEFT 0x00000004
273#define BUTTON_RIGHT 0x00000008
274#define BUTTON_UP 0x00000010
275#define BUTTON_DOWN 0x00000020
276
277#define BUTTON_REC 0x00000040
278#define BUTTON_SELECT 0x00000080
279
280#define BUTTON_MAIN (BUTTON_POWER|BUTTON_PLAY|BUTTON_LEFT|BUTTON_RIGHT\
281 |BUTTON_UP|BUTTON_DOWN|BUTTON_REC|BUTTON_SELECT)
282
283 /* Remote control's buttons */
284#define BUTTON_RC_PLAY 0x00100000
285
286#define BUTTON_RC_REW 0x00080000
287#define BUTTON_RC_FF 0x00040000
288#define BUTTON_RC_VOL_UP 0x00020000
289#define BUTTON_RC_VOL_DOWN 0x00010000
290
291#define BUTTON_RC_REC 0x00008000
292#define BUTTON_RC_MENU 0x00004000
293
294#define BUTTON_RC_MODE 0x00002000
295
296#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN\
297 |BUTTON_RC_REW|BUTTON_RC_FF\
298 |BUTTON_RC_REC|BUTTON_RC_MENU|BUTTON_RC_MODE)
193 299
194#define BUTTON_PLAY 0x0001
195#define BUTTON_REC 0x0002
196#define BUTTON_POWER 0x0004
197#define BUTTON_UP 0x0008
198#define BUTTON_DOWN 0x0010
199#define BUTTON_SELECT 0x0020
200 300
201#define BUTTON_RC_PLAY (BUTTON_REMOTE | 0x00010000)
202#define BUTTON_RC_REW (BUTTON_REMOTE | 0x00020000)
203#define BUTTON_RC_FF (BUTTON_REMOTE | 0x00040000)
204#define BUTTON_RC_MODE (BUTTON_REMOTE | 0x00080000)
205#define BUTTON_RC_REC (BUTTON_REMOTE | 0x00100000)
206#define BUTTON_RC_MENU (BUTTON_REMOTE | 0x00200000)
207 301
208#elif CONFIG_KEYPAD == GIGABEAT_PAD 302#elif CONFIG_KEYPAD == GIGABEAT_PAD
303/* Toshiba Gigabeat specific button codes */
304
305#define BUTTON_POWER 0x00000001
306#define BUTTON_MENU 0x00000002
307
308#define BUTTON_LEFT 0x00000004
309#define BUTTON_RIGHT 0x00000008
310#define BUTTON_UP 0x00000010
311#define BUTTON_DOWN 0x00000020
312
313#define BUTTON_VOL_UP 0x00000040
314#define BUTTON_VOL_DOWN 0x00000080
315
316#define BUTTON_SELECT 0x00000100
317#define BUTTON_A 0x00000200
318
319
320#define BUTTON_MAIN (BUTTON_POWER|BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT\
321 |BUTTON_UP|BUTTON_DOWN|BUTTON_VOL_UP|BUTTON_VOL_DOWN\
322 |BUTTON_SELECT|BUTTON_A)
323
324
325#define BUTTON_REMOTE 0
326
327#elif 0
209 328
210/* TODO: These codes should relate to the hardware */ 329/*
330 * Please, add the next Rockbox target's button defines here,
331 * using:
332 * - bits 0 and up: for main unit's buttons
333 * - bits 20 (0x00100000) and downwards for the remote buttons (if applicable)
334 * Don't forget to add BUTTON_MAIN and BUTTON_REMOTE masks
335 * Currently, main buttons on all targets are up to bit 9 (0x00000200),
336 * and remote buttons are down to bit 10 (0x00000400)
337 */
211 338
212#define BUTTON_POWER 0x0001
213#define BUTTON_MENU 0x0002
214#define BUTTON_VOL_UP 0x0008
215#define BUTTON_VOL_DOWN 0x0010
216#define BUTTON_A 0x0020
217#define BUTTON_UP 0x0100
218#define BUTTON_DOWN 0x0200
219#define BUTTON_SELECT 0x0400
220 339
221 340
222#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */ 341#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */