diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-04-11 12:35:54 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-04-11 12:35:54 +0000 |
commit | a1a2d9ebcc1a37ae30fc16e00f5df027b40b9b7d (patch) | |
tree | 6770685816c557e0f18e86b9f3337869bc02ad84 /firmware/lcd.h | |
parent | f3e11d8f746660fe14bfc9afcddce51f43ade92c (diff) | |
download | rockbox-a1a2d9ebcc1a37ae30fc16e00f5df027b40b9b7d.tar.gz rockbox-a1a2d9ebcc1a37ae30fc16e00f5df027b40b9b7d.zip |
Updated a lot.
Uses the new config #defines for hardware features
Allows SIMULATOR
Now contains defines for the bitmap LCD display
Most of this came from Alan and Gary, kudos!
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@74 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/lcd.h')
-rw-r--r-- | firmware/lcd.h | 74 |
1 files changed, 64 insertions, 10 deletions
diff --git a/firmware/lcd.h b/firmware/lcd.h index 03c459c303..449adba57d 100644 --- a/firmware/lcd.h +++ b/firmware/lcd.h | |||
@@ -20,15 +20,17 @@ | |||
20 | #ifndef __LCD_H__ | 20 | #ifndef __LCD_H__ |
21 | #define __LCD_H__ | 21 | #define __LCD_H__ |
22 | 22 | ||
23 | #include <sh7034.h> | 23 | #include "sh7034.h" |
24 | #include <system.h> | 24 | #include "system.h" |
25 | #include "types.h" | ||
25 | 26 | ||
26 | #define LCDR (PBDR+1) | 27 | #define LCDR (PBDR+1) |
27 | 28 | ||
28 | /* PA14 : /LCD-BL --- backlight */ | 29 | /* PA14 : /LCD-BL --- backlight */ |
29 | #define LCD_BL (14-8) | 30 | #define LCD_BL (14-8) |
30 | 31 | ||
31 | #ifdef JBP /* JukeBox MP3 Player - AJB6K, AJBS20 */ | 32 | #ifdef HAVE_LCD_CHARCELLS |
33 | /* JukeBox MP3 Player - AJB6K, AJBS20 */ | ||
32 | # define LCD_DS +1 // PB0 = 1 --- 0001 --- LCD-DS | 34 | # define LCD_DS +1 // PB0 = 1 --- 0001 --- LCD-DS |
33 | # define LCD_CS +2 // PB1 = 1 --- 0010 --- /LCD-CS | 35 | # define LCD_CS +2 // PB1 = 1 --- 0010 --- /LCD-CS |
34 | # define LCD_SD +4 // PB2 = 1 --- 0100 --- LCD-SD | 36 | # define LCD_SD +4 // PB2 = 1 --- 0100 --- LCD-SD |
@@ -78,11 +80,63 @@ | |||
78 | # define LCD_PARAM_SYMBOL 0xF0 | 80 | # define LCD_PARAM_SYMBOL 0xF0 |
79 | #endif | 81 | #endif |
80 | 82 | ||
81 | #ifdef JBR /* JukeBox MP3 Recorder - AJBR --- FIXME */ | 83 | #ifdef HAVE_LCD_BITMAP |
82 | # error "JBR : FIX ME" | 84 | /* JukeBox MP3 Recorder - AJBR --- FIXME */ |
85 | |||
86 | /* Defines from Alan on IRC, April 11th 2002 */ | ||
87 | #define LCD_SD +1 // PB0 = 1 --- 0001 | ||
88 | #define LCD_SC +2 // PB1 = 1 --- 0010 | ||
89 | #define LCD_RS +4 // PB2 = 1 --- 0100 | ||
90 | #define LCD_CS +8 // PB3 = 1 --- 1000 | ||
91 | |||
92 | #define LCD_DS LCD_RS | ||
93 | |||
94 | #define LCD_SET_LOWER_COLUMN_ADDRESS ((char)0x00) | ||
95 | #define LCD_SET_HIGHER_COLUMN_ADDRESS ((char)0x10) | ||
96 | #define LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO ((char)0x20) | ||
97 | #define LCD_SET_POWER_CONTROL_REGISTER ((char)0x28) | ||
98 | #define LCD_SET_DISPLAY_START_LINE ((char)0x40) | ||
99 | #define LCD_SET_CONTRAST_CONTROL_REGISTER ((char)0x81) | ||
100 | #define LCD_SET_SEGMENT_REMAP ((char)0xA0) | ||
101 | #define LCD_SET_LCD_BIAS ((char)0xA2) | ||
102 | #define LCD_SET_ENTIRE_DISPLAY_OFF ((char)0xA4) | ||
103 | #define LCD_SET_ENTIRE_DISPLAY_ON ((char)0xA5) | ||
104 | #define LCD_SET_NORMAL_DISPLAY ((char)0xA6) | ||
105 | #define LCD_SET_REVERSE_DISPLAY ((char)0xA7) | ||
106 | #define LCD_SET_INDICATOR_OFF ((char)0xAC) | ||
107 | #define LCD_SET_INDICATOR_ON ((char)0xAD) | ||
108 | #define LCD_SET_DISPLAY_OFF ((char)0xAE) | ||
109 | #define LCD_SET_DISPLAY_ON ((char)0xAF) | ||
110 | #define LCD_SET_PAGE_ADDRESS ((char)0xB0) | ||
111 | #define LCD_SET_COM_OUTPUT_SCAN_DIRECTION ((char)0xC0) | ||
112 | #define LCD_SET_DISPLAY_OFFSET ((char)0xD3) | ||
113 | #define LCD_SET_READ_MODIFY_WRITE_MODE ((char)0xE0) | ||
114 | #define LCD_SOFTWARE_RESET ((char)0xE2) | ||
115 | #define LCD_NOP ((char)0xE3) | ||
116 | #define LCD_SET_END_OF_READ_MODIFY_WRITE_MODE ((char)0xEE) | ||
117 | |||
118 | |||
119 | #define DISP_X 112 | ||
120 | #define DISP_Y 64 | ||
121 | |||
122 | #define LCD_WIDTH DISP_X /* Display width in pixels */ | ||
123 | #define LCD_HEIGHT DISP_Y /* Display height in pixels */ | ||
124 | |||
125 | void lcd_init (void); | ||
126 | void lcd_update (void); | ||
127 | void lcd_clear_display (void); | ||
128 | void lcd_position (int x, int y, int size); | ||
129 | void lcd_string (const char *str); | ||
130 | void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny, | ||
131 | bool clear); | ||
132 | void lcd_clearrect (int x, int y, int nx, int ny); | ||
133 | void lcd_fillrect (int x, int y, int nx, int ny); | ||
134 | void lcd_invertrect (int x, int y, int nx, int ny); | ||
135 | |||
83 | #endif | 136 | #endif |
84 | 137 | ||
85 | 138 | ||
139 | #ifndef SIMULATOR | ||
86 | /* | 140 | /* |
87 | * About /CS,DS,SC,SD | 141 | * About /CS,DS,SC,SD |
88 | * ------------------ | 142 | * ------------------ |
@@ -222,6 +276,10 @@ static inline void lcd_byte (int byte,int rs) | |||
222 | /* %4 */ "I"(LCD_SC), | 276 | /* %4 */ "I"(LCD_SC), |
223 | /* %5 */ "z"(LCDR)); | 277 | /* %5 */ "z"(LCDR)); |
224 | } | 278 | } |
279 | #else | ||
280 | /* make a faked lcd_byte() function when simulating */ | ||
281 | #define lcd_byte(x,y) | ||
282 | #endif /* SIMULATOR */ | ||
225 | 283 | ||
226 | extern void lcd_data (int data); | 284 | extern void lcd_data (int data); |
227 | extern void lcd_instruction (int instruction); | 285 | extern void lcd_instruction (int instruction); |
@@ -229,7 +287,7 @@ extern void lcd_zero (int length); | |||
229 | extern void lcd_fill (int data,int length); | 287 | extern void lcd_fill (int data,int length); |
230 | extern void lcd_copy (void *data,int count); | 288 | extern void lcd_copy (void *data,int count); |
231 | 289 | ||
232 | #ifdef JBP | 290 | #ifdef HAVE_LCD_CHARCELLS |
233 | 291 | ||
234 | extern void lcd_puts (char const *string); | 292 | extern void lcd_puts (char const *string); |
235 | extern void lcd_putns (char const *string,int n); | 293 | extern void lcd_putns (char const *string,int n); |
@@ -243,10 +301,6 @@ static inline void lcd_goto (int x,int y) | |||
243 | 301 | ||
244 | #endif | 302 | #endif |
245 | 303 | ||
246 | #ifdef JBR | ||
247 | # error "JBR : FIX ME" | ||
248 | #endif | ||
249 | |||
250 | /*** BACKLIGHT ***/ | 304 | /*** BACKLIGHT ***/ |
251 | 305 | ||
252 | static inline void lcd_toggle_backlight (void) | 306 | static inline void lcd_toggle_backlight (void) |