Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2002 Mats Lidell <matsl@contactor.se> |
| 11 | * |
| 12 | * All files in this archive are subject to the GNU General Public License. |
| 13 | * See the file COPYING in the source tree root for full license agreement. |
| 14 | * |
| 15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 16 | * KIND, either express or implied. |
| 17 | * |
| 18 | ****************************************************************************/ |
| 19 | #ifdef HAVE_LCD_CHARCELLS |
| 20 | |
| 21 | #include "sim_icons.h" |
| 22 | |
| 23 | #include <lcd.h> |
| 24 | #include <kernel.h> |
| 25 | #include <sprintf.h> |
| 26 | #include <string.h> |
| 27 | #include <debug.h> |
| 28 | |
Kjell Ericson | a901c3a | 2002-10-21 20:46:10 +0000 | [diff] [blame] | 29 | extern void lcd_print_icon(int x, int icon_line, bool enable, char **icon); |
| 30 | |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 31 | static char* icon_battery_bit[]= |
| 32 | { |
| 33 | "------", |
| 34 | "------", |
| 35 | "------", |
| 36 | "******", |
| 37 | "******", |
| 38 | "******", |
| 39 | "******", |
| 40 | "******", |
| 41 | "******", |
| 42 | "******", |
| 43 | "******", |
| 44 | "******", |
| 45 | "******", |
| 46 | "******", |
| 47 | "******", |
| 48 | "******", |
| 49 | "------", |
| 50 | "------", |
| 51 | "------", |
| 52 | NULL |
| 53 | }; |
| 54 | |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 55 | static char* icon_battery[]= |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 56 | { |
| 57 | " ********************************** ", |
Kjell Ericson | b3e41c7 | 2002-11-01 08:10:33 +0000 | [diff] [blame] | 58 | "*..................................* ", |
| 59 | "*..................................* ", |
| 60 | "*..................................* ", |
| 61 | "*..................................* ", |
| 62 | "*..................................*****", |
| 63 | "*..................................*****", |
| 64 | "*..................................*****", |
| 65 | "*..................................*****", |
| 66 | "*..................................*****", |
| 67 | "*..................................*****", |
| 68 | "*..................................*****", |
| 69 | "*..................................*****", |
| 70 | "*..................................*****", |
| 71 | "*..................................* ", |
| 72 | "*..................................* ", |
| 73 | "*..................................* ", |
| 74 | "*..................................* ", |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 75 | " ********************************** ", |
| 76 | NULL |
| 77 | }; |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 78 | |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 79 | static char* icon_volume[]= |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 80 | { |
| 81 | " ", |
| 82 | " ", |
| 83 | " ", |
| 84 | " ", |
| 85 | " ", |
| 86 | " ", |
| 87 | "* * * ", |
| 88 | "* * * ", |
| 89 | " * * * ", |
| 90 | " * * * ", |
| 91 | " * * * ", |
| 92 | " * * * ", |
| 93 | " * * * ", |
| 94 | " * * ** * ", |
| 95 | " * * * * * ", |
| 96 | " * * * * * ", |
| 97 | " * * * * * ", |
| 98 | " * * * * * ", |
| 99 | " * ** * ", |
| 100 | NULL |
| 101 | }; |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 102 | |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 103 | static char* icon_volume_1[]= |
| 104 | { |
| 105 | " ", |
| 106 | " ", |
| 107 | " ", |
| 108 | " ", |
| 109 | " ", |
| 110 | " ", |
| 111 | " ", |
| 112 | " ", |
| 113 | " ", |
| 114 | " ", |
| 115 | " ", |
| 116 | " ", |
| 117 | " ", |
| 118 | " ", |
| 119 | " ", |
| 120 | " ", |
| 121 | "**", |
| 122 | "**", |
| 123 | "**", |
| 124 | NULL |
| 125 | }; |
| 126 | |
| 127 | static char* icon_volume_2[]= |
| 128 | { |
| 129 | " ", |
| 130 | " ", |
| 131 | " ", |
| 132 | " ", |
| 133 | " ", |
| 134 | " ", |
| 135 | " ", |
| 136 | " ", |
| 137 | " ", |
| 138 | " ", |
| 139 | " ", |
| 140 | " ", |
| 141 | " ", |
| 142 | "**", |
| 143 | "**", |
| 144 | "**", |
| 145 | "**", |
| 146 | "**", |
| 147 | "**", |
| 148 | NULL |
| 149 | }; |
| 150 | |
| 151 | static char* icon_volume_3[]= |
| 152 | { |
| 153 | " ", |
| 154 | " ", |
| 155 | " ", |
| 156 | " ", |
| 157 | " ", |
| 158 | " ", |
| 159 | " ", |
| 160 | " ", |
| 161 | " ", |
| 162 | " ", |
| 163 | "**", |
| 164 | "**", |
| 165 | "**", |
| 166 | "**", |
| 167 | "**", |
| 168 | "**", |
| 169 | "**", |
| 170 | "**", |
| 171 | "**", |
| 172 | NULL |
| 173 | }; |
| 174 | |
| 175 | static char* icon_volume_4[]= |
| 176 | { |
| 177 | " ", |
| 178 | " ", |
| 179 | " ", |
| 180 | " ", |
| 181 | " ", |
| 182 | " ", |
| 183 | " ", |
| 184 | "**", |
| 185 | "**", |
| 186 | "**", |
| 187 | "**", |
| 188 | "**", |
| 189 | "**", |
| 190 | "**", |
| 191 | "**", |
| 192 | "**", |
| 193 | "**", |
| 194 | "**", |
| 195 | "**", |
| 196 | NULL |
| 197 | }; |
| 198 | |
| 199 | static char* icon_volume_5[]= |
| 200 | { |
| 201 | " ", |
| 202 | " ", |
| 203 | " ", |
| 204 | " ", |
| 205 | "**", |
| 206 | "**", |
| 207 | "**", |
| 208 | "**", |
| 209 | "**", |
| 210 | "**", |
| 211 | "**", |
| 212 | "**", |
| 213 | "**", |
| 214 | "**", |
| 215 | "**", |
| 216 | "**", |
| 217 | "**", |
| 218 | "**", |
| 219 | "**", |
| 220 | NULL |
| 221 | }; |
| 222 | |
| 223 | static char* icon_pause[]= |
| 224 | { |
| 225 | "**** ****", |
| 226 | "**** ****", |
| 227 | "**** ****", |
| 228 | "**** ****", |
| 229 | "**** ****", |
| 230 | "**** ****", |
| 231 | "**** ****", |
| 232 | "**** ****", |
| 233 | "**** ****", |
| 234 | "**** ****", |
| 235 | "**** ****", |
| 236 | "**** ****", |
| 237 | "**** ****", |
| 238 | "**** ****", |
| 239 | "**** ****", |
| 240 | "**** ****", |
| 241 | "**** ****", |
| 242 | "**** ****", |
| 243 | "**** ****", |
| 244 | NULL |
| 245 | }; |
| 246 | |
| 247 | static char* icon_play[]= |
| 248 | { |
| 249 | "** ", |
| 250 | "**** ", |
| 251 | "****** ", |
| 252 | "******** ", |
| 253 | "********** ", |
| 254 | "************ ", |
| 255 | "************** ", |
| 256 | "**************** ", |
| 257 | "****************** ", |
| 258 | "******************** ", |
| 259 | "****************** ", |
| 260 | "**************** ", |
| 261 | "************** ", |
| 262 | "************ ", |
| 263 | "********** ", |
| 264 | "******** ", |
| 265 | "****** ", |
| 266 | "**** ", |
| 267 | "** ", |
| 268 | NULL |
| 269 | }; |
| 270 | |
| 271 | static char* icon_record[]= |
| 272 | { |
| 273 | " ", |
| 274 | " ", |
| 275 | " ", |
| 276 | " ", |
| 277 | " *** ", |
| 278 | " ********* ", |
| 279 | " ************* ", |
| 280 | " *************** ", |
| 281 | "*****************", |
| 282 | "*****************", |
| 283 | "*****************", |
| 284 | " *************** ", |
| 285 | " ************* ", |
| 286 | " ********* ", |
| 287 | " *** ", |
| 288 | " ", |
| 289 | " ", |
| 290 | " ", |
| 291 | " ", |
| 292 | NULL |
| 293 | }; |
| 294 | |
| 295 | static char* icon_usb[]= |
| 296 | { |
| 297 | " ", |
| 298 | " ", |
| 299 | " ************************** ", |
| 300 | " ** **** ", |
| 301 | " ** ", |
| 302 | " ** ", |
| 303 | " ** ", |
| 304 | " ** ", |
| 305 | " ** ", |
| 306 | " **** ** **** ", |
| 307 | "***************************************************", |
| 308 | " **** ** **** ", |
| 309 | " ** ", |
| 310 | " ** ", |
| 311 | " ** ", |
| 312 | " ** ", |
| 313 | " *** *** ", |
| 314 | " ***************** ", |
| 315 | " ", |
| 316 | NULL |
| 317 | }; |
| 318 | |
| 319 | static char* icon_audio[]= |
| 320 | { |
| 321 | " ************************************** ", |
| 322 | " ****************************************** ", |
| 323 | " ** ** ", |
| 324 | " ** ** ", |
| 325 | " ** **** ** ** ****** ** **** ** ", |
| 326 | "** ****** ** ** ******* ** ****** **", |
| 327 | "** ** ** ** ** ** ** ** ** ** **", |
| 328 | "** ** ** ** ** ** ** ** ** ** **", |
| 329 | "** ** ** ** ** ** ** ** ** ** **", |
| 330 | "** ** ** ** ** ** ** ** ** ** **", |
| 331 | "** ******** ** ** ** ** ** ** ** **", |
| 332 | "** ******** ** ** ** ** ** ** ** **", |
| 333 | "** ** ** ** ** ** ** ** ** ** **", |
| 334 | "** ** ** ****** ******* ** ****** **", |
| 335 | " ** ** ** **** ****** ** **** ** ", |
| 336 | " ** ** ", |
| 337 | " ** ** ", |
| 338 | " ****************************************** ", |
| 339 | " ************************************** ", |
| 340 | NULL |
| 341 | }; |
| 342 | |
| 343 | static char* icon_param[]= |
| 344 | { |
| 345 | " ********************************************** ", |
| 346 | " ************************************************** ", |
| 347 | " ** ** ", |
| 348 | " ** ** ", |
| 349 | " ** ******* **** ******* ***** ** ** ** ", |
| 350 | "** ******** ****** ******** ******* ** ** **", |
| 351 | "** ** ** ** ** ** ** ** ** *** *** **", |
| 352 | "** ** ** ** ** ** ** ** ** *** *** **", |
| 353 | "** ** ** ** ** ** ** ** ** **** **** **", |
| 354 | "** ** ** ** ** ** ** ** ** ** **** ** **", |
| 355 | "** ******** ******** ******** ******** ** **** ** **", |
| 356 | "** ******* ******** ******* ******** ** ** ** **", |
| 357 | "** ** ** ** ** *** ** ** ** ** **", |
| 358 | "** ** ** ** ** *** ** ** ** ** **", |
| 359 | " ** ** ** ** ** *** ** ** ** ** ** ", |
| 360 | " ** ** ", |
| 361 | " ** ** ", |
| 362 | " ************************************************** ", |
| 363 | " ********************************************** ", |
| 364 | NULL |
| 365 | }; |
| 366 | |
| 367 | static char* icon_repeat[]= |
| 368 | { |
| 369 | " ************************* ", |
| 370 | " *************************** ", |
| 371 | " *** ", |
| 372 | " ** ", |
| 373 | " ** ", |
| 374 | " ** ", |
| 375 | " ** ", |
| 376 | "** ", |
| 377 | "** ", |
| 378 | "** ", |
| 379 | "** ", |
| 380 | "** ", |
| 381 | " ** ** ", |
| 382 | " ** **** ", |
| 383 | " ** ****** ", |
| 384 | " ** ******** ", |
| 385 | " *** ********** ", |
| 386 | " ***************************** ", |
| 387 | " *****************************", |
| 388 | NULL |
| 389 | }; |
| 390 | |
| 391 | static char* icon_repeat2[]= |
| 392 | { |
| 393 | " *", |
| 394 | " **", |
| 395 | "***", |
| 396 | " *", |
| 397 | " *", |
| 398 | " *", |
| 399 | " *", |
| 400 | " *", |
| 401 | " *", |
| 402 | " *", |
| 403 | " *", |
| 404 | " *", |
| 405 | " *", |
| 406 | " *", |
| 407 | " *", |
| 408 | " *", |
| 409 | " *", |
| 410 | " *", |
| 411 | " *", |
| 412 | NULL |
| 413 | }; |
| 414 | |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 415 | |
| 416 | struct icon_info |
| 417 | { |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 418 | char** bitmap; |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 419 | int xpos; |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 420 | int row; |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 421 | }; |
| 422 | |
Jörg Hohensohn | c6fb565 | 2003-04-19 13:15:33 +0000 | [diff] [blame] | 423 | #define ICON_VOLUME_POS 224 |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 424 | #define ICON_VOLUME_SIZE 20 |
| 425 | #define ICON_VOLUME_X_SIZE 2 |
| 426 | |
| 427 | static struct icon_info icons [] = |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 428 | { |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 429 | {icon_battery, 0, 0}, |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 430 | {icon_battery_bit, 5, 0}, |
| 431 | {icon_battery_bit, 15, 0}, |
| 432 | {icon_battery_bit, 25, 0}, |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 433 | {icon_usb, 0, 1}, |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 434 | {icon_play, 55, 0}, |
| 435 | {icon_record, 75, 0}, |
| 436 | {icon_pause, 100, 0}, |
| 437 | {icon_audio, 90, 1}, |
| 438 | {icon_repeat, 170, 0}, |
| 439 | {icon_repeat2, 170+35+4, 0}, |
| 440 | {icon_volume, ICON_VOLUME_POS, 0}, |
| 441 | {icon_volume_1, ICON_VOLUME_POS+ICON_VOLUME_SIZE, 0}, |
| 442 | {icon_volume_2, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(1*ICON_VOLUME_X_SIZE)+1, 0}, |
| 443 | {icon_volume_3, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(2*ICON_VOLUME_X_SIZE)+2, 0}, |
| 444 | {icon_volume_4, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(3*ICON_VOLUME_X_SIZE)+3, 0}, |
| 445 | {icon_volume_5, ICON_VOLUME_POS+ICON_VOLUME_SIZE+(4*ICON_VOLUME_X_SIZE)+4, 0}, |
| 446 | {icon_param, 170, 1} |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 447 | }; |
| 448 | |
| 449 | void |
Björn Stenberg | 86f9a84 | 2002-09-23 11:17:52 +0000 | [diff] [blame] | 450 | lcd_icon(int icon, bool enable) |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 451 | { |
Kjell Ericson | fe10eb3 | 2002-10-21 20:17:47 +0000 | [diff] [blame] | 452 | lcd_print_icon(icons[icon].xpos, icons[icon].row, enable, |
| 453 | icons[icon].bitmap); |
Mats Lidell | 89d2285 | 2002-08-21 10:37:34 +0000 | [diff] [blame] | 454 | } |
| 455 | |
| 456 | #endif /* HAVE_LCD_CHARCELLS */ |
Mats Lidell | 0d79fa1 | 2002-10-31 17:34:07 +0000 | [diff] [blame] | 457 | |
| 458 | |