1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2009 Bertrik Sikken
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
27 #include "button-target.h"
29 /* Button driver for the meizu M6SP
33 * left/right buttons (probably read out with ADC0)
34 * unify with m3/m6sl button driver if possible
39 void button_init_device(void)
41 PCON0
&= ~(0x3 << 10); /* P0.5 hold switch */
42 PCON0
&= ~(0x3 << 14); /* P0.7 enter button */
43 PCON1
&= ~(0xF << 16); /* P1.4 play/power button */
46 int button_read_device(void)
54 if ((PDAT1
& (1 << 4)) == 0) {
55 buttons
|= BUTTON_PLAY
;
57 if ((PDAT0
& (1 << 7)) == 0) {
58 buttons
|= BUTTON_ENTER
;
64 bool button_hold(void)
66 return ((PDAT0
& (1 << 5)) != 0);