1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef _LCD_H_
14#define _LCD_H_
15#include <lcd_console.h>
16#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
17#include <bmp_layout.h>
18#include <asm/byteorder.h>
19#endif
20
21int bmp_display(ulong addr, int x, int y);
22struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
23 void **alloc_addr);
24
25#ifndef CONFIG_DM_VIDEO
26
27extern char lcd_is_enabled;
28extern int lcd_line_length;
29extern struct vidinfo panel_info;
30
31void lcd_ctrl_init(void *lcdbase);
32void lcd_enable(void);
33void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue);
34
35
36
37
38
39
40
41void lcd_set_flush_dcache(int flush);
42
43#if defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
44 defined CONFIG_CPU_MONAHANS
45#include <pxa_lcd.h>
46#elif defined(CONFIG_ATMEL_LCD) || defined(CONFIG_ATMEL_HLCD)
47#include <atmel_lcd.h>
48#elif defined(CONFIG_EXYNOS_FB)
49#include <exynos_lcd.h>
50#else
51typedef struct vidinfo {
52 ushort vl_col;
53 ushort vl_row;
54 ushort vl_rot;
55 u_char vl_bpix;
56 ushort *cmap;
57 void *priv;
58} vidinfo_t;
59
60static __maybe_unused ushort *configuration_get_cmap(void)
61{
62 return panel_info.cmap;
63}
64#endif
65
66ushort *configuration_get_cmap(void);
67
68extern vidinfo_t panel_info;
69
70void lcd_putc(const char c);
71void lcd_puts(const char *s);
72void lcd_printf(const char *fmt, ...);
73void lcd_clear(void);
74int lcd_display_bitmap(ulong bmp_image, int x, int y);
75
76
77
78
79
80
81int lcd_get_pixel_width(void);
82
83
84
85
86
87
88int lcd_get_pixel_height(void);
89
90
91
92
93
94
95int lcd_get_screen_rows(void);
96
97
98
99
100
101
102int lcd_get_screen_columns(void);
103
104
105
106
107
108
109int lcd_getbgcolor(void);
110
111
112
113
114
115
116int lcd_getfgcolor(void);
117
118
119
120
121
122
123
124void lcd_position_cursor(unsigned col, unsigned row);
125
126
127void lcd_show_board_info(void);
128
129
130int lcd_get_size(int *line_length);
131
132
133void lcd_sync(void);
134
135
136
137
138
139
140#define CONFIG_SYS_HIGH 0
141#define CONFIG_SYS_LOW 1
142
143#define LCD_MONOCHROME 0
144#define LCD_COLOR2 1
145#define LCD_COLOR4 2
146#define LCD_COLOR8 3
147#define LCD_COLOR16 4
148#define LCD_COLOR32 5
149
150#if defined(CONFIG_LCD_INFO_BELOW_LOGO)
151#define LCD_INFO_X 0
152#define LCD_INFO_Y (BMP_LOGO_HEIGHT + VIDEO_FONT_HEIGHT)
153#elif defined(CONFIG_LCD_LOGO)
154#define LCD_INFO_X (BMP_LOGO_WIDTH + 4 * VIDEO_FONT_WIDTH)
155#define LCD_INFO_Y VIDEO_FONT_HEIGHT
156#else
157#define LCD_INFO_X VIDEO_FONT_WIDTH
158#define LCD_INFO_Y VIDEO_FONT_HEIGHT
159#endif
160
161
162#ifndef LCD_BPP
163#define LCD_BPP LCD_COLOR8
164#endif
165
166#ifndef LCD_DF
167#define LCD_DF 1
168#endif
169
170
171#define NBITS(bit_code) (1 << (bit_code))
172#define NCOLORS(bit_code) (1 << NBITS(bit_code))
173
174#if LCD_BPP == LCD_COLOR8
175# define CONSOLE_COLOR_BLACK 0
176# define CONSOLE_COLOR_RED 1
177# define CONSOLE_COLOR_GREEN 2
178# define CONSOLE_COLOR_YELLOW 3
179# define CONSOLE_COLOR_BLUE 4
180# define CONSOLE_COLOR_MAGENTA 5
181# define CONSOLE_COLOR_CYAN 6
182# define CONSOLE_COLOR_GREY 14
183# define CONSOLE_COLOR_WHITE 15
184#elif LCD_BPP == LCD_COLOR32
185#define CONSOLE_COLOR_RED 0x00ff0000
186#define CONSOLE_COLOR_GREEN 0x0000ff00
187#define CONSOLE_COLOR_YELLOW 0x00ffff00
188#define CONSOLE_COLOR_BLUE 0x000000ff
189#define CONSOLE_COLOR_MAGENTA 0x00ff00ff
190#define CONSOLE_COLOR_CYAN 0x0000ffff
191#define CONSOLE_COLOR_GREY 0x00aaaaaa
192#define CONSOLE_COLOR_BLACK 0x00000000
193#define CONSOLE_COLOR_WHITE 0x00ffffff
194#define NBYTES(bit_code) (NBITS(bit_code) >> 3)
195#else
196# define CONSOLE_COLOR_BLACK 0x0000
197# define CONSOLE_COLOR_RED 0xF800
198# define CONSOLE_COLOR_GREEN 0x07E0
199# define CONSOLE_COLOR_YELLOW 0xFFE0
200# define CONSOLE_COLOR_BLUE 0x001F
201# define CONSOLE_COLOR_MAGENTA 0xF81F
202# define CONSOLE_COLOR_CYAN 0x07FF
203# define CONSOLE_COLOR_GREY 0xC618
204# define CONSOLE_COLOR_WHITE 0xffff
205#endif
206
207#if LCD_BPP == LCD_COLOR16
208#define fbptr_t ushort
209#elif LCD_BPP == LCD_COLOR32
210#define fbptr_t u32
211#else
212#define fbptr_t uchar
213#endif
214
215#ifndef PAGE_SIZE
216#define PAGE_SIZE 4096
217#endif
218
219#endif
220
221#endif
222