Remove inner loop from button scanning on Gigabeat S. Requires changing the button...
[kugel-rb.git] / firmware / target / arm / imx31 / gigabeat-s / button-target.h
blobe2f68162f729f73e194ccc0f253cbe8378533004
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 by Linus Nielsen Feltzing
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 ****************************************************************************/
19 #ifndef _BUTTON_TARGET_H_
20 #define _BUTTON_TARGET_H_
22 #include <stdbool.h>
23 #include "config.h"
25 #define HAS_BUTTON_HOLD
27 bool button_hold(void);
28 void button_init_device(void);
29 int button_read_device(void);
30 void button_power_set_state(bool pressed);
31 void set_headphones_inserted(bool inserted);
32 bool headphones_inserted(void);
34 /* Toshiba Gigabeat S-specific button codes */
36 /* These shifts are selected to optimize scanning of the keypad port */
37 #define BUTTON_LEFT (1 << 0)
38 #define BUTTON_UP (1 << 1)
39 #define BUTTON_DOWN (1 << 2)
40 #define BUTTON_RIGHT (1 << 3)
41 #define BUTTON_SELECT (1 << 4)
42 #define BUTTON_BACK (1 << 5)
43 #define BUTTON_MENU (1 << 6)
44 #define BUTTON_VOL_UP (1 << 7)
45 #define BUTTON_VOL_DOWN (1 << 8)
46 #define BUTTON_PREV (1 << 9)
47 #define BUTTON_PLAY (1 << 10)
48 #define BUTTON_NEXT (1 << 11)
49 #define BUTTON_POWER (1 << 12) /* Read from PMIC */
51 #define BUTTON_REMOTE 0
53 #define POWEROFF_BUTTON BUTTON_POWER
54 #define POWEROFF_COUNT 10
56 #endif /* _BUTTON_TARGET_H_ */