Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2008 by Maurus Cuelenaere |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 16 | * |
| 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 Cuelenaere | 1ea884b | 2008-05-15 18:01:14 +0000 | [diff] [blame] | 42 | #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 Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 50 | #define BUTTON_REMOTE 0 |
| 51 | |
Maurus Cuelenaere | 1ea884b | 2008-05-15 18:01:14 +0000 | [diff] [blame] | 52 | #ifndef CREATIVE_ZV |
Maurus Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 53 | #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 Cuelenaere | 1ea884b | 2008-05-15 18:01:14 +0000 | [diff] [blame] | 56 | #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 Cuelenaere | 95167e0 | 2008-04-24 20:08:28 +0000 | [diff] [blame] | 62 | |
| 63 | #define POWEROFF_BUTTON BUTTON_POWER |
| 64 | #define POWEROFF_COUNT 10 |
| 65 | |
| 66 | void button_init_device(void); |
| 67 | int button_read_device(void); |
| 68 | bool headphones_inserted(void); |
| 69 | bool button_hold(void); |
| 70 | bool button_usb_connected(void); |
| 71 | |
| 72 | int get_debug_info(int choice); |
| 73 | |
| 74 | #endif /* _BUTTON_TARGET_H_ */ |