summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2014-09-28 21:08:29 +0200
committerMichael Giacomelli <giac2000@hotmail.com>2014-09-28 21:36:17 +0200
commitf014a768660ec9b14a18b5d574b83bc865f3f48c (patch)
treebc661779481a775b43eb5ec8f05b365ba969690c
parent23dc0b01794fe8001a76eb4371afdc9326648357 (diff)
Add various additional AS3525v2 SOC voltages to the debug screen.
Change-Id: I8c110771f73f5248e949b027fbe1c281c6b1f6f7 Reviewed-on: http://gerrit.rockbox.org/991 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com> Tested: Michael Giacomelli <giac2000@hotmail.com>
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index ab70f73165..b8c5d883e9 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -437,6 +437,14 @@ end:
return false;
}
+void adc_set_voltage_mux(int channel)
+{
+ ascodec_lock();
+ /*this register also controls which subregister is subsequently written, so be careful*/
+ ascodec_write(AS3543_PMU_ENABLE, 8 | channel << 4 );
+ ascodec_unlock();
+}
+
bool dbg_ports(void)
{
int line, btn, i;
@@ -510,10 +518,22 @@ bool dbg_ports(void)
"I_CHGact",
"I_CHGref",
};
+
+ static const char *adc_mux_name[10] = {
+ NULL,
+ "AVDD27 ",
+ "AVDD17 ",
+ "PVDD1 ",
+ "PVDD2 ",
+ "CVDD1 ",
+ "CVDD2 ",
+ "RVDD ",
+ "FVDD ",
+ "PWGD ",
+ };
#endif
lcd_clear_display();
-
while(1)
{
line = 0;
@@ -550,6 +570,7 @@ bool dbg_ports(void)
for(; i<16; i++)
lcd_putsf(0, line++, "%s: %d mV", adc_name[i], adc_read(i));
#endif
+
lcd_update();
btn = button_get_w_tmo(HZ/10);
@@ -558,7 +579,25 @@ bool dbg_ports(void)
else if(btn == (BUTTON_DOWN|BUTTON_REL))
break;
}
- }
+#if CONFIG_CPU == AS3525v2 /*extend AS3543 voltage registers*/
+ lcd_clear_display();
+ while(1)
+ {
+ line = 0;
+ for(i=1; i<9; i++){
+ adc_set_voltage_mux(i); /*change the voltage mux to a new channel*/
+ lcd_putsf(0, line++, "%s: %d mV", adc_mux_name[i], adc_read(5) * 5);
+ }
+ lcd_update();
+
+ btn = button_get_w_tmo(HZ/10);
+ if(btn == (DEBUG_CANCEL|BUTTON_REL))
+ goto end;
+ else if(btn == (BUTTON_DOWN|BUTTON_REL))
+ break;
+ }
+#endif
+ }
end:
lcd_setfont(FONT_UI);