Skip to main content
moredatalesscenter
Associate III
Question

Inverting colors

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.

This topic has been closed for replies.

6 replies

moredatalesscenter
Associate III

Is this possible?

MM..1
Super User

Simpler way is use display registers setup to inverted mode, then no next code changes.

moredatalesscenter
Associate III

Unfortunately the device doesn't have this capability

MM..1
Super User

Make two screens one positive one negative and switch between when your display controller IC dont have invert mode

moredatalesscenter
Associate III

Not practical - I have hundreds of screens.

MM..1
Super User

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

}