1
0
Fork 0
forked from len0rd/rockbox

Sansa AMS: Debug screen, shows GPIO and (on the fuze) DBOP input for now, to be extended

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19866 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-01-27 11:05:38 +00:00
parent 9d10f11299
commit a43b0db3d1
9 changed files with 166 additions and 13 deletions

View file

@ -2651,10 +2651,10 @@ static const struct the_menu_item menuitems[] = {
{ "Dump ROM contents", dbg_save_roms }, { "Dump ROM contents", dbg_save_roms },
#endif #endif
#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \ #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \
|| CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L || CONFIG_CPU == AS3525
{ "View I/O ports", dbg_ports }, { "View I/O ports", dbg_ports },
#endif #endif
#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR)
{ "View PCF registers", dbg_pcf }, { "View PCF registers", dbg_pcf },
#endif #endif
#if defined(HAVE_TSC2100) && !defined(SIMULATOR) #if defined(HAVE_TSC2100) && !defined(SIMULATOR)

View file

@ -344,6 +344,7 @@ target/arm/pnx0101/system-pnx0101.c
#endif #endif
#if CONFIG_CPU == AS3525 #if CONFIG_CPU == AS3525
target/arm/as3525/debug-as3525.c
target/arm/as3525/system-as3525.c target/arm/as3525/system-as3525.c
target/arm/as3525/kernel-as3525.c target/arm/as3525/kernel-as3525.c
target/arm/as3525/ata_sd_as3525.c target/arm/as3525/ata_sd_as3525.c

View file

@ -21,15 +21,60 @@
#include <stdbool.h> #include <stdbool.h>
#include "debug-target.h" #include "debug-target.h"
#include "button.h"
#include "lcd.h"
#include "font.h"
#include "system.h"
#include "sprintf.h"
#define _DEBUG_PRINTF(a,varargs...) \
snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
/* TODO */ /* TODO */
bool __dbg_ports(void)
{
return false;
}
bool __dbg_hw_info(void) bool __dbg_hw_info(void)
{ {
return false; return false;
} }
bool __dbg_ports(void)
{
char buf[50];
int line, i;
char counter = 0;
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
char gpio_data[4] = {0,0,0,0};
while(1)
{
line = 0;
for (i = 0; i < 8; i++)
{
gpio_data[0] |= GPIOA_PIN(i) & (1<<i);
gpio_data[1] |= GPIOB_PIN(i) & (1<<i);
gpio_data[2] |= GPIOC_PIN(i) & (1<<i);
gpio_data[3] |= GPIOD_PIN(i) & (1<<i);
}
line++;
_DEBUG_PRINTF("[GPIO Values and Directions]");
_DEBUG_PRINTF("GPIOA: %2x DIR: %2x", gpio_data[0], GPIOA_DIR);
_DEBUG_PRINTF("GPIOB: %2x DIR: %2x", gpio_data[1], GPIOB_DIR);
_DEBUG_PRINTF("GPIOC: %2x DIR: %2x", gpio_data[2], GPIOC_DIR);
_DEBUG_PRINTF("GPIOD: %2x DIR: %2x", gpio_data[3], GPIOD_DIR);
line++;
#ifdef TRACK_DBOP_DIN
_DEBUG_PRINTF("[DBOP_DIN]");
_DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din);
#endif
memset(gpio_data, 0, sizeof(gpio_data));
lcd_update();
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
break;
}
lcd_setfont(FONT_UI);
return false;
}

View file

@ -21,5 +21,6 @@
#include <stdbool.h> #include <stdbool.h>
#define DEBUG_CANCEL BUTTON_LEFT
bool __dbg_hw_info(void); bool __dbg_hw_info(void);
bool __dbg_ports(void); bool __dbg_ports(void);

View file

@ -0,0 +1,26 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Karl Kurbjun
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include <stdbool.h>
#define DEBUG_CANCEL BUTTON_LEFT
bool __dbg_hw_info(void);
bool __dbg_ports(void);

View file

@ -0,0 +1,26 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Karl Kurbjun
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include <stdbool.h>
#define DEBUG_CANCEL BUTTON_LEFT
bool __dbg_hw_info(void);
bool __dbg_ports(void);

View file

@ -42,8 +42,8 @@ static bool hold_button_old = false;
#else #else
#define hold_button false #define hold_button false
#endif /* !BOOTLOADER */ #endif /* !BOOTLOADER */
static int int_btn = BUTTON_NONE; static int int_btn = BUTTON_NONE;
static short dbop_din = BUTTON_NONE; short _dbop_din = BUTTON_NONE;
void button_init_device(void) void button_init_device(void)
{ {
@ -76,7 +76,7 @@ static void get_wheel(void)
{ 2, 0, 3, 1 }, /* Clockwise rotation */ { 2, 0, 3, 1 }, /* Clockwise rotation */
{ 1, 3, 0, 2 }, /* Counter-clockwise */ { 1, 3, 0, 2 }, /* Counter-clockwise */
}; };
wheel_value = dbop_din & (1<<13|1<<14); wheel_value = _dbop_din & (1<<13|1<<14);
wheel_value >>= 13; wheel_value >>= 13;
/* did the wheel value change? */ /* did the wheel value change? */
if (!hold_button) if (!hold_button)
@ -130,7 +130,7 @@ static void get_wheel(void)
/* get hold button state */ /* get hold button state */
static void get_hold(void) static void get_hold(void)
{ {
hold_button = dbop_din & (1<<12); hold_button = _dbop_din & (1<<12);
} }
#endif #endif
@ -141,7 +141,7 @@ bool button_hold(void)
static void get_power(void) static void get_power(void)
{ {
if (dbop_din & (1<<8)) if (_dbop_din & (1<<8))
int_btn |= BUTTON_POWER; int_btn |= BUTTON_POWER;
} }
@ -172,7 +172,7 @@ static void get_button_from_dbob(void)
temp = DBOP_STAT; temp = DBOP_STAT;
} while ((temp & (1<<16)) == 0); /* wait for valid data */ } while ((temp & (1<<16)) == 0); /* wait for valid data */
dbop_din = DBOP_DIN; /* now read */ _dbop_din = DBOP_DIN; /* now read */
DBOP_TIMPOL_01 = 0x6e167; DBOP_TIMPOL_01 = 0x6e167;
DBOP_TIMPOL_23 = 0xa167e06f; DBOP_TIMPOL_23 = 0xa167e06f;

View file

@ -0,0 +1,28 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Karl Kurbjun
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include <stdbool.h>
#define DEBUG_CANCEL BUTTON_LEFT
#define TRACK_DBOP_DIN
extern short _dbop_din;
bool __dbg_hw_info(void);
bool __dbg_ports(void);

View file

@ -0,0 +1,26 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Karl Kurbjun
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include <stdbool.h>
#define DEBUG_CANCEL BUTTON_LEFT
bool __dbg_hw_info(void);
bool __dbg_ports(void);