2025-07-03 12:11 AM
Hello
I have a monochrome RGB display which expects on the green pins a 8 bits grey scale value, 0x00 is black and 0xFF is white . I managed to make it work without TouchGfx, configuring LTDC with L8 pixel format on layer 0 and using a LUT (HAL_LTDC_ConfigCLUT and HAL_LTDC_EnableCLUT functions).
Now I want to use the display with TouchGfx.
I see I can not select a Frame buffer Pixel Format (LTDC) which would make Touch Gfx to write on frame buffer with a 8 bits grey scale format.
I selected ABGR2222, in order to test and see what happened.
I designed a few boxes of different grey scale on TouhGfx Designer. I generated code from TouchGfx Designer. I can see on my TouchGFXGeneratedHAL.cpp that a LCD8bpp_CLUT[] is used.
The program runs and the display shows something.
The problem is I can not see the whole range of 256 gray scale. It seems I only have a few of grey scales. I have an snippet which tries to show smoothly the grey scale on a box color, I only get a few of greys, not the whole range scale.
void InstaScreenView::handleTickEvent(){
greytickcounter++;
if(greytickcounter >= 6U){ // 6 frames 0.1 second
greytickcounter = 0U;
//InstaBox01.setColor(touchgfx::Color::getColorFromRGB(greycounter, greycounter, greycounter));
InstaBox01.setColor(greycounter);
InstaBox01.invalidate();
greycounter++;
if(greycounter >= 255U){
greycounter = 0U;
}
}
}
Regards
2025-07-03 1:45 AM
Hello @rvminsta_01 ,
You use the function box.setColor().
This functions takes as argument a colorType:
The colorType takes an int 32 :
But you only feed values from 0 to 255 which is ARGB8888.
So I would assume you are only changing the last part of the colortype, therefore only increasing the blue part of the display, but after blending with the other colors and after your screen also makes his transformation to go from color to grey (because it can only show grey), you get only a limited range of grey that goes from dark grey to black.
If you want to correctly check your display and the color format, you should increment the red, green and blue part.
To do so, you could call getColorFromRGB inside your colorType:
And set all the colors to the same value:
Regards,