summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/debug-imx31.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-04-12 16:56:45 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-04-12 16:56:45 +0000
commita7af9e4a7f25f5a32306c74e95a677e6c85f399e (patch)
tree5df60e8382b69cf943840852269ea9387d42ea46 /firmware/target/arm/imx31/debug-imx31.c
parentddfd787c54d78104dac4ed144ff6cb6df8617a0e (diff)
downloadrockbox-a7af9e4a7f25f5a32306c74e95a677e6c85f399e.tar.gz
rockbox-a7af9e4a7f25f5a32306c74e95a677e6c85f399e.zip
Add GPIO manager. Get the PMIC interrupt handling working (along with power button and HP detect). Add some reg field defined instead of using raw numbers. Add PMIC info to debug ports screen. Refine PMIC driver ops a little bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17086 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/debug-imx31.c')
-rw-r--r--firmware/target/arm/imx31/debug-imx31.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c
index ab8db78063..7f1c9166d6 100644
--- a/firmware/target/arm/imx31/debug-imx31.c
+++ b/firmware/target/arm/imx31/debug-imx31.c
@@ -24,6 +24,7 @@
24#include "sprintf.h" 24#include "sprintf.h"
25#include "font.h" 25#include "font.h"
26#include "debug-target.h" 26#include "debug-target.h"
27#include "mc13783.h"
27 28
28bool __dbg_hw_info(void) 29bool __dbg_hw_info(void)
29{ 30{
@@ -34,6 +35,43 @@ bool __dbg_ports(void)
34{ 35{
35 char buf[50]; 36 char buf[50];
36 int line; 37 int line;
38 int i;
39
40 static const char pmic_regset[] =
41 {
42 MC13783_INTERRUPT_STATUS0,
43 MC13783_INTERRUPT_SENSE0,
44 MC13783_INTERRUPT_STATUS1,
45 MC13783_INTERRUPT_SENSE1,
46 MC13783_RTC_TIME,
47 MC13783_RTC_ALARM,
48 MC13783_RTC_DAY,
49 MC13783_RTC_DAY_ALARM,
50 MC13783_ADC0,
51 MC13783_ADC1,
52 MC13783_ADC2,
53 MC13783_ADC3,
54 MC13783_ADC4,
55 };
56
57 static const char *pmic_regnames[ARRAYLEN(pmic_regset)] =
58 {
59 "Int Stat0 ",
60 "Int Sense0",
61 "Int Stat1 ",
62 "Int Sense1",
63 "RTC Time ",
64 "RTC Alarm ",
65 "RTC Day ",
66 "RTC Day Al",
67 "ADC0 ",
68 "ADC1 ",
69 "ADC2 ",
70 "ADC3 ",
71 "ADC4 ",
72 };
73
74 uint32_t pmic_regs[ARRAYLEN(pmic_regset)];
37 75
38 lcd_setmargins(0, 0); 76 lcd_setmargins(0, 0);
39 lcd_clear_display(); 77 lcd_clear_display();
@@ -84,6 +122,16 @@ bool __dbg_ports(void)
84 snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR); 122 snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR);
85 lcd_puts(0, line++, buf); line++; 123 lcd_puts(0, line++, buf); line++;
86 124
125 lcd_puts(0, line++, "PMIC Registers"); line++;
126
127 mc13783_read_regset(pmic_regset, pmic_regs, ARRAYLEN(pmic_regs));
128
129 for (i = 0; i < (int)ARRAYLEN(pmic_regs); i++)
130 {
131 snprintf(buf, sizeof(buf), "%s: %08lx", pmic_regnames[i], pmic_regs[i]);
132 lcd_puts(0, line++, buf);
133 }
134
87 lcd_update(); 135 lcd_update();
88 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) 136 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
89 return false; 137 return false;