diff options
author | Robert Keevil <rkeevil+rockbox@gmail.com> | 2009-07-13 21:09:39 +0000 |
---|---|---|
committer | Robert Keevil <rkeevil+rockbox@gmail.com> | 2009-07-13 21:09:39 +0000 |
commit | eea149bd1399e749a6dae8b3a6fe5ff076ead985 (patch) | |
tree | a131998421757859c25c567c657223ece0430c31 /firmware | |
parent | 5f6998bde9b8a7a7aa61df602202ff41feb13ea1 (diff) | |
download | rockbox-eea149bd1399e749a6dae8b3a6fe5ff076ead985.tar.gz rockbox-eea149bd1399e749a6dae8b3a6fe5ff076ead985.zip |
FS#10436 - add the Sansa View to the build system. The bootloader builds but doesn't do anything useful yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21848 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/SOURCES | 19 | ||||
-rw-r--r-- | firmware/export/config-view.h | 207 | ||||
-rw-r--r-- | firmware/export/config.h | 11 | ||||
-rw-r--r-- | firmware/export/cpu.h | 3 | ||||
-rw-r--r-- | firmware/export/pp6100.h | 31 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/boot.lds | 5 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/adc-view.c | 33 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/backlight-target.h | 34 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/backlight-view.c | 50 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/button-target.h | 62 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/button-view.c | 37 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/i2c-view.c | 26 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/lcd-view.c | 428 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/power-view.c | 28 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/powermgmt-view.c | 55 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-view/usb-view.c | 36 |
16 files changed, 1062 insertions, 3 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 0ad0d5ebfe..50c57e3323 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -561,6 +561,25 @@ target/arm/sandisk/audio-c200_e200.c | |||
561 | #endif /* SIMULATOR */ | 561 | #endif /* SIMULATOR */ |
562 | #endif /* SANSA_C200 */ | 562 | #endif /* SANSA_C200 */ |
563 | 563 | ||
564 | #ifdef SANSA_VIEW | ||
565 | #ifndef SIMULATOR | ||
566 | /* target/arm/ascodec-pp.c */ | ||
567 | target/arm/ata-sd-pp.c | ||
568 | target/arm/lcd-as-memframe.S | ||
569 | target/arm/i2s-pp.c | ||
570 | /* target/arm/usb-fw-pp502x.c */ | ||
571 | target/arm/sandisk/sansa-view/backlight-view.c | ||
572 | target/arm/sandisk/sansa-view/adc-view.c | ||
573 | target/arm/sandisk/sansa-view/power-view.c | ||
574 | target/arm/sandisk/sansa-view/lcd-view.c | ||
575 | target/arm/sandisk/sansa-view/button-view.c | ||
576 | target/arm/sandisk/sansa-view/powermgmt-view.c | ||
577 | #ifndef BOOTLOADER | ||
578 | /* target/arm/sandisk/audio-view.c */ | ||
579 | #endif /* BOOTLOADER */ | ||
580 | #endif /* SIMULATOR */ | ||
581 | #endif /* SANSA_VIEW */ | ||
582 | |||
564 | #ifdef PHILIPS_SA9200 | 583 | #ifdef PHILIPS_SA9200 |
565 | #ifndef SIMULATOR | 584 | #ifndef SIMULATOR |
566 | #ifndef BOOTLOADER | 585 | #ifndef BOOTLOADER |
diff --git a/firmware/export/config-view.h b/firmware/export/config-view.h new file mode 100644 index 0000000000..81706844d2 --- /dev/null +++ b/firmware/export/config-view.h | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * This config file is for the Sandisk Sansa View | ||
3 | */ | ||
4 | #define TARGET_TREE /* this target is using the target tree system */ | ||
5 | |||
6 | /* For Rolo and boot loader */ | ||
7 | #define MODEL_NUMBER 63 | ||
8 | #define MODEL_NAME "Sandisk View" | ||
9 | |||
10 | #define HW_SAMPR_CAPS (SAMPR_CAP_44) | ||
11 | |||
12 | /* define this if you have recording possibility */ | ||
13 | /* #define HAVE_RECORDING */ | ||
14 | |||
15 | #define REC_SAMPR_CAPS (SAMPR_CAP_22) | ||
16 | #define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ | ||
17 | #define REC_SAMPR_DEFAULT SAMPR_22 | ||
18 | |||
19 | /* Define bitmask of input sources - recordable bitmask can be defined | ||
20 | explicitly if different */ | ||
21 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) | ||
22 | |||
23 | /* define this if you have a bitmap LCD display */ | ||
24 | #define HAVE_LCD_BITMAP | ||
25 | |||
26 | /* define this if you have a colour LCD */ | ||
27 | #define HAVE_LCD_COLOR | ||
28 | |||
29 | /* define this if you want album art for this target */ | ||
30 | #define HAVE_ALBUMART | ||
31 | |||
32 | /* define this to enable bitmap scaling */ | ||
33 | #define HAVE_BMP_SCALING | ||
34 | |||
35 | /* define this to enable JPEG decoding */ | ||
36 | #define HAVE_JPEG | ||
37 | |||
38 | /* define this if you have a light associated with the buttons */ | ||
39 | #define HAVE_BUTTON_LIGHT | ||
40 | |||
41 | /* define this if you have access to the quickscreen */ | ||
42 | #define HAVE_QUICKSCREEN | ||
43 | |||
44 | /* define this if you have access to the pitchscreen */ | ||
45 | #define HAVE_PITCHSCREEN | ||
46 | |||
47 | /* define this if you would like tagcache to build on this target */ | ||
48 | #define HAVE_TAGCACHE | ||
49 | |||
50 | /* LCD dimensions */ | ||
51 | #define LCD_WIDTH 240 | ||
52 | #define LCD_HEIGHT 320 | ||
53 | #define LCD_DEPTH 16 /* 65536 colours */ | ||
54 | #define LCD_PIXELFORMAT RGB565 /* rgb565 */ | ||
55 | |||
56 | #ifndef BOOTLOADER | ||
57 | /* define this if you have LCD enable function */ | ||
58 | /* #define HAVE_LCD_ENABLE */ | ||
59 | |||
60 | /* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE | ||
61 | should be defined as well. */ | ||
62 | /* #define HAVE_LCD_SLEEP */ | ||
63 | /* #define HAVE_LCD_SLEEP_SETTING */ | ||
64 | #endif | ||
65 | |||
66 | /* define this if you can flip your LCD */ | ||
67 | #define HAVE_LCD_FLIP | ||
68 | |||
69 | /* define this if you can invert the colours on your LCD */ | ||
70 | #define HAVE_LCD_INVERT | ||
71 | |||
72 | /* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */ | ||
73 | |||
74 | /* The only difference is that the power/hold is on the left instead of right on Fuze */ | ||
75 | #define CONFIG_KEYPAD SANSA_FUZE_PAD | ||
76 | |||
77 | /* Define this if you do software codec */ | ||
78 | #define CONFIG_CODEC SWCODEC | ||
79 | /* There is no hardware tone control */ | ||
80 | #define HAVE_SW_TONE_CONTROLS | ||
81 | |||
82 | /* define this if you have a real-time clock */ | ||
83 | #ifndef BOOTLOADER | ||
84 | /* #define CONFIG_RTC RTC_ */ | ||
85 | #endif | ||
86 | |||
87 | /* Define this if you have a software controlled poweroff */ | ||
88 | #define HAVE_SW_POWEROFF | ||
89 | |||
90 | /* Required for MicroSD cards */ | ||
91 | #define HAVE_FAT16SUPPORT | ||
92 | |||
93 | /* The number of bytes reserved for loadable codecs */ | ||
94 | #define CODEC_SIZE 0x100000 | ||
95 | |||
96 | /* The number of bytes reserved for loadable plugins */ | ||
97 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
98 | |||
99 | #define AB_REPEAT_ENABLE 1 | ||
100 | |||
101 | /* Define this for LCD backlight available */ | ||
102 | #define HAVE_BACKLIGHT | ||
103 | /* #define HAVE_BACKLIGHT_BRIGHTNESS */ | ||
104 | |||
105 | /* define this if the unit uses a scrollwheel for navigation */ | ||
106 | #define HAVE_SCROLLWHEEL | ||
107 | /* define to activate advanced wheel acceleration code */ | ||
108 | #define HAVE_WHEEL_ACCELERATION | ||
109 | /* define from which rotation speed [degree/sec] on the acceleration starts */ | ||
110 | #define WHEEL_ACCEL_START 540 | ||
111 | /* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */ | ||
112 | #define WHEEL_ACCELERATION 1 | ||
113 | |||
114 | /* define this if you have a flash memory storage */ | ||
115 | #define HAVE_FLASH_STORAGE | ||
116 | |||
117 | /* define this if the flash memory uses the SecureDigital Memory Card protocol */ | ||
118 | #define CONFIG_STORAGE STORAGE_SD | ||
119 | |||
120 | #define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */ | ||
121 | #define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */ | ||
122 | #define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */ | ||
123 | #define BATTERY_CAPACITY_INC 0 /* capacity increment */ | ||
124 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
125 | |||
126 | /* Charging implemented in a target-specific algorithm */ | ||
127 | #define CONFIG_CHARGING CHARGING_SIMPLE | ||
128 | #define HAVE_POWEROFF_WHILE_CHARGING | ||
129 | |||
130 | /* define current usage levels */ | ||
131 | #define CURRENT_NORMAL 30 /* Toni's measurements in Nov 2008 */ | ||
132 | #define CURRENT_BACKLIGHT 40 /* Screen is about 20, blue LEDs are another 20, so 40 if both */ | ||
133 | #define CURRENT_RECORD 30 /* flash player, so this is just unboosted current*/ | ||
134 | |||
135 | /* define this if the unit can be powered or charged via USB */ | ||
136 | #define HAVE_USB_POWER | ||
137 | |||
138 | /** Non-simulator section **/ | ||
139 | #ifndef SIMULATOR | ||
140 | |||
141 | /* Define this if you have a PortalPlayer PP5024 */ | ||
142 | #define CONFIG_CPU PP6100 | ||
143 | |||
144 | /* Define this if you want to use the PP5024 i2c interface */ | ||
145 | #define CONFIG_I2C I2C_PP5024 | ||
146 | |||
147 | /* define this if the hardware can be powered off while charging */ | ||
148 | /* Sansa can't be powered off while charging */ | ||
149 | /* #define HAVE_POWEROFF_WHILE_CHARGING */ | ||
150 | |||
151 | /* The start address index for ROM builds */ | ||
152 | #define ROM_START 0x00000000 | ||
153 | |||
154 | /* Define this to the CPU frequency */ | ||
155 | #define CPU_FREQ 250000000 | ||
156 | |||
157 | /* Type of LCD TODO: hopefully the same as the x5 but check this*/ | ||
158 | #define CONFIG_LCD LCD_VIEW | ||
159 | |||
160 | /* Offset ( in the firmware file's header ) to the file CRC and data. These are | ||
161 | only used when loading the old format rockbox.e200 file | ||
162 | Required for bootloader/common.c to compile */ | ||
163 | #define FIRMWARE_OFFSET_FILE_CRC 0x0 | ||
164 | #define FIRMWARE_OFFSET_FILE_DATA 0x8 | ||
165 | |||
166 | #ifndef BOOTLOADER | ||
167 | #define HAVE_MULTIVOLUME | ||
168 | #define HAVE_HOTSWAP | ||
169 | #endif | ||
170 | |||
171 | /* USB On-the-go */ | ||
172 | /* #define CONFIG_USBOTG USBOTG_ARC */ | ||
173 | |||
174 | /* enable these for the experimental usb stack */ | ||
175 | #define HAVE_USBSTACK | ||
176 | #define USE_ROCKBOX_USB | ||
177 | #define USB_VENDOR_ID 0x0781 | ||
178 | #define USB_PRODUCT_ID 0x74b1 | ||
179 | |||
180 | /* Virtual LED (icon) */ | ||
181 | #define CONFIG_LED LED_VIRTUAL | ||
182 | |||
183 | /* Define this if you have adjustable CPU frequency */ | ||
184 | /* #define HAVE_ADJUSTABLE_CPU_FREQ */ | ||
185 | |||
186 | #define MI4_FORMAT | ||
187 | #define BOOTFILE_EXT "mi4" | ||
188 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
189 | #define BOOTDIR "/.rockbox" | ||
190 | |||
191 | #define ICODE_ATTR_TREMOR_NOT_MDCT | ||
192 | |||
193 | #define INCLUDE_TIMEOUT_API | ||
194 | |||
195 | #endif /* SIMULATOR */ | ||
196 | |||
197 | /** Port-specific settings **/ | ||
198 | |||
199 | /* Main LCD backlight brightness range and defaults */ | ||
200 | #define MIN_BRIGHTNESS_SETTING 1 | ||
201 | #define MAX_BRIGHTNESS_SETTING 12 | ||
202 | #define DEFAULT_BRIGHTNESS_SETTING 6 | ||
203 | |||
204 | /* Default recording levels */ | ||
205 | #define DEFAULT_REC_MIC_GAIN 23 | ||
206 | #define DEFAULT_REC_LEFT_GAIN 23 | ||
207 | #define DEFAULT_REC_RIGHT_GAIN 23 | ||
diff --git a/firmware/export/config.h b/firmware/export/config.h index 22d7090f96..aa3f4f8d40 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -57,6 +57,7 @@ | |||
57 | #define PP5020 5020 | 57 | #define PP5020 5020 |
58 | #define PP5022 5022 | 58 | #define PP5022 5022 |
59 | #define PP5024 5024 | 59 | #define PP5024 5024 |
60 | #define PP6100 6100 | ||
60 | #define PNX0101 101 | 61 | #define PNX0101 101 |
61 | #define S3C2440 2440 | 62 | #define S3C2440 2440 |
62 | #define DSC25 25 | 63 | #define DSC25 25 |
@@ -188,7 +189,8 @@ | |||
188 | #define LCD_FUZE 32 /* as used by the Sansa Fuze */ | 189 | #define LCD_FUZE 32 /* as used by the Sansa Fuze */ |
189 | #define LCD_LYRE_PROTO1 33 /* as used by the Lyre */ | 190 | #define LCD_LYRE_PROTO1 33 /* as used by the Lyre */ |
190 | #define LCD_YH925 34 /* as used by Samsung YH-925 (similar to the H10 20GB) */ | 191 | #define LCD_YH925 34 /* as used by Samsung YH-925 (similar to the H10 20GB) */ |
191 | 192 | #define LCD_VIEW 35 /* as used by the Sansa View */ | |
193 | |||
192 | /* LCD_PIXELFORMAT */ | 194 | /* LCD_PIXELFORMAT */ |
193 | #define HORIZONTAL_PACKING 1 | 195 | #define HORIZONTAL_PACKING 1 |
194 | #define VERTICAL_PACKING 2 | 196 | #define VERTICAL_PACKING 2 |
@@ -368,6 +370,8 @@ Lyre prototype 1*/ | |||
368 | #include "config-fuze.h" | 370 | #include "config-fuze.h" |
369 | #elif defined(SANSA_C200V2) | 371 | #elif defined(SANSA_C200V2) |
370 | #include "config-c200v2.h" | 372 | #include "config-c200v2.h" |
373 | #elif defined(SANSA_VIEW) | ||
374 | #include "config-view.h" | ||
371 | #elif defined(LYRE_PROTO1) | 375 | #elif defined(LYRE_PROTO1) |
372 | #include "config-lyre_proto1.h" | 376 | #include "config-lyre_proto1.h" |
373 | #elif defined(SAMSUNG_YH820) | 377 | #elif defined(SAMSUNG_YH820) |
@@ -576,7 +580,8 @@ Lyre prototype 1*/ | |||
576 | /* define for all cpus from PP family */ | 580 | /* define for all cpus from PP family */ |
577 | #if (CONFIG_CPU == PP5002) | 581 | #if (CONFIG_CPU == PP5002) |
578 | #define CPU_PP | 582 | #define CPU_PP |
579 | #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) | 583 | #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) \ |
584 | || (CONFIG_CPU == PP5024) || (CONFIG_CPU == PP6100) | ||
580 | #define CPU_PP | 585 | #define CPU_PP |
581 | #define CPU_PP502x | 586 | #define CPU_PP502x |
582 | #endif | 587 | #endif |
@@ -682,7 +687,7 @@ Lyre prototype 1*/ | |||
682 | 687 | ||
683 | /* Change this if you want to build a single-core firmware for a multicore | 688 | /* Change this if you want to build a single-core firmware for a multicore |
684 | * target for debugging */ | 689 | * target for debugging */ |
685 | #if defined(BOOTLOADER) | 690 | #if defined(BOOTLOADER) || (CONFIG_CPU == PP6100) |
686 | #define FORCE_SINGLE_CORE | 691 | #define FORCE_SINGLE_CORE |
687 | #endif | 692 | #endif |
688 | 693 | ||
diff --git a/firmware/export/cpu.h b/firmware/export/cpu.h index 4623f57004..6041b388b4 100644 --- a/firmware/export/cpu.h +++ b/firmware/export/cpu.h | |||
@@ -38,6 +38,9 @@ | |||
38 | #if CONFIG_CPU == PP5024 | 38 | #if CONFIG_CPU == PP5024 |
39 | #include "pp5024.h" | 39 | #include "pp5024.h" |
40 | #endif | 40 | #endif |
41 | #if CONFIG_CPU == PP6100 | ||
42 | #include "pp6100.h" | ||
43 | #endif | ||
41 | #if CONFIG_CPU == PNX0101 | 44 | #if CONFIG_CPU == PNX0101 |
42 | #include "pnx0101.h" | 45 | #include "pnx0101.h" |
43 | #endif | 46 | #endif |
diff --git a/firmware/export/pp6100.h b/firmware/export/pp6100.h new file mode 100644 index 0000000000..0894affdd2 --- /dev/null +++ b/firmware/export/pp6100.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef __PP6100_H__ | ||
2 | #define __PP6100_H__ | ||
3 | /*************************************************************************** | ||
4 | * __________ __ ___. | ||
5 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
6 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
7 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
8 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
9 | * \/ \/ \/ \/ \/ | ||
10 | * $Id$ | ||
11 | * | ||
12 | * Copyright (C) 2009 by Robert Keevil | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version 2 | ||
17 | * of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | * KIND, either express or implied. | ||
21 | * | ||
22 | ****************************************************************************/ | ||
23 | |||
24 | /* We believe this is quite similar to the 5020 and for now we just use that | ||
25 | completely and redefine any minor differences */ | ||
26 | #include "pp5020.h" | ||
27 | |||
28 | #undef DRAM_START | ||
29 | #define DRAM_START 0x10f00000 | ||
30 | |||
31 | #endif | ||
diff --git a/firmware/target/arm/sandisk/boot.lds b/firmware/target/arm/sandisk/boot.lds index f2178651cd..622695f5b6 100644 --- a/firmware/target/arm/sandisk/boot.lds +++ b/firmware/target/arm/sandisk/boot.lds | |||
@@ -7,7 +7,12 @@ STARTUP(target/arm/crt0-pp-bl.o) | |||
7 | 7 | ||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | 8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) |
9 | 9 | ||
10 | #ifdef SANSA_VIEW | ||
11 | #define DRAMORIG 0x10f00000 | ||
12 | #else | ||
10 | #define DRAMORIG 0x10000000 | 13 | #define DRAMORIG 0x10000000 |
14 | #endif | ||
15 | |||
11 | #ifndef IRAMORIG | 16 | #ifndef IRAMORIG |
12 | #define IRAMORIG 0x40000000 | 17 | #define IRAMORIG 0x40000000 |
13 | #endif | 18 | #endif |
diff --git a/firmware/target/arm/sandisk/sansa-view/adc-view.c b/firmware/target/arm/sandisk/sansa-view/adc-view.c new file mode 100644 index 0000000000..deb8de2471 --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/adc-view.c | |||
@@ -0,0 +1,33 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Robert Keevil | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "adc-target.h" | ||
23 | |||
24 | void adc_init(void) | ||
25 | { | ||
26 | } | ||
27 | |||
28 | /* Called to get the recent ADC reading */ | ||
29 | inline unsigned short adc_read(int channel) | ||
30 | { | ||
31 | (void)channel; | ||
32 | return 0; | ||
33 | } | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-target.h b/firmware/target/arm/sandisk/sansa-view/backlight-target.h new file mode 100644 index 0000000000..a2282ba316 --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/backlight-target.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Robert Keevil | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef BACKLIGHT_TARGET_H | ||
23 | #define BACKLIGHT_TARGET_H | ||
24 | |||
25 | #include <stdbool.h> | ||
26 | |||
27 | #define _backlight_init() true | ||
28 | void _backlight_on(void); | ||
29 | void _backlight_off(void); | ||
30 | |||
31 | void _buttonlight_on(void); | ||
32 | void _buttonlight_off(void); | ||
33 | |||
34 | #endif | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-view.c b/firmware/target/arm/sandisk/sansa-view/backlight-view.c new file mode 100644 index 0000000000..20932c8607 --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/backlight-view.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Robert Keevil | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | #include "backlight-target.h" | ||
23 | #include "system.h" | ||
24 | #include "lcd.h" | ||
25 | #include "backlight.h" | ||
26 | |||
27 | void _backlight_set_brightness(int brightness) | ||
28 | { | ||
29 | (void)brightness; | ||
30 | } | ||
31 | |||
32 | void _backlight_off(void) | ||
33 | { | ||
34 | GPIO_SET_BITWISE(GPIOD_ENABLE, 1<<8); | ||
35 | } | ||
36 | |||
37 | void _backlight_on(void) | ||
38 | { | ||
39 | GPIO_SET_BITWISE(GPIOD_ENABLE, 1); | ||
40 | } | ||
41 | |||
42 | void _buttonlight_on(void) | ||
43 | { | ||
44 | GPIO_CLEAR_BITWISE(GPIOA_ENABLE, 0x2); | ||
45 | } | ||
46 | |||
47 | void _buttonlight_off(void) | ||
48 | { | ||
49 | GPIO_SET_BITWISE(GPIOA_ENABLE, 0x2); | ||
50 | } | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/button-target.h b/firmware/target/arm/sandisk/sansa-view/button-target.h new file mode 100644 index 0000000000..18931da700 --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/button-target.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Barry Wardell | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef _BUTTON_TARGET_H_ | ||
23 | #define _BUTTON_TARGET_H_ | ||
24 | |||
25 | #include <stdbool.h> | ||
26 | #include "config.h" | ||
27 | |||
28 | #define HAS_BUTTON_HOLD | ||
29 | |||
30 | void button_init_device(void); | ||
31 | bool button_hold(void); | ||
32 | int button_read_device(void); | ||
33 | /* Sandisk Sansa View button codes */ | ||
34 | |||
35 | /* Main unit's buttons */ | ||
36 | #define BUTTON_HOME 0x00000001 | ||
37 | |||
38 | #define BUTTON_DOWN 0x00000002 | ||
39 | #define BUTTON_RIGHT 0x00000004 | ||
40 | |||
41 | #define BUTTON_LEFT 0x00000008 | ||
42 | #define BUTTON_SELECT 0x00000010 | ||
43 | #define BUTTON_UP 0x00000020 | ||
44 | #define BUTTON_POWER 0x00000040 | ||
45 | |||
46 | #define BUTTON_SCROLL_BACK 0x00000080 | ||
47 | #define BUTTON_SCROLL_FWD 0x00000100 | ||
48 | |||
49 | #define BUTTON_HOLD 0x00000400 | ||
50 | |||
51 | #define BUTTON_MAIN (BUTTON_HOME|BUTTON_DOWN|BUTTON_RIGHT|BUTTON_LEFT \ | ||
52 | |BUTTON_SELECT|BUTTON_UP|BUTTON_POWER \ | ||
53 | |BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD \ | ||
54 | |BUTTON_HOLD) | ||
55 | |||
56 | /* No Remote control */ | ||
57 | #define BUTTON_REMOTE 0 | ||
58 | |||
59 | #define POWEROFF_BUTTON BUTTON_POWER | ||
60 | #define POWEROFF_COUNT 10 | ||
61 | |||
62 | #endif /* _BUTTON_TARGET_H_ */ | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/button-view.c b/firmware/target/arm/sandisk/sansa-view/button-view.c new file mode 100644 index 0000000000..e1a0bbbcaf --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/button-view.c | |||
@@ -0,0 +1,37 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Robert Keevil | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "button.h" | ||
23 | |||
24 | void button_init_device(void) | ||
25 | { | ||
26 | |||
27 | } | ||
28 | |||
29 | bool button_hold(void) | ||
30 | { | ||
31 | return false; | ||
32 | } | ||
33 | |||
34 | int button_read_device(void) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/i2c-view.c b/firmware/target/arm/sandisk/sansa-view/i2c-view.c new file mode 100644 index 0000000000..a8ded7d2bf --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/i2c-view.c | |||
@@ -0,0 +1,26 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Robert Keevil | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "i2c.h" | ||
23 | |||
24 | void i2c_init(void) | ||
25 | { | ||
26 | } | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/lcd-view.c b/firmware/target/arm/sandisk/sansa-view/lcd-view.c new file mode 100644 index 0000000000..39b0d574eb --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/lcd-view.c | |||
@@ -0,0 +1,428 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Rockbox driver for Sansa View LCDs | ||
11 | * | ||
12 | * Copyright (c) 2009 Robert Keevil | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version 2 | ||
17 | * of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | * KIND, either express or implied. | ||
21 | * | ||
22 | ****************************************************************************/ | ||
23 | #include <string.h> | ||
24 | #include "cpu.h" | ||
25 | #include "system.h" | ||
26 | #include "backlight-target.h" | ||
27 | #include "lcd.h" | ||
28 | |||
29 | #include "bitmaps/rockboxlogo.h" | ||
30 | |||
31 | /* Power and display status */ | ||
32 | static bool power_on = false; /* Is the power turned on? */ | ||
33 | static bool display_on SHAREDBSS_ATTR = false; /* Is the display turned on? */ | ||
34 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; | ||
35 | |||
36 | #define LCD_DATA_OUT_GPIO GPIOH_OUTPUT_VAL | ||
37 | #define LCD_DATA_OUT_PIN 4 | ||
38 | |||
39 | #define LCD_CLOCK_GPIO GPIOH_OUTPUT_VAL | ||
40 | #define LCD_CLOCK_PIN 6 | ||
41 | |||
42 | #define LCD_CS_GPIO GPIOH_OUTPUT_VAL | ||
43 | #define LCD_CS_PIN 7 | ||
44 | |||
45 | #ifdef BOOTLOADER | ||
46 | static void lcd_init_gpio(void) | ||
47 | { | ||
48 | // OF: 0x5CC8 | ||
49 | |||
50 | outl(inl(0x70000010) | 0xFC000000, 0x70000010); | ||
51 | outl(inl(0x70000014) | 0xC300000, 0x70000014); | ||
52 | |||
53 | GPIOE_ENABLE = 0; | ||
54 | /* TODO: check GPIOM exists and isn't just atomic access */ | ||
55 | /* GPIOM_ENABLE &= ~0x3; */ | ||
56 | GPIOJ_ENABLE &= ~0x1a; | ||
57 | GPIOB_ENABLE &= ~0x8; | ||
58 | GPIOH_OUTPUT_VAL |= 0x80; | ||
59 | GPIOH_OUTPUT_EN |= 0x80; | ||
60 | GPIOH_ENABLE |= 0x80; | ||
61 | GPIOH_OUTPUT_VAL |= 0x40; | ||
62 | GPIOH_OUTPUT_EN |= 0x40; | ||
63 | GPIOH_ENABLE |= 0x40; | ||
64 | GPIOH_OUTPUT_VAL |= 0x20; | ||
65 | GPIOH_OUTPUT_EN |= 0x20; | ||
66 | GPIOH_ENABLE |= 0x20; | ||
67 | GPIOH_OUTPUT_VAL |= 0x10; | ||
68 | GPIOH_OUTPUT_EN |= 0x10; | ||
69 | GPIOH_ENABLE |= 0x10; | ||
70 | // GPIOD_OUTOUT_VAL &= ~0x1; //backlight on | ||
71 | // GPIOD_ENABLE |= 0x1; | ||
72 | GPIOB_OUTPUT_VAL |= 0x4; | ||
73 | GPIOB_ENABLE |= 0x4; | ||
74 | GPIOB_OUTPUT_EN |= 0x4; | ||
75 | GPIOG_ENABLE |= 0x8; | ||
76 | GPIOG_OUTPUT_EN &= ~0x8; | ||
77 | |||
78 | // more to add here... | ||
79 | } | ||
80 | #endif | ||
81 | |||
82 | static void lcd_send_msg(unsigned char count, unsigned int data) | ||
83 | { | ||
84 | // OF: 0x645C | ||
85 | int i; | ||
86 | |||
87 | LCD_CLOCK_GPIO |= (1 << LCD_CLOCK_PIN); | ||
88 | LCD_CS_GPIO &= ~(1 << LCD_CS_PIN); | ||
89 | |||
90 | for (i = count - 1; i >= 0; i--) | ||
91 | { | ||
92 | if (data & (1 << count)) | ||
93 | { | ||
94 | // LCD_DATA_OUT_GPIO &= ~(1 << LCD_DATA_OUT_PIN); | ||
95 | LCD_DATA_OUT_GPIO |= (1 << LCD_DATA_OUT_PIN); | ||
96 | } else { | ||
97 | // LCD_DATA_OUT_GPIO |= (1 << LCD_DATA_OUT_PIN); | ||
98 | LCD_DATA_OUT_GPIO &= ~(1 << LCD_DATA_OUT_PIN); | ||
99 | } | ||
100 | LCD_CLOCK_GPIO &= ~(1 << LCD_CLOCK_PIN); | ||
101 | udelay(1); | ||
102 | LCD_CLOCK_GPIO |= (1 << LCD_CLOCK_PIN); | ||
103 | udelay(2); | ||
104 | } | ||
105 | |||
106 | LCD_CS_GPIO |= (1 << LCD_CS_PIN); | ||
107 | LCD_CLOCK_GPIO |= (1 << LCD_CLOCK_PIN); | ||
108 | udelay(1); | ||
109 | } | ||
110 | |||
111 | /* | ||
112 | static void lcd_write_reg(unsigned int reg, unsigned int data) | ||
113 | { | ||
114 | // OF: 0x6278 - referenced from 0x62840 | ||
115 | |||
116 | // So far this function is always called with shift = 0x0 ? | ||
117 | // If so can remove and simplify | ||
118 | |||
119 | unsigned int cmd; | ||
120 | unsigned int shift = 0; | ||
121 | |||
122 | cmd = shift << 0x2; | ||
123 | cmd |= 0x70; | ||
124 | cmd = cmd << 0x10; | ||
125 | cmd |= reg; | ||
126 | lcd_send_msg(0x18, cmd); | ||
127 | |||
128 | cmd = shift << 0x2; | ||
129 | cmd |= 0x72; | ||
130 | cmd = cmd << 0x10; | ||
131 | cmd |= data; | ||
132 | lcd_send_msg(0x18, cmd); | ||
133 | |||
134 | // lcd_send_msg(0x70, reg); | ||
135 | // lcd_send_msg(0x72, data); | ||
136 | } | ||
137 | */ | ||
138 | |||
139 | static void lcd_write_cmd(unsigned int cmd) | ||
140 | { | ||
141 | lcd_send_msg(0x18, (0x700000 | cmd)); | ||
142 | } | ||
143 | |||
144 | static void lcd_write_info(unsigned int data) | ||
145 | { | ||
146 | lcd_send_msg(0x18, (0x720000 | data)); | ||
147 | } | ||
148 | |||
149 | static void lcd_write_reg(unsigned int cmd, unsigned int data) | ||
150 | { | ||
151 | lcd_write_cmd(cmd); | ||
152 | lcd_write_info(data); | ||
153 | } | ||
154 | |||
155 | /* Run the powerup sequence for the driver IC */ | ||
156 | static void lcd_power_on(void) | ||
157 | { | ||
158 | /* OF: 0x5DC0 * | ||
159 | * r2: cmd * | ||
160 | * r3: data */ | ||
161 | lcd_write_reg(0xE5, 0x8000); | ||
162 | lcd_write_reg(0x0, 0x1); | ||
163 | lcd_write_reg(0x1, 0x100); | ||
164 | lcd_write_reg(0x2, 0x700); | ||
165 | lcd_write_reg(0x3, 0x1230); | ||
166 | lcd_write_reg(0x4, 0x0); | ||
167 | lcd_write_reg(0x8, 0x408); | ||
168 | lcd_write_reg(0x9, 0x0); | ||
169 | lcd_write_reg(0xa, 0x0); | ||
170 | lcd_write_reg(0xd, 0x0); | ||
171 | lcd_write_reg(0xf, 0x2); | ||
172 | lcd_write_reg(0x10, 0x0); | ||
173 | lcd_write_reg(0x11, 0x0); | ||
174 | lcd_write_reg(0x12, 0x0); | ||
175 | lcd_write_reg(0x13, 0x0); | ||
176 | sleep(HZ/5); | ||
177 | lcd_write_reg(0x10, 0x17B0); | ||
178 | lcd_write_reg(0x11, 0x7); | ||
179 | sleep(HZ/20); | ||
180 | lcd_write_reg(0x12, 0x13c); | ||
181 | sleep(HZ/20); | ||
182 | |||
183 | // OF: BNE 0x5fb2 | ||
184 | |||
185 | // two different models in use?!? | ||
186 | if (1) | ||
187 | { | ||
188 | lcd_write_reg(0x13, 0x1800); | ||
189 | lcd_write_reg(0x29, 0x13); | ||
190 | sleep(HZ/10); | ||
191 | lcd_write_reg(0x20, 0x0); | ||
192 | lcd_write_reg(0x21, 0x0); | ||
193 | |||
194 | lcd_write_reg(0x30, 0x2); | ||
195 | lcd_write_reg(0x31, 0xF07); // 0x37 option in other controller | ||
196 | lcd_write_reg(0x32, 0x403); // 0x31 option in other controller | ||
197 | lcd_write_reg(0x35, 0x206); | ||
198 | lcd_write_reg(0x36, 0x504); | ||
199 | lcd_write_reg(0x37, 0x707); | ||
200 | lcd_write_reg(0x38, 0x403); | ||
201 | } | ||
202 | else | ||
203 | { | ||
204 | // OF: last func continues, 0x5EFC | ||
205 | lcd_write_reg(0x13, 0x1700); | ||
206 | lcd_write_reg(0x29, 0x10); | ||
207 | sleep(HZ/10); | ||
208 | lcd_write_reg(0x20, 0x0); | ||
209 | lcd_write_reg(0x21, 0x0); | ||
210 | |||
211 | lcd_write_reg(0x30, 0x7); | ||
212 | lcd_write_reg(0x31, 0x403); | ||
213 | lcd_write_reg(0x32, 0x400); | ||
214 | lcd_write_reg(0x35, 0x3); | ||
215 | lcd_write_reg(0x36, 0xF07); | ||
216 | lcd_write_reg(0x37, 0x403); | ||
217 | lcd_write_reg(0x37, 0x106); | ||
218 | } | ||
219 | |||
220 | // OF: b 0x6066 | ||
221 | lcd_write_reg(0x39, 0x7); | ||
222 | lcd_write_reg(0x3c, 0x700); | ||
223 | lcd_write_reg(0x3d, 0x700); | ||
224 | |||
225 | lcd_write_reg(0x50, 0x0); | ||
226 | lcd_write_reg(0x51, 0xef); // 239 - LCD_WIDTH | ||
227 | lcd_write_reg(0x52, 0x0); | ||
228 | lcd_write_reg(0x53, 0x13f); // 319 - LCD_HEIGHT | ||
229 | |||
230 | // OF: b 0x6114 | ||
231 | lcd_write_reg(0x60, 0x2700); | ||
232 | lcd_write_reg(0x61, 0x1); | ||
233 | lcd_write_reg(0x6a, 0x0); | ||
234 | |||
235 | lcd_write_reg(0x80, 0x0); | ||
236 | lcd_write_reg(0x81, 0x0); | ||
237 | lcd_write_reg(0x82, 0x0); | ||
238 | lcd_write_reg(0x83, 0x0); | ||
239 | lcd_write_reg(0x84, 0x0); | ||
240 | lcd_write_reg(0x85, 0x0); | ||
241 | |||
242 | // OF: 0x61A8 | ||
243 | lcd_write_reg(0x90, 0x10); | ||
244 | lcd_write_reg(0x92, 0x0); | ||
245 | lcd_write_reg(0x93, 0x3); | ||
246 | lcd_write_reg(0x95, 0x110); | ||
247 | lcd_write_reg(0x97, 0x0); | ||
248 | lcd_write_reg(0x98, 0x0); | ||
249 | |||
250 | lcd_write_reg(0xc, 0x110); | ||
251 | lcd_write_reg(0x7, 0x173); | ||
252 | sleep(HZ/10); | ||
253 | lcd_write_cmd(0x22); | ||
254 | |||
255 | power_on = true; | ||
256 | } | ||
257 | |||
258 | void unknown01(void) | ||
259 | { | ||
260 | // OF: 0x62C4 | ||
261 | |||
262 | lcd_write_reg(0x10, 0x17B0); | ||
263 | udelay(100); | ||
264 | lcd_write_reg(0x7, 0x173); | ||
265 | } | ||
266 | |||
267 | void unknown02(void) | ||
268 | { | ||
269 | // OF: 0x6308 | ||
270 | |||
271 | lcd_write_reg(0x7, 0x160); | ||
272 | lcd_write_reg(0x10, 0x17B1); | ||
273 | } | ||
274 | |||
275 | void unknown03(void) | ||
276 | { | ||
277 | // OF: 0x6410 | ||
278 | GPIOJ_ENABLE |= 0x2; | ||
279 | GPIOJ_OUTPUT_EN |= 0x2; | ||
280 | GPIOJ_OUTPUT_VAL &= ~0x02; | ||
281 | } | ||
282 | |||
283 | void unknown04(void) | ||
284 | { | ||
285 | // OF: 0x623C | ||
286 | |||
287 | GPIOB_OUTPUT_VAL |= 0x4; | ||
288 | udelay(1000); | ||
289 | GPIOB_OUTPUT_VAL &= ~0x4; | ||
290 | sleep(HZ/10); | ||
291 | GPIOB_OUTPUT_VAL |= 0x4; | ||
292 | udelay(1000); | ||
293 | } | ||
294 | |||
295 | /* Run the display on sequence for the driver IC */ | ||
296 | static void lcd_display_on(void) | ||
297 | { | ||
298 | display_on = true; | ||
299 | } | ||
300 | |||
301 | |||
302 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | ||
303 | bool lcd_active(void) | ||
304 | { | ||
305 | return display_on; | ||
306 | } | ||
307 | |||
308 | /* Turn off visible display operations */ | ||
309 | static void lcd_display_off(void) | ||
310 | { | ||
311 | display_on = false; | ||
312 | } | ||
313 | #endif | ||
314 | |||
315 | void lcd_init_device(void) | ||
316 | { | ||
317 | |||
318 | #ifdef BOOTLOADER /* Bother at all to do this again? */ | ||
319 | //#if 0 | ||
320 | /* Init GPIO ports */ | ||
321 | lcd_init_gpio(); | ||
322 | lcd_power_on(); | ||
323 | lcd_display_on(); | ||
324 | #else | ||
325 | |||
326 | power_on = true; | ||
327 | display_on = true; | ||
328 | |||
329 | lcd_set_invert_display(false); | ||
330 | lcd_set_flip(false); | ||
331 | #endif | ||
332 | } | ||
333 | |||
334 | #if defined(HAVE_LCD_ENABLE) | ||
335 | void lcd_enable(bool on) | ||
336 | { | ||
337 | (void)on; | ||
338 | } | ||
339 | #endif | ||
340 | |||
341 | #if defined(HAVE_LCD_SLEEP) | ||
342 | void lcd_sleep(void) | ||
343 | { | ||
344 | |||
345 | } | ||
346 | #endif | ||
347 | |||
348 | void lcd_update(void) | ||
349 | { | ||
350 | const fb_data *addr; | ||
351 | |||
352 | addr = &lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; | ||
353 | |||
354 | lcd_write_reg(0x20, 0x0); | ||
355 | lcd_write_reg(0x21, 0x0); | ||
356 | |||
357 | int i,j; | ||
358 | for(i=0; i < LCD_HEIGHT; i++) | ||
359 | { | ||
360 | for(j=0; j < LCD_WIDTH; j++) | ||
361 | { | ||
362 | lcd_write_reg(0x22, *addr); | ||
363 | addr++; | ||
364 | } | ||
365 | } | ||
366 | } | ||
367 | |||
368 | /* Update a fraction of the display. */ | ||
369 | void lcd_update_rect(int x, int y, int width, int height) | ||
370 | { | ||
371 | (void)x; | ||
372 | (void)y; | ||
373 | (void)width; | ||
374 | (void)height; | ||
375 | lcd_update(); | ||
376 | } | ||
377 | |||
378 | |||
379 | /*** hardware configuration ***/ | ||
380 | |||
381 | void lcd_set_contrast(int val) | ||
382 | { | ||
383 | (void)val; | ||
384 | } | ||
385 | |||
386 | void lcd_set_invert_display(bool yesno) | ||
387 | { | ||
388 | (void)yesno; | ||
389 | } | ||
390 | |||
391 | /* turn the display upside down (call lcd_update() afterwards) */ | ||
392 | void lcd_set_flip(bool yesno) | ||
393 | { | ||
394 | (void)yesno; | ||
395 | } | ||
396 | |||
397 | /* Blitting functions */ | ||
398 | |||
399 | void lcd_yuv_set_options(unsigned options) | ||
400 | { | ||
401 | lcd_yuv_options = options; | ||
402 | } | ||
403 | |||
404 | /* Line write helper function for lcd_yuv_blit. Write two lines of yuv420. */ | ||
405 | extern void lcd_write_yuv420_lines(fb_data *dst, | ||
406 | unsigned char const * const src[3], | ||
407 | int width, | ||
408 | int stride); | ||
409 | extern void lcd_write_yuv420_lines_odither(fb_data *dst, | ||
410 | unsigned char const * const src[3], | ||
411 | int width, | ||
412 | int stride, | ||
413 | int x_screen, /* To align dither pattern */ | ||
414 | int y_screen); | ||
415 | |||
416 | void lcd_blit_yuv(unsigned char * const src[3], | ||
417 | int src_x, int src_y, int stride, | ||
418 | int x, int y, int width, int height) | ||
419 | { | ||
420 | (void)src; | ||
421 | (void)src_x; | ||
422 | (void)src_y; | ||
423 | (void)stride; | ||
424 | (void)x; | ||
425 | (void)y; | ||
426 | (void)width; | ||
427 | (void)height; | ||
428 | } | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/power-view.c b/firmware/target/arm/sandisk/sansa-view/power-view.c new file mode 100644 index 0000000000..7df7296718 --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/power-view.c | |||
@@ -0,0 +1,28 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Robert Keevil | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | void power_init(void) | ||
23 | { | ||
24 | } | ||
25 | |||
26 | void power_off(void) | ||
27 | { | ||
28 | } | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/powermgmt-view.c b/firmware/target/arm/sandisk/sansa-view/powermgmt-view.c new file mode 100644 index 0000000000..459b60dd45 --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/powermgmt-view.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Robert Keevil | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "config.h" | ||
23 | #include "adc.h" | ||
24 | #include "powermgmt.h" | ||
25 | |||
26 | unsigned int battery_adc_voltage(void) | ||
27 | { | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | /* FIXME - next 4 functions taken from e200 - last 2 will need | ||
32 | to be updated */ | ||
33 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | ||
34 | { | ||
35 | 3400 | ||
36 | }; | ||
37 | |||
38 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | ||
39 | { | ||
40 | 3300 | ||
41 | }; | ||
42 | |||
43 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ | ||
44 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | ||
45 | { | ||
46 | /* Sansa Li Ion 750mAH FIXME */ | ||
47 | { 3300, 3680, 3740, 3760, 3780, 3810, 3870, 3930, 3970, 4070, 4160 }, | ||
48 | }; | ||
49 | |||
50 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ | ||
51 | const unsigned short percent_to_volt_charge[11] = | ||
52 | { | ||
53 | /* Sansa Li Ion 750mAH FIXME */ | ||
54 | 3300, 3680, 3740, 3760, 3780, 3810, 3870, 3930, 3970, 4070, 4160 | ||
55 | }; | ||
diff --git a/firmware/target/arm/sandisk/sansa-view/usb-view.c b/firmware/target/arm/sandisk/sansa-view/usb-view.c new file mode 100644 index 0000000000..6356ee6ffd --- /dev/null +++ b/firmware/target/arm/sandisk/sansa-view/usb-view.c | |||
@@ -0,0 +1,36 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Robert Keevil | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "usb.h" | ||
23 | |||
24 | int usb_detect(void) | ||
25 | { | ||
26 | return.0; | ||
27 | } | ||
28 | |||
29 | void usb_enable(bool on) | ||
30 | { | ||
31 | (void)on; | ||
32 | } | ||
33 | |||
34 | void usb_init_device(void) | ||
35 | { | ||
36 | } | ||