1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Rob Purchase
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
29 #include "debug-target.h"
32 /* IRQ status registers of debug interest only */
33 #define STS (*(volatile unsigned long *)0xF3001008)
34 #define SRC (*(volatile unsigned long *)0xF3001010)
36 bool __dbg_ports(void)
41 bool __dbg_hw_info(void)
43 int line
= 0, i
, button
, oldline
;
48 lcd_setfont(FONT_SYSFIXED
);
51 /* Put all the static text before the while loop */
52 lcd_puts(0, line
++, "[Hardware info]");
59 button
= button_get(false);
61 button
&= ~BUTTON_REPEAT
;
63 if (button
== BUTTON_POWER
)
66 snprintf(buf
, sizeof(buf
), "current tick: %08x Seconds running: %08d",
67 (unsigned int)current_tick
, (unsigned int)current_tick
/100); lcd_puts(0, line
++, buf
);
69 snprintf(buf
, sizeof(buf
), "GPIOA: 0x%08x GPIOB: 0x%08x",
70 (unsigned int)GPIOA
, (unsigned int)GPIOB
); lcd_puts(0, line
++, buf
);
71 snprintf(buf
, sizeof(buf
), "GPIOC: 0x%08x GPIOD: 0x%08x",
72 (unsigned int)GPIOC
, (unsigned int)GPIOD
); lcd_puts(0, line
++, buf
);
73 snprintf(buf
, sizeof(buf
), "GPIOE: 0x%08x",
74 (unsigned int)GPIOE
); lcd_puts(0, line
++, buf
);
78 snprintf(buf
, sizeof(buf
), "ADC%d: 0x%04x", i
, adc_read(i
));
79 lcd_puts(0, line
++, buf
);
82 snprintf(buf
, sizeof(buf
), "STS: 0x%08x SRC: 0x%08x",
83 (unsigned int)STS
, (unsigned int)SRC
); lcd_puts(0, line
++, buf
);