diff options
author | Tomasz Malesinski <tomal@rockbox.org> | 2006-11-09 22:58:35 +0000 |
---|---|---|
committer | Tomasz Malesinski <tomal@rockbox.org> | 2006-11-09 22:58:35 +0000 |
commit | 6e992abf36b1719cba18c9f4d519a02b187c8bca (patch) | |
tree | c7a02d2f1182990bb1df8d11fc4d4967e3695340 /firmware | |
parent | fedfd44825a1880019706a2b71241216350e3590 (diff) | |
download | rockbox-6e992abf36b1719cba18c9f4d519a02b187c8bca.tar.gz rockbox-6e992abf36b1719cba18c9f4d519a02b187c8bca.zip |
Target tree support for Iriver iFP.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11485 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/SOURCES | 10 | ||||
-rw-r--r-- | firmware/backlight.c | 4 | ||||
-rw-r--r-- | firmware/drivers/adc.c | 34 | ||||
-rw-r--r-- | firmware/drivers/button.c | 51 | ||||
-rw-r--r-- | firmware/drivers/power.c | 7 | ||||
-rw-r--r-- | firmware/export/adc.h | 9 | ||||
-rw-r--r-- | firmware/export/button.h | 22 | ||||
-rw-r--r-- | firmware/export/config-ifp7xx.h | 6 |
8 files changed, 18 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 | |||
518 | target/arm/ipod/usb-ipod.c | 518 | target/arm/ipod/usb-ipod.c |
519 | #endif /* SIMULATOR */ | 519 | #endif /* SIMULATOR */ |
520 | #endif /* IPOD_MINI2G */ | 520 | #endif /* IPOD_MINI2G */ |
521 | |||
522 | #ifdef IRIVER_IFP7XX | ||
523 | target/arm/iriver/ifp7xx/power-ifp7xx.c | ||
524 | #ifndef SIMULATOR | ||
525 | target/arm/iriver/ifp7xx/adc-ifp7xx.c | ||
526 | target/arm/iriver/ifp7xx/backlight-ifp7xx.c | ||
527 | target/arm/iriver/ifp7xx/button-ifp7xx.c | ||
528 | target/arm/iriver/ifp7xx/usb-ifp7xx.c | ||
529 | #endif | ||
530 | #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) | |||
71 | or_b(0x40, &PADRH); /* drive it high */ | 71 | or_b(0x40, &PADRH); /* drive it high */ |
72 | #elif CONFIG_BACKLIGHT == BL_GMINI | 72 | #elif CONFIG_BACKLIGHT == BL_GMINI |
73 | P1 |= 0x10; | 73 | P1 |= 0x10; |
74 | #elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX | ||
75 | GPIO3_SET = 1; | ||
76 | #endif | 74 | #endif |
77 | } | 75 | } |
78 | 76 | ||
@@ -87,8 +85,6 @@ static inline void __backlight_off(void) | |||
87 | and_b(~0x40, &PADRH); /* drive it low */ | 85 | and_b(~0x40, &PADRH); /* drive it low */ |
88 | #elif CONFIG_BACKLIGHT == BL_GMINI | 86 | #elif CONFIG_BACKLIGHT == BL_GMINI |
89 | P1 &= ~0x10; | 87 | P1 &= ~0x10; |
90 | #elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX | ||
91 | GPIO3_CLR = 1; | ||
92 | #endif | 88 | #endif |
93 | } | 89 | } |
94 | #endif | 90 | #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) | |||
155 | sleep(2); /* Ensure valid readings when adc_init returns */ | 155 | sleep(2); /* Ensure valid readings when adc_init returns */ |
156 | } | 156 | } |
157 | 157 | ||
158 | #elif CONFIG_CPU == PNX0101 | ||
159 | |||
160 | static unsigned short adcdata[NUM_ADC_CHANNELS]; | ||
161 | |||
162 | unsigned short adc_read(int channel) | ||
163 | { | ||
164 | return adcdata[channel]; | ||
165 | } | ||
166 | |||
167 | static void adc_tick(void) | ||
168 | { | ||
169 | if (ADCST & 0x10) { | ||
170 | adcdata[0] = ADCCH0 & 0x3ff; | ||
171 | adcdata[1] = ADCCH1 & 0x3ff; | ||
172 | adcdata[2] = ADCCH2 & 0x3ff; | ||
173 | adcdata[3] = ADCCH3 & 0x3ff; | ||
174 | adcdata[4] = ADCCH4 & 0x3ff; | ||
175 | ADCST = 0xa; | ||
176 | } | ||
177 | } | ||
178 | |||
179 | void adc_init(void) | ||
180 | { | ||
181 | ADCR24 = 0xaaaaa; | ||
182 | ADCR28 = 0; | ||
183 | ADCST = 2; | ||
184 | ADCST = 0xa; | ||
185 | |||
186 | while (!(ADCST & 0x10)); | ||
187 | adc_tick(); | ||
188 | |||
189 | tick_add_task(adc_tick); | ||
190 | } | ||
191 | |||
192 | #endif | 158 | #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; | |||
75 | #define REPEAT_INTERVAL_FINISH 5 | 75 | #define REPEAT_INTERVAL_FINISH 5 |
76 | 76 | ||
77 | /* the power-off button and number of repeated keys before shutting off */ | 77 | /* the power-off button and number of repeated keys before shutting off */ |
78 | #if (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) | 78 | #if !defined(TARGET_TREE) |
79 | #define POWEROFF_BUTTON BUTTON_PLAY | ||
80 | #define POWEROFF_COUNT 40 | ||
81 | #elif !defined(TARGET_TREE) | ||
82 | #define POWEROFF_BUTTON BUTTON_OFF | 79 | #define POWEROFF_BUTTON BUTTON_OFF |
83 | #define POWEROFF_COUNT 10 | 80 | #define POWEROFF_COUNT 10 |
84 | #endif | 81 | #endif |
@@ -506,46 +503,6 @@ static int button_read(void) | |||
506 | || (CONFIG_KEYPAD == IRIVER_H300_PAD) | 503 | || (CONFIG_KEYPAD == IRIVER_H300_PAD) |
507 | btn = button_read_device(); /* temp untill TARGET_TREE is defined */ | 504 | btn = button_read_device(); /* temp untill TARGET_TREE is defined */ |
508 | 505 | ||
509 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
510 | static bool hold_button = false; | ||
511 | bool hold_button_old; | ||
512 | |||
513 | /* normal buttons */ | ||
514 | hold_button_old = hold_button; | ||
515 | hold_button = button_hold(); | ||
516 | |||
517 | if (hold_button != hold_button_old) | ||
518 | backlight_hold_changed(hold_button); | ||
519 | |||
520 | if (!button_hold()) | ||
521 | { | ||
522 | data = adc_read(ADC_BUTTONS); | ||
523 | if (data < 0x35c) | ||
524 | { | ||
525 | if (data < 0x151) | ||
526 | if (data < 0xc7) | ||
527 | if (data < 0x41) | ||
528 | btn = BUTTON_LEFT; | ||
529 | else | ||
530 | btn = BUTTON_RIGHT; | ||
531 | else | ||
532 | btn = BUTTON_SELECT; | ||
533 | else | ||
534 | if (data < 0x268) | ||
535 | if (data < 0x1d7) | ||
536 | btn = BUTTON_UP; | ||
537 | else | ||
538 | btn = BUTTON_DOWN; | ||
539 | else | ||
540 | if (data < 0x2f9) | ||
541 | btn = BUTTON_EQ; | ||
542 | else | ||
543 | btn = BUTTON_MODE; | ||
544 | } | ||
545 | |||
546 | if (adc_read(ADC_BUTTON_PLAY) < 0x64) | ||
547 | btn |= BUTTON_PLAY; | ||
548 | } | ||
549 | 506 | ||
550 | #elif CONFIG_KEYPAD == RECORDER_PAD | 507 | #elif CONFIG_KEYPAD == RECORDER_PAD |
551 | #ifndef HAVE_FMADC | 508 | #ifndef HAVE_FMADC |
@@ -703,12 +660,6 @@ static int button_read(void) | |||
703 | return retval; | 660 | return retval; |
704 | } | 661 | } |
705 | 662 | ||
706 | #if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
707 | bool button_hold(void) | ||
708 | { | ||
709 | return (GPIO5_READ & 4) ? false : true; | ||
710 | } | ||
711 | #endif | ||
712 | 663 | ||
713 | int button_status(void) | 664 | int button_status(void) |
714 | { | 665 | { |
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) | |||
144 | P1 |= 0x08; | 144 | P1 |= 0x08; |
145 | else | 145 | else |
146 | P1 &= ~0x08; | 146 | P1 &= ~0x08; |
147 | #elif CONFIG_CPU == PNX0101 | ||
148 | /* no ide controller */ | ||
149 | #elif defined(TOSHIBA_GIGABEAT_F) | 147 | #elif defined(TOSHIBA_GIGABEAT_F) |
150 | /* Gigabeat TODO */ | 148 | /* Gigabeat TODO */ |
151 | #else /* SH1 based archos */ | 149 | #else /* SH1 based archos */ |
@@ -222,10 +220,7 @@ bool ide_powered(void) | |||
222 | void power_off(void) | 220 | void power_off(void) |
223 | { | 221 | { |
224 | set_irq_level(HIGHEST_IRQ_LEVEL); | 222 | set_irq_level(HIGHEST_IRQ_LEVEL); |
225 | #if CONFIG_CPU == PNX0101 | 223 | #if defined(GMINI_ARCH) |
226 | GPIO1_CLR = 1 << 16; | ||
227 | GPIO2_SET = 1; | ||
228 | #elif defined(GMINI_ARCH) | ||
229 | P1 &= ~1; | 224 | P1 &= ~1; |
230 | P1CON &= ~1; | 225 | P1CON &= ~1; |
231 | #elif defined(TOSHIBA_GIGABEAT_F) | 226 | #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 @@ | |||
24 | #ifdef TARGET_TREE | 24 | #ifdef TARGET_TREE |
25 | #include "adc-target.h" | 25 | #include "adc-target.h" |
26 | 26 | ||
27 | #elif defined(IRIVER_IFP7XX) | ||
28 | |||
29 | #define NUM_ADC_CHANNELS 5 | ||
30 | |||
31 | #define ADC_BUTTONS 0 | ||
32 | #define ADC_BATTERY 1 | ||
33 | #define ADC_BUTTON_PLAY 2 | ||
34 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ | ||
35 | |||
36 | #else | 27 | #else |
37 | 28 | ||
38 | #define NUM_ADC_CHANNELS 8 | 29 | #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 @@ | |||
26 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | 26 | (CONFIG_KEYPAD == IRIVER_H300_PAD) |
27 | #define HAS_BUTTON_HOLD | 27 | #define HAS_BUTTON_HOLD |
28 | #define HAS_REMOTE_BUTTON_HOLD | 28 | #define HAS_REMOTE_BUTTON_HOLD |
29 | #elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) | ||
30 | #define HAS_BUTTON_HOLD | ||
31 | #endif | 29 | #endif |
32 | extern struct event_queue button_queue; | 30 | extern struct event_queue button_queue; |
33 | 31 | ||
@@ -173,26 +171,6 @@ void wheel_send_events(bool send); | |||
173 | 171 | ||
174 | #define BUTTON_REMOTE 0 | 172 | #define BUTTON_REMOTE 0 |
175 | 173 | ||
176 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
177 | |||
178 | /* iriver IFP7XX specific button codes */ | ||
179 | |||
180 | #define BUTTON_PLAY 0x00000001 | ||
181 | #define BUTTON_SELECT 0x00000002 | ||
182 | |||
183 | #define BUTTON_LEFT 0x00000004 | ||
184 | #define BUTTON_RIGHT 0x00000008 | ||
185 | #define BUTTON_UP 0x00000010 | ||
186 | #define BUTTON_DOWN 0x00000020 | ||
187 | |||
188 | #define BUTTON_MODE 0x00000040 | ||
189 | #define BUTTON_EQ 0x00000080 | ||
190 | |||
191 | #define BUTTON_MAIN (BUTTON_PLAY|BUTTON_SELECT\ | ||
192 | |BUTTON_LEFT|BUTTON_RIGHT|BUTTON_UP|BUTTON_DOWN\ | ||
193 | |BUTTON_MODE|BUTTON_EQ) | ||
194 | |||
195 | #define BUTTON_REMOTE 0 | ||
196 | 174 | ||
197 | #elif 0 | 175 | #elif 0 |
198 | 176 | ||
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 @@ | |||
1 | /* | 1 | /* |
2 | * This config file is for iriver iFP-799 | 2 | * This config file is for iriver iFP-799 |
3 | */ | 3 | */ |
4 | #define TARGET_TREE | ||
5 | |||
4 | #define IRIVER_IFP7XX_SERIES 1 | 6 | #define IRIVER_IFP7XX_SERIES 1 |
5 | 7 | ||
6 | /* For Rolo and boot loader */ | 8 | /* For Rolo and boot loader */ |
@@ -91,6 +93,10 @@ | |||
91 | /* Virtual LED (icon) */ | 93 | /* Virtual LED (icon) */ |
92 | #define CONFIG_LED LED_VIRTUAL | 94 | #define CONFIG_LED LED_VIRTUAL |
93 | 95 | ||
96 | #define MIN_CONTRAST_SETTING 5 | ||
97 | #define MAX_CONTRAST_SETTING 63 | ||
98 | #define DEFAULT_CONTRAST_SETTING 40 | ||
99 | |||
94 | /* Define this if you have adjustable CPU frequency */ | 100 | /* Define this if you have adjustable CPU frequency */ |
95 | //#define HAVE_ADJUSTABLE_CPU_FREQ | 101 | //#define HAVE_ADJUSTABLE_CPU_FREQ |
96 | 102 | ||