Amaury Pouly | 08fb3f6 | 2011-05-01 13:02:46 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 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 | |
| 27 | void button_init_device(void); |
| 28 | int button_read_device(void); |
Amaury Pouly | 7e211ff | 2011-11-17 19:13:09 +0000 | [diff] [blame] | 29 | bool button_debug_screen(void); |
Amaury Pouly | 08fb3f6 | 2011-05-01 13:02:46 +0000 | [diff] [blame] | 30 | |
| 31 | /* Main unit's buttons */ |
Amaury Pouly | 374a08a | 2011-11-30 18:39:22 +0000 | [diff] [blame] | 32 | #define BUTTON_POWER 0x00000001 |
| 33 | #define BUTTON_VOL_UP 0x00000002 |
| 34 | #define BUTTON_VOL_DOWN 0x00000004 |
Amaury Pouly | eb90d95 | 2011-07-23 11:45:22 +0000 | [diff] [blame] | 35 | /* Virtual buttons */ |
Amaury Pouly | 374a08a | 2011-11-30 18:39:22 +0000 | [diff] [blame] | 36 | #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 Pouly | 84b97dd | 2011-12-26 17:45:54 +0000 | [diff] [blame^] | 45 | |
Amaury Pouly | 08fb3f6 | 2011-05-01 13:02:46 +0000 | [diff] [blame] | 46 | |
Amaury Pouly | eb90d95 | 2011-07-23 11:45:22 +0000 | [diff] [blame] | 47 | #define BUTTON_MAIN (BUTTON_VOL_UP|BUTTON_VOL_DOWN|BUTTON_POWER|BUTTON_LEFT| \ |
| 48 | BUTTON_UP|BUTTON_RIGHT|BUTTON_DOWN|BUTTON_SELECT| \ |
Amaury Pouly | 374a08a | 2011-11-30 18:39:22 +0000 | [diff] [blame] | 49 | BUTTON_PLAYPAUSE|BUTTON_BACK| \ |
Amaury Pouly | 84b97dd | 2011-12-26 17:45:54 +0000 | [diff] [blame^] | 50 | BUTTON_BOTTOMRIGHT|BUTTON_BOTTOMLEFT) |
Amaury Pouly | 08fb3f6 | 2011-05-01 13:02:46 +0000 | [diff] [blame] | 51 | |
| 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_ */ |