summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/debug-imx31.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx31/debug-imx31.c')
-rw-r--r--firmware/target/arm/imx31/debug-imx31.c91
1 files changed, 91 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c
new file mode 100644
index 0000000000..ab8db78063
--- /dev/null
+++ b/firmware/target/arm/imx31/debug-imx31.c
@@ -0,0 +1,91 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Michael Sevakis
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#include "config.h"
20#include "system.h"
21#include "string.h"
22#include "button.h"
23#include "lcd.h"
24#include "sprintf.h"
25#include "font.h"
26#include "debug-target.h"
27
28bool __dbg_hw_info(void)
29{
30 return false;
31}
32
33bool __dbg_ports(void)
34{
35 char buf[50];
36 int line;
37
38 lcd_setmargins(0, 0);
39 lcd_clear_display();
40 lcd_setfont(FONT_SYSFIXED);
41
42 while(1)
43 {
44 line = 0;
45 snprintf(buf, sizeof(buf), "[Ports and Registers]");
46 lcd_puts(0, line++, buf); line++;
47
48 /* GPIO1 */
49 snprintf(buf, sizeof(buf), "GPIO1: DR: %08lx GDIR: %08lx", GPIO1_DR, GPIO1_GDIR);
50 lcd_puts(0, line++, buf);
51
52 snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO1_PSR, GPIO1_ICR1);
53 lcd_puts(0, line++, buf);
54
55 snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO1_ICR2, GPIO1_IMR);
56 lcd_puts(0, line++, buf);
57
58 snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO1_ISR);
59 lcd_puts(0, line++, buf); line++;
60
61 /* GPIO2 */
62 snprintf(buf, sizeof(buf), "GPIO2: DR: %08lx GDIR: %08lx", GPIO2_DR, GPIO2_GDIR);
63 lcd_puts(0, line++, buf);
64
65 snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO2_PSR, GPIO2_ICR1);
66 lcd_puts(0, line++, buf);
67
68 snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO2_ICR2, GPIO2_IMR);
69 lcd_puts(0, line++, buf);
70
71 snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO2_ISR);
72 lcd_puts(0, line++, buf); line++;
73
74 /* GPIO3 */
75 snprintf(buf, sizeof(buf), "GPIO3: DR: %08lx GDIR: %08lx", GPIO3_DR, GPIO3_GDIR);
76 lcd_puts(0, line++, buf);
77
78 snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO3_PSR, GPIO3_ICR1);
79 lcd_puts(0, line++, buf);
80
81 snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO3_ICR2, GPIO3_IMR);
82 lcd_puts(0, line++, buf);
83
84 snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR);
85 lcd_puts(0, line++, buf); line++;
86
87 lcd_update();
88 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
89 return false;
90 }
91}