From: Bernard L. <le...@bo...> - 2004-04-29 18:32:08
|
Sorry, I don't think you can read back the values from the controller. You could check the databook but I'm fairly sure you can't do it. Anyhow its probably better/easier to just do what the framebuffer does and keep a local buffer. If you look at the microwdindows driver it uses the framebuffer's local storage to "double buffer" the ram. Speaking of microwindows though, why would you need your own drawPixel when you could just use that? cheers, bern. On Thu, 2004-04-29 at 10:08, Jean-Charles Tournier wrote: > Hi all, > > I'am trying to access to the LCD directly by its controller. Thanks > tothe framebuffer source file i understood how to write a pixel with > the0x12 command. But now my problem is to read a value of a pixel? It > isalso the command 0x12, but where I read the value in the CGRAM > pointedby 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 anddata_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. |