If I use AL44 color schema, only 16 items are used in CLUT. In this
situation these 16 items are 0x00, 0x11, 0x22'th etc. of 256 elements of
the table.
It was easier to initialize the color table with a smaller and any order arraystatic uint_32t LCUT= {0x00000000, 0x11ff0000, 0x2200ff00, 0x330000ff, 0x44ffffff}; //black, colors, white

The name of “HAL_LTDC_ProgramLineInterrupt()” API is changed to “HAL_LTDC_ProgramLineEvent()” and the comment must be updated.

The inputted color lookup table contain only from 0 to 256 colors and cannot contain the index of the color, for this we have to specify and add the index (CLUT address) before the load. For the AL44 pixel format we can optimize the code to have in input only ordered 16 items as follows:

Sorry for dispute:)), but LTDC_LxCLUTWR upper 8 bits is the index itself, so I can address any single one of the 256 CLUT items.<br><br>Bits 31:24 CLUTADD[7:0]: CLUT Address<br>These bits configure the CLUT address (color position within the CLUT) of each RGB<br>value<br>Bits 23:16 RED[7:0]: Red value<br>These bits configure the red value<br>Bits 15:8 GREEN[7:0]: Green value<br>These bits configure the green value<br>Bits 7:0 BLUE[7:0]: Blue value<br>These bits configure the blue value<br><br>Original solution generates the index, so allows us to

load the table only from the the beginning, my solution allows the user

to load the table in any order by direct addressing. The most flexible way to initialize is supplying a given number [1..256] of 32bit values, where upmost 8bit is the index, the other 8-8-8 are the color components.<br>For example I'm able to change only the color nr 20 (and leave all the rest untouched), I call<br><br>uint32_t NewCLUTItem= 0x16000000; //black to color nr 20<br>HAL_LTDC_ConfigCLUT(&hltdc, &NewCLUTItem, 1, 0);<br><br><br>Thank you,<br>Tamas

In fact the implementation we have already suggested is generic and allows us to load the CLUT table from the begenning with the 256 items, which is the most used case. Loading the table in any order by direct addressing, can be a specific use case.