summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Malesinski <tomal@rockbox.org>2006-11-09 22:58:35 +0000
committerTomasz Malesinski <tomal@rockbox.org>2006-11-09 22:58:35 +0000
commit6e992abf36b1719cba18c9f4d519a02b187c8bca (patch)
treec7a02d2f1182990bb1df8d11fc4d4967e3695340
parentfedfd44825a1880019706a2b71241216350e3590 (diff)
Target tree support for Iriver iFP.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11485 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/SOURCES10
-rw-r--r--firmware/backlight.c4
-rw-r--r--firmware/drivers/adc.c34
-rw-r--r--firmware/drivers/button.c51
-rw-r--r--firmware/drivers/power.c7
-rw-r--r--firmware/export/adc.h9
-rw-r--r--firmware/export/button.h22
-rw-r--r--firmware/export/config-ifp7xx.h6
-rwxr-xr-xtools/configure3
9 files changed, 21 insertions, 125 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 1a43eab0a9..32de5a0c4e 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -518,3 +518,13 @@ target/arm/ipod/power-ipod.c
target/arm/ipod/usb-ipod.c
#endif /* SIMULATOR */
#endif /* IPOD_MINI2G */
+
+#ifdef IRIVER_IFP7XX
+target/arm/iriver/ifp7xx/power-ifp7xx.c
+#ifndef SIMULATOR
+target/arm/iriver/ifp7xx/adc-ifp7xx.c
+target/arm/iriver/ifp7xx/backlight-ifp7xx.c
+target/arm/iriver/ifp7xx/button-ifp7xx.c
+target/arm/iriver/ifp7xx/usb-ifp7xx.c
+#endif
+#endif
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 897627bf55..7b499f26bf 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -71,8 +71,6 @@ static inline void __backlight_on(void)
or_b(0x40, &PADRH); /* drive it high */
#elif CONFIG_BACKLIGHT == BL_GMINI
P1 |= 0x10;
-#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
- GPIO3_SET = 1;
#endif
}
@@ -87,8 +85,6 @@ static inline void __backlight_off(void)
and_b(~0x40, &PADRH); /* drive it low */
#elif CONFIG_BACKLIGHT == BL_GMINI
P1 &= ~0x10;
-#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
- GPIO3_CLR = 1;
#endif
}
#endif
diff --git a/firmware/drivers/adc.c b/firmware/drivers/adc.c
index 388ff66d5f..adeace005b 100644
--- a/firmware/drivers/adc.c
+++ b/firmware/drivers/adc.c
@@ -155,38 +155,4 @@ void adc_init(void)
sleep(2); /* Ensure valid readings when adc_init returns */
}
-#elif CONFIG_CPU == PNX0101
-
-static unsigned short adcdata[NUM_ADC_CHANNELS];
-
-unsigned short adc_read(int channel)
-{
- return adcdata[channel];
-}
-
-static void adc_tick(void)
-{
- if (ADCST & 0x10) {
- adcdata[0] = ADCCH0 & 0x3ff;
- adcdata[1] = ADCCH1 & 0x3ff;
- adcdata[2] = ADCCH2 & 0x3ff;
- adcdata[3] = ADCCH3 & 0x3ff;
- adcdata[4] = ADCCH4 & 0x3ff;
- ADCST = 0xa;
- }
-}
-
-void adc_init(void)
-{
- ADCR24 = 0xaaaaa;
- ADCR28 = 0;
- ADCST = 2;
- ADCST = 0xa;
-
- while (!(ADCST & 0x10));
- adc_tick();
-
- tick_add_task(adc_tick);
-}
-
#endif
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 3ae4893290..1cdd8995fe 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -75,10 +75,7 @@ static bool remote_filter_first_keypress;
#define REPEAT_INTERVAL_FINISH 5
/* the power-off button and number of repeated keys before shutting off */
-#if (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
-#define POWEROFF_BUTTON BUTTON_PLAY
-#define POWEROFF_COUNT 40
-#elif !defined(TARGET_TREE)
+#if !defined(TARGET_TREE)
#define POWEROFF_BUTTON BUTTON_OFF
#define POWEROFF_COUNT 10
#endif
@@ -506,46 +503,6 @@ static int button_read(void)
|| (CONFIG_KEYPAD == IRIVER_H300_PAD)
btn = button_read_device(); /* temp untill TARGET_TREE is defined */
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
- static bool hold_button = false;
- bool hold_button_old;
-
- /* normal buttons */
- hold_button_old = hold_button;
- hold_button = button_hold();
-
- if (hold_button != hold_button_old)
- backlight_hold_changed(hold_button);
-
- if (!button_hold())
- {
- data = adc_read(ADC_BUTTONS);
- if (data < 0x35c)
- {
- if (data < 0x151)
- if (data < 0xc7)
- if (data < 0x41)
- btn = BUTTON_LEFT;
- else
- btn = BUTTON_RIGHT;
- else
- btn = BUTTON_SELECT;
- else
- if (data < 0x268)
- if (data < 0x1d7)
- btn = BUTTON_UP;
- else
- btn = BUTTON_DOWN;
- else
- if (data < 0x2f9)
- btn = BUTTON_EQ;
- else
- btn = BUTTON_MODE;
- }
-
- if (adc_read(ADC_BUTTON_PLAY) < 0x64)
- btn |= BUTTON_PLAY;
- }
#elif CONFIG_KEYPAD == RECORDER_PAD
#ifndef HAVE_FMADC
@@ -703,12 +660,6 @@ static int button_read(void)
return retval;
}
-#if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-bool button_hold(void)
-{
- return (GPIO5_READ & 4) ? false : true;
-}
-#endif
int button_status(void)
{
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index e48993c2aa..e0a5de4bfb 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -144,8 +144,6 @@ void ide_power_enable(bool on)
P1 |= 0x08;
else
P1 &= ~0x08;
-#elif CONFIG_CPU == PNX0101
- /* no ide controller */
#elif defined(TOSHIBA_GIGABEAT_F)
/* Gigabeat TODO */
#else /* SH1 based archos */
@@ -222,10 +220,7 @@ bool ide_powered(void)
void power_off(void)
{
set_irq_level(HIGHEST_IRQ_LEVEL);
-#if CONFIG_CPU == PNX0101
- GPIO1_CLR = 1 << 16;
- GPIO2_SET = 1;
-#elif defined(GMINI_ARCH)
+#if defined(GMINI_ARCH)
P1 &= ~1;
P1CON &= ~1;
#elif defined(TOSHIBA_GIGABEAT_F)
diff --git a/firmware/export/adc.h b/firmware/export/adc.h
index 4dced55f09..d8e3b7078f 100644
--- a/firmware/export/adc.h
+++ b/firmware/export/adc.h
@@ -24,15 +24,6 @@
#ifdef TARGET_TREE
#include "adc-target.h"
-#elif defined(IRIVER_IFP7XX)
-
-#define NUM_ADC_CHANNELS 5
-
-#define ADC_BUTTONS 0
-#define ADC_BATTERY 1
-#define ADC_BUTTON_PLAY 2
-#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
-
#else
#define NUM_ADC_CHANNELS 8
diff --git a/firmware/export/button.h b/firmware/export/button.h
index d702b50fcd..240ec08d9b 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -26,8 +26,6 @@
(CONFIG_KEYPAD == IRIVER_H300_PAD)
#define HAS_BUTTON_HOLD
#define HAS_REMOTE_BUTTON_HOLD
-#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
-#define HAS_BUTTON_HOLD
#endif
extern struct event_queue button_queue;
@@ -173,26 +171,6 @@ void wheel_send_events(bool send);
#define BUTTON_REMOTE 0
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-
-/* iriver IFP7XX specific button codes */
-
-#define BUTTON_PLAY 0x00000001
-#define BUTTON_SELECT 0x00000002
-
-#define BUTTON_LEFT 0x00000004
-#define BUTTON_RIGHT 0x00000008
-#define BUTTON_UP 0x00000010
-#define BUTTON_DOWN 0x00000020
-
-#define BUTTON_MODE 0x00000040
-#define BUTTON_EQ 0x00000080
-
-#define BUTTON_MAIN (BUTTON_PLAY|BUTTON_SELECT\
- |BUTTON_LEFT|BUTTON_RIGHT|BUTTON_UP|BUTTON_DOWN\
- |BUTTON_MODE|BUTTON_EQ)
-
-#define BUTTON_REMOTE 0
#elif 0
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h
index b0724f6e83..637a754f2a 100644
--- a/firmware/export/config-ifp7xx.h
+++ b/firmware/export/config-ifp7xx.h
@@ -1,6 +1,8 @@
/*
* This config file is for iriver iFP-799
*/
+#define TARGET_TREE
+
#define IRIVER_IFP7XX_SERIES 1
/* For Rolo and boot loader */
@@ -91,6 +93,10 @@
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
+#define MIN_CONTRAST_SETTING 5
+#define MAX_CONTRAST_SETTING 63
+#define DEFAULT_CONTRAST_SETTING 40
+
/* Define this if you have adjustable CPU frequency */
//#define HAVE_ADJUSTABLE_CPU_FREQ
diff --git a/tools/configure b/tools/configure
index dbebb2c2b3..2b7b55fbed 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1088,6 +1088,9 @@ EOF
# toolset is the tools within the tools directory that we build for
# this particular target.
toolset=$genericbitmaptools
+ t_cpu="arm"
+ t_manufacturer="iriver"
+ t_model="ifp7xx"
;;
40|gigabeatf)