2020-09-04 06:29 PM
Hello, I have a 1bpp display and would like to invert the colors on all screens programatically. I've tried in
a) getColorFrom24BitRGB(uint8_t red, uint8_t green, uint8_t blue) by XORing with 1, which is ok except for bitmaps
b) TouchGFXHAL::flushFrameBuffer(const touchgfx::Rect& rect) by locking the framebuffer and XORing each word with 0xFFFFFFFF, which is ok on invalidated rect, but flickers on the remainder of the screen.
2020-09-12 05:12 PM
Is this possible?
2020-09-13 04:32 AM
Simpler way is use display registers setup to inverted mode, then no next code changes.
2020-09-14 04:01 AM
Unfortunately the device doesn't have this capability
2020-09-15 02:08 AM
Make two screens one positive one negative and switch between when your display controller IC dont have invert mode
2020-09-17 09:29 AM
Not practical - I have hundreds of screens.
2020-09-17 10:08 AM
Then you need display with invert function, that is practical, or virtual buffers mean touchgfx uses positive buffers and ltdc negative with double buffering.
Example command on LCD
void ili9341_Initnoinvert(void)
{
LCD_IO_Init();
ili9341_WriteReg(0x21);//Display Inversion Off
}
void ili9341_Initinvert(void)
{
LCD_IO_Init();
ili9341_WriteReg(0x20);//Display Inversion On
}