Main Site Documentation

Start address screen buffer


#1

Does anyone know the start address of the screen buffer for the Cobra? I asume I can directly write to it and see the update in real time on the LCD screen.


#2

It will be smart to just read it from the LCD registers. This way if we move it in future then your code wouldn’t need to changer.


#3

If anyone is interested, the starting address is set in the LCD_UPBASE register.

Cast it to a WORD table f.e.:


WORD * screenBuffer = (WORD *)LCD_UPBASE;

You write pixels like this:


screenBuffer[x + y * SCREEN_WIDTH] = color;

Color is a WORD (16 bit) defined as: upper 5 bits as RED, next 6 bits as GREEN, lower 5 bits as BLUE.


#4

+1k internets to Wouter.

I will definitely be using that in projects to come.