blob: 1536dbe1ab1bd7393a7101223f42c18cccf1d3c3 [file] [log] [blame]
Amaury Pouly08fb3f62011-05-01 13:02:46 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2011 by Amaury Pouly
11 *
12 * 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.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _BUTTON_TARGET_H_
22#define _BUTTON_TARGET_H_
23
24#include <stdbool.h>
25#include "config.h"
26
27void button_init_device(void);
28int button_read_device(void);
Amaury Pouly7e211ff2011-11-17 19:13:09 +000029bool button_debug_screen(void);
Amaury Pouly08fb3f62011-05-01 13:02:46 +000030
31/* Main unit's buttons */
Amaury Pouly374a08a2011-11-30 18:39:22 +000032#define BUTTON_POWER 0x00000001
33#define BUTTON_VOL_UP 0x00000002
34#define BUTTON_VOL_DOWN 0x00000004
Amaury Poulyeb90d952011-07-23 11:45:22 +000035/* Virtual buttons */
Amaury Pouly374a08a2011-11-30 18:39:22 +000036#define BUTTON_LEFT 0x00000008
37#define BUTTON_UP 0x00000010
38#define BUTTON_RIGHT 0x00000020
39#define BUTTON_DOWN 0x00000040
40#define BUTTON_SELECT 0x00000080
41#define BUTTON_PLAYPAUSE 0x00000100
42#define BUTTON_BACK 0x00000200
43#define BUTTON_BOTTOMLEFT 0x00000400
44#define BUTTON_BOTTOMRIGHT 0x00000800
Amaury Pouly84b97dd2011-12-26 17:45:54 +000045
Amaury Pouly08fb3f62011-05-01 13:02:46 +000046
Amaury Poulyeb90d952011-07-23 11:45:22 +000047#define BUTTON_MAIN (BUTTON_VOL_UP|BUTTON_VOL_DOWN|BUTTON_POWER|BUTTON_LEFT| \
48 BUTTON_UP|BUTTON_RIGHT|BUTTON_DOWN|BUTTON_SELECT| \
Amaury Pouly374a08a2011-11-30 18:39:22 +000049 BUTTON_PLAYPAUSE|BUTTON_BACK| \
Amaury Pouly84b97dd2011-12-26 17:45:54 +000050 BUTTON_BOTTOMRIGHT|BUTTON_BOTTOMLEFT)
Amaury Pouly08fb3f62011-05-01 13:02:46 +000051
52#define BUTTON_REMOTE 0
53
54/* Software power-off */
55#define POWEROFF_BUTTON BUTTON_POWER
56#define POWEROFF_COUNT 10
57
58#endif /* _BUTTON_TARGET_H_ */