A bit of cleanup in config-fuze (don't define features we do not have yet), a bit of reordering. Cleanup in the lcd driver. Reintroduce the delay in the dbop read function, as it helps avoiding heavy hold button weirdness when boosted

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20583 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-03-30 19:57:42 +00:00
parent a56cba52bd
commit 487d78995a
3 changed files with 37 additions and 54 deletions

View file

@ -17,6 +17,11 @@
#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ #define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */
#define REC_SAMPR_DEFAULT SAMPR_22 #define REC_SAMPR_DEFAULT SAMPR_22
/* Default recording levels */
#define DEFAULT_REC_MIC_GAIN 23
#define DEFAULT_REC_LEFT_GAIN 23
#define DEFAULT_REC_RIGHT_GAIN 23
/* Define bitmask of input sources - recordable bitmask can be defined /* Define bitmask of input sources - recordable bitmask can be defined
explicitly if different */ explicitly if different */
#endif #endif
@ -24,11 +29,10 @@
/* define this if you have a bitmap LCD display */ /* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP #define HAVE_LCD_BITMAP
/* define this if you have a colour LCD */ /* define this if you have a colour LCD */
#define HAVE_LCD_COLOR #define HAVE_LCD_COLOR
/* define this if you want album art for this target */ #ifndef BOOTLOADER/* define this if you want album art for this target */
#define HAVE_ALBUMART #define HAVE_ALBUMART
/* define this if you have a light associated with the buttons */ /* define this if you have a light associated with the buttons */
@ -43,13 +47,6 @@
/* define this if you would like tagcache to build on this target */ /* define this if you would like tagcache to build on this target */
#define HAVE_TAGCACHE #define HAVE_TAGCACHE
/* LCD dimensions */
#define LCD_WIDTH 220
#define LCD_HEIGHT 176
#define LCD_DEPTH 16 /* 65536 colours */
#define LCD_PIXELFORMAT RGB565 /* rgb565 */
#ifndef BOOTLOADER
/* define this if you have LCD enable function */ /* define this if you have LCD enable function */
#define HAVE_LCD_ENABLE #define HAVE_LCD_ENABLE
@ -58,14 +55,21 @@
#define HAVE_LCD_SLEEP #define HAVE_LCD_SLEEP
#define HAVE_LCD_SLEEP_SETTING #define HAVE_LCD_SLEEP_SETTING
*/ */
#endif
/* define this if you can flip your LCD */ /* define this if you can flip your LCD */
#define HAVE_LCD_FLIP //#define HAVE_LCD_FLIP
/* define this if you can invert the colours on your LCD */ /* define this if you can invert the colours on your LCD */
#define HAVE_LCD_INVERT //#define HAVE_LCD_INVERT
/* define this if you have a real-time clock */
#define CONFIG_RTC RTC_AS3514
/* There is no hardware tone control */
#define HAVE_SW_TONE_CONTROLS
#endif /* !BOOTLOADER */
/* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */ /* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */
#define CONFIG_KEYPAD SANSA_FUZE_PAD #define CONFIG_KEYPAD SANSA_FUZE_PAD
@ -73,22 +77,22 @@
/* Define this if you do software codec */ /* Define this if you do software codec */
#define CONFIG_CODEC SWCODEC #define CONFIG_CODEC SWCODEC
/* There is no hardware tone control */
#define HAVE_SW_TONE_CONTROLS /* LCD dimensions */
#define LCD_WIDTH 220
#define LCD_HEIGHT 176
#define LCD_DEPTH 16 /* 65536 colours */
#define LCD_PIXELFORMAT RGB565 /* rgb565 */
/* We're working on the assumption that the AS3525 has something /* We're working on the assumption that the AS3525 has something
similar to the AS3514 for audio codec etc */ similar to the AS3514 for audio codec etc */
#define HAVE_AS3514 #define HAVE_AS3514
/* define this if you have a real-time clock */
#ifndef BOOTLOADER
#define CONFIG_RTC RTC_AS3514
#endif
/* Define this if you have a software controlled poweroff */ /* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF #define HAVE_SW_POWEROFF
/* Some Sansa E200s seem to be FAT16 formatted */ /* Some Sansa Fuzes seem to be FAT16 formatted */
#define HAVE_FAT16SUPPORT #define HAVE_FAT16SUPPORT
/* The number of bytes reserved for loadable codecs */ /* The number of bytes reserved for loadable codecs */
@ -151,15 +155,8 @@
/* Define this if you want to use the AS2525 i2c interface */ /* Define this if you want to use the AS2525 i2c interface */
#define CONFIG_I2C I2C_AS3525 #define CONFIG_I2C I2C_AS3525
/* define this if the hardware can be powered off while charging */
/* Sansa can't be powered off while charging */
/* #define HAVE_POWEROFF_WHILE_CHARGING */
/* The start address index for ROM builds */
#define ROM_START 0x00000000
/* Define this to the CPU frequency */ /* Define this to the CPU frequency */
#define CPU_FREQ 75000000 #define CPU_FREQ 250000000
/* Type of LCD */ /* Type of LCD */
#define CONFIG_LCD LCD_FUZE #define CONFIG_LCD LCD_FUZE
@ -200,7 +197,3 @@
#endif /* SIMULATOR */ #endif /* SIMULATOR */
/* Default recording levels */
#define DEFAULT_REC_MIC_GAIN 23
#define DEFAULT_REC_LEFT_GAIN 23
#define DEFAULT_REC_RIGHT_GAIN 23

View file

@ -133,6 +133,12 @@ bool button_hold(void)
return hold_button; return hold_button;
} }
static void button_delay(void)
{
int i = 32;
while(i--);
}
static short button_dbop(void) static short button_dbop(void)
{ {
/* skip home and power reading if lcd_button_support was blocked, /* skip home and power reading if lcd_button_support was blocked,
@ -153,6 +159,8 @@ static short button_dbop(void)
DBOP_TIMPOL_01 = 0xe167e167; DBOP_TIMPOL_01 = 0xe167e167;
DBOP_TIMPOL_23 = 0xe167006e; DBOP_TIMPOL_23 = 0xe167006e;
button_delay();
DBOP_CTRL |= (1<<15); /* start read */ DBOP_CTRL |= (1<<15); /* start read */
while((DBOP_STAT & (1<<16)) == 0); /* wait for valid data */ while((DBOP_STAT & (1<<16)) == 0); /* wait for valid data */

View file

@ -44,7 +44,7 @@ static int xoffset = 20; /* needed for flip */
/* we need to write a red pixel for correct button reads /* we need to write a red pixel for correct button reads
* (see lcd_button_support()), but that must not happen while the lcd is updating * (see lcd_button_support()), but that must not happen while the lcd is updating
* so block lcd_button_support the during updates */ * so block lcd_button_support the during updates */
static volatile bool lcd_busy = false; static bool lcd_busy = false;
static void as3525_dbop_init(void) static void as3525_dbop_init(void)
{ {
@ -108,32 +108,13 @@ static void lcd_write_reg(int reg, int value)
lcd_write_data(&data, 1); lcd_write_data(&data, 1);
} }
/*** hardware configuration ***/
void lcd_set_contrast(int val)
{
(void)val;
}
void lcd_set_invert_display(bool yesno)
{
(void)yesno;
}
static void flip_lcd(bool yesno)
{
(void)yesno;
}
/* turn the display upside down (call lcd_update() afterwards) */ /* turn the display upside down (call lcd_update() afterwards) */
void lcd_set_flip(bool yesno) void lcd_set_flip(bool yesno)
{ {
display_flipped = yesno; display_flipped = yesno;
xoffset = yesno ? 0 : 20; /* TODO: Implement flipped mode */ xoffset = yesno ? 0 : 20; /* TODO: Implement flipped mode */
if (display_on) /* TODO */
flip_lcd(yesno);
} }
@ -355,7 +336,8 @@ bool lcd_button_support(void)
lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ); lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
/* Set start position and window */ /* Set start position and window */
lcd_window_x(-1, 1); lcd_window_x(-1, 0);
lcd_window_y(-1, 0);
lcd_write_cmd(R_WRITE_DATA_2_GRAM); lcd_write_cmd(R_WRITE_DATA_2_GRAM);
lcd_write_data(&data, 1); lcd_write_data(&data, 1);