diff options
author | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2013-11-16 18:21:00 +0400 |
---|---|---|
committer | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2013-12-16 00:45:18 +0400 |
commit | 5b5f0755d6d7fd9e3fdfdb479caeb7fafd0a9960 (patch) | |
tree | 4b9c567df8a5aefb46ace938a034988b7fdb045d | |
parent | 04c59b8a15f96812081ea8730337825af679fbce (diff) | |
download | rockbox-5b5f0755d6d7fd9e3fdfdb479caeb7fafd0a9960.tar.gz rockbox-5b5f0755d6d7fd9e3fdfdb479caeb7fafd0a9960.zip |
Introduce IHIFI760/960 targets.
Change-Id: Ie36e48742c0ed9aa3fd6f49aa034a11d2492327c
-rw-r--r-- | apps/SOURCES | 2 | ||||
-rw-r--r-- | apps/keymaps/keymap-ihifi.c | 229 | ||||
-rw-r--r-- | bootloader/SOURCES | 3 | ||||
-rw-r--r-- | firmware/SOURCES | 12 | ||||
-rw-r--r-- | firmware/export/config.h | 6 | ||||
-rw-r--r-- | firmware/export/config/ihifi760.h | 187 | ||||
-rw-r--r-- | firmware/export/config/ihifi960.h | 187 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/backlight-rk27xx.c | 7 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/debug-rk27xx.c | 3 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/ihifi/button-ihifi.c | 53 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/ihifi/button-target.h | 40 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/ihifi/lcd-ihifi.c | 224 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/ihifi/lcd-target.h | 26 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/ihifi/power-ihifi.c | 51 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/ihifi/powermgmt-ihifi760.c | 65 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/ihifi/powermgmt-ihifi960.c | 65 | ||||
-rw-r--r-- | firmware/target/arm/rk27xx/sd-rk27xx.c | 3 | ||||
-rwxr-xr-x | tools/configure | 51 |
18 files changed, 1212 insertions, 2 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index 0e7fc3efca..b6bb82fa31 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -299,5 +299,7 @@ keymaps/keymap-ma.c | |||
299 | keymaps/keymap-nwz.c | 299 | keymaps/keymap-nwz.c |
300 | #elif CONFIG_KEYPAD == SAMSUNG_YPZ5_PAD | 300 | #elif CONFIG_KEYPAD == SAMSUNG_YPZ5_PAD |
301 | keymaps/keymap-ypz5.c | 301 | keymaps/keymap-ypz5.c |
302 | #elif CONFIG_KEYPAD == IHIFI_PAD | ||
303 | keymaps/keymap-ihifi.c | ||
302 | #endif | 304 | #endif |
303 | 305 | ||
diff --git a/apps/keymaps/keymap-ihifi.c b/apps/keymaps/keymap-ihifi.c new file mode 100644 index 0000000000..0d574c19e6 --- /dev/null +++ b/apps/keymaps/keymap-ihifi.c | |||
@@ -0,0 +1,229 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2013 Andrew Ryabinin | ||
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 | /* Button Code Definitions for IHIFI 760/960 targets */ | ||
23 | |||
24 | #include "config.h" | ||
25 | #include "action.h" | ||
26 | #include "button.h" | ||
27 | #include "settings.h" | ||
28 | |||
29 | /* | ||
30 | * The format of the list is as follows | ||
31 | * { Action Code, Button code, Prereq button code } | ||
32 | * if there's no need to check the previous button's value, use BUTTON_NONE | ||
33 | * Insert LAST_ITEM_IN_LIST at the end of each mapping | ||
34 | */ | ||
35 | static const struct button_mapping button_context_standard[] = { | ||
36 | { ACTION_STD_PREV, BUTTON_BWD, BUTTON_NONE }, | ||
37 | { ACTION_STD_PREVREPEAT, BUTTON_BWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
38 | { ACTION_STD_NEXT, BUTTON_FWD, BUTTON_NONE }, | ||
39 | { ACTION_STD_NEXTREPEAT, BUTTON_FWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
40 | |||
41 | { ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
42 | { ACTION_STD_CANCEL, BUTTON_RETURN|BUTTON_REL, BUTTON_RETURN }, | ||
43 | { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
44 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
45 | |||
46 | LAST_ITEM_IN_LIST | ||
47 | }; /* button_context_standard */ | ||
48 | |||
49 | static const struct button_mapping button_context_wps[] = { | ||
50 | { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
51 | { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
52 | { ACTION_WPS_SKIPPREV, BUTTON_BWD|BUTTON_REL, BUTTON_BWD }, | ||
53 | { ACTION_WPS_SEEKBACK, BUTTON_BWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
54 | { ACTION_WPS_STOPSEEK, BUTTON_BWD|BUTTON_REL, BUTTON_BWD|BUTTON_REPEAT }, | ||
55 | { ACTION_WPS_SKIPNEXT, BUTTON_FWD|BUTTON_REL, BUTTON_FWD }, | ||
56 | { ACTION_WPS_SEEKFWD, BUTTON_FWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
57 | { ACTION_WPS_STOPSEEK, BUTTON_FWD|BUTTON_REL, BUTTON_FWD|BUTTON_REPEAT }, | ||
58 | |||
59 | { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_PLAY|BUTTON_FWD, BUTTON_PLAY }, | ||
60 | { ACTION_WPS_ABSETA_PREVDIR, BUTTON_PLAY|BUTTON_BWD, BUTTON_PLAY }, | ||
61 | { ACTION_WPS_ABRESET, BUTTON_PLAY|BUTTON_BWD, BUTTON_PLAY }, | ||
62 | |||
63 | { ACTION_WPS_BROWSE, BUTTON_RETURN|BUTTON_REL, BUTTON_RETURN }, | ||
64 | { ACTION_WPS_CONTEXT, BUTTON_RETURN|BUTTON_REPEAT, BUTTON_RETURN }, | ||
65 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
66 | { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
67 | |||
68 | LAST_ITEM_IN_LIST | ||
69 | }; /* button_context_wps */ | ||
70 | |||
71 | /** Bookmark Screen **/ | ||
72 | static const struct button_mapping button_context_bmark[] = { | ||
73 | { ACTION_BMS_DELETE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
74 | |||
75 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), | ||
76 | }; /* button_context_settings_bmark */ | ||
77 | |||
78 | |||
79 | /** Keyboard **/ | ||
80 | static const struct button_mapping button_context_keyboard[] = { | ||
81 | { ACTION_KBD_LEFT, BUTTON_RETURN, BUTTON_NONE }, | ||
82 | { ACTION_KBD_LEFT, BUTTON_RETURN|BUTTON_REPEAT, BUTTON_NONE }, | ||
83 | { ACTION_KBD_RIGHT, BUTTON_MENU, BUTTON_NONE }, | ||
84 | { ACTION_KBD_RIGHT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | ||
85 | { ACTION_KBD_UP, BUTTON_BWD, BUTTON_NONE }, | ||
86 | { ACTION_KBD_UP, BUTTON_BWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
87 | { ACTION_KBD_DOWN, BUTTON_FWD, BUTTON_NONE }, | ||
88 | { ACTION_KBD_DOWN, BUTTON_FWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
89 | { ACTION_KBD_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
90 | { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
91 | { ACTION_KBD_ABORT, BUTTON_PLAY|BUTTON_RETURN, BUTTON_PLAY }, | ||
92 | |||
93 | LAST_ITEM_IN_LIST | ||
94 | }; /* button_context_keyboard */ | ||
95 | |||
96 | /** Pitchscreen **/ | ||
97 | static const struct button_mapping button_context_pitchscreen[] = { | ||
98 | { ACTION_PS_INC_SMALL, BUTTON_BWD, BUTTON_NONE }, | ||
99 | { ACTION_PS_INC_BIG, BUTTON_BWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
100 | { ACTION_PS_DEC_SMALL, BUTTON_FWD, BUTTON_NONE }, | ||
101 | { ACTION_PS_DEC_BIG, BUTTON_FWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
102 | { ACTION_PS_NUDGE_LEFT, BUTTON_RETURN, BUTTON_NONE }, | ||
103 | { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RETURN|BUTTON_REL, BUTTON_NONE }, | ||
104 | { ACTION_PS_NUDGE_RIGHT, BUTTON_MENU, BUTTON_NONE }, | ||
105 | { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_MENU|BUTTON_REL, BUTTON_NONE }, | ||
106 | { ACTION_PS_TOGGLE_MODE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
107 | { ACTION_PS_RESET, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
108 | { ACTION_PS_EXIT, BUTTON_PLAY|BUTTON_RETURN, BUTTON_PLAY }, | ||
109 | |||
110 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
111 | }; /* button_context_pitchscreen */ | ||
112 | |||
113 | /** Quickscreen **/ | ||
114 | static const struct button_mapping button_context_quickscreen[] = { | ||
115 | { ACTION_QS_TOP, BUTTON_BWD, BUTTON_NONE }, | ||
116 | { ACTION_QS_TOP, BUTTON_BWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
117 | { ACTION_QS_DOWN, BUTTON_FWD, BUTTON_NONE }, | ||
118 | { ACTION_QS_DOWN, BUTTON_FWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
119 | { ACTION_QS_LEFT, BUTTON_RETURN, BUTTON_NONE }, | ||
120 | { ACTION_QS_LEFT, BUTTON_RETURN|BUTTON_REPEAT, BUTTON_NONE }, | ||
121 | { ACTION_QS_RIGHT, BUTTON_MENU, BUTTON_NONE }, | ||
122 | { ACTION_QS_RIGHT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | ||
123 | { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
124 | |||
125 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
126 | }; /* button_context_quickscreen */ | ||
127 | |||
128 | /** Settings - General Mappings **/ | ||
129 | static const struct button_mapping button_context_settings[] = { | ||
130 | { ACTION_SETTINGS_RESET, BUTTON_PLAY, BUTTON_NONE }, | ||
131 | { ACTION_SETTINGS_INC, BUTTON_BWD, BUTTON_NONE }, | ||
132 | { ACTION_SETTINGS_INCREPEAT, BUTTON_BWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
133 | { ACTION_SETTINGS_DEC, BUTTON_FWD, BUTTON_NONE }, | ||
134 | { ACTION_SETTINGS_DECREPEAT, BUTTON_FWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
135 | { ACTION_STD_PREV, BUTTON_RETURN, BUTTON_NONE }, | ||
136 | { ACTION_STD_PREVREPEAT, BUTTON_RETURN|BUTTON_REPEAT, BUTTON_NONE }, | ||
137 | { ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
138 | |||
139 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
140 | }; /* button_context_settings */ | ||
141 | |||
142 | /** Settings - Using Sliders **/ | ||
143 | static const struct button_mapping button_context_settings_r_is_inc[] = { | ||
144 | { ACTION_SETTINGS_INC, BUTTON_MENU, BUTTON_NONE }, | ||
145 | { ACTION_SETTINGS_INCREPEAT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | ||
146 | { ACTION_SETTINGS_DEC, BUTTON_RETURN, BUTTON_NONE }, | ||
147 | { ACTION_SETTINGS_DECREPEAT, BUTTON_RETURN|BUTTON_REPEAT, BUTTON_NONE }, | ||
148 | |||
149 | { ACTION_STD_PREV, BUTTON_BWD, BUTTON_NONE }, | ||
150 | { ACTION_STD_PREVREPEAT, BUTTON_BWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
151 | { ACTION_STD_NEXT, BUTTON_FWD, BUTTON_NONE }, | ||
152 | { ACTION_STD_NEXTREPEAT, BUTTON_FWD|BUTTON_REPEAT, BUTTON_NONE }, | ||
153 | |||
154 | { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE }, | ||
155 | { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, | ||
156 | |||
157 | LAST_ITEM_IN_LIST | ||
158 | }; /* button_context_settings_r_is_inc */ | ||
159 | |||
160 | /** Tree **/ | ||
161 | static const struct button_mapping button_context_tree[] = { | ||
162 | { ACTION_TREE_WPS, BUTTON_RETURN|BUTTON_REPEAT, BUTTON_RETURN }, | ||
163 | |||
164 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
165 | }; /* button_context_tree */ | ||
166 | |||
167 | static const struct button_mapping button_context_tree_scroll_lr[] = { | ||
168 | { ACTION_TREE_ROOT_INIT, BUTTON_RETURN|BUTTON_REPEAT, BUTTON_RETURN }, | ||
169 | { ACTION_TREE_PGLEFT, BUTTON_PLAY|BUTTON_BWD, BUTTON_NONE }, | ||
170 | { ACTION_TREE_PGRIGHT, BUTTON_PLAY|BUTTON_FWD, BUTTON_NONE }, | ||
171 | |||
172 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
173 | }; /* button_context_tree_scroll_lr */ | ||
174 | |||
175 | /** Yes/No Screen **/ | ||
176 | static const struct button_mapping button_context_yesnoscreen[] = { | ||
177 | { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE }, | ||
178 | LAST_ITEM_IN_LIST | ||
179 | }; /* button_context_settings_yesnoscreen */ | ||
180 | |||
181 | /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ | ||
182 | const struct button_mapping* get_context_mapping(int context) | ||
183 | { | ||
184 | switch (context) | ||
185 | { | ||
186 | /* anything that uses button_context_standard */ | ||
187 | case CONTEXT_LIST: | ||
188 | case CONTEXT_STD: | ||
189 | default: | ||
190 | return button_context_standard; | ||
191 | |||
192 | /* contexts with special mapping */ | ||
193 | case CONTEXT_BOOKMARKSCREEN: | ||
194 | return button_context_bmark; | ||
195 | |||
196 | case CONTEXT_KEYBOARD: | ||
197 | case CONTEXT_MORSE_INPUT: | ||
198 | return button_context_keyboard; | ||
199 | |||
200 | case CONTEXT_PITCHSCREEN: | ||
201 | return button_context_pitchscreen; | ||
202 | |||
203 | case CONTEXT_QUICKSCREEN: | ||
204 | return button_context_quickscreen; | ||
205 | |||
206 | case CONTEXT_SETTINGS: | ||
207 | case CONTEXT_SETTINGS_TIME: | ||
208 | return button_context_settings; | ||
209 | |||
210 | case CONTEXT_SETTINGS_COLOURCHOOSER: | ||
211 | case CONTEXT_SETTINGS_EQ: | ||
212 | case CONTEXT_SETTINGS_RECTRIGGER: | ||
213 | return button_context_settings_r_is_inc; | ||
214 | |||
215 | case CONTEXT_TREE: | ||
216 | case CONTEXT_MAINMENU: | ||
217 | if (global_settings.hold_lr_for_scroll_in_list) | ||
218 | return button_context_tree_scroll_lr; | ||
219 | /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */ | ||
220 | case CONTEXT_TREE|CONTEXT_CUSTOM: | ||
221 | return button_context_tree; | ||
222 | |||
223 | case CONTEXT_WPS: | ||
224 | return button_context_wps; | ||
225 | |||
226 | case CONTEXT_YESNOSCREEN: | ||
227 | return button_context_yesnoscreen; | ||
228 | } | ||
229 | } | ||
diff --git a/bootloader/SOURCES b/bootloader/SOURCES index ffd1b402dc..4f3cd385f9 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES | |||
@@ -68,7 +68,8 @@ show_logo.c | |||
68 | #elif defined(MPIO_HD200) || defined(MPIO_HD300) | 68 | #elif defined(MPIO_HD200) || defined(MPIO_HD300) |
69 | mpio_hd200_hd300.c | 69 | mpio_hd200_hd300.c |
70 | #elif defined(RK27_GENERIC) || defined(HM60X) || defined(HM801) \ | 70 | #elif defined(RK27_GENERIC) || defined(HM60X) || defined(HM801) \ |
71 | || defined(MA9) || defined(MA9C) || defined(MA8) || defined(MA8C) | 71 | || defined(MA9) || defined(MA9C) || defined(MA8) || defined(MA8C) \ |
72 | || defined(IHIFI760) || defined(IHIFI960) | ||
72 | rk27xx.c | 73 | rk27xx.c |
73 | show_logo.c | 74 | show_logo.c |
74 | #elif defined(SANSA_CONNECT) | 75 | #elif defined(SANSA_CONNECT) |
diff --git a/firmware/SOURCES b/firmware/SOURCES index 64041e448e..5591f684af 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -709,6 +709,8 @@ target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c | |||
709 | target/arm/s3c2440/lcd-s3c2440.c | 709 | target/arm/s3c2440/lcd-s3c2440.c |
710 | #elif CONFIG_LCD == LCD_ILI9342 || CONFIG_LCD == LCD_ILI9342C | 710 | #elif CONFIG_LCD == LCD_ILI9342 || CONFIG_LCD == LCD_ILI9342C |
711 | target/arm/rk27xx/ma/lcd-ma.c | 711 | target/arm/rk27xx/ma/lcd-ma.c |
712 | #elif CONFIG_LCD == LCD_IHIFI | ||
713 | target/arm/rk27xx/ihifi/lcd-ihifi.c | ||
712 | #endif | 714 | #endif |
713 | 715 | ||
714 | /* USB Stack */ | 716 | /* USB Stack */ |
@@ -1765,6 +1767,16 @@ target/arm/rk27xx/ma/pca9555-ma.c | |||
1765 | target/arm/rk27xx/ma/audio-ma.c | 1767 | target/arm/rk27xx/ma/audio-ma.c |
1766 | #endif | 1768 | #endif |
1767 | 1769 | ||
1770 | #if defined(IHIFI760) || defined(IHIFI960) | ||
1771 | target/arm/rk27xx/ihifi/button-ihifi.c | ||
1772 | target/arm/rk27xx/ihifi/power-ihifi.c | ||
1773 | #if defined(IHIFI760) | ||
1774 | target/arm/rk27xx/ihifi/powermgmt-ihifi760.c | ||
1775 | #else | ||
1776 | target/arm/rk27xx/ihifi/powermgmt-ihifi960.c | ||
1777 | #endif | ||
1778 | #endif | ||
1779 | |||
1768 | #if (CONFIG_PLATFORM & PLATFORM_ANDROID) | 1780 | #if (CONFIG_PLATFORM & PLATFORM_ANDROID) |
1769 | target/hosted/kernel-unix.c | 1781 | target/hosted/kernel-unix.c |
1770 | target/hosted/filesystem-unix.c | 1782 | target/hosted/filesystem-unix.c |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 23ee56fc75..702a58811c 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -151,6 +151,7 @@ | |||
151 | #define SONY_NWZ_PAD 57 | 151 | #define SONY_NWZ_PAD 57 |
152 | #define CREATIVE_ZEN_PAD 58 | 152 | #define CREATIVE_ZEN_PAD 58 |
153 | #define SAMSUNG_YPZ5_PAD 59 | 153 | #define SAMSUNG_YPZ5_PAD 59 |
154 | #define IHIFI_PAD 60 | ||
154 | 155 | ||
155 | /* CONFIG_REMOTE_KEYPAD */ | 156 | /* CONFIG_REMOTE_KEYPAD */ |
156 | #define H100_REMOTE 1 | 157 | #define H100_REMOTE 1 |
@@ -260,6 +261,7 @@ | |||
260 | #define LCD_ILI9342C 57 /* another type of lcd used by HiFi E.T MA9/MA8 */ | 261 | #define LCD_ILI9342C 57 /* another type of lcd used by HiFi E.T MA9/MA8 */ |
261 | #define LCD_CREATIVEZENV 58 /* as used by the Creativr Zen V (Plus) */ | 262 | #define LCD_CREATIVEZENV 58 /* as used by the Creativr Zen V (Plus) */ |
262 | #define LCD_SAMSUNGYPZ5 59 /* as used by Samsung YP-Z5 */ | 263 | #define LCD_SAMSUNGYPZ5 59 /* as used by Samsung YP-Z5 */ |
264 | #define LCD_IHIFI 60 /* as used by IHIFI 760/960 */ | ||
263 | 265 | ||
264 | /* LCD_PIXELFORMAT */ | 266 | /* LCD_PIXELFORMAT */ |
265 | #define HORIZONTAL_PACKING 1 | 267 | #define HORIZONTAL_PACKING 1 |
@@ -550,6 +552,10 @@ Lyre prototype 1 */ | |||
550 | #include "config/sonynwze360.h" | 552 | #include "config/sonynwze360.h" |
551 | #elif defined(SAMSUNG_YPZ5) | 553 | #elif defined(SAMSUNG_YPZ5) |
552 | #include "config/samsungypz5.h" | 554 | #include "config/samsungypz5.h" |
555 | #elif defined(IHIFI760) | ||
556 | #include "config/ihifi760.h" | ||
557 | #elif defined(IHIFI960) | ||
558 | #include "config/ihifi960.h" | ||
553 | #else | 559 | #else |
554 | /* no known platform */ | 560 | /* no known platform */ |
555 | #endif | 561 | #endif |
diff --git a/firmware/export/config/ihifi760.h b/firmware/export/config/ihifi760.h new file mode 100644 index 0000000000..ea84a4a891 --- /dev/null +++ b/firmware/export/config/ihifi760.h | |||
@@ -0,0 +1,187 @@ | |||
1 | /* | ||
2 | * This config file is for IHIFI 760 | ||
3 | */ | ||
4 | |||
5 | /* For Rolo and boot loader */ | ||
6 | #define MODEL_NUMBER 92 | ||
7 | |||
8 | #define MODEL_NAME "IHIFI 760" | ||
9 | |||
10 | /* Define bitmask of input sources - recordable bitmask can be defined | ||
11 | explicitly if different */ | ||
12 | /* #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FM) */ | ||
13 | |||
14 | /* define the bitmask of hardware sample rates */ | ||
15 | #define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_48 | SAMPR_CAP_44 | \ | ||
16 | SAMPR_CAP_32 | SAMPR_CAP_24 | SAMPR_CAP_22 | \ | ||
17 | SAMPR_CAP_16 | SAMPR_CAP_12 | SAMPR_CAP_11 | SAMPR_CAP_8) | ||
18 | |||
19 | #define HAVE_DUMMY_CODEC | ||
20 | #define CODEC_SLAVE | ||
21 | /* define this if you have a bitmap LCD display */ | ||
22 | #define HAVE_LCD_BITMAP | ||
23 | |||
24 | /* define this if you can flip your LCD */ | ||
25 | /* #define HAVE_LCD_FLIP */ | ||
26 | |||
27 | /* define this if you have a colour LCD */ | ||
28 | #define HAVE_LCD_COLOR | ||
29 | |||
30 | /* define this if you want album art for this target */ | ||
31 | #define HAVE_ALBUMART | ||
32 | |||
33 | /* define this to enable bitmap scaling */ | ||
34 | #define HAVE_BMP_SCALING | ||
35 | |||
36 | /* define this to enable JPEG decoding */ | ||
37 | #define HAVE_JPEG | ||
38 | |||
39 | /* define this if you can invert the colours on your LCD */ | ||
40 | /* #define HAVE_LCD_INVERT */ | ||
41 | |||
42 | /* define this if you have access to the quickscreen */ | ||
43 | #define HAVE_QUICKSCREEN | ||
44 | |||
45 | /* define this if you would like tagcache to build on this target */ | ||
46 | #define HAVE_TAGCACHE | ||
47 | |||
48 | /* define this if you have a flash memory storage */ | ||
49 | #define HAVE_FLASH_STORAGE | ||
50 | |||
51 | #define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND) | ||
52 | |||
53 | #define CONFIG_NAND NAND_RK27XX | ||
54 | #define HAVE_SW_TONE_CONTROLS | ||
55 | |||
56 | #define HAVE_SW_VOLUME_CONTROL | ||
57 | |||
58 | /* commented for now */ | ||
59 | /* #define HAVE_HOTSWAP */ | ||
60 | |||
61 | #define NUM_DRIVES 1 | ||
62 | #define SECTOR_SIZE 512 | ||
63 | |||
64 | /* for small(ish) SD cards */ | ||
65 | #define HAVE_FAT16SUPPORT | ||
66 | |||
67 | /* LCD dimensions */ | ||
68 | #define LCD_WIDTH 320 | ||
69 | #define LCD_HEIGHT 240 | ||
70 | #define LCD_DEPTH 16 /* pseudo 262.144 colors */ | ||
71 | #define LCD_PIXELFORMAT RGB565 /* rgb565 */ | ||
72 | |||
73 | /* Define this if the LCD can shut down */ | ||
74 | /* #define HAVE_LCD_SHUTDOWN */ | ||
75 | |||
76 | /* Define this if your LCD can be enabled/disabled */ | ||
77 | #define HAVE_LCD_ENABLE | ||
78 | |||
79 | /* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE | ||
80 | should be defined as well. */ | ||
81 | #ifndef BOOTLOADER | ||
82 | /* TODO: #define HAVE_LCD_SLEEP */ | ||
83 | /* TODO: #define HAVE_LCD_SLEEP_SETTING */ | ||
84 | #endif | ||
85 | |||
86 | #define CONFIG_KEYPAD IHIFI_PAD | ||
87 | |||
88 | /* Define this to enable morse code input */ | ||
89 | #define HAVE_MORSE_INPUT | ||
90 | |||
91 | /* Define this if you do software codec */ | ||
92 | #define CONFIG_CODEC SWCODEC | ||
93 | |||
94 | /* define this if you have a real-time clock */ | ||
95 | /* #define CONFIG_RTC RTC_NANO2G */ | ||
96 | |||
97 | /* Define if the device can wake from an RTC alarm */ | ||
98 | /* #define HAVE_RTC_ALARM */ | ||
99 | |||
100 | #define CONFIG_LCD LCD_IHIFI | ||
101 | |||
102 | /* Define the type of audio codec */ | ||
103 | /*#define HAVE_RK27XX_CODEC */ | ||
104 | |||
105 | /* #define HAVE_PCM_DMA_ADDRESS */ | ||
106 | |||
107 | /* Define this for LCD backlight available */ | ||
108 | #define HAVE_BACKLIGHT | ||
109 | #define HAVE_BACKLIGHT_BRIGHTNESS | ||
110 | #define MIN_BRIGHTNESS_SETTING 0 | ||
111 | #define MAX_BRIGHTNESS_SETTING 31 | ||
112 | #define DEFAULT_BRIGHTNESS_SETTING 20 | ||
113 | #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG | ||
114 | |||
115 | /* Define this if you have a software controlled poweroff */ | ||
116 | #define HAVE_SW_POWEROFF | ||
117 | |||
118 | /* The number of bytes reserved for loadable codecs */ | ||
119 | #define CODEC_SIZE 0x100000 | ||
120 | |||
121 | /* The number of bytes reserved for loadable plugins */ | ||
122 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
123 | |||
124 | /* TODO: Figure out real values */ | ||
125 | #define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity */ | ||
126 | #define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */ | ||
127 | #define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */ | ||
128 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | ||
129 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
130 | |||
131 | #define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE | ||
132 | |||
133 | /* Hardware controlled charging with monitoring */ | ||
134 | #define CONFIG_CHARGING CHARGING_MONITOR | ||
135 | |||
136 | /* define current usage levels */ | ||
137 | /* TODO: #define CURRENT_NORMAL | ||
138 | * TODO: #define CURRENT_BACKLIGHT 23 | ||
139 | */ | ||
140 | |||
141 | /* define this if the unit can be powered or charged via USB */ | ||
142 | #define HAVE_USB_POWER | ||
143 | |||
144 | /* USB On-the-go */ | ||
145 | #define CONFIG_USBOTG USBOTG_RK27XX | ||
146 | |||
147 | /* enable these for the experimental usb stack */ | ||
148 | #define HAVE_USBSTACK | ||
149 | |||
150 | #define USE_ROCKBOX_USB | ||
151 | #define USB_VENDOR_ID 0x071b | ||
152 | #define USB_PRODUCT_ID 0x3202 | ||
153 | #define HAVE_BOOTLOADER_USB_MODE | ||
154 | |||
155 | /* Define this if your LCD can set contrast */ | ||
156 | /* #define HAVE_LCD_CONTRAST */ | ||
157 | |||
158 | /* The exact type of CPU */ | ||
159 | #define CONFIG_CPU RK27XX | ||
160 | |||
161 | /* I2C interface */ | ||
162 | #define CONFIG_I2C I2C_RK27XX | ||
163 | |||
164 | /* Define this to the CPU frequency */ | ||
165 | #define CPU_FREQ 200000000 | ||
166 | |||
167 | /* define this if the hardware can be powered off while charging */ | ||
168 | /* #define HAVE_POWEROFF_WHILE_CHARGING */ | ||
169 | |||
170 | /* Offset ( in the firmware file's header ) to the file CRC */ | ||
171 | #define FIRMWARE_OFFSET_FILE_CRC 0 | ||
172 | |||
173 | /* Offset ( in the firmware file's header ) to the real data */ | ||
174 | #define FIRMWARE_OFFSET_FILE_DATA 8 | ||
175 | |||
176 | #define STORAGE_NEEDS_ALIGN | ||
177 | |||
178 | /* Define this if you have adjustable CPU frequency */ | ||
179 | #define HAVE_ADJUSTABLE_CPU_FREQ | ||
180 | |||
181 | /* Virtual LED (icon) */ | ||
182 | #define CONFIG_LED LED_VIRTUAL | ||
183 | |||
184 | #define RKW_FORMAT | ||
185 | #define BOOTFILE_EXT "rkw" | ||
186 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
187 | #define BOOTDIR "/.rockbox" | ||
diff --git a/firmware/export/config/ihifi960.h b/firmware/export/config/ihifi960.h new file mode 100644 index 0000000000..3ef6609aa5 --- /dev/null +++ b/firmware/export/config/ihifi960.h | |||
@@ -0,0 +1,187 @@ | |||
1 | /* | ||
2 | * This config file is for IHIFI 960 | ||
3 | */ | ||
4 | |||
5 | /* For Rolo and boot loader */ | ||
6 | #define MODEL_NUMBER 93 | ||
7 | |||
8 | #define MODEL_NAME "IHIFI 960" | ||
9 | |||
10 | /* Define bitmask of input sources - recordable bitmask can be defined | ||
11 | explicitly if different */ | ||
12 | /* #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FM) */ | ||
13 | |||
14 | /* define the bitmask of hardware sample rates */ | ||
15 | #define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_48 | SAMPR_CAP_44 | \ | ||
16 | SAMPR_CAP_32 | SAMPR_CAP_24 | SAMPR_CAP_22 | \ | ||
17 | SAMPR_CAP_16 | SAMPR_CAP_12 | SAMPR_CAP_11 | SAMPR_CAP_8) | ||
18 | |||
19 | #define HAVE_DUMMY_CODEC | ||
20 | #define CODEC_SLAVE | ||
21 | /* define this if you have a bitmap LCD display */ | ||
22 | #define HAVE_LCD_BITMAP | ||
23 | |||
24 | /* define this if you can flip your LCD */ | ||
25 | /* #define HAVE_LCD_FLIP */ | ||
26 | |||
27 | /* define this if you have a colour LCD */ | ||
28 | #define HAVE_LCD_COLOR | ||
29 | |||
30 | /* define this if you want album art for this target */ | ||
31 | #define HAVE_ALBUMART | ||
32 | |||
33 | /* define this to enable bitmap scaling */ | ||
34 | #define HAVE_BMP_SCALING | ||
35 | |||
36 | /* define this to enable JPEG decoding */ | ||
37 | #define HAVE_JPEG | ||
38 | |||
39 | /* define this if you can invert the colours on your LCD */ | ||
40 | /* #define HAVE_LCD_INVERT */ | ||
41 | |||
42 | /* define this if you have access to the quickscreen */ | ||
43 | #define HAVE_QUICKSCREEN | ||
44 | |||
45 | /* define this if you would like tagcache to build on this target */ | ||
46 | #define HAVE_TAGCACHE | ||
47 | |||
48 | /* define this if you have a flash memory storage */ | ||
49 | #define HAVE_FLASH_STORAGE | ||
50 | |||
51 | #define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND) | ||
52 | |||
53 | #define CONFIG_NAND NAND_RK27XX | ||
54 | #define HAVE_SW_TONE_CONTROLS | ||
55 | |||
56 | #define HAVE_SW_VOLUME_CONTROL | ||
57 | |||
58 | /* commented for now */ | ||
59 | /* #define HAVE_HOTSWAP */ | ||
60 | |||
61 | #define NUM_DRIVES 1 | ||
62 | #define SECTOR_SIZE 512 | ||
63 | |||
64 | /* for small(ish) SD cards */ | ||
65 | #define HAVE_FAT16SUPPORT | ||
66 | |||
67 | /* LCD dimensions */ | ||
68 | #define LCD_WIDTH 320 | ||
69 | #define LCD_HEIGHT 240 | ||
70 | #define LCD_DEPTH 16 /* pseudo 262.144 colors */ | ||
71 | #define LCD_PIXELFORMAT RGB565 /* rgb565 */ | ||
72 | |||
73 | /* Define this if the LCD can shut down */ | ||
74 | /* #define HAVE_LCD_SHUTDOWN */ | ||
75 | |||
76 | /* Define this if your LCD can be enabled/disabled */ | ||
77 | #define HAVE_LCD_ENABLE | ||
78 | |||
79 | /* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE | ||
80 | should be defined as well. */ | ||
81 | #ifndef BOOTLOADER | ||
82 | /* TODO: #define HAVE_LCD_SLEEP */ | ||
83 | /* TODO: #define HAVE_LCD_SLEEP_SETTING */ | ||
84 | #endif | ||
85 | |||
86 | #define CONFIG_KEYPAD IHIFI_PAD | ||
87 | |||
88 | /* Define this to enable morse code input */ | ||
89 | #define HAVE_MORSE_INPUT | ||
90 | |||
91 | /* Define this if you do software codec */ | ||
92 | #define CONFIG_CODEC SWCODEC | ||
93 | |||
94 | /* define this if you have a real-time clock */ | ||
95 | /* #define CONFIG_RTC RTC_NANO2G */ | ||
96 | |||
97 | /* Define if the device can wake from an RTC alarm */ | ||
98 | /* #define HAVE_RTC_ALARM */ | ||
99 | |||
100 | #define CONFIG_LCD LCD_IHIFI | ||
101 | |||
102 | /* Define the type of audio codec */ | ||
103 | /*#define HAVE_RK27XX_CODEC */ | ||
104 | |||
105 | /* #define HAVE_PCM_DMA_ADDRESS */ | ||
106 | |||
107 | /* Define this for LCD backlight available */ | ||
108 | #define HAVE_BACKLIGHT | ||
109 | #define HAVE_BACKLIGHT_BRIGHTNESS | ||
110 | #define MIN_BRIGHTNESS_SETTING 0 | ||
111 | #define MAX_BRIGHTNESS_SETTING 31 | ||
112 | #define DEFAULT_BRIGHTNESS_SETTING 20 | ||
113 | #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG | ||
114 | |||
115 | /* Define this if you have a software controlled poweroff */ | ||
116 | #define HAVE_SW_POWEROFF | ||
117 | |||
118 | /* The number of bytes reserved for loadable codecs */ | ||
119 | #define CODEC_SIZE 0x100000 | ||
120 | |||
121 | /* The number of bytes reserved for loadable plugins */ | ||
122 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
123 | |||
124 | /* TODO: Figure out real values */ | ||
125 | #define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity */ | ||
126 | #define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */ | ||
127 | #define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */ | ||
128 | #define BATTERY_CAPACITY_INC 10 /* capacity increment */ | ||
129 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
130 | |||
131 | #define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE | ||
132 | |||
133 | /* Hardware controlled charging with monitoring */ | ||
134 | #define CONFIG_CHARGING CHARGING_MONITOR | ||
135 | |||
136 | /* define current usage levels */ | ||
137 | /* TODO: #define CURRENT_NORMAL | ||
138 | * TODO: #define CURRENT_BACKLIGHT 23 | ||
139 | */ | ||
140 | |||
141 | /* define this if the unit can be powered or charged via USB */ | ||
142 | #define HAVE_USB_POWER | ||
143 | |||
144 | /* USB On-the-go */ | ||
145 | #define CONFIG_USBOTG USBOTG_RK27XX | ||
146 | |||
147 | /* enable these for the experimental usb stack */ | ||
148 | #define HAVE_USBSTACK | ||
149 | |||
150 | #define USE_ROCKBOX_USB | ||
151 | #define USB_VENDOR_ID 0x071b | ||
152 | #define USB_PRODUCT_ID 0x3202 | ||
153 | #define HAVE_BOOTLOADER_USB_MODE | ||
154 | |||
155 | /* Define this if your LCD can set contrast */ | ||
156 | /* #define HAVE_LCD_CONTRAST */ | ||
157 | |||
158 | /* The exact type of CPU */ | ||
159 | #define CONFIG_CPU RK27XX | ||
160 | |||
161 | /* I2C interface */ | ||
162 | #define CONFIG_I2C I2C_RK27XX | ||
163 | |||
164 | /* Define this to the CPU frequency */ | ||
165 | #define CPU_FREQ 200000000 | ||
166 | |||
167 | /* define this if the hardware can be powered off while charging */ | ||
168 | /* #define HAVE_POWEROFF_WHILE_CHARGING */ | ||
169 | |||
170 | /* Offset ( in the firmware file's header ) to the file CRC */ | ||
171 | #define FIRMWARE_OFFSET_FILE_CRC 0 | ||
172 | |||
173 | /* Offset ( in the firmware file's header ) to the real data */ | ||
174 | #define FIRMWARE_OFFSET_FILE_DATA 8 | ||
175 | |||
176 | #define STORAGE_NEEDS_ALIGN | ||
177 | |||
178 | /* Define this if you have adjustable CPU frequency */ | ||
179 | #define HAVE_ADJUSTABLE_CPU_FREQ | ||
180 | |||
181 | /* Virtual LED (icon) */ | ||
182 | #define CONFIG_LED LED_VIRTUAL | ||
183 | |||
184 | #define RKW_FORMAT | ||
185 | #define BOOTFILE_EXT "rkw" | ||
186 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
187 | #define BOOTDIR "/.rockbox" | ||
diff --git a/firmware/target/arm/rk27xx/backlight-rk27xx.c b/firmware/target/arm/rk27xx/backlight-rk27xx.c index 5d92cd827b..361d18c948 100644 --- a/firmware/target/arm/rk27xx/backlight-rk27xx.c +++ b/firmware/target/arm/rk27xx/backlight-rk27xx.c | |||
@@ -68,6 +68,13 @@ static const unsigned short lin_brightness[] = { | |||
68 | 198, 227, 260, 295, 334, 376, 421, 470, | 68 | 198, 227, 260, 295, 334, 376, 421, 470, |
69 | 522, 578, 638, 702, 770, 842, 918, 1000 | 69 | 522, 578, 638, 702, 770, 842, 918, 1000 |
70 | }; | 70 | }; |
71 | #elif defined(IHIFI760) || defined(IHIFI960) | ||
72 | static const unsigned short lin_brightness[] = { | ||
73 | 700, 701, 702, 703, 704, 706, 708, 711, | ||
74 | 714, 717, 721, 726, 731, 737, 743, 751, | ||
75 | 759, 768, 778, 788, 800, 812, 826, 841, | ||
76 | 856, 873, 891, 910, 931, 952, 975, 1000 | ||
77 | }; | ||
71 | #endif | 78 | #endif |
72 | 79 | ||
73 | bool _backlight_init(void) | 80 | bool _backlight_init(void) |
diff --git a/firmware/target/arm/rk27xx/debug-rk27xx.c b/firmware/target/arm/rk27xx/debug-rk27xx.c index 79c779461b..83bc1a5af6 100644 --- a/firmware/target/arm/rk27xx/debug-rk27xx.c +++ b/firmware/target/arm/rk27xx/debug-rk27xx.c | |||
@@ -32,7 +32,8 @@ | |||
32 | 32 | ||
33 | #ifdef RK27_GENERIC | 33 | #ifdef RK27_GENERIC |
34 | #define DEBUG_CANCEL BUTTON_VOL | 34 | #define DEBUG_CANCEL BUTTON_VOL |
35 | #elif defined(HM60X) || defined(HM801) || (CONFIG_KEYPAD == MA_PAD) | 35 | #elif defined(HM60X) || defined(HM801) || (CONFIG_KEYPAD == MA_PAD) || \ |
36 | (CONFIG_KEYPAD == IHIFI_PAD) | ||
36 | #define DEBUG_CANCEL BUTTON_LEFT | 37 | #define DEBUG_CANCEL BUTTON_LEFT |
37 | #endif | 38 | #endif |
38 | 39 | ||
diff --git a/firmware/target/arm/rk27xx/ihifi/button-ihifi.c b/firmware/target/arm/rk27xx/ihifi/button-ihifi.c new file mode 100644 index 0000000000..6477400255 --- /dev/null +++ b/firmware/target/arm/rk27xx/ihifi/button-ihifi.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2013 Andrew Ryabinin | ||
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 "system.h" | ||
24 | #include "button.h" | ||
25 | #include "adc.h" | ||
26 | #include "backlight.h" | ||
27 | |||
28 | void button_init_device(void) { | ||
29 | /* setup button gpio as input */ | ||
30 | GPIO_PCCON &= ~(POWEROFF_BUTTON); | ||
31 | } | ||
32 | |||
33 | int button_read_device(void) { | ||
34 | int adc_val = adc_read(ADC_BUTTONS); | ||
35 | int gpio_btn = GPIO_PCDR & BUTTON_PLAY; | ||
36 | |||
37 | if (adc_val < 270) { | ||
38 | if (adc_val < 110) { /* 0 - 109 */ | ||
39 | return BUTTON_RETURN | gpio_btn; | ||
40 | } else { /* 110 - 269 */ | ||
41 | return BUTTON_MENU |gpio_btn; | ||
42 | } | ||
43 | } else { | ||
44 | if (adc_val < 420) { /* 270 - 419 */ | ||
45 | return BUTTON_BWD | gpio_btn; | ||
46 | } else if (adc_val < 580) { /* 420 - 579 */ | ||
47 | return BUTTON_FWD | gpio_btn; | ||
48 | } | ||
49 | } | ||
50 | return gpio_btn; | ||
51 | } | ||
52 | |||
53 | |||
diff --git a/firmware/target/arm/rk27xx/ihifi/button-target.h b/firmware/target/arm/rk27xx/ihifi/button-target.h new file mode 100644 index 0000000000..f78727b0f5 --- /dev/null +++ b/firmware/target/arm/rk27xx/ihifi/button-target.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2013 Andrew Ryabinin | ||
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 | #ifndef _BUTTON_TARGET_H_ | ||
22 | #define _BUTTON_TARGET_H_ | ||
23 | |||
24 | #define BUTTON_FWD 0x00000001 | ||
25 | #define BUTTON_PLAY 0x00000002 | ||
26 | #define BUTTON_BWD 0x00000004 | ||
27 | #define BUTTON_RETURN 0x00000008 | ||
28 | #define BUTTON_MENU 0x00000010 | ||
29 | |||
30 | #define BUTTON_LEFT BUTTON_RETURN | ||
31 | #define BUTTON_RIGHT BUTTON_MENU | ||
32 | |||
33 | #define BUTTON_MAIN (BUTTON_FWD|BUTTON_PLAY| \ | ||
34 | BUTTON_BWD|BUTTON_RETURN| \ | ||
35 | BUTTON_MENU) | ||
36 | |||
37 | #define POWEROFF_BUTTON BUTTON_PLAY | ||
38 | #define POWEROFF_COUNT 30 | ||
39 | |||
40 | #endif /* _BUTTON_TARGET_H_ */ | ||
diff --git a/firmware/target/arm/rk27xx/ihifi/lcd-ihifi.c b/firmware/target/arm/rk27xx/ihifi/lcd-ihifi.c new file mode 100644 index 0000000000..d5906b9dd5 --- /dev/null +++ b/firmware/target/arm/rk27xx/ihifi/lcd-ihifi.c | |||
@@ -0,0 +1,224 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2013 Andrew Ryabinin | ||
11 | * | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | |||
23 | #include "config.h" | ||
24 | #include "kernel.h" | ||
25 | #include "lcd.h" | ||
26 | #include "system.h" | ||
27 | #include "cpu.h" | ||
28 | #include "lcdif-rk27xx.h" | ||
29 | |||
30 | static bool display_on = false; | ||
31 | |||
32 | void lcd_display_init(void) | ||
33 | { | ||
34 | unsigned int x, y; | ||
35 | |||
36 | lcd_cmd(0xEF); | ||
37 | lcd_data(0x03); | ||
38 | lcd_data(0x80); | ||
39 | lcd_data(0x02); | ||
40 | |||
41 | lcd_cmd(0x00CF); | ||
42 | lcd_data(0x00); | ||
43 | lcd_data(0xC1); | ||
44 | lcd_data(0x30); | ||
45 | |||
46 | lcd_cmd(0xED); | ||
47 | lcd_data(0x67); | ||
48 | lcd_data(0x03); | ||
49 | lcd_data(0x12); | ||
50 | lcd_data(0x81); | ||
51 | |||
52 | lcd_cmd(0xE8); | ||
53 | lcd_data(0x85); | ||
54 | lcd_data(0x11); | ||
55 | lcd_data(0x79); | ||
56 | |||
57 | lcd_cmd(0xCB); | ||
58 | lcd_data(0x39); | ||
59 | lcd_data(0x2C); | ||
60 | lcd_data(0x00); | ||
61 | lcd_data(0x34); | ||
62 | lcd_data(0x06); | ||
63 | |||
64 | lcd_cmd(0xF7); | ||
65 | lcd_data(0x20); | ||
66 | |||
67 | lcd_cmd(0xEA); | ||
68 | lcd_data(0x00); | ||
69 | lcd_data(0x00); | ||
70 | |||
71 | lcd_cmd(0xC0); | ||
72 | lcd_data(0x1D); | ||
73 | |||
74 | lcd_cmd(0xC1); | ||
75 | lcd_data(0x12); | ||
76 | |||
77 | lcd_cmd(0xC5); | ||
78 | lcd_data(0x44); | ||
79 | lcd_data(0x3C); | ||
80 | |||
81 | lcd_cmd(0xC7); | ||
82 | lcd_data(0x88); | ||
83 | |||
84 | lcd_cmd(0x3A); | ||
85 | lcd_data(0x55); | ||
86 | |||
87 | lcd_cmd(0x36); | ||
88 | lcd_data(0xA8); | ||
89 | |||
90 | lcd_cmd(0xB1); | ||
91 | lcd_data(0x00); | ||
92 | lcd_data(0x17); | ||
93 | |||
94 | lcd_cmd(0xB6); | ||
95 | lcd_data(0x0A); | ||
96 | lcd_data(0xA2); | ||
97 | |||
98 | lcd_cmd(0xF2); | ||
99 | lcd_data(0x00); | ||
100 | |||
101 | lcd_cmd(0x26); | ||
102 | lcd_data(0x01); | ||
103 | |||
104 | lcd_cmd(0xE0); | ||
105 | lcd_data(0x0F); | ||
106 | lcd_data(0x22); | ||
107 | lcd_data(0x1C); | ||
108 | lcd_data(0x1B); | ||
109 | lcd_data(0x08); | ||
110 | lcd_data(0x0F); | ||
111 | lcd_data(0x48); | ||
112 | lcd_data(0xB8); | ||
113 | lcd_data(0x34); | ||
114 | lcd_data(0x05); | ||
115 | lcd_data(0x0C); | ||
116 | lcd_data(0x09); | ||
117 | lcd_data(0x0F); | ||
118 | lcd_data(0x07); | ||
119 | lcd_data(0x00); | ||
120 | |||
121 | lcd_cmd(0xE1); | ||
122 | lcd_data(0x00); | ||
123 | lcd_data(0x23); | ||
124 | lcd_data(0x24); | ||
125 | lcd_data(0x07); | ||
126 | lcd_data(0x10); | ||
127 | lcd_data(0x07); | ||
128 | lcd_data(0x38); | ||
129 | lcd_data(0x47); | ||
130 | lcd_data(0x4B); | ||
131 | lcd_data(0x0A); | ||
132 | lcd_data(0x13); | ||
133 | lcd_data(0x06); | ||
134 | lcd_data(0x30); | ||
135 | lcd_data(0x38); | ||
136 | lcd_data(0x0F); | ||
137 | |||
138 | lcd_cmd(0x2A); | ||
139 | lcd_data(0x00); | ||
140 | lcd_data(0x00); | ||
141 | lcd_data(0x01); | ||
142 | lcd_data(0x3F); | ||
143 | |||
144 | lcd_cmd(0x2B); | ||
145 | lcd_data(0x00); | ||
146 | lcd_data(0x00); | ||
147 | lcd_data(0x00); | ||
148 | lcd_data(0xEF); | ||
149 | |||
150 | lcd_cmd(0x11); | ||
151 | |||
152 | udelay(120000); | ||
153 | |||
154 | lcd_cmd(0x29); | ||
155 | lcd_cmd(0x2C); | ||
156 | |||
157 | for (x = 0; x < LCD_WIDTH; x++) | ||
158 | for(y=0; y < LCD_HEIGHT; y++) | ||
159 | lcd_data(0x00); | ||
160 | |||
161 | display_on = true; | ||
162 | } | ||
163 | |||
164 | void lcd_enable (bool on) | ||
165 | { | ||
166 | if (on == display_on) | ||
167 | return; | ||
168 | |||
169 | lcdctrl_bypass(1); | ||
170 | LCDC_CTRL |= RGB24B; | ||
171 | |||
172 | if (on) { | ||
173 | lcd_cmd(0x11); | ||
174 | udelay(120000); | ||
175 | lcd_cmd(0x29); | ||
176 | lcd_cmd(0x2C); | ||
177 | } else { | ||
178 | lcd_cmd(0x28); | ||
179 | } | ||
180 | |||
181 | display_on = on; | ||
182 | LCDC_CTRL &= ~RGB24B; | ||
183 | } | ||
184 | |||
185 | void lcd_set_gram_area(int x_start, int y_start, | ||
186 | int x_end, int y_end) | ||
187 | { | ||
188 | lcdctrl_bypass(1); | ||
189 | LCDC_CTRL |= RGB24B; | ||
190 | lcd_cmd(0x002A); | ||
191 | lcd_data((x_start&0xff00)>>8); | ||
192 | lcd_data(x_start&0x00ff); | ||
193 | lcd_data((x_end&0xff00)>>8); | ||
194 | lcd_data(x_end&0x00ff); | ||
195 | lcd_cmd(0x002B); | ||
196 | lcd_data((y_start&0xff00)>>8); | ||
197 | lcd_data(y_start&0x00ff); | ||
198 | lcd_data((y_end&0xff00)>>8); | ||
199 | lcd_data(y_end&0x00ff); | ||
200 | |||
201 | lcd_cmd(0x2C); | ||
202 | LCDC_CTRL &= ~RGB24B; | ||
203 | |||
204 | } | ||
205 | |||
206 | bool lcd_active() | ||
207 | { | ||
208 | return display_on; | ||
209 | } | ||
210 | |||
211 | /* Blit a YUV bitmap directly to the LCD */ | ||
212 | void lcd_blit_yuv(unsigned char * const src[3], | ||
213 | int src_x, int src_y, int stride, | ||
214 | int x, int y, int width, int height) | ||
215 | { | ||
216 | (void)src; | ||
217 | (void)src_x; | ||
218 | (void)src_y; | ||
219 | (void)stride; | ||
220 | (void)x; | ||
221 | (void)y; | ||
222 | (void)width; | ||
223 | (void)height; | ||
224 | } | ||
diff --git a/firmware/target/arm/rk27xx/ihifi/lcd-target.h b/firmware/target/arm/rk27xx/ihifi/lcd-target.h new file mode 100644 index 0000000000..0d245c888b --- /dev/null +++ b/firmware/target/arm/rk27xx/ihifi/lcd-target.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2012 Andrew Ryabinin | ||
11 | * | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | #ifndef LCD_TARGET_H | ||
23 | #define LCD_TARGET_H | ||
24 | |||
25 | #define LCD_DATABUS_WIDTH LCDIF_16BIT | ||
26 | #endif | ||
diff --git a/firmware/target/arm/rk27xx/ihifi/power-ihifi.c b/firmware/target/arm/rk27xx/ihifi/power-ihifi.c new file mode 100644 index 0000000000..780d476112 --- /dev/null +++ b/firmware/target/arm/rk27xx/ihifi/power-ihifi.c | |||
@@ -0,0 +1,51 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2013 Andrew Ryabinin | ||
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 <stdbool.h> | ||
22 | #include "config.h" | ||
23 | #include "inttypes.h" | ||
24 | #include "power.h" | ||
25 | #include "panic.h" | ||
26 | #include "system.h" | ||
27 | #include "usb_core.h" /* for usb_charging_maxcurrent_change */ | ||
28 | |||
29 | void power_off(void) | ||
30 | { | ||
31 | GPIO_PCCON &= ~(1<<0); | ||
32 | while(1); | ||
33 | } | ||
34 | |||
35 | void power_init(void) | ||
36 | { | ||
37 | GPIO_PCDR |= (1<<0); | ||
38 | GPIO_PCCON |= (1<<0); | ||
39 | } | ||
40 | |||
41 | unsigned int power_input_status(void) | ||
42 | { | ||
43 | unsigned int status = POWER_INPUT_NONE; | ||
44 | /* TODO: implement */ | ||
45 | return status; | ||
46 | } | ||
47 | |||
48 | bool charging_state(void) | ||
49 | { | ||
50 | return true; | ||
51 | } | ||
diff --git a/firmware/target/arm/rk27xx/ihifi/powermgmt-ihifi760.c b/firmware/target/arm/rk27xx/ihifi/powermgmt-ihifi760.c new file mode 100644 index 0000000000..c849bc27e6 --- /dev/null +++ b/firmware/target/arm/rk27xx/ihifi/powermgmt-ihifi760.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2013 Andrew Ryabinin | ||
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 "adc-target.h" | ||
25 | #include "powermgmt.h" | ||
26 | |||
27 | /* Battery voltage calculation and discharge/charge curves for the HiFiMAN HM-60x. | ||
28 | |||
29 | Battery voltage is calculated under the assumption that the adc full-scale | ||
30 | readout represents 3.00V and that the battery ADC channel is fed with | ||
31 | exactly half of the battery voltage (through a resistive divider). | ||
32 | Charge curve have not been calibrated yet. | ||
33 | */ | ||
34 | |||
35 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | ||
36 | { | ||
37 | /* TODO: this is just an initial guess */ | ||
38 | 3350, | ||
39 | }; | ||
40 | |||
41 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | ||
42 | { | ||
43 | 3300, | ||
44 | }; | ||
45 | |||
46 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ | ||
47 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | ||
48 | { | ||
49 | /* FIXME: Uncalibrated curve */ | ||
50 | { 3300, 3350, 3433, 3516, 3600, 3683, 3767, 3850, 3933, 4017, 4100 } | ||
51 | }; | ||
52 | |||
53 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ | ||
54 | const unsigned short percent_to_volt_charge[11] = | ||
55 | /* TODO: simple copy of discharge curve */ | ||
56 | { 3300, 3350, 3433, 3516, 3600, 3683, 3767, 3850, 3933, 4017, 4100 }; | ||
57 | |||
58 | /* full-scale ADC readout (2^10) in millivolt */ | ||
59 | #define BATTERY_SCALE_FACTOR 6100 | ||
60 | |||
61 | /* Returns battery voltage from ADC [millivolts] */ | ||
62 | int _battery_voltage(void) | ||
63 | { | ||
64 | return (adc_read(ADC_BATTERY) * BATTERY_SCALE_FACTOR) >> 10; | ||
65 | } | ||
diff --git a/firmware/target/arm/rk27xx/ihifi/powermgmt-ihifi960.c b/firmware/target/arm/rk27xx/ihifi/powermgmt-ihifi960.c new file mode 100644 index 0000000000..c8797c0a32 --- /dev/null +++ b/firmware/target/arm/rk27xx/ihifi/powermgmt-ihifi960.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2013 Andrew Ryabinin | ||
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 "adc-target.h" | ||
25 | #include "powermgmt.h" | ||
26 | |||
27 | /* Battery voltage calculation and discharge/charge curves for the HiFiMAN HM-60x. | ||
28 | |||
29 | Battery voltage is calculated under the assumption that the adc full-scale | ||
30 | readout represents 3.00V and that the battery ADC channel is fed with | ||
31 | exactly half of the battery voltage (through a resistive divider). | ||
32 | Charge curve have not been calibrated yet. | ||
33 | */ | ||
34 | |||
35 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | ||
36 | { | ||
37 | /* TODO: this is just an initial guess */ | ||
38 | 7050, | ||
39 | }; | ||
40 | |||
41 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | ||
42 | { | ||
43 | 7000, | ||
44 | }; | ||
45 | |||
46 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ | ||
47 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | ||
48 | { | ||
49 | /* FIXME: Uncalibrated curve */ | ||
50 | { 7000, 7050, 7100, 7150, 7200, 7250, 7300, 7350, 7400, 7450, 7500 } | ||
51 | }; | ||
52 | |||
53 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ | ||
54 | const unsigned short percent_to_volt_charge[11] = | ||
55 | /* TODO: simple copy of discharge curve */ | ||
56 | { 7000, 7050, 7100, 7150, 7200, 7250, 7300, 7350, 7400, 7450, 7500 }; | ||
57 | |||
58 | /* full-scale ADC readout (2^10) in millivolt */ | ||
59 | #define BATTERY_SCALE_FACTOR 13000 | ||
60 | |||
61 | /* Returns battery voltage from ADC [millivolts] */ | ||
62 | int _battery_voltage(void) | ||
63 | { | ||
64 | return (adc_read(ADC_BATTERY) * BATTERY_SCALE_FACTOR) >> 10; | ||
65 | } | ||
diff --git a/firmware/target/arm/rk27xx/sd-rk27xx.c b/firmware/target/arm/rk27xx/sd-rk27xx.c index 9f6ba467b7..deca8a1fa7 100644 --- a/firmware/target/arm/rk27xx/sd-rk27xx.c +++ b/firmware/target/arm/rk27xx/sd-rk27xx.c | |||
@@ -134,6 +134,9 @@ static inline bool card_detect_target(void) | |||
134 | return !(GPIO_PFDR & (1<<2)); | 134 | return !(GPIO_PFDR & (1<<2)); |
135 | #elif defined(MA9) || defined(MA9C) || defined(MA8) || defined(MA8C) | 135 | #elif defined(MA9) || defined(MA9C) || defined(MA8) || defined(MA8C) |
136 | return (GPIO_PCDR & 0x80); | 136 | return (GPIO_PCDR & 0x80); |
137 | #elif defined(IHIFI760) || defined(IHIFI960) | ||
138 | /* TODO: find out pin */ | ||
139 | return true; | ||
137 | #else | 140 | #else |
138 | #error "Unknown target" | 141 | #error "Unknown target" |
139 | #endif | 142 | #endif |
diff --git a/tools/configure b/tools/configure index b33c798a3a..08b0e252b0 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -1336,6 +1336,11 @@ cat <<EOF | |||
1336 | 205) Samsung YP-R0 213) MA8C 221) NWZ-E360 series | 1336 | 205) Samsung YP-R0 213) MA8C 221) NWZ-E360 series |
1337 | 206) Android MIPS | 1337 | 206) Android MIPS |
1338 | 207) Android x86 | 1338 | 207) Android x86 |
1339 | |||
1340 | ==IHIFI== | ||
1341 | 230) 760 | ||
1342 | 231) 960 | ||
1343 | |||
1339 | EOF | 1344 | EOF |
1340 | 1345 | ||
1341 | buildfor=`input`; | 1346 | buildfor=`input`; |
@@ -3648,6 +3653,52 @@ fi | |||
3648 | arm926ejscc | 3653 | arm926ejscc |
3649 | ;; | 3654 | ;; |
3650 | 3655 | ||
3656 | 230|ihifi760) | ||
3657 | target_id=92 | ||
3658 | modelname="ihifi760" | ||
3659 | target="IHIFI760" | ||
3660 | memory=16 | ||
3661 | arm7ejscc | ||
3662 | tool="$rootdir/tools/scramble -rkw -modelnum=92" | ||
3663 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | ||
3664 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | ||
3665 | output="rockbox.rkw" | ||
3666 | bootoutput="bootloader.rkw" | ||
3667 | appextra="recorder:gui" | ||
3668 | plugins="" | ||
3669 | swcodec="yes" | ||
3670 | # toolset is the tools within the tools directory that we build for | ||
3671 | # this particular target. | ||
3672 | toolset="$genericbitmaptools" | ||
3673 | # architecture, manufacturer and model for the target-tree build | ||
3674 | t_cpu="arm" | ||
3675 | t_manufacturer="rk27xx" | ||
3676 | t_model="ihifi" | ||
3677 | ;; | ||
3678 | |||
3679 | 231|ihifi960) | ||
3680 | target_id=93 | ||
3681 | modelname="ihifi960" | ||
3682 | target="IHIFI960" | ||
3683 | memory=16 | ||
3684 | arm7ejscc | ||
3685 | tool="$rootdir/tools/scramble -rkw -modelnum=93" | ||
3686 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | ||
3687 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | ||
3688 | output="rockbox.rkw" | ||
3689 | bootoutput="bootloader.rkw" | ||
3690 | appextra="recorder:gui" | ||
3691 | plugins="" | ||
3692 | swcodec="yes" | ||
3693 | # toolset is the tools within the tools directory that we build for | ||
3694 | # this particular target. | ||
3695 | toolset="$genericbitmaptools" | ||
3696 | # architecture, manufacturer and model for the target-tree build | ||
3697 | t_cpu="arm" | ||
3698 | t_manufacturer="rk27xx" | ||
3699 | t_model="ihifi" | ||
3700 | ;; | ||
3701 | |||
3651 | *) | 3702 | *) |
3652 | echo "Please select a supported target platform!" | 3703 | echo "Please select a supported target platform!" |
3653 | exit 7 | 3704 | exit 7 |