From: Jean-Charles T. <jea...@rd...> - 2004-04-29 08:08:33
|
Hi all, I'am trying to access to the LCD directly by its controller. Thanks to the framebuffer source file i understood how to write a pixel with the 0x12 command. But now my problem is to read a value of a pixel? It is also the command 0x12, but where I read the value in the CGRAM pointed by my cursor??? I can't find this information in the documentation. I send you my code which draw a pixel. void drawPixel( int x, int y, int color){ unsigned short cursor_pos; unsigned data_lo, data_hi, data, mask; cursor_pos = (x/8) + (y * 0x20); // /* move the cursor */ lcd_cmd_and_data(0x11, cursor_pos >> 8, cursor_pos & 0xff); /* setup for printing */ lcd_prepare_cmd(0x12); data = color; data = data << ((x%4)*2); //Here is the problem!!! I know that my value of data_lo and data_hi are false lcd_wait_write(); data_lo = inl(0xc0001010); lcd_wait_write(); data_hi = inl(0xc0001010); mask = 0x03; mask = mask << ((x%4)*2); mask = ~mask; if (x%8<4){ data_lo &= mask; data_lo |= data; } else{ data_hi &= mask; data_hi |= data; } lcd_send_data( data_hi, data_lo); } If anyone have an idea..... thanks, jean-charles. |