38.6.4.3 Color Look-Up Table Configuration

For each layer, the LCDC includes four 256-entry color look-up tables (CLUT) that can be used either for indexed color formats (up to 8bpp) or for gamma correction. One CLUT is dedicated to each pixel component (A, R, G and B).

When indexed color format is used, the frame buffer contains the CLUT read address used to recall the corresponding real ARGB pixel value previously stored.

For more details about gamma correction, see Gamma Correction.

There are two ways to load CLUT values:

  1. through the User Interface
  2. by DMA access

From the User Interface, the CLUT can be accessed directly at the corresponding address space, but only when the targeted layer CLUT and gamma correction are disabled (see LCDC_BASECLA, LCDC_OVR1CLA, LCDC_OVR2CLA, LCDC_HEOCLA). The CLUT content can also be fetched by the DMA at the next start of frame, before fetching the frame buffer. The following sequence is used to update the CLUT:

  1. Write the CLUT content(s) in memory.
  2. Configure the CLA field in the Color Look-Up Table Address registers of each layer (LCDC_xxxCLA).
  3. Check that all fields in LCDC_ATTRS are cleared.
  4. Write a one to the Update Color LUT field for each layer in LCDC_ATTRE.