summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-09-13 23:40:09 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-09-13 23:40:09 +0000
commit696b9d146b69b36fc309233f62d43f4f57f26823 (patch)
tree1bd143562b773bedd4ce29314b066f746e0527fb /firmware/target
parent45537a4e87c8696629cbda8efcd721b74f084ff1 (diff)
downloadrockbox-696b9d146b69b36fc309233f62d43f4f57f26823.tar.gz
rockbox-696b9d146b69b36fc309233f62d43f4f57f26823.zip
imx233/fuze+: implement lradc function and adc on top of it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30534 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/imx233/adc-imx233.c64
-rw-r--r--firmware/target/arm/imx233/adc-imx233.h38
-rw-r--r--firmware/target/arm/imx233/lradc-imx233.c146
-rw-r--r--firmware/target/arm/imx233/lradc-imx233.h128
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c37
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h35
6 files changed, 446 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/adc-imx233.c b/firmware/target/arm/imx233/adc-imx233.c
index 8236f58767..4f183ac531 100644
--- a/firmware/target/arm/imx233/adc-imx233.c
+++ b/firmware/target/arm/imx233/adc-imx233.c
@@ -23,12 +23,72 @@
23#include "adc.h" 23#include "adc.h"
24#include "adc-target.h" 24#include "adc-target.h"
25 25
26/* dedicate two channels to temperature sensing
27 * dedicate channel 7 to battery
28 * and channel 6 to vddio */
29static int pmos_chan, nmos_chan;
30static int battery_chan, vddio_chan;
31
26void adc_init(void) 32void adc_init(void)
27{ 33{
34 imx233_lradc_init();
35 battery_chan = 7;
36 imx233_lradc_reserve_channel(7);
37 vddio_chan = 6;
38 imx233_lradc_reserve_channel(6);
39
40 pmos_chan = imx233_lradc_acquire_channel(0);
41 if(pmos_chan < 0) panicf("No LRADC channel for PMOS !");
42 nmos_chan = imx233_lradc_acquire_channel(0);
43 if(nmos_chan < 0) panicf("No LRADC channel for NMOS !");
44
45 // setup them
46 imx233_lradc_setup_channel(battery_chan, false, false, 0, HW_LRADC_CHANNEL_BATTERY);
47 imx233_lradc_setup_channel(vddio_chan, false, false, 0, HW_LRADC_CHANNEL_VDDIO);
48 imx233_lradc_setup_channel(nmos_chan, false, false, 0, HW_LRADC_CHANNEL_NMOS_THIN);
49 imx233_lradc_setup_channel(pmos_chan, false, false, 0, HW_LRADC_CHANNEL_PMOS_THIN);
50}
51
52int adc_read_physical_ex(int virt)
53{
54 imx233_lradc_clear_channel(virt);
55 imx233_lradc_kick_channel(virt);
56 imx233_lradc_wait_channel(virt);
57 int v = imx233_lradc_read_channel(virt);
58 return v;
59}
60
61int adc_read_physical(int src)
62{
63 int virt = imx233_lradc_acquire_channel(TIMEOUT_BLOCK);
64 // divide by two for wider ranger
65 imx233_lradc_setup_channel(virt, false, false, 0, src);
66 int val = adc_read_physical_ex(virt);
67 imx233_lradc_release_channel(virt);
68 return val;
69}
70
71unsigned short adc_read_virtual(int c)
72{
73 switch(c)
74 {
75 case IMX233_ADC_BATTERY:
76 return adc_read_physical_ex(battery_chan);
77 case IMX233_ADC_VDDIO:
78 return adc_read_physical_ex(vddio_chan);
79 case IMX233_ADC_DIE_TEMP:
80 // do kelvin to celsius conversion
81 return imx233_lradc_sense_die_temperature(nmos_chan, pmos_chan) - 273;
82 default:
83 return 0;
84 }
28} 85}
29 86
30unsigned short adc_read(int channel) 87unsigned short adc_read(int channel)
31{ 88{
32 (void) channel; 89 int c = imx233_adc_mapping[channel];
33 return 0; 90 if(c < 0)
91 return adc_read_virtual(c);
92 else
93 return adc_read_physical(c);
34} 94}
diff --git a/firmware/target/arm/imx233/adc-imx233.h b/firmware/target/arm/imx233/adc-imx233.h
new file mode 100644
index 0000000000..6025fdcdf8
--- /dev/null
+++ b/firmware/target/arm/imx233/adc-imx233.h
@@ -0,0 +1,38 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2011 by Amaury Pouly
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#ifndef _ADC_IMX233_H_
22#define _ADC_IMX233_H_
23
24#include "system.h"
25#include "lradc-imx233.h"
26#include "adc-imx233.h"
27
28/* Virtual channels */
29#define IMX233_ADC_BATTERY -1 /* Battery voltage (mV) */
30#define IMX233_ADC_DIE_TEMP -2 /* Die temperature (°C) */
31#define IMX233_ADC_VDDIO -3 /* VddIO voltage (mV) */
32
33/* Channel mapping */
34extern int imx233_adc_mapping[];
35/* Channel names */
36extern const char *imx233_adc_channel_name[];
37
38#endif
diff --git a/firmware/target/arm/imx233/lradc-imx233.c b/firmware/target/arm/imx233/lradc-imx233.c
new file mode 100644
index 0000000000..7da58c64b3
--- /dev/null
+++ b/firmware/target/arm/imx233/lradc-imx233.c
@@ -0,0 +1,146 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2011 by Amaury Pouly
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 "system.h"
22#include "system-target.h"
23#include "lradc-imx233.h"
24
25static struct semaphore free_bm_sema;
26static struct mutex free_bm_mutex;
27static unsigned free_bm;
28
29void imx233_lradc_setup_channel(int channel, bool div2, bool acc, int nr_samples, int src)
30{
31 __REG_CLR(HW_LRADC_CHx(channel)) =HW_LRADC_CHx__NUM_SAMPLES_BM | HW_LRADC_CHx__ACCUMULATE;
32 __REG_SET(HW_LRADC_CHx(channel)) = nr_samples << HW_LRADC_CHx__NUM_SAMPLES_BP |
33 acc << HW_LRADC_CHx__ACCUMULATE;
34 if(div2)
35 __REG_SET(HW_LRADC_CTRL2) = HW_LRADC_CTRL2__DIVIDE_BY_TWO(channel);
36 else
37 __REG_CLR(HW_LRADC_CTRL2) = HW_LRADC_CTRL2__DIVIDE_BY_TWO(channel);
38 __REG_CLR(HW_LRADC_CTRL4) = HW_LRADC_CTRL4__LRADCxSELECT_BM(channel);
39 __REG_SET(HW_LRADC_CTRL4) = src << HW_LRADC_CTRL4__LRADCxSELECT_BP(channel);
40}
41
42void imx233_lradc_setup_delay(int dchan, int trigger_lradc, int trigger_delays,
43 int loop_count, int delay)
44{
45 HW_LRADC_DELAYx(dchan) =
46 trigger_lradc << HW_LRADC_DELAYx__TRIGGER_LRADCS_BP |
47 trigger_delays << HW_LRADC_DELAYx__TRIGGER_DELAYS_BP |
48 loop_count << HW_LRADC_DELAYx__LOOP_COUNT_BP |
49 delay << HW_LRADC_DELAYx__DELAY_BP;
50}
51
52void imx233_lradc_kick_channel(int channel)
53{
54 __REG_CLR(HW_LRADC_CTRL1) = HW_LRADC_CTRL1__LRADCx_IRQ(channel);
55 __REG_SET(HW_LRADC_CTRL0) = HW_LRADC_CTRL0__SCHEDULE(channel);
56}
57
58void imx233_lradc_kick_delay(int dchan)
59{
60 __REG_SET(HW_LRADC_DELAYx(dchan)) = HW_LRADC_DELAYx__KICK;
61}
62
63void imx233_lradc_wait_channel(int channel)
64{
65 /* wait for completion */
66 while(!(HW_LRADC_CTRL1 & HW_LRADC_CTRL1__LRADCx_IRQ(channel)))
67 yield();
68}
69
70int imx233_lradc_read_channel(int channel)
71{
72 return __XTRACT_EX(HW_LRADC_CHx(channel), HW_LRADC_CHx__VALUE);
73}
74
75void imx233_lradc_clear_channel(int channel)
76{
77 __REG_CLR(HW_LRADC_CHx(channel)) = HW_LRADC_CHx__VALUE_BM;
78}
79
80int imx233_lradc_acquire_channel(int timeout)
81{
82 int w = semaphore_wait(&free_bm_sema, timeout);
83 if(w == OBJ_WAIT_TIMEDOUT)
84 return w;
85 mutex_lock(&free_bm_mutex);
86 int chan = find_first_set_bit(free_bm);
87 if(chan >= HW_LRADC_NUM_CHANNELS)
88 panicf("imx233_lradc_acquire_channel cannot find a free channel !");
89 free_bm &= ~(1 << chan);
90 mutex_unlock(&free_bm_mutex);
91 return chan;
92}
93
94void imx233_lradc_release_channel(int chan)
95{
96 mutex_lock(&free_bm_mutex);
97 free_bm |= 1 << chan;
98 mutex_unlock(&free_bm_mutex);
99 semaphore_release(&free_bm_sema);
100}
101
102void imx233_lradc_reserve_channel(int channel)
103{
104 semaphore_wait(&free_bm_sema, TIMEOUT_NOBLOCK);
105 mutex_lock(&free_bm_mutex);
106 free_bm &= ~(1 << channel);
107 mutex_unlock(&free_bm_mutex);
108}
109
110int imx233_lradc_sense_die_temperature(int nmos_chan, int pmos_chan)
111{
112 // mux sensors
113 __REG_CLR(HW_LRADC_CTRL2) = HW_LRADC_CTRL2__TEMPSENSE_PWD;
114 imx233_lradc_clear_channel(nmos_chan);
115 imx233_lradc_clear_channel(pmos_chan);
116 // schedule both channels
117 imx233_lradc_kick_channel(nmos_chan);
118 imx233_lradc_kick_channel(pmos_chan);
119 // wait completion
120 imx233_lradc_wait_channel(nmos_chan);
121 imx233_lradc_wait_channel(pmos_chan);
122 // mux sensors
123 __REG_SET(HW_LRADC_CTRL2) = HW_LRADC_CTRL2__TEMPSENSE_PWD;
124 // do the computation
125 int diff = imx233_lradc_read_channel(nmos_chan) - imx233_lradc_read_channel(pmos_chan);
126 // return diff * 1.012 / 4
127 return (diff * 1012) / 4000;
128}
129
130void imx233_lradc_init(void)
131{
132 mutex_init(&free_bm_mutex);
133 semaphore_init(&free_bm_sema, HW_LRADC_NUM_CHANNELS, HW_LRADC_NUM_CHANNELS);
134 free_bm = (1 << HW_LRADC_NUM_CHANNELS) - 1;
135 // enable block
136 imx233_reset_block(&HW_LRADC_CTRL0);
137 // disable ground ref
138 __REG_CLR(HW_LRADC_CTRL0) = HW_LRADC_CTRL0__ONCHIP_GROUNDREF;
139 // disable temperature sensors
140 __REG_CLR(HW_LRADC_CTRL2) = HW_LRADC_CTRL2__TEMP_SENSOR_IENABLE0 |
141 HW_LRADC_CTRL2__TEMP_SENSOR_IENABLE1;
142 __REG_SET(HW_LRADC_CTRL2) = HW_LRADC_CTRL2__TEMPSENSE_PWD;
143 // set frequency
144 __REG_CLR(HW_LRADC_CTRL3) = HW_LRADC_CTRL3__CYCLE_TIME_BM;
145 __REG_SET(HW_LRADC_CTRL3) = HW_LRADC_CTRL3__CYCLE_TIME__6MHz;
146}
diff --git a/firmware/target/arm/imx233/lradc-imx233.h b/firmware/target/arm/imx233/lradc-imx233.h
new file mode 100644
index 0000000000..a72916054a
--- /dev/null
+++ b/firmware/target/arm/imx233/lradc-imx233.h
@@ -0,0 +1,128 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2011 by Amaury Pouly
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#ifndef __lradc_imx233__
22#define __lradc_imx233__
23
24#include "config.h"
25#include "cpu.h"
26
27#include "cpu.h"
28#include "system.h"
29#include "system-target.h"
30
31#define HW_LRADC_BASE 0x80050000
32
33#define HW_LRADC_CTRL0 (*(volatile uint32_t *)(HW_LRADC_BASE + 0x0))
34#define HW_LRADC_CTRL0__ONCHIP_GROUNDREF (1 << 21)
35#define HW_LRADC_CTRL0__SCHEDULE(x) (1 << (x))
36
37#define HW_LRADC_CTRL1 (*(volatile uint32_t *)(HW_LRADC_BASE + 0x10))
38#define HW_LRADC_CTRL1__LRADCx_IRQ(x) (1 << (x))
39#define HW_LRADC_CTRL1__LRADCx_IRQ_EN(x) (1 << ((x) + 16))
40
41#define HW_LRADC_CTRL2 (*(volatile uint32_t *)(HW_LRADC_BASE + 0x20))
42#define HW_LRADC_CTRL2__TEMP_ISRC1_BP 4
43#define HW_LRADC_CTRL2__TEMP_ISRC1_BM 0xf0
44#define HW_LRADC_CTRL2__TEMP_ISRC0_BP 0
45#define HW_LRADC_CTRL2__TEMP_ISRC0_BM 0xf
46#define HW_LRADC_CTRL2__TEMP_SENSOR_IENABLE0 (1 << 8)
47#define HW_LRADC_CTRL2__TEMP_SENSOR_IENABLE1 (1 << 9)
48#define HW_LRADC_CTRL2__TEMPSENSE_PWD (1 << 15)
49#define HW_LRADC_CTRL2__DIVIDE_BY_TWO(x) (1 << ((x) + 24))
50
51#define HW_LRADC_CTRL3 (*(volatile uint32_t *)(HW_LRADC_BASE + 0x30))
52#define HW_LRADC_CTRL3__CYCLE_TIME_BM 0x300
53#define HW_LRADC_CTRL3__CYCLE_TIME_BP 8
54#define HW_LRADC_CTRL3__CYCLE_TIME__6MHz (0 << 8)
55#define HW_LRADC_CTRL3__CYCLE_TIME__4MHz (1 << 8)
56#define HW_LRADC_CTRL3__CYCLE_TIME__3MHz (2 << 8)
57#define HW_LRADC_CTRL3__CYCLE_TIME__2MHz (3 << 8)
58
59#define HW_LRADC_STATUS (*(volatile uint32_t *)(HW_LRADC_BASE + 0x40))
60
61#define HW_LRADC_CHx(x) (*(volatile uint32_t *)(HW_LRADC_BASE + 0x50 + (x) * 0x10))
62#define HW_LRADC_CHx__NUM_SAMPLES_BM (0xf << 24)
63#define HW_LRADC_CHx__NUM_SAMPLES_BP 24
64#define HW_LRADC_CHx__ACCUMULATE 29
65#define HW_LRADC_CHx__VALUE_BM 0x3ffff
66#define HW_LRADC_CHx__VALUE_BP 0
67
68#define HW_LRADC_DELAYx(x) (*(volatile uint32_t *)(HW_LRADC_BASE + 0xD0 + (x) * 0x10))
69#define HW_LRADC_DELAYx__DELAY_BP 0
70#define HW_LRADC_DELAYx__DELAY_BM 0x7ff
71#define HW_LRADC_DELAYx__LOOP_COUNT_BP 11
72#define HW_LRADC_DELAYx__LOOP_COUNT_BM (0x1f << 11)
73#define HW_LRADC_DELAYx__TRIGGER_DELAYS_BP 16
74#define HW_LRADC_DELAYx__TRIGGER_DELAYS_BM (0xf << 16)
75#define HW_LRADC_DELAYx__KICK (1 << 20)
76#define HW_LRADC_DELAYx__TRIGGER_LRADCS_BP 24
77#define HW_LRADC_DELAYx__TRIGGER_LRADCS_BM (0xff << 24)
78
79#define HW_LRADC_CONVERSION (*(volatile uint32_t *)(HW_LRADC_BASE + 0x130))
80#define HW_LRADC_CONVERSION__SCALED_BATT_VOLTAGE_BP 0
81#define HW_LRADC_CONVERSION__SCALED_BATT_VOLTAGE_BM 0x3ff
82#define HW_LRADC_CONVERSION__SCALE_FACTOR_BM (3 << 16)
83#define HW_LRADC_CONVERSION__SCALE_FACTOR_BP 16
84#define HW_LRADC_CONVERSION__SCALE_FACTOR__LI_ION (2 << 16)
85#define HW_LRADC_CONVERSION__AUTOMATIC (1 << 20)
86
87#define HW_LRADC_CTRL4 (*(volatile uint32_t *)(HW_LRADC_BASE + 0x140))
88#define HW_LRADC_CTRL4__LRADCxSELECT_BM(x) (0xf << ((x) * 4))
89#define HW_LRADC_CTRL4__LRADCxSELECT_BP(x) ((x) * 4)
90
91#define HW_LRADC_VERSION (*(volatile uint32_t *)(HW_LRADC_BASE + 0x150))
92
93#define HW_LRADC_NUM_CHANNELS 8
94#define HW_LRADC_NUM_DELAYS 4
95
96#define HW_LRADC_CHANNEL(x) (x)
97#define HW_LRADC_CHANNEL_VDDIO HW_LRADC_CHANNEL(6)
98#define HW_LRADC_CHANNEL_BATTERY HW_LRADC_CHANNEL(7)
99#define HW_LRADC_CHANNEL_PMOS_THIN HW_LRADC_CHANNEL(8)
100#define HW_LRADC_CHANNEL_NMOS_THIN HW_LRADC_CHANNEL(9)
101#define HW_LRADC_CHANNEL_NMOS_THICK HW_LRADC_CHANNEL(10)
102#define HW_LRADC_CHANNEL_PMOS_THICK HW_LRADC_CHANNEL(11)
103#define HW_LRADC_CHANNEL_PMOS_THICK HW_LRADC_CHANNEL(11)
104#define HW_LRADC_CHANNEL_USB_DP HW_LRADC_CHANNEL(12)
105#define HW_LRADC_CHANNEL_USB_DN HW_LRADC_CHANNEL(13)
106#define HW_LRADC_CHANNEL_VBG HW_LRADC_CHANNEL(14)
107#define HW_LRADC_CHANNEL_5V HW_LRADC_CHANNEL(15)
108
109void imx233_lradc_init(void);
110void imx233_lradc_setup_channel(int channel, bool div2, bool acc, int nr_samples, int src);
111void imx233_lradc_setup_delay(int dchan, int trigger_lradc, int trigger_delays,
112 int loop_count, int delay);
113void imx233_lradc_kick_channel(int channel);
114void imx233_lradc_kick_delay(int dchan);
115void imx233_lradc_wait_channel(int channel);
116int imx233_lradc_read_channel(int channel);
117void imx233_lradc_clear_channel(int channel);
118// acquire a virtual channel, returns -1 on timeout, channel otherwise */
119int imx233_lradc_acquire_channel(int timeout);
120void imx233_lradc_release_channel(int chan);
121// doesn't check that channel is in use!
122void imx233_lradc_reserve_channel(int channel);
123
124/* enable sensing and return temperature in kelvin,
125 * channels must already be configured as nmos and pmos */
126int imx233_lradc_sense_die_temperature(int nmos_chan, int pmos_chan);
127
128#endif /* __lradc_imx233__ */
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c
new file mode 100644
index 0000000000..8a99d19323
--- /dev/null
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/adc-fuzeplus.c
@@ -0,0 +1,37 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2011 by Amaury Pouly
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 "adc-target.h"
22
23int imx233_adc_mapping[] =
24{
25 [ADC_BATTERY] = IMX233_ADC_BATTERY,
26 [ADC_DIE_TEMP] = IMX233_ADC_DIE_TEMP,
27 [ADC_VDDIO] = IMX233_ADC_VDDIO,
28 [ADC_5V] = HW_LRADC_CHANNEL_5V,
29};
30
31const char *imx233_adc_channel_name[] =
32{
33 "Battery(mV)",
34 "Die temperature(°C)",
35 "VddIO",
36 "5V",
37};
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h b/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h
new file mode 100644
index 0000000000..ea0102d5c1
--- /dev/null
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h
@@ -0,0 +1,35 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2011 by Amaury Pouly
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#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_
23
24#include "system.h"
25#include "lradc-imx233.h"
26#include "adc-imx233.h"
27
28#define NUM_ADC_CHANNELS 4
29
30#define ADC_BATTERY 0
31#define ADC_DIE_TEMP 1
32#define ADC_VDDIO 2
33#define ADC_5V 3
34
35#endif