diff options
Diffstat (limited to 'firmware/target/arm/pnx0101/iriver-ifp7xx/adc-ifp7xx.c')
-rw-r--r-- | firmware/target/arm/pnx0101/iriver-ifp7xx/adc-ifp7xx.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/firmware/target/arm/pnx0101/iriver-ifp7xx/adc-ifp7xx.c b/firmware/target/arm/pnx0101/iriver-ifp7xx/adc-ifp7xx.c deleted file mode 100644 index 0f306f9986..0000000000 --- a/firmware/target/arm/pnx0101/iriver-ifp7xx/adc-ifp7xx.c +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
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 | #include "config.h" | ||
22 | #include "cpu.h" | ||
23 | #include "system.h" | ||
24 | #include "kernel.h" | ||
25 | #include "thread.h" | ||
26 | #include "adc.h" | ||
27 | |||
28 | static unsigned short adcdata[NUM_ADC_CHANNELS]; | ||
29 | |||
30 | unsigned short adc_read(int channel) | ||
31 | { | ||
32 | return adcdata[channel]; | ||
33 | } | ||
34 | |||
35 | static void adc_tick(void) | ||
36 | { | ||
37 | if (ADCST & 0x10) { | ||
38 | adcdata[0] = ADCCH0 & 0x3ff; | ||
39 | adcdata[1] = ADCCH1 & 0x3ff; | ||
40 | adcdata[2] = ADCCH2 & 0x3ff; | ||
41 | adcdata[3] = ADCCH3 & 0x3ff; | ||
42 | adcdata[4] = ADCCH4 & 0x3ff; | ||
43 | ADCST = 0xa; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | void adc_init(void) | ||
48 | { | ||
49 | ADCR24 = 0xaaaaa; | ||
50 | ADCR28 = 0; | ||
51 | ADCST = 2; | ||
52 | ADCST = 0xa; | ||
53 | |||
54 | while (!(ADCST & 0x10)); | ||
55 | adc_tick(); | ||
56 | |||
57 | tick_add_task(adc_tick); | ||
58 | } | ||
59 | |||