53 #define d4dlcd_frame_buffer_ID 1
58 #if (D4D_MK_STR(D4D_LLD_LCD) == d4dlcd_frame_buffer_ID)
73 static unsigned char D4DLCD_Init_FrameBuffer(
void);
74 static unsigned char D4DLCD_SetWindow_FrameBuffer(
unsigned short x1,
unsigned short y1,
unsigned short x2,
unsigned short y2);
75 static unsigned char D4DLCD_SetOrientation_FrameBuffer(
D4DLCD_ORIENTATION new_orientation);
76 static void D4DLCD_Send_PixelColor_FrameBuffer(
D4D_COLOR value) ;
77 static D4D_COLOR D4DLCD_Read_PixelColor_FrameBuffer(
void);
79 static unsigned char D4DLCD_DeInit_FrameBuffer(
void);
81 static void D4DLCD_ComputeCurAdrr(
void);
94 D4DLCD_Init_FrameBuffer,
95 D4DLCD_SetWindow_FrameBuffer,
96 D4DLCD_SetOrientation_FrameBuffer,
97 D4DLCD_Send_PixelColor_FrameBuffer,
98 D4DLCD_Read_PixelColor_FrameBuffer,
99 D4DLCD_Flush_FrameBuffer,
101 D4DLCD_DeInit_FrameBuffer,
110 static unsigned long win_cur_addr;
111 static unsigned long win_cur_w;
112 static unsigned long win_cur_h;
114 static unsigned long win_x;
115 static unsigned long win_y;
116 static unsigned long win_width;
117 static unsigned long win_height;
119 static signed long win_const1;
120 static signed long win_const2;
121 static signed long win_const3;
123 static unsigned long pix_cnt;
125 static unsigned long bpp_byte;
150 static unsigned char D4DLCD_Init_FrameBuffer(
void)
190 static unsigned char D4DLCD_DeInit_FrameBuffer(
void)
208 static unsigned char D4DLCD_SetWindow_FrameBuffer(
unsigned short x1,
unsigned short y1,
unsigned short x2,
unsigned short y2)
213 win_width = (
unsigned short)(x2 - x1);
214 win_height = (
unsigned short)(y2 - y1);
216 win_cur_w = win_width;
217 win_cur_h = win_height;
223 win_const2 = (
signed long)((p_fbDesc->
lcd_x_max - win_width) * bpp_byte);
224 win_const3 = (
signed long)(bpp_byte);
228 win_const1 = (
signed long)((p_fbDesc->
fb_start_addr + (pix_cnt * bpp_byte)) - (p_fbDesc->
lcd_x_max * win_y + win_x) * bpp_byte);
229 win_const2 = (
signed long)((p_fbDesc->
lcd_x_max - win_width) * -1 * bpp_byte);
230 win_const3 = (
signed long)(-1 * bpp_byte);
235 win_const2 = (
signed long)((win_width * p_fbDesc->
lcd_x_max + 1) * -1 * bpp_byte);
236 win_const3 = (
signed long)((p_fbDesc->
lcd_x_max) * bpp_byte);
241 win_const2 = (
signed long)((win_width * p_fbDesc->
lcd_x_max + 1) * bpp_byte);
242 win_const3 = (
signed long)((p_fbDesc->
lcd_x_max) * -1 * bpp_byte);
248 D4DLCD_ComputeCurAdrr();
264 static unsigned char D4DLCD_SetOrientation_FrameBuffer(
D4DLCD_ORIENTATION new_orientation)
268 lcd_orient = new_orientation;
271 switch(new_orientation)
299 static void D4DLCD_Send_PixelColor_FrameBuffer(
D4D_COLOR value)
301 #if D4DLCDHWFB_DIRECT_MEM_ACCESS == 1
303 #ifdef D4D_COLOR_TRANSPARENT
304 if(value != D4D_COLOR_TRANSPARENT)
307 D4DLCD_ComputeCurAdrr();
310 #ifdef D4D_COLOR_TRANSPARENT
311 if(value != D4D_COLOR_TRANSPARENT)
314 D4DLCD_ComputeCurAdrr();
329 static D4D_COLOR D4DLCD_Read_PixelColor_FrameBuffer(
void)
333 #if D4DLCDHWFB_DIRECT_MEM_ACCESS == 1
335 D4DLCD_ComputeCurAdrr();
339 D4DLCD_ComputeCurAdrr();
362 static void D4DLCD_ComputeCurAdrr(
void)
365 if(win_cur_w > win_width)
369 if(win_cur_h > win_height)
372 win_cur_addr = (
unsigned long)(win_const1);
375 win_cur_addr += win_const2;
378 win_cur_addr += win_const3;
382 #endif //(D4D_MK_STR(D4D_LLD_LCD) == d4dlcd_frame_buffer_ID)
D4D low level standard LCD interface API structure.
D4D driver - frame_buffer lcd driver function header file.
Orientation LandScape up side down.
D4D Driver main header file.
unsigned short lcd_x_max
The resolution of LCD in axis X.
D4DLCD_FLUSH_MODE
D4D low level eGUI flush screen types enumeration.
D4D Driver private header file.
Orientation Portrait up side down.
D4DLCD_ORIENTATION
D4D low level screen orientation enumeration type.
D4D low level frame buffer description structure.
#define NULL
Type definition of null pointer.
unsigned short lcd_y_max
The resolution of LCD in axis Y.
unsigned char bpp_byte
The bytes per pixel.
unsigned long fb_start_addr
The address of frame buffer.
D4D driver - common low level driver header file.
void D4DLCD_Delay_ms_Common(unsigned short period)
D4D driver - resistive touch screen driver function header file.
LWord D4D_COLOR
Type definition of eGUI color variables.