diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-04-11 12:39:50 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-04-11 12:39:50 +0000 |
commit | eb2072507dd51c634ab7abef2c25bc61161e08fd (patch) | |
tree | 4b10b6ad411c78fad5091d63cd4968c8ddf12218 /uisimulator/lcd-recorder.c | |
parent | 2101b9bd4185835d4a70d92233c1762bf3722cde (diff) | |
download | rockbox-eb2072507dd51c634ab7abef2c25bc61161e08fd.tar.gz rockbox-eb2072507dd51c634ab7abef2c25bc61161e08fd.zip |
use live, actual firmware code instead
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@79 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/lcd-recorder.c')
-rw-r--r-- | uisimulator/lcd-recorder.c | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/uisimulator/lcd-recorder.c b/uisimulator/lcd-recorder.c deleted file mode 100644 index 9ddcb53817..0000000000 --- a/uisimulator/lcd-recorder.c +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.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 | |||
20 | /* | ||
21 | * Hardware-specific implementations for the Archos Recorder LCD. | ||
22 | * | ||
23 | * Archos Jukebox Recorder LCD functions. | ||
24 | * Solomon SSD1815Z controller and Shing Yih Technology G112064-30 LCD. | ||
25 | * | ||
26 | */ | ||
27 | |||
28 | /* LCD command codes */ | ||
29 | #define LCD_CNTL_RESET 0xe2 /* Software reset */ | ||
30 | #define LCD_CNTL_POWER 0x2f /* Power control */ | ||
31 | #define LCD_CNTL_CONTRAST 0x81 /* Contrast */ | ||
32 | #define LCD_CNTL_OUTSCAN 0xc8 /* Output scan direction */ | ||
33 | #define LCD_CNTL_SEGREMAP 0xa1 /* Segment remap */ | ||
34 | #define LCD_CNTL_DISPON 0xaf /* Display on */ | ||
35 | |||
36 | #define LCD_CNTL_PAGE 0xb0 /* Page address */ | ||
37 | #define LCD_CNTL_HIGHCOL 0x10 /* Upper column address */ | ||
38 | #define LCD_CNTL_LOWCOL 0x00 /* Lower column address */ | ||
39 | |||
40 | |||
41 | /* | ||
42 | * Initialize LCD | ||
43 | */ | ||
44 | void lcd_init (void) | ||
45 | { | ||
46 | /* Initialize PB0-3 as output pins */ | ||
47 | PBCR2 &= 0xff00; /* MD = 00 */ | ||
48 | PBIOR |= 0x000f; /* IOR = 1 */ | ||
49 | |||
50 | /* Initialize LCD */ | ||
51 | lcd_write (TRUE, LCD_CNTL_RESET); | ||
52 | lcd_write (TRUE, LCD_CNTL_POWER); | ||
53 | lcd_write (TRUE, LCD_CNTL_SEGREMAP); | ||
54 | lcd_write (TRUE, LCD_CNTL_OUTSCAN); | ||
55 | lcd_write (TRUE, LCD_CNTL_CONTRAST); | ||
56 | lcd_write (TRUE, 0x30); /* contrast parameter */ | ||
57 | lcd_write (TRUE, LCD_CNTL_DISPON); | ||
58 | |||
59 | lcd_clear(); | ||
60 | lcd_update(); | ||
61 | } | ||
62 | |||
63 | /* | ||
64 | * Update the display. | ||
65 | * This must be called after all other LCD funtions that change the display. | ||
66 | */ | ||
67 | void lcd_update (void) | ||
68 | { | ||
69 | int row, col; | ||
70 | |||
71 | /* Copy display bitmap to hardware */ | ||
72 | for (row = 0; row < DISP_Y/8; row++) { | ||
73 | lcd_write (TRUE, LCD_CNTL_PAGE | (row & 0xf)); | ||
74 | lcd_write (TRUE, LCD_CNTL_HIGHCOL); | ||
75 | lcd_write (TRUE, LCD_CNTL_LOWCOL); | ||
76 | |||
77 | for (col = 0; col < DISP_X; col++) | ||
78 | lcd_write (FALSE, display[row][col]); | ||
79 | } | ||
80 | } | ||
81 | |||
82 | /* | ||
83 | * Write a byte to LCD controller. | ||
84 | * command is TRUE if value is a command byte. | ||
85 | */ | ||
86 | static void lcd_write (BOOL command, int value) | ||
87 | { | ||
88 | int i; | ||
89 | |||
90 | /* Read PBDR, clear LCD bits */ | ||
91 | int pbdr = PBDR & ~(PBDR_LCD_CS1|PBDR_LCD_DC|PBDR_LCD_SDA|PBDR_LCD_SCK); | ||
92 | if (!command) | ||
93 | pbdr |= PBDR_LCD_DC; /* set data indicator */ | ||
94 | |||
95 | /* Send each bit, starting with MSB */ | ||
96 | for (i = 0; i < 8; i++) { | ||
97 | if (value & 0x80) { | ||
98 | /* Set data, toggle clock */ | ||
99 | PBDR = pbdr | PBDR_LCD_SDA; | ||
100 | PBDR = pbdr | PBDR_LCD_SDA | PBDR_LCD_SCK; | ||
101 | } | ||
102 | else { | ||
103 | /* Clear data, toggle clock */ | ||
104 | PBDR = pbdr; | ||
105 | PBDR = pbdr | PBDR_LCD_SCK; | ||
106 | } | ||
107 | value <<= 1; | ||
108 | } | ||
109 | } | ||