summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/debug-imx31.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-04-13 20:03:08 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-04-13 20:03:08 +0000
commitb12c69bac7a02ea161ebc02ce7323e82bebe7b23 (patch)
treed1d827c2e91e7591cb0d661ea0b20c26f0a21d2d /firmware/target/arm/imx31/debug-imx31.c
parent73d1eb4ac06809b64a0545bae22f7e436d3c8b70 (diff)
downloadrockbox-b12c69bac7a02ea161ebc02ce7323e82bebe7b23.tar.gz
rockbox-b12c69bac7a02ea161ebc02ce7323e82bebe7b23.zip
ADC driver for Gigabeat S - a bit on the general side for now. Needs to have scales set properly (what physical value a reading represents isn't clear from the docs or I'm just lazy atm). Throw-in a _bunch_ more reg defines for the PMIC. Show all 16 raw channels values in debug menu.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17100 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/debug-imx31.c')
-rw-r--r--firmware/target/arm/imx31/debug-imx31.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c
index 7f1c9166d6..94df64b6d7 100644
--- a/firmware/target/arm/imx31/debug-imx31.c
+++ b/firmware/target/arm/imx31/debug-imx31.c
@@ -25,6 +25,7 @@
25#include "font.h" 25#include "font.h"
26#include "debug-target.h" 26#include "debug-target.h"
27#include "mc13783.h" 27#include "mc13783.h"
28#include "adc.h"
28 29
29bool __dbg_hw_info(void) 30bool __dbg_hw_info(void)
30{ 31{
@@ -47,11 +48,6 @@ bool __dbg_ports(void)
47 MC13783_RTC_ALARM, 48 MC13783_RTC_ALARM,
48 MC13783_RTC_DAY, 49 MC13783_RTC_DAY,
49 MC13783_RTC_DAY_ALARM, 50 MC13783_RTC_DAY_ALARM,
50 MC13783_ADC0,
51 MC13783_ADC1,
52 MC13783_ADC2,
53 MC13783_ADC3,
54 MC13783_ADC4,
55 }; 51 };
56 52
57 static const char *pmic_regnames[ARRAYLEN(pmic_regset)] = 53 static const char *pmic_regnames[ARRAYLEN(pmic_regset)] =
@@ -64,11 +60,6 @@ bool __dbg_ports(void)
64 "RTC Alarm ", 60 "RTC Alarm ",
65 "RTC Day ", 61 "RTC Day ",
66 "RTC Day Al", 62 "RTC Day Al",
67 "ADC0 ",
68 "ADC1 ",
69 "ADC2 ",
70 "ADC3 ",
71 "ADC4 ",
72 }; 63 };
73 64
74 uint32_t pmic_regs[ARRAYLEN(pmic_regset)]; 65 uint32_t pmic_regs[ARRAYLEN(pmic_regset)];
@@ -132,6 +123,21 @@ bool __dbg_ports(void)
132 lcd_puts(0, line++, buf); 123 lcd_puts(0, line++, buf);
133 } 124 }
134 125
126 line++;
127
128 lcd_puts(0, line++, "ADC"); line++;
129
130 for (i = 0; i < NUM_ADC_CHANNELS; i += 4)
131 {
132 snprintf(buf, sizeof(buf),
133 "CH%02d:%04u CH%02d:%04u CH%02d:%04u CH%02d:%04u",
134 i+0, adc_read(i+0),
135 i+1, adc_read(i+1),
136 i+2, adc_read(i+2),
137 i+3, adc_read(i+3));
138 lcd_puts(0, line++, buf);
139 }
140
135 lcd_update(); 141 lcd_update();
136 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) 142 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
137 return false; 143 return false;