AnsweredAssumed Answered

lpc54608 LCD palette issue?

Question asked by Rob Jansen on Mar 10, 2017
Latest reply on Mar 28, 2017 by Rob Jansen

I just started to use the LCD controller and created a small test program based on the lcdc_tft example (in boards/lpcxpresso54608/driver_examples/lcdc/lcdc_tft in the SDK) and while playing around with that example I had some problems figuring out what the values for the palette in LCD_SetPalette() mean.

In the example, the palette is defined as uint32_t palette[] and the lpc54608.h also defines the palette registers in the chip as uint32_t PAL[128].


That got me confused. How do 8 bits per pixel result in a palette of 128 entries?

After checking with the user manual, I found that there are actually 256 palette entries, each 16 bits wide organized as 128 32 bits wide registers.

All access to registers is only 32 bits wide, so I do understand the fact that in lpc54608.h this is defined as such, but from a programmer point of view it would make sense to define the palette table as uint16_t array