blob: 897fa9529c67a730eb0df3f0a4f437d66253d5c6 [file] [log] [blame]
Maurus Cuelenaere95167e02008-04-24 20:08:28 +00001/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2008 by Maurus Cuelenaere
11*
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000016*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21
22#ifndef _BUTTON_TARGET_H_
23#define _BUTTON_TARGET_H_
24
25#include "config.h"
26
27#define BUTTON_BACK (1 << 0)
28#define BUTTON_CUSTOM (1 << 1)
29#define BUTTON_MENU (1 << 2)
30
31#define BUTTON_LEFT (1 << 3)
32#define BUTTON_RIGHT (1 << 4)
33#define BUTTON_UP (1 << 5)
34#define BUTTON_DOWN (1 << 6)
35#define BUTTON_SELECT (1 << 7)
36
37#define BUTTON_POWER (1 << 8)
38#define BUTTON_PLAY (1 << 9)
39
40#define BUTTON_HOLD (1 << 10)
41
Maurus Cuelenaere1ea884b2008-05-15 18:01:14 +000042#ifdef CREATIVE_ZV
43#define BUTTON_PREV (1 << 11)
44#define BUTTON_NEXT (1 << 12)
45
46#define BUTTON_VOL_UP (1 << 13)
47#define BUTTON_VOL_DOWN (1 << 14)
48#endif
49
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000050#define BUTTON_REMOTE 0
51
Maurus Cuelenaere1ea884b2008-05-15 18:01:14 +000052#ifndef CREATIVE_ZV
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000053#define BUTTON_MAIN ( BUTTON_BACK | BUTTON_MENU | BUTTON_LEFT | BUTTON_RIGHT \
54 | BUTTON_UP | BUTTON_DOWN | BUTTON_SELECT | BUTTON_POWER \
55 | BUTTON_PLAY | BUTTON_HOLD | BUTTON_CUSTOM )
Maurus Cuelenaere1ea884b2008-05-15 18:01:14 +000056#else
57#define BUTTON_MAIN ( BUTTON_BACK | BUTTON_MENU | BUTTON_LEFT | BUTTON_RIGHT \
58 | BUTTON_UP | BUTTON_DOWN | BUTTON_SELECT | BUTTON_POWER \
59 | BUTTON_PLAY | BUTTON_HOLD | BUTTON_NEXT | BUTTON_PREV \
60 | BUTTON_VOL_UP | BUTTON_VOL_DOWN )
61#endif
Maurus Cuelenaere95167e02008-04-24 20:08:28 +000062
63#define POWEROFF_BUTTON BUTTON_POWER
64#define POWEROFF_COUNT 10
65
66void button_init_device(void);
67int button_read_device(void);
68bool headphones_inserted(void);
69bool button_hold(void);
70bool button_usb_connected(void);
71
72int get_debug_info(int choice);
73
74#endif /* _BUTTON_TARGET_H_ */