summaryrefslogtreecommitdiff
path: root/firmware/target/arm/philips/hdd1630/button-hdd1630.c
diff options
context:
space:
mode:
authorMark Arigo <markarigo@gmail.com>2008-06-27 18:40:25 +0000
committerMark Arigo <markarigo@gmail.com>2008-06-27 18:40:25 +0000
commit22e7bf32b894acc1f9e2820e213f05a57bd4148c (patch)
treecdecc7a9f0db0b41d7ac55680c2b3b2212ab4dda /firmware/target/arm/philips/hdd1630/button-hdd1630.c
parent78337961b72b76c410075a0d5fe6c3cf1269b5e8 (diff)
downloadrockbox-22e7bf32b894acc1f9e2820e213f05a57bd4148c.tar.gz
rockbox-22e7bf32b894acc1f9e2820e213f05a57bd4148c.zip
My Devcon 2008 contribution: port for Philips GoGear HDD1630 (PP5022-based). Current status is that the bootloader works to load Rockbox, but dual boot does not work: it freezes after decrypting the OF. When Rockbox boots, it freezes somewhere between showing the logo and the main menu. And there's no driver for the touchpad. So lots of work left.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17809 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/philips/hdd1630/button-hdd1630.c')
-rwxr-xr-xfirmware/target/arm/philips/hdd1630/button-hdd1630.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/firmware/target/arm/philips/hdd1630/button-hdd1630.c b/firmware/target/arm/philips/hdd1630/button-hdd1630.c
new file mode 100755
index 0000000000..ac478065bc
--- /dev/null
+++ b/firmware/target/arm/philips/hdd1630/button-hdd1630.c
@@ -0,0 +1,65 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Mark Arigo
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "system.h"
21#include "button.h"
22#include "backlight.h"
23
24void button_init_device(void)
25{
26 /* TODO...for now, hardware initialisation is done by the bootloader */
27}
28
29bool button_hold(void)
30{
31 return !(GPIOJ_INPUT_VAL & 0x8);
32}
33
34/*
35 * Get button pressed from hardware
36 */
37int button_read_device(void)
38{
39 int btn = BUTTON_NONE;
40 static bool hold_button = false;
41 bool hold_button_old;
42
43 /* Hold */
44 hold_button_old = hold_button;
45 hold_button = button_hold();
46
47 /* device buttons */
48 if (!hold_button)
49 {
50 if (!(GPIOA_INPUT_VAL & 0x01)) btn |= BUTTON_MENU;
51 if (!(GPIOA_INPUT_VAL & 0x02)) btn |= BUTTON_VOL_UP;
52 if (!(GPIOA_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN;
53 if (!(GPIOA_INPUT_VAL & 0x08)) btn |= BUTTON_VIEW;
54
55 if (!(GPIOD_INPUT_VAL & 0x20)) btn |= BUTTON_PLAYLIST;
56 if (!(GPIOD_INPUT_VAL & 0x40)) btn |= BUTTON_POWER;
57 }
58
59 return btn;
60}
61
62bool headphones_inserted(void)
63{
64 return true;
65}