slightly better touchpad driver. Still not brilliant, but the bootloader/debugger...
[Rockbox.git] / firmware / target / arm / tms320dm320 / mrobe-500 / button-target.h
blob238a3f6143b3b2fe4f7a7a537f3dd29202c0d6a0
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 by Jonathan Gordon
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef _BUTTON_TARGET_H_
21 #define _BUTTON_TARGET_H_
23 #include <stdbool.h>
24 #include "config.h"
26 #define HAS_BUTTON_HOLD
28 bool button_hold(void);
29 void button_init_device(void);
30 int button_read_device(void);
31 int button_get_last_touch(void);
33 struct touch_calibration_point {
34 short px_x; /* known pixel value */
35 short px_y;
36 short val_x; /* touchpad value at the known pixel */
37 short val_y;
39 void use_calibration(bool enable);
41 /* m:robe 500 specific button codes */
43 #define BUTTON_POWER 0x00000001
45 /* Remote control buttons */
47 #define BUTTON_RC_HEART 0x00000002
48 #define BUTTON_RC_MODE 0x00000004
49 #define BUTTON_RC_VOL_DOWN 0x00000008
50 #define BUTTON_RC_VOL_UP 0x00000010
53 #define BUTTON_RC_PLAY 0x00000020
54 #define BUTTON_RC_REW 0x00000040
55 #define BUTTON_RC_FF 0x00000080
56 #define BUTTON_RC_DOWN 0x00000100
57 #define BUTTON_TOUCH 0x00000200
59 /* compatibility hacks */
60 #define BUTTON_LEFT BUTTON_RC_REW
61 #define BUTTON_RIGHT BUTTON_RC_FF
63 #define POWEROFF_BUTTON BUTTON_POWER
64 #define POWEROFF_COUNT 10
66 #define BUTTON_MAIN BUTTON_POWER
68 #define BUTTON_REMOTE (BUTTON_RC_HEART|BUTTON_RC_MODE| \
69 BUTTON_RC_VOL_DOWN|BUTTON_RC_VOL_UP| \
70 BUTTON_RC_PLAY|BUTTON_RC_DOWN| \
71 BUTTON_RC_REW|BUTTON_RC_FF)
73 #endif /* _BUTTON_TARGET_H_ */