I had a quick take on getting that partial flip thing to work, but for a reason I can't figure out ( I'm either too dumb, tired, or both ;p ) I can't make it work for only a vertical portion of the screen ( smaller than LCD_WIDTH )
any quick hint on this ?
( --> currently fixing & dev stuff on 1.44" 128x128 ;p )
// working version
// ..
spi.write(0x2A,dc);
spi.write(0,1,0,LCD_WIDTH);
// ..
spi.write(0x2B,dc);
spi.write(0,y1+1,-2,(y2-y1)+1);
// ..
var lines = 16; // size of buffer to use for un-paletting
var a = new Uint16Array(LCD_WIDTHlines);
for (var y=0;y<y2-y1;y+=lines) {
E.mapInPlace(new Uint8Array(g.buffer, y1LCD_WIDTHbits/8 + yLCD_WIDTHbits/8, a.length), a, palette, bits); //works whatever x & y !!!
spi.write(a.buffer);
}
// not working version :frowning: ..
// ..
spi.write(0x2A,dc);
spi.write(0,x1+1,0,(x2-x1));
// ..
spi.write(0x2B,dc);
spi.write(0,y1+1,-2,(y2-y1)+1);
// ..
var lines = 16; // size of buffer to use for un-paletting
var a = new Uint16Array((x2-x1)lines);
for (var y=0;y<y2-y1;y+=lines) {
E.mapInPlace(new Uint8Array(g.buffer, y1LCD_WIDTHbits/8 + yLCD_WIDTHbits/8+ x1*bits/8, a.length), a, palette, bits); // wip ... FIX THIS !! :|
spi.write(a.buffer);
}
Also, I've been able to figure out that my screen seems to accept either RBG or BRG, not RGB, and thanks to the following link /code, here's a quick & handy remapper for those in need ;)
-> I hope I'll be able to draw things faster in "unicolor" that way ;p ( one of the goals is to be able to draw in 2 colors, one black & the other dynamically changing )
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi there !
I had a quick take on getting that partial flip thing to work, but for a reason I can't figure out ( I'm either too dumb, tired, or both ;p ) I can't make it work for only a vertical portion of the screen ( smaller than LCD_WIDTH )
any quick hint on this ?
( --> currently fixing & dev stuff on 1.44" 128x128 ;p )
Also, I've been able to figure out that my screen seems to accept either RBG or BRG, not RGB, and thanks to the following link /code, here's a quick & handy remapper for those in need ;)
-> I hope I'll be able to draw things faster in "unicolor" that way ;p ( one of the goals is to be able to draw in 2 colors, one black & the other dynamically changing )