summaryrefslogtreecommitdiff
path: root/firmware/target/sh/archos/player/button-player.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/sh/archos/player/button-player.c')
-rw-r--r--firmware/target/sh/archos/player/button-player.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/firmware/target/sh/archos/player/button-player.c b/firmware/target/sh/archos/player/button-player.c
deleted file mode 100644
index 3cf634853e..0000000000
--- a/firmware/target/sh/archos/player/button-player.c
+++ /dev/null
@@ -1,76 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
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
22#include "config.h"
23#include "system.h"
24#include "button.h"
25#include "backlight.h"
26#include "adc.h"
27
28/*
29 Player hardware button hookup
30 =============================
31
32 Player
33 ------
34 LEFT: AN0
35 MENU: AN1
36 RIGHT: AN2
37 PLAY: AN3
38
39 STOP: PA11
40 ON: PA5
41
42 All buttons are low active
43*/
44
45void button_init_device(void)
46{
47 /* set PA5 and PA11 as input pins */
48 PACR1 &= 0xff3f; /* PA11MD = 00 */
49 PACR2 &= 0xfbff; /* PA5MD = 0 */
50 PAIOR &= ~0x0820; /* Inputs */
51}
52
53int button_read_device(void)
54{
55 int btn = BUTTON_NONE;
56 int data;
57
58 /* buttons are active low */
59 if (adc_read(ADC_BUTTON_LEFT) < 0x180)
60 btn = BUTTON_LEFT;
61 if (adc_read(ADC_BUTTON_MENU) < 0x180)
62 btn |= BUTTON_MENU;
63 if (adc_read(ADC_BUTTON_RIGHT) < 0x180)
64 btn |= BUTTON_RIGHT;
65 if (adc_read(ADC_BUTTON_PLAY) < 0x180)
66 btn |= BUTTON_PLAY;
67
68 /* check port A pins for ON and STOP */
69 data = PADR;
70 if ( !(data & 0x0020) )
71 btn |= BUTTON_ON;
72 if ( !(data & 0x0800) )
73 btn |= BUTTON_STOP;
74
75 return btn;
76}