1.uboot用来LCD输出的最底层函数为:static void video_drawchars (int xx, int yy, unsigned char *s, int count),该函数位于driver/video/cfb_console.c中。
static void video_drawchars (int xx, int yy, unsigned char *s, int count)
{
u8 *cdat, *dest, *dest0;
int rows, offset, c;
offset = yy * VIDEO_LINE_LEN + xx * VIDEO_PIXEL_SIZE;
dest0 = video_fb_address + offset;
switch (VIDEO_DATA_FORMAT) {
case GDF__8BIT_INDEX:
case GDF__8BIT_332RGB:
while (count--) {
c = *s;
cdat = video_fontdata + c * VIDEO_FONT_HEIGHT;
for (rows = VIDEO_FONT_HEIGHT, dest = dest0;
rows--;
dest += VIDEO_LINE_LEN) {
u8 bits = *cdat++;
((u32 *) dest)[0] = (video_font_draw_table8[bits >> 4] & eorx) ^ bgx;
((u32 *) dest)[1] = (video_font_draw_table8[bits & 15] & eorx) ^ bgx;
}
dest0 += VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE;
s++;
}
break;
case GDF_15BIT_555RGB:
while (count--) {
c = *s;
cdat = video_fontdata + c * VIDEO_FONT_HEIGHT;
for (rows = VIDEO_FONT_HEIGHT, dest = dest0;
rows--;
dest += VIDEO_LINE_LEN) {
u8 bits = *cdat++;
((u32 *) dest)[0] = SHORTSWAP32 ((video_font_draw_table15 [bits >> 6] & eorx) ^ bgx);
((u32 *) dest)[1] = SHORTSWAP32 ((video_font_draw_table15 [bits >> 4 & 3] & eorx) ^ bgx);
((u32 *) dest)[2] = SHORTSWAP32 ((video_font_draw_table15 [bits >> 2 & 3] & eorx) ^ bgx);
((u32 *) dest)[3] = SHORT