1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Dave Chapman
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
25 void button_init_device(void)
30 int button_read_device(void)
32 int btn
= BUTTON_NONE
;
38 int i
=20; while (i
--);
40 if (GPIOA
& 0x10) btn
|= BUTTON_PLAYPAUSE
; /* up */
41 if (GPIOA
& 0x20) btn
|= BUTTON_RIGHT
;
42 if (GPIOA
& 0x40) btn
|= BUTTON_LEFT
;
49 if (GPIOA
& 0x10) btn
|= BUTTON_VOLUP
;
50 if (GPIOA
& 0x20) btn
|= BUTTON_VOLDOWN
;
51 if (GPIOA
& 0x40) btn
|= BUTTON_REPEATAB
; /* down */
53 if (GPIOA
& 0x80) btn
|= BUTTON_SELECT
;
54 if (GPIOA
& 0x100) btn
|= BUTTON_MENU
;
59 bool button_hold(void)