summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/lcd.h74
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
125void lcd_init (void);
126void lcd_update (void);
127void lcd_clear_display (void);
128void lcd_position (int x, int y, int size);
129void lcd_string (const char *str);
130void lcd_bitmap (const unsigned char *src, int x, int y, int nx, int ny,
131 bool clear);
132void lcd_clearrect (int x, int y, int nx, int ny);
133void lcd_fillrect (int x, int y, int nx, int ny);
134void 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
226extern void lcd_data (int data); 284extern void lcd_data (int data);
227extern void lcd_instruction (int instruction); 285extern void lcd_instruction (int instruction);
@@ -229,7 +287,7 @@ extern void lcd_zero (int length);
229extern void lcd_fill (int data,int length); 287extern void lcd_fill (int data,int length);
230extern void lcd_copy (void *data,int count); 288extern void lcd_copy (void *data,int count);
231 289
232#ifdef JBP 290#ifdef HAVE_LCD_CHARCELLS
233 291
234extern void lcd_puts (char const *string); 292extern void lcd_puts (char const *string);
235extern void lcd_putns (char const *string,int n); 293extern 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
252static inline void lcd_toggle_backlight (void) 306static inline void lcd_toggle_backlight (void)