AnsweredAssumed Answered

STM32CubeF4 LTDC minor issues

Question asked by Tamas Novak on Nov 16, 2014
Latest reply on Nov 22, 2014 by Tamas Novak
- In a comment in stm32f4xx_hal_ltdc.c   HAL_LTDC_ProgramLineInterrupt() is mentioned...but couldn't find such a function. It's not even declared in "...ltdc.h".


- In the source of HAL_LTDC_ConfigCLUT function you find

HAL_StatusTypeDef  HAL_LTDC_ConfigCLUT(LTDC_HandleTypeDef *hltdc, uint32_t *pCLUT, uint32_t CLUTSize, uint32_t LayerIdx) {
....
for(counter = 0; (counter < CLUTSize); counter++)   {
    tmp  = ((counter << 24) | ((uint32_t)(*pCLUT) & 0xFF) | ((uint32_t)(*pCLUT) & 0xFF00) | ((uint32_t)(*pCLUT) & 0xFF0000));
    pcounter = (uint32_t)pCLUT + sizeof(*pCLUT);
    pCLUT = (uint32_t *)pcounter;

    /* Specifies the C-LUT address and RGB value */
    __HAL_LTDC_LAYER(hltdc, LayerIdx)->CLUTWR  = tmp;
  }

  

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 array

static uint_32t  LCUT= {0x00000000, 0x11ff0000, 0x2200ff00, 0x330000ff, 0x44ffffff}; //black, colors, white

if code was simply

for(counter = 0; (counter < CLUTSize); counter++)   {
    __HAL_LTDC_LAYER(hltdc, LayerIdx)->CLUTWR  =  *pCLUT;
    pCLUT +=  sizeof(*pCLUT);
}

Outcomes