summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorHristo Kovachev <bger@rockbox.org>2006-08-11 08:35:27 +0000
committerHristo Kovachev <bger@rockbox.org>2006-08-11 08:35:27 +0000
commit9dc0e6222942b31ecf8a7ba4b8f4d1dff1d52caa (patch)
treeca0458168d06e758160bae2980797ee52ed27fb4 /firmware
parent2c3fd0ce7e035fe0c42fed1e4be9c5a22518fd6f (diff)
Patch #5731 by Barry Wardell: more iriver h10 work. Thanks!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10521 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/SOURCES2
-rw-r--r--firmware/export/config-h10.h2
-rw-r--r--firmware/target/arm/ata-pp5020.c (renamed from firmware/target/arm/iriver/h10/ata-h10.c)0
-rw-r--r--firmware/target/arm/ata-target.h23
-rw-r--r--firmware/target/arm/iriver/h10/ata-target.h72
-rw-r--r--firmware/target/arm/iriver/h10/button-h10.c26
-rw-r--r--firmware/target/arm/iriver/h10/lcd-h10.c30
7 files changed, 48 insertions, 107 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 0317b4abff..a0e4922154 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -250,7 +250,7 @@ target/coldfire/iaudio/x5/lcd-remote-x5.c
#ifndef SIMULATOR
target/arm/iriver/h10/backlight-h10.c
target/arm/iriver/h10/button-h10.c
-target/arm/iriver/h10/ata-h10.c
+target/arm/ata-pp5020.c
target/arm/iriver/h10/power-h10.c
target/arm/iriver/h10/usb-h10.c
target/arm/iriver/h10/lcd-h10.c
diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h
index 5a410f6b42..cae37fcce4 100644
--- a/firmware/export/config-h10.h
+++ b/firmware/export/config-h10.h
@@ -59,7 +59,7 @@
#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary
because of 'target' stuff */
-#define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity
+#define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity
TODO: check this, probably different
for different models too */
diff --git a/firmware/target/arm/iriver/h10/ata-h10.c b/firmware/target/arm/ata-pp5020.c
index f8ca773132..f8ca773132 100644
--- a/firmware/target/arm/iriver/h10/ata-h10.c
+++ b/firmware/target/arm/ata-pp5020.c
diff --git a/firmware/target/arm/ata-target.h b/firmware/target/arm/ata-target.h
new file mode 100644
index 0000000000..417485fb8a
--- /dev/null
+++ b/firmware/target/arm/ata-target.h
@@ -0,0 +1,23 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2006 by Barry Wardell
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+void ata_reset(void);
+void ata_enable(bool on);
+bool ata_is_coldstart(void);
+void ata_device_init(void);
diff --git a/firmware/target/arm/iriver/h10/ata-target.h b/firmware/target/arm/iriver/h10/ata-target.h
deleted file mode 100644
index a93af79015..0000000000
--- a/firmware/target/arm/iriver/h10/ata-target.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2006 by Barry Wardell
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-/* ATA stuff was taken from the iPod code */
-
-/* Plain C read & write loops */
-#define PREFER_C_READING
-#define PREFER_C_WRITING
-
-#if (CONFIG_CPU == PP5002)
-#define ATA_IOBASE 0xc00031e0
-#define ATA_CONTROL (*((volatile unsigned char*)(0xc00033f8)))
-#elif (CONFIG_CPU == PP5020)
-#define ATA_IOBASE 0xc30001e0
-#define ATA_CONTROL (*((volatile unsigned char*)(0xc30003f8)))
-#endif
-
-#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE)))
-#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x04)))
-#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x08)))
-#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x0c)))
-#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x10)))
-#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x14)))
-#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x18)))
-#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x1c)))
-
-#define STATUS_BSY 0x80
-#define STATUS_RDY 0x40
-#define STATUS_DF 0x20
-#define STATUS_DRQ 0x08
-#define STATUS_ERR 0x01
-#define ERROR_ABRT 0x04
-
-#define WRITE_PATTERN1 0xa5
-#define WRITE_PATTERN2 0x5a
-#define WRITE_PATTERN3 0xaa
-#define WRITE_PATTERN4 0x55
-
-#define READ_PATTERN1 0xa5
-#define READ_PATTERN2 0x5a
-#define READ_PATTERN3 0xaa
-#define READ_PATTERN4 0x55
-
-#define READ_PATTERN1_MASK 0xff
-#define READ_PATTERN2_MASK 0xff
-#define READ_PATTERN3_MASK 0xff
-#define READ_PATTERN4_MASK 0xff
-
-#define SET_REG(reg,val) reg = (val)
-#define SET_16BITREG(reg,val) reg = (val)
-
-
-void ata_reset(void);
-void ata_enable(bool on);
-bool ata_is_coldstart(void);
-void ata_device_init(void);
diff --git a/firmware/target/arm/iriver/h10/button-h10.c b/firmware/target/arm/iriver/h10/button-h10.c
index badcd594a1..7979a52976 100644
--- a/firmware/target/arm/iriver/h10/button-h10.c
+++ b/firmware/target/arm/iriver/h10/button-h10.c
@@ -49,6 +49,7 @@ int button_read_device(void)
int btn = BUTTON_NONE;
unsigned char state;
static bool hold_button = false;
+
#if 0
/* light handling */
if (hold_button && !button_hold())
@@ -58,12 +59,25 @@ int button_read_device(void)
#endif
hold_button = button_hold();
- state = GPIOA_INPUT_VAL & 0xf8;
- if ((state & 0x8) == 0) btn |= BUTTON_FF;
- if ((state & 0x16) == 0) btn |= BUTTON_PLAY;
- if ((state & 0x32) == 0) btn |= BUTTON_REW;
- if ((state & 0x64) == 0) btn |= BUTTON_RIGHT;
- if ((state & 0x128) == 0) btn |= BUTTON_LEFT;
+ if (!hold_button)
+ {
+ /* Read normal buttons */
+ state = GPIOA_INPUT_VAL & 0xf8;
+ if ((state & 0x8) == 0) btn |= BUTTON_FF;
+ if ((state & 0x10) == 0) btn |= BUTTON_PLAY;
+ if ((state & 0x20) == 0) btn |= BUTTON_REW;
+ if ((state & 0x40) == 0) btn |= BUTTON_RIGHT;
+ if ((state & 0x80) == 0) btn |= BUTTON_LEFT;
+
+ /* Read power button */
+ if ((GPIOB_INPUT_VAL & 0x1) == 0) btn |= BUTTON_POWER;
+
+ /* Read scroller */
+ if ( ((GPIOC_INPUT_VAL & 0x4)==1) && ((GPIOD_INPUT_VAL & 0x10)==1) )
+ {
+ /* Scroller is pressed */
+ }
+ }
return btn;
}
diff --git a/firmware/target/arm/iriver/h10/lcd-h10.c b/firmware/target/arm/iriver/h10/lcd-h10.c
index c2fa05b05c..3640aa1ba1 100644
--- a/firmware/target/arm/iriver/h10/lcd-h10.c
+++ b/firmware/target/arm/iriver/h10/lcd-h10.c
@@ -36,8 +36,8 @@
static bool display_on=false; /* is the display turned on? */
-#define LCD_CMD *(volatile unsigned short *)0xf0008000
-#define LCD_DATA *(volatile unsigned short *)0xf0008002
+#define LCD_CMD *(volatile unsigned short *)0x70003008 /* or maybe 0x70008a0c */
+#define LCD_DATA *(volatile unsigned short *)0x70003010
/* register defines for the Renesas HD66773R */
#define R_HORIZ_RAM_ADDR_POS 0x16
@@ -98,30 +98,23 @@ const short high8to9[] ICONST_ATTR = {
/* called very frequently - inline! */
inline void lcd_write_reg(int reg, int val)
{
-#if 0
LCD_CMD = (reg >> 8) << 1;
LCD_CMD = (reg & 0xff) << 1;
LCD_DATA = (val >> 8) << 1;
LCD_DATA = (val & 0xff) << 1;
-#endif
- (void)reg;
- (void)val;
}
/* called very frequently - inline! */
inline void lcd_begin_write_gram(void)
{
-#if 0
LCD_CMD = (R_WRITE_DATA_2_GRAM >> 8) << 1;
LCD_CMD = (R_WRITE_DATA_2_GRAM & 0xff) << 1;
-#endif
}
/* called very frequently - inline! */
inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR;
inline void lcd_write_data(const unsigned short* p_bytes, int count)
{
-#if 0
unsigned int tmp;
unsigned int *ptr = (unsigned int *)p_bytes;
bool extra;
@@ -144,9 +137,6 @@ inline void lcd_write_data(const unsigned short* p_bytes, int count)
LCD_DATA = high8to9[read >> 8];
LCD_DATA = read<<1;
}
-#endif
- (void)p_bytes;
- (void)count;
}
/*** hardware configuration ***/
@@ -158,15 +148,12 @@ int lcd_default_contrast(void)
void lcd_set_contrast(int val)
{
-#if 0
if (val >= 15) // val must'nt be 15 or 31
++val;
if (val > 30)
return;
lcd_write_reg(0x0e, 0x201e + (val << 8));
-#endif
- (void)val;
}
void lcd_set_invert_display(bool yesno)
@@ -197,9 +184,9 @@ void lcd_roll(int lines)
*/
void lcd_init_device(void)
{
-#if 0
display_on=true;
+#if 0
/* LCD Reset */
and_l(~0x00000010, &GPIO1_OUT);
or_l(0x00000010, &GPIO1_ENABLE);
@@ -268,10 +255,7 @@ void lcd_init_device(void)
void lcd_enable(bool on)
{
-#if 0
display_on = on;
-#endif
- (void)on;
}
/*** update functions ***/
@@ -297,7 +281,6 @@ void lcd_blit(const fb_data* data, int x, int by, int width,
void lcd_update(void) ICODE_ATTR;
void lcd_update(void)
{
-#if 0
if(display_on){
/* Copy display bitmap to hardware */
@@ -305,14 +288,12 @@ void lcd_update(void)
lcd_begin_write_gram();
lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
}
-#endif
}
/* Update a fraction of the display. */
void lcd_update_rect(int, int, int, int) ICODE_ATTR;
void lcd_update_rect(int x, int y, int width, int height)
{
-#if 0
if(display_on) {
int ymax = y + height;
@@ -343,9 +324,4 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 0x7f00);
lcd_write_reg(R_VERT_RAM_ADDR_POS, 0x9f00);
}
-#endif
- (void)x;
- (void)y;
- (void)width;
- (void)height;
}