RA Flexible Software Package Documentation  Release v5.2.0

 
Graphics LCD (r_glcdc)

Functions

fsp_err_t R_GLCDC_Open (display_ctrl_t *const p_api_ctrl, display_cfg_t const *const p_cfg)
 
fsp_err_t R_GLCDC_Close (display_ctrl_t *const p_api_ctrl)
 
fsp_err_t R_GLCDC_Start (display_ctrl_t *const p_api_ctrl)
 
fsp_err_t R_GLCDC_Stop (display_ctrl_t *const p_api_ctrl)
 
fsp_err_t R_GLCDC_LayerChange (display_ctrl_t const *const p_api_ctrl, display_runtime_cfg_t const *const p_cfg, display_frame_layer_t layer)
 
fsp_err_t R_GLCDC_BufferChange (display_ctrl_t const *const p_api_ctrl, uint8_t *const framebuffer, display_frame_layer_t layer)
 
fsp_err_t R_GLCDC_ColorCorrection (display_ctrl_t const *const p_api_ctrl, display_correction_t const *const p_correction)
 
fsp_err_t R_GLCDC_ClutUpdate (display_ctrl_t const *const p_api_ctrl, display_clut_cfg_t const *const p_clut_cfg, display_frame_layer_t layer)
 
fsp_err_t R_GLCDC_ClutEdit (display_ctrl_t const *const p_api_ctrl, display_frame_layer_t layer, uint8_t index, uint32_t color)
 
fsp_err_t R_GLCDC_ColorKeySet (display_ctrl_t const *const p_api_ctrl, display_colorkeying_layer_t key_cfg, display_frame_layer_t layer)
 
fsp_err_t R_GLCDC_StatusGet (display_ctrl_t const *const p_api_ctrl, display_status_t *const p_status)
 

Detailed Description

Driver for the GLCDC peripheral on RA MCUs. This module implements the Display Interface.

Overview

The GLCDC is a multi-stage graphics output peripheral designed to automatically generate timing and data signals for LCD panels. As part of its internal pipeline the two internal graphics layers can be repositioned, alpha blended, color corrected, dithered and converted to and from a wide variety of pixel formats.

Features

The following features are available:

Feature Options
Input color formats ARGB8888, ARGB4444, ARGB1555, RGB888 (32-bit), RGB565, CLUT 8bpp, CLUT 4bpp, CLUT 1bpp
Output color formats RGB888, RGB666, RGB565, Serial RGB888 (8-bit parallel)
Correction processes Alpha blending, positioning, brightness and contrast, gamma correction, dithering
Timing signals Dot clock, Vsync, Hsync, Vertical and horizontal data enable (DE)
Maximum resolution Up to 2038 x 2043 pixels (dependent on sync signal width)
Maximum dot clock 60MHz for serial RGB mode, 54MHz otherwise
Internal clock divisors 1-9, 12, 16, 24, 32
Interrupts Line detect (Vblank), Layer 1 underflow, Layer 2 underflow
Other functions Byte-order and endianness control, line repeat function

Configuration

Build Time Configurations for r_glcdc

The following build time configurations are defined in fsp_cfg/r_glcdc_cfg.h:

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
Default (BSP) If selected, code for parameter checking is included in the build.
Color Correction
  • On
  • Off
Off If selected, code to adjust brightness, contrast and gamma settings is included in the build. When disabled all color correction configuration options are ignored.

Configurations for Graphics > Graphics LCD (r_glcdc)

This module can be added to the Stacks tab via New Stack > Graphics > Graphics LCD (r_glcdc).

ConfigurationOptionsDefaultDescription
General
NameName must be a valid C symbolg_display0 Module name.
Interrupts
Callback FunctionName must be a valid C symbolNULL A user callback function can be defined here.
Line Detect Interrupt PriorityMCU Specific OptionsSelect the line detect (Vsync) interrupt priority.
Underflow 1 Interrupt PriorityMCU Specific OptionsSelect the underflow interrupt priority for layer 1.
Underflow 2 Interrupt PriorityMCU Specific OptionsSelect the underflow interrupt priority for layer 2.
Input
Input > Graphics Layer 1
Input > Graphics Layer 1 > General
Enabled
  • Yes
  • No
Yes Specify Used if the graphics layer 1 is used. If so a framebuffer will be automatically generated based on the specified height and horizontal stride.
Horizontal sizeValue must be an integer from 16 to 2040480 Specify the number of horizontal pixels.
Vertical sizeValue must be an integer from 16 to 2043854 Specify the number of vertical pixels.
Horizontal positionMust be a valid non-negative integer with a maximum configurable value of 40910 Specify the horizontal offset in pixels of the graphics layer from the background layer.
Vertical positionMust be a valid non-negative integer with a maximum configurable value of 40940 Specify the vertical offset in pixels of the graphics layer from the background layer.
Color format
  • ARGB8888 (32-bit)
  • RGB888 (32-bit)
  • RGB565 (16-bit)
  • ARGB1555 (16-bit)
  • ARGB4444 (16-bit)
  • CLUT8 (8-bit)
  • CLUT4 (4-bit)
  • CLUT1 (1-bit)
RGB565 (16-bit) Specify the graphics layer Input format. If selecting CLUT formats, you must write the CLUT table data before starting output.
Line descending mode
  • Enabled
  • Disabled
Disabled Select Used if the framebuffer starts from the bottom of the line.
Input > Graphics Layer 1 > Background Color
AlphaValue must be an integer from 0 to 255255 Based on the alpha value, either the graphics Layer 2 (foreground graphics layer) is blended into the graphics Layer 1 (background graphics layer) or the graphics Layer 1 is blended into the monochrome background layer.
RedValue must be an integer from 0 to 255255 Red component of the background color for layer 1.
GreenValue must be an integer from 0 to 255255 Green component of the background color for layer 1.
BlueValue must be an integer from 0 to 255255 Blue component of the background color for layer 1.
Input > Graphics Layer 1 > Framebuffer
Framebuffer nameThis property must be a valid C symbolfb_background Specify the name for the framebuffer for Layer 1.
Number of framebuffersMust be a valid non-negative integer2 Number of framebuffers allocated for Graphics Layer 1.
Section for framebuffer allocationManual Entry.sdram Specify the section in which to allocate the framebuffer. When Arm Compiler 6 is used to place this memory in on-chip SRAM, the section name must be .bss or start with .bss. to avoid consuming unnecessary ROM space.
Input > Graphics Layer 1 > Line Repeat
Enable
  • On
  • Off
Off Select On if the display will be repeated from a smaller section of the framebuffer.
Repeat countMust be a valid non-negative integer with a maximum configurable value of 65535 i.e (vertical size) x (lines repeat times) must be equal to the panel vertical size0 Specify the number of times the image is repeated.
Input > Graphics Layer 1 > Fading
Mode
  • None
  • Fade-in
  • Fade-out
None Select the fade method.
SpeedValue must be an integer from 0 to 2550 Specify the number of frames for the fading transition to complete.
Input > Graphics Layer 2
Input > Graphics Layer 2 > General
Enabled
  • Yes
  • No
No Specify Used if the graphics layer 2 is used. If so a framebuffer will be automatically generated based on the specified height and horizontal stride.
Horizontal sizeValue must be be an integer from 16 to 2040480 Specify the number of horizontal pixels.
Vertical sizeValue must be be an integer from 16 to 2043854 Specify the number of vertical pixels.
Horizontal positionMust be a valid non-negative integer with a maximum configurable value of 40910 Specify the horizontal offset in pixels of the graphics layer from the background layer.
Vertical positionMust be a valid non-negative integer with a maximum configurable value of 40940 Specify the vertical offset in pixels of the graphics layer from the background layer.
Color format
  • ARGB8888 (32-bit)
  • RGB888 (32-bit)
  • RGB565 (16-bit)
  • ARGB1555 (16-bit)
  • ARGB4444 (16-bit)
  • CLUT8 (8-bit)
  • CLUT4 (4-bit)
  • CLUT1 (1-bit)
RGB565 (16-bit) Specify the graphics layer Input format. If selecting CLUT formats, you must write the CLUT table data before starting output.
Line descending mode
  • Enabled
  • Disabled
Disabled Select Used if the framebuffer starts from the bottom of the line.
Input > Graphics Layer 2 > Background Color
AlphaValue must be an integer from 0 to 255255 Based on the alpha value, either the graphics Layer 2 (foreground graphics layer) is blended into the graphics Layer 1 (background graphics layer) or the graphics Layer 1 is blended into the monochrome background layer.
RedValue must be an integer from 0 to 255255 Red component of the background color for layer 2.
GreenValue must be an integer from 0 to 255255 Green component of the background color for layer 2.
BlueValue must be an integer from 0 to 255255 Blue component of the background color for layer 2.
Input > Graphics Layer 2 > Framebuffer
Framebuffer nameThis property must be a valid C symbolfb_foreground Specify the name for the framebuffer for Layer 2.
Number of framebuffersMust be a valid non-negative integer2 Number of framebuffers allocated for Graphics Layer 2.
Section for framebuffer allocationManual Entry.sdram Specify the section in which to allocate the framebuffer. When Arm Compiler 6 is used to place this memory in on-chip SRAM, the section name must be .bss or start with .bss. to avoid consuming unnecessary ROM space.
Input > Graphics Layer 2 > Line Repeat
Enable
  • On
  • Off
Off Select On if the display will be repeated from a smaller section of the framebuffer.
Repeat countMust be a valid non-negative integer with a maximum configurable value of 65535 i.e (vertical size) x (lines repeat times) must be equal to the panel vertical size0 Specify the number of times the image is repeated.
Input > Graphics Layer 2 > Fading
Mode
  • None
  • Fade-in
  • Fade-out
None Select the fade method.
SpeedValue must be an integer from 0 to 2550 Specify the number of frames for the fading transition to complete.
Output
Output > Timing
Horizontal total cyclesValue must be an integer from 24 to 2047559 Specify the total cycles in a horizontal line. Set to the number of cycles defined in the data sheet of LCD panel sheet in your system
Horizontal active video cyclesValue must be an integer from 16 to 2040480 Specify the number of active video cycles in a horizontal line (including front and back porch). Set to the number of cycles defined in the data sheet of LCD panel sheet in your system.
Horizontal back porch cyclesValue must be an integer from 5 to 20295 Specify the number of back porch cycles in a horizontal line. Back porch starts from the beginning of Hsync cycles, which means back porch cycles contain Hsync cycles. Set to the number of cycles defined in the data sheet of LCD panel sheet in your system.
Horizontal sync signal cyclesValue must be an integer from 0 to 20462 Specify the number of Hsync signal assertion cycles. Set to the number of cycles defined in the data sheet of LCD panel sheet in your system.
Horizontal sync signal polarity
  • Low active
  • High active
Low active Select the polarity of Hsync signal to match your system.
Vertical total linesValue must be an integer from 20 to 2047894 Specify number of total lines in a frame (including front and back porch).
Vertical active video linesValue must be an integer from 16 to 2043854 Specify the number of active video lines in a frame.
Vertical back porch linesValue must be an integer from 3 to 203020 Specify the number of back porch lines in a frame. Back porch starts from the beginning of Vsync lines, which means back porch lines contain Vsync lines.
Vertical sync signal linesValue must be an integer from 0 to 20463 Specify the Vsync signal assertion lines in a frame.
Vertical sync signal polarity
  • Low active
  • High active
Low active Select the polarity of Vsync signal to match to your system.
Data Enable Signal Polarity
  • Low active
  • High active
High active Select the polarity of Data Enable signal to match to your system.
Sync edge
  • Rising edge
  • Falling edge
Falling edge Select the polarity of Sync signals to match to your system.
Output > Format
Color format
  • 24bits RGB888
  • 18bits RGB666
  • 16bits RGB565
  • 8bits serial
24bits RGB888 Specify the graphics layer output format to match to your LCD panel.
Color order
  • RGB
  • BGR
RGB Select data order for output signal to LCD panel.
Endian
  • Little endian
  • Big endian
Little endian Select data endianness for output signal to LCD panel.
Output > Background
AlphaValue must be an integer from 0 to 255255 Alpha component of the background color.
RedValue must be an integer from 0 to 2550 Red component of the background color.
GreenValue must be an integer from 0 to 2550 Green component of the background color.
BlueValue must be an integer from 0 to 2550 Blue component of the background color.
CLUT
Enabled
  • Yes
  • No
No Specify Used if selecting CLUT formats for a graphics layer input format. If used, a buffer (CLUT_buffer) will be automatically generated based on the selected pixel width.
SizeMust be a valid non-negative integer with a maximum configurable value of 256256 Specify the number of entries for the CLUT source data buffer. Each entry consumes 4 bytes (1 word).
TCON
Hsync pin select
  • Not used
  • LCD_TCON0
  • LCD_TCON1
  • LCD_TCON2
  • LCD_TCON3
LCD_TCON1 Select the TCON pin used for the Hsync signal to match to your system.
Vsync pin select
  • Not used
  • LCD_TCON0
  • LCD_TCON1
  • LCD_TCON2
  • LCD_TCON3
LCD_TCON0 Select TCON pin used for Vsync signal to match to your system.
Data enable (DE) pin select
  • Not used
  • LCD_TCON0
  • LCD_TCON1
  • LCD_TCON2
  • LCD_TCON3
LCD_TCON2 Select TCON pin used for DataEnable signal to match to your system.
Panel clock source
  • Internal clock (GLCDCLK)
  • External clock (LCD_EXTCLK)
Internal clock (GLCDCLK) Choose between an internal GLCDCLK generated from PCLKA or an external clock provided to the LCD_EXTCLK pin.
Panel clock division ratioRefer to the RA Configuration tool for available options.1/8 Select the clock source divider value.
Color Correction
Color Correction > Brightness
Enabled
  • Yes
  • No
No Enable brightness color correction.
Red channelValue must be an integer from 0 to 1023512 Red component of the brightness calibration. This value is divided by 512 to determine gain.
Green channelValue must be an integer from 0 to 1023512 Green component of the brightness calibration. This value is divided by 512 to determine gain.
Blue channelValue must be an integer from 0 to 1023512 Blue component of the brightness calibration. This value is divided by 512 to determine gain.
Color Correction > Contrast
Enabled
  • Yes
  • No
No Enable contrast color correction.
Red channel gainValue must be an integer from 0 to 255128 Red component of the contrast calibration. This value is divided by 128 to determine gain.
Green channel gainValue must be an integer from 0 to 255128 Green component of the contrast calibration. This value is divided by 128 to determine gain.
Blue channel gainValue must be an integer from 0 to 255128 Blue component of the contrast calibration. This value is divided by 128 to determine gain.
Color Correction > Gamma
Color Correction > Gamma > Tables
Color Correction > Gamma > Tables > Red
Color Correction > Gamma > Tables > Red > Gain
0Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
1Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
2Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
3Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
4Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
5Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
6Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
7Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
8Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
9Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
10Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
11Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
12Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
13Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
14Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
15Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
Color Correction > Gamma > Tables > Red > Threshold
1Value must be an integer from 0 to 102364 Enter a threshold value between the surrounding values less than or equal to 1023.
2Value must be an integer from 0 to 1023128 Enter a threshold value between the surrounding values less than or equal to 1023.
3Value must be an integer from 0 to 1023192 Enter a threshold value between the surrounding values less than or equal to 1023.
4Value must be an integer from 0 to 1023256 Enter a threshold value between the surrounding values less than or equal to 1023.
5Value must be an integer from 0 to 1023320 Enter a threshold value between the surrounding values less than or equal to 1023.
6Value must be an integer from 0 to 1023384 Enter a threshold value between the surrounding values less than or equal to 1023.
7Value must be an integer from 0 to 1023448 Enter a threshold value between the surrounding values less than or equal to 1023.
8Value must be an integer from 0 to 1023512 Enter a threshold value between the surrounding values less than or equal to 1023.
9Value must be an integer from 0 to 1023576 Enter a threshold value between the surrounding values less than or equal to 1023.
10Value must be an integer from 0 to 1023640 Enter a threshold value between the surrounding values less than or equal to 1023.
11Value must be an integer from 0 to 1023704 Enter a threshold value between the surrounding values less than or equal to 1023.
12Value must be an integer from 0 to 1023768 Enter a threshold value between the surrounding values less than or equal to 1023.
13Value must be an integer from 0 to 1023832 Enter a threshold value between the surrounding values less than or equal to 1023.
14Value must be an integer from 0 to 1023896 Enter a threshold value between the surrounding values less than or equal to 1023.
15Value must be an integer from 0 to 1023960 Enter a threshold value between the surrounding values less than or equal to 1023.
Color Correction > Gamma > Tables > Green
Color Correction > Gamma > Tables > Green > Gain
0Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
1Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
2Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
3Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
4Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
5Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
6Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
7Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
8Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
9Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
10Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
11Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
12Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
13Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
14Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
15Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
Color Correction > Gamma > Tables > Green > Threshold
1Value must be an integer from 0 to 102364 Enter a threshold value between the surrounding values less than or equal to 1023.
2Value must be an integer from 0 to 1023128 Enter a threshold value between the surrounding values less than or equal to 1023.
3Value must be an integer from 0 to 1023192 Enter a threshold value between the surrounding values less than or equal to 1023.
4Value must be an integer from 0 to 1023256 Enter a threshold value between the surrounding values less than or equal to 1023.
5Value must be an integer from 0 to 1023320 Enter a threshold value between the surrounding values less than or equal to 1023.
6Value must be an integer from 0 to 1023384 Enter a threshold value between the surrounding values less than or equal to 1023.
7Value must be an integer from 0 to 1023448 Enter a threshold value between the surrounding values less than or equal to 1023.
8Value must be an integer from 0 to 1023512 Enter a threshold value between the surrounding values less than or equal to 1023.
9Value must be an integer from 0 to 1023576 Enter a threshold value between the surrounding values less than or equal to 1023.
10Value must be an integer from 0 to 1023640 Enter a threshold value between the surrounding values less than or equal to 1023.
11Value must be an integer from 0 to 1023704 Enter a threshold value between the surrounding values less than or equal to 1023.
12Value must be an integer from 0 to 1023768 Enter a threshold value between the surrounding values less than or equal to 1023.
13Value must be an integer from 0 to 1023832 Enter a threshold value between the surrounding values less than or equal to 1023.
14Value must be an integer from 0 to 1023896 Enter a threshold value between the surrounding values less than or equal to 1023.
15Value must be an integer from 0 to 1023960 Enter a threshold value between the surrounding values less than or equal to 1023.
Color Correction > Gamma > Tables > Blue
Color Correction > Gamma > Tables > Blue > Gain
0Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
1Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
2Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
3Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
4Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
5Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
6Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
7Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
8Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
9Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
10Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
11Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
12Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
13Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
14Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
15Value must be an integer from 0 to 20471024 Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively).
Color Correction > Gamma > Tables > Blue > Threshold
1Value must be an integer from 0 to 102364 Enter a threshold value between the surrounding values less than or equal to 1023.
2Value must be an integer from 0 to 1023128 Enter a threshold value between the surrounding values less than or equal to 1023.
3Value must be an integer from 0 to 1023192 Enter a threshold value between the surrounding values less than or equal to 1023.
4Value must be an integer from 0 to 1023256 Enter a threshold value between the surrounding values less than or equal to 1023.
5Value must be an integer from 0 to 1023320 Enter a threshold value between the surrounding values less than or equal to 1023.
6Value must be an integer from 0 to 1023384 Enter a threshold value between the surrounding values less than or equal to 1023.
7Value must be an integer from 0 to 1023448 Enter a threshold value between the surrounding values less than or equal to 1023.
8Value must be an integer from 0 to 1023512 Enter a threshold value between the surrounding values less than or equal to 1023.
9Value must be an integer from 0 to 1023576 Enter a threshold value between the surrounding values less than or equal to 1023.
10Value must be an integer from 0 to 1023640 Enter a threshold value between the surrounding values less than or equal to 1023.
11Value must be an integer from 0 to 1023704 Enter a threshold value between the surrounding values less than or equal to 1023.
12Value must be an integer from 0 to 1023768 Enter a threshold value between the surrounding values less than or equal to 1023.
13Value must be an integer from 0 to 1023832 Enter a threshold value between the surrounding values less than or equal to 1023.
14Value must be an integer from 0 to 1023896 Enter a threshold value between the surrounding values less than or equal to 1023.
15Value must be an integer from 0 to 1023960 Enter a threshold value between the surrounding values less than or equal to 1023.
Red
  • On
  • Off
Off Enable gamma color correction for the red channel.
Green
  • On
  • Off
Off Enable gamma color correction for the green channel.
Blue
  • On
  • Off
Off Enable gamma color correction for the blue channel.
Table Mode
  • Constant
  • Variable
Variable Set to Constant to override the automatically-generated RAM gamma tables with a constant declaration using the provided values.
Process order
  • Brightness/contrast first
  • Gamma first
Brightness/contrast first Select the color correction processing order.
Dithering
Enabled
  • Yes
  • No
No Enable dithering to reduce the effect of color banding.
Mode
  • Truncate
  • Round off
  • 2x2 Pattern
Truncate Select the dithering mode.
Pattern A
  • Pattern 00
  • Pattern 01
  • Pattern 10
  • Pattern 11
Pattern 11 Select the dithering pattern.
Pattern B
  • Pattern 00
  • Pattern 01
  • Pattern 10
  • Pattern 11
Pattern 11 Select the dithering pattern.
Pattern C
  • Pattern 00
  • Pattern 01
  • Pattern 10
  • Pattern 11
Pattern 11 Select the dithering pattern.
Pattern D
  • Pattern 00
  • Pattern 01
  • Pattern 10
  • Pattern 11
Pattern 11 Select the dithering pattern.

Clock Configuration

The peripheral clock for this module is PCLKA.

The dot clock is typically generated from the PLL with a maximum output frequency of 54 MHz in most pixel formats (60 MHz for serial RGB). Optionally, a clock signal can be provided to the LCD_EXTCLK pin for finer framerate control (60 MHz maximum input). With either clock source dividers of 1-9, 12, 16, 24 and 32 may be used. Clocks must be initialized and settled prior to starting this module.

Pin Configuration

This module controls a variety of pins necessary for LCD data and timing signal output:

Pin Name Function Notes
LCD_EXTCLK External clock signal input The maximum input clock frequency is 60MHz.
LCD_CLK Dot clock output The maximum output frequency is 54MHz (60MHz in serial RGB mode).
LCD_DATAn Pixel data output lines Pin assignment and color order is based on the output block configuration. See the RA6M3 User's Manual (R01UH0886EJ0100) section 58.1.4 "Output Control for Data Format" for details.
LCD_TCONn Panel timing signal output These pins can be configured to output vertical and horizontal synchronization and data valid signals.
Note
There are two banks of pins listed for the GLCDC in the RA6M3 User's Manual (_A and _B). In most cases the _B bank will be used as _A conflicts with SDRAM pins. In either case, it is generally recommended to only use pins from only one bank at a time as this allows for superior signal routing both inside and outside the package. If _A and _B pins must be mixed be sure to note the timing precision penalty detailed in Table 60.33 in in the RA6M3 User's Manual.

Usage Notes

Overview

The GLCDC peripheral is a combination of several sub-peripherals that form a pixel data processing pipeline. Each block passes pixel data to the next but otherwise they are disconnected from one another - in other words, changing timing block parameters does not affect the output generation block configuration and vice versa.

Initial Configuration

During R_GLCDC_Open all configured parameters are set in the GLCDC peripheral fully preparing it for operation. Once opened, calling R_GLCDC_Start is typically all that is needed for basic operation. Background generation, timing and output parameters are not configurable at runtime, though layer control and color correction options can be altered.

Framebuffer Allocation

The framebuffer should be allocated in the highest-speed region available without displacing the stack, heap and other program-critical structures. Regardless of the placement two rules must be followed to ensure correct operation of the GLCDC:

Note
Framebuffers allocated through the RA Configuraton tool automatically follow the alignment and size requirements.

If your framebuffer will be placed in internal memory it is recommended to avoid any high-speed RAM regions as there is typically no speed advantage for doing so. In particular, it is important to ensure the framebuffer does not push the stack or any heaps outside of high-speed RAM areas to preserve CPU performance.

Graphics Layers and Timing Parameters

The GLCDC synthesizes graphics data through two configurable graphics layers onto a background layer. The background is used as a solid-color canvas upon which to composite data from the graphics layers. The two graphics layers are blended on top of each other (Layer 2 above Layer 1) and overlaid on the background layer based on their individual configuration. The placement of the layers (as well as LCD timing parameters) are detailed in Figure 1. The colors of the dimensions indicate which element of the display_cfg_t struct is being referenced - for example, the width of the background layer would be [display_cfg].output.htiming.display_cyc as shown in the figure below.

r_glcdc_timing.svg
GLCDC layers and timing
Note
The data enable signal (if configured) is the logical AND of the horizontal and vertical data valid signals.
In the GLCDC layers and timing figure, only one graphics layer is shown for simplicity. Additionally, in most applications the graphics layer(s) will be the same dimensions as the background layer.


Runtime Configuration Options

Note
All runtime configurations detailed below are also automatically configured during R_GLCDC_Open based on the options selected in the RA Configuration editor.

Blend processing

Control of layer positioning, alpha blending and fading is possible at runtime via R_GLCDC_LayerChange. This function takes a display_runtime_cfg_t parameter which contains the same input and layer elements as the display_cfg_t control block. Refer to the documentation for display_runtime_cfg_t as well as the Examples below to see what options are configurable.

Brightness and contrast

Brightness and contrast correction can be controlled through R_GLCDC_ColorCorrection. The display_correction_t parameter is used to control enabling, disabling and gain values for both corrections as shown below:

/* Brightness values are 0-1023 with +512 offset being neutral */
correction.brightness.r = 512;
correction.brightness.g = 512;
correction.brightness.b = 512;
/* Contrast values are 0-255 representing gain of 0-2 (128 is gain of 1) */
correction.contrast.r = 128;
correction.contrast.g = 128;
correction.contrast.b = 128;
/* Brightness and contrast correction can be enabled or disabled independent of one another */
correction.brightness.enable = true;
correction.contrast.enable = true;
/* Enable correction */
R_GLCDC_ColorCorrection(&g_disp_ctrl, &correction);

Color Look-Up Table (CLUT) Modes

The GLCDC supports 1-, 4- and 8-bit color look-up table (CLUT) formats for input pixel data. By using these modes the framebuffer size in memory can be reduced significantly, allowing even high-resolution displays to be buffered in on-chip SRAM. To enable CLUT modes for a layer the color format must be set to a CLUT mode (either at startup or through R_GLCDC_LayerChange) in addition to filling the CLUT as appropriate via R_GLCDC_ClutUpdate as shown below:

/* Basic 4-bit (16-color) CLUT definition */
uint32_t clut_4[16] =
{
0xFF000000, // Black
0xFFFFFFFF, // White
0xFF0000FF, // Blue
0xFF0080FF, // Turquoise
0xFF00FFFF, // Cyan
0xFF00FF80, // Mint Green
0xFF00FF00, // Green
0xFF80FF00, // Lime Green
0xFFFFFF00, // Yellow
0xFFFF8000, // Orange
0xFFFF0000, // Red
0xFFFF0080, // Pink
0xFFFF00FF, // Magenta
0xFF8000FF, // Purple
0xFF808080, // Gray
0x00000000 // Transparent
};
/* Define the CLUT configuration */
display_clut_cfg_t clut_cfg =
{
.start = 0,
.size = 16,
.p_base = clut_4
};
/* Update the CLUT in the GLCDC */
R_GLCDC_ClutUpdate(&g_disp_ctrl, &clut_cfg, DISPLAY_FRAME_LAYER_1);
Note
If individual elements of the CLUT must be changed or if elements must be changed one at a time (for instance, when using emWin) it is recommended to use R_GLCDC_ClutEdit to avoid repeated memcpy operations.

Other Configuration Options

Gamma correction

Gamma correction is performed based on a gain curved defined in the RA Configuration editor. Each point on the curve is defined by a threshold and a gain value - each gain value represents a multiplier from 0x-2x (set as 0-2047) that sets the Y-value of the slope of the gain curve, while each threshold interval sets the X-value respectively. For a more detailed explanation refer to the RA6M3 User's Manual (R01UH0886EJ0100) Figure 58.12 "Calculation of gamma correction value" and the related description above it.

When setting threshold values three rules must be followed:

Note
Gamma correction can only be applied via R_GLCDC_Open.

Dithering

Dithering is a method of pixel blending that allows for smoother transitions between colors when using a limited palette. A full description of dithering is outside the scope of this document. For more information on the pattern settings and how to configure them refer to the RA6M3 User's Manual (R01UH0886EJ0100) Figure 58.13 "Configuration of dither correction block" and Figure 58.14 "Addition value selection method for 2x2 pattern dither".

Maximum Resolution

Though the GLCDC is capable of outputting resolutions in excess of HD, maximum clockspeeds and bus throughput limit what can be realistically achieved. Below is a table of maximum recommended widescreen resolutions at various input color depths based on clock and bus limits at 60 FPS.

Device 8bpp 16bpp 24/32bpp
RA6M3 960x540 (qHD) 800x480 (WVGA) 640x360 (nHD)
RA8 1920x1200 (WUXGA) 1280x800 (WXGA) 960x540 (qHD)
Note
The above values are estimated conservatively based on effective SDRAM bus throughput at a standard framerate. To calculate estimated maximum values for other situations the following equations can be used:
bytes per frame = (SDCLK speed (Hz) * SDRAM bus width / 8) / framerate
width = sqrt(16/9 * (bytes per frame) / (pixel bit depth / 8))
height = 9/16 * width
These equations provide values that are theoretically possible but may or may not be attainable depending on a number of other factors. It is the responsibility of the developer to test and confirm performance on each system to determine a suitable panel size for the application.

Limitations

Developers should be aware of the following limitations when using the GLCDC API:

Examples

Basic Example

This is a basic example showing the minimum code required to initialize and start the GLCDC module. If the entire display can be drawn within the vertical blanking period no further code may be necessary.

void glcdc_init (void)
{
fsp_err_t err;
// Open the GLCDC driver
err = R_GLCDC_Open(&g_disp_ctrl, &g_disp_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
// Start display output
err = R_GLCDC_Start(&g_disp_ctrl);
assert(FSP_SUCCESS == err);
}

Layer Transitions

This example demonstrates how to set up and execute both a sliding and fading layer transition. This is most useful in static image transition scenarios as switching between two actively-drawing graphics layers may require up to four framebuffers to eliminate tearing.

volatile uint32_t g_vsync_count = 0;
/* Callback function for GLCDC interrupts */
static void glcdc_callback (display_callback_args_t * p_args)
{
{
g_vsync_count++;
}
}
/* Simple wait that returns 1 if no Vsync happened within the timeout period */
uint8_t vsync_wait (void)
{
uint32_t timeout_timer = GLCDC_VSYNC_TIMEOUT;
g_vsync_count = 0;
while (!g_vsync_count && --timeout_timer)
{
/* Spin here until DISPLAY_EVENT_LINE_DETECTION callback or timeout */
}
return timeout_timer ? 0 : 1;
}
/* Initiate a fade on Layer 2
*
* Parameters:
* direction True for fade in, false for fade out
* speed number of frames over which to fade
*/
void glcdc_layer_transition_fade (display_runtime_cfg_t * disp_rt_cfg, bool direction, uint16_t speed)
{
fsp_err_t err;
if (direction)
{
/* Set the runtime struct to the desired buffer */
disp_rt_cfg->input.p_base = (uint32_t *) g_framebuffer_1;
}
else
{
}
/* Ensure speed is at least 1 frame */
if (!speed)
{
speed = 1;
}
/* Set the fade speed to the desired change in alpha per frame */
disp_rt_cfg->layer.fade_speed = UINT8_MAX / speed;
/* Initiate the fade (will start on the next Vsync) */
err = R_GLCDC_LayerChange(&g_disp_ctrl, disp_rt_cfg, DISPLAY_FRAME_LAYER_2);
assert(FSP_SUCCESS == err);
}
/* Slide Layer 1 out to the left while sliding Layer 2 in from the right */
void glcdc_layer_transition_sliding (display_runtime_cfg_t * disp_rt_cfg_in, display_runtime_cfg_t * disp_rt_cfg_out)
{
fsp_err_t err;
/* Set the config for the incoming layer to be just out of bounds on the right side */
disp_rt_cfg_in->input.p_base = (uint32_t *) g_framebuffer_1;
disp_rt_cfg_in->layer.coordinate.x = DISPLAY_WIDTH;
/* Move layer 1 out and layer 2 in at a fixed rate of 4 pixels per frame */
for (int32_t x = disp_rt_cfg_in->layer.coordinate.x; x >= 0; x -= 4)
{
/* Wait for a Vsync before starting */
vsync_wait();
/* Set the X-coordinate of both layers then update them */
disp_rt_cfg_out->layer.coordinate.x = (int16_t) (x - DISPLAY_WIDTH);
disp_rt_cfg_in->layer.coordinate.x = (int16_t) x;
err = R_GLCDC_LayerChange(&g_disp_ctrl, disp_rt_cfg_out, DISPLAY_FRAME_LAYER_1);
assert(FSP_SUCCESS == err);
err = R_GLCDC_LayerChange(&g_disp_ctrl, disp_rt_cfg_in, DISPLAY_FRAME_LAYER_2);
assert(FSP_SUCCESS == err);
}
}

Double-Buffering

Using a double-buffer allows one to be output to the LCD while the other is being drawn to memory, eliminating tearing and in some cases reducing bus load. The following is a basic example showing integration of the line detect (Vsync) interrupt to set the timing for buffer swapping and drawing.

/* User-defined function to draw the current display to a framebuffer */
void display_draw (uint8_t * framebuffer)
{
FSP_PARAMETER_NOT_USED(framebuffer);
/* Draw buffer here */
}
/* This function is an example of a basic double-buffered display thread */
void display_thread (void)
{
uint8_t * p_framebuffer = NULL;
fsp_err_t err;
/* Initialize and start the R_GLCDC module */
glcdc_init();
while (1)
{
/* Swap the active framebuffer */
p_framebuffer = (p_framebuffer == g_framebuffer_0) ? g_framebuffer_1 : g_framebuffer_0;
/* Draw the new framebuffer now */
display_draw(p_framebuffer);
/* Now that the framebuffer is ready, update the GLCDC buffer pointer on the next Vsync */
err = R_GLCDC_BufferChange(&g_disp_ctrl, p_framebuffer, DISPLAY_FRAME_LAYER_1);
assert(FSP_SUCCESS == err);
/* Wait for a Vsync event */
vsync_wait();
}
}

Data Structures

struct  glcdc_instance_ctrl_t
 
struct  glcdc_extended_cfg_t
 

Enumerations

enum  glcdc_clk_src_t
 
enum  glcdc_panel_clk_div_t
 
enum  glcdc_tcon_pin_t
 
enum  glcdc_bus_arbitration_t
 
enum  glcdc_correction_proc_order_t
 
enum  glcdc_tcon_signal_select_t
 
enum  glcdc_clut_plane_t
 
enum  glcdc_dithering_mode_t
 
enum  glcdc_dithering_pattern_t
 
enum  glcdc_input_interface_format_t
 
enum  glcdc_output_interface_format_t
 
enum  glcdc_dithering_output_format_t
 

Data Structure Documentation

◆ glcdc_instance_ctrl_t

struct glcdc_instance_ctrl_t

Display control block. DO NOT INITIALIZE.

◆ glcdc_extended_cfg_t

struct glcdc_extended_cfg_t

GLCDC hardware specific configuration

Data Fields
glcdc_tcon_pin_t tcon_hsync GLCDC TCON output pin select.
glcdc_tcon_pin_t tcon_vsync GLCDC TCON output pin select.
glcdc_tcon_pin_t tcon_de GLCDC TCON output pin select.
glcdc_correction_proc_order_t correction_proc_order Correction control route select.
glcdc_clk_src_t clksrc Clock Source selection.
glcdc_panel_clk_div_t clock_div_ratio Clock divide ratio for dot clock.
glcdc_dithering_mode_t dithering_mode Dithering mode.
glcdc_dithering_pattern_t dithering_pattern_A Dithering pattern A.
glcdc_dithering_pattern_t dithering_pattern_B Dithering pattern B.
glcdc_dithering_pattern_t dithering_pattern_C Dithering pattern C.
glcdc_dithering_pattern_t dithering_pattern_D Dithering pattern D.
void * phy_layer Alternate PHY layer, such as MIPI DSI.

Enumeration Type Documentation

◆ glcdc_clk_src_t

Clock source select

Enumerator
GLCDC_CLK_SRC_INTERNAL 

Internal.

GLCDC_CLK_SRC_EXTERNAL 

External.

◆ glcdc_panel_clk_div_t

Clock frequency division ratio

Enumerator
GLCDC_PANEL_CLK_DIVISOR_1 

Division Ratio 1/1.

GLCDC_PANEL_CLK_DIVISOR_2 

Division Ratio 1/2.

GLCDC_PANEL_CLK_DIVISOR_3 

Division Ratio 1/3.

GLCDC_PANEL_CLK_DIVISOR_4 

Division Ratio 1/4.

GLCDC_PANEL_CLK_DIVISOR_5 

Division Ratio 1/5.

GLCDC_PANEL_CLK_DIVISOR_6 

Division Ratio 1/6.

GLCDC_PANEL_CLK_DIVISOR_7 

Division Ratio 1/7.

GLCDC_PANEL_CLK_DIVISOR_8 

Division Ratio 1/8.

GLCDC_PANEL_CLK_DIVISOR_9 

Division Ratio 1/9.

GLCDC_PANEL_CLK_DIVISOR_12 

Division Ratio 1/12.

GLCDC_PANEL_CLK_DIVISOR_16 

Division Ratio 1/16.

GLCDC_PANEL_CLK_DIVISOR_24 

Division Ratio 1/24.

GLCDC_PANEL_CLK_DIVISOR_32 

Division Ratio 1/32.

◆ glcdc_tcon_pin_t

LCD TCON output pin select

Enumerator
GLCDC_TCON_PIN_NONE 

No output.

GLCDC_TCON_PIN_0 

LCD_TCON0.

GLCDC_TCON_PIN_1 

LCD_TCON1.

GLCDC_TCON_PIN_2 

LCD_TCON2.

GLCDC_TCON_PIN_3 

LCD_TCON3.

◆ glcdc_bus_arbitration_t

Bus Arbitration setting

Enumerator
GLCDC_BUS_ARBITRATION_ROUNDROBIN 

Round robin.

GLCDC_BUS_ARBITRATION_FIX_PRIORITY 

Fixed.

◆ glcdc_correction_proc_order_t

Correction circuit sequence control

Enumerator
GLCDC_CORRECTION_PROC_ORDER_BRIGHTNESS_CONTRAST2GAMMA 

Brightness -> contrast -> gamma correction.

GLCDC_CORRECTION_PROC_ORDER_GAMMA2BRIGHTNESS_CONTRAST 

Gamma correction -> brightness -> contrast.

◆ glcdc_tcon_signal_select_t

Timing signals for driving the LCD panel

Enumerator
GLCDC_TCON_SIGNAL_SELECT_STVA_VS 

STVA/VS.

GLCDC_TCON_SIGNAL_SELECT_STVB_VE 

STVB/VE.

GLCDC_TCON_SIGNAL_SELECT_STHA_HS 

STH/SP/HS.

GLCDC_TCON_SIGNAL_SELECT_STHB_HE 

STB/LP/HE.

GLCDC_TCON_SIGNAL_SELECT_DE 

DE.

◆ glcdc_clut_plane_t

Clock phase adjustment for serial RGB output

Enumerator
GLCDC_CLUT_PLANE_0 

GLCDC CLUT plane 0.

GLCDC_CLUT_PLANE_1 

GLCDC CLUT plane 1.

◆ glcdc_dithering_mode_t

Dithering mode

Enumerator
GLCDC_DITHERING_MODE_TRUNCATE 

No dithering (truncate)

GLCDC_DITHERING_MODE_ROUND_OFF 

Dithering with round off.

GLCDC_DITHERING_MODE_2X2PATTERN 

Dithering with 2x2 pattern.

◆ glcdc_dithering_pattern_t

Dithering mode

Enumerator
GLCDC_DITHERING_PATTERN_00 

2x2 pattern '00'

GLCDC_DITHERING_PATTERN_01 

2x2 pattern '01'

GLCDC_DITHERING_PATTERN_10 

2x2 pattern '10'

GLCDC_DITHERING_PATTERN_11 

2x2 pattern '11'

◆ glcdc_input_interface_format_t

Output interface format

Enumerator
GLCDC_INPUT_INTERFACE_FORMAT_RGB565 

Input interface format RGB565.

GLCDC_INPUT_INTERFACE_FORMAT_RGB888 

Input interface format RGB888.

GLCDC_INPUT_INTERFACE_FORMAT_ARGB1555 

Input interface format ARGB1555.

GLCDC_INPUT_INTERFACE_FORMAT_ARGB4444 

Input interface format ARGB4444.

GLCDC_INPUT_INTERFACE_FORMAT_ARGB8888 

Input interface format ARGB8888.

GLCDC_INPUT_INTERFACE_FORMAT_CLUT8 

Input interface format CLUT8.

GLCDC_INPUT_INTERFACE_FORMAT_CLUT4 

Input interface format CLUT4.

GLCDC_INPUT_INTERFACE_FORMAT_CLUT1 

Input interface format CLUT1.

◆ glcdc_output_interface_format_t

Output interface format

Enumerator
GLCDC_OUTPUT_INTERFACE_FORMAT_RGB888 

Output interface format RGB888.

GLCDC_OUTPUT_INTERFACE_FORMAT_RGB666 

Output interface format RGB666.

GLCDC_OUTPUT_INTERFACE_FORMAT_RGB565 

Output interface format RGB565.

GLCDC_OUTPUT_INTERFACE_FORMAT_SERIAL_RGB 

Output interface format Serial RGB.

◆ glcdc_dithering_output_format_t

Dithering output format

Enumerator
GLCDC_DITHERING_OUTPUT_FORMAT_RGB888 

Dithering output format RGB888.

GLCDC_DITHERING_OUTPUT_FORMAT_RGB666 

Dithering output format RGB666.

GLCDC_DITHERING_OUTPUT_FORMAT_RGB565 

Dithering output format RGB565.

Function Documentation

◆ R_GLCDC_Open()

fsp_err_t R_GLCDC_Open ( display_ctrl_t *const  p_api_ctrl,
display_cfg_t const *const  p_cfg 
)

Open GLCDC module. Implements display_api_t::open.

Return values
FSP_SUCCESSDevice was opened successfully.
FSP_ERR_ALREADY_OPENDevice was already open.
FSP_ERR_ASSERTIONPointer to the control block or the configuration structure is NULL.
FSP_ERR_CLOCK_GENERATIONDot clock cannot be generated from clock source.
FSP_ERR_INVALID_TIMING_SETTINGInvalid panel timing parameter.
FSP_ERR_INVALID_LAYER_SETTINGInvalid layer setting found.
FSP_ERR_INVALID_ALIGNMENTInput buffer alignment invalid.
FSP_ERR_INVALID_GAMMA_SETTINGInvalid gamma correction setting found
FSP_ERR_INVALID_BRIGHTNESS_SETTINGInvalid brightness correction setting found
Note
PCLKA must be supplied to Graphics LCD Controller (GLCDC) and GLCDC pins must be set in IOPORT before calling this API.

◆ R_GLCDC_Close()

fsp_err_t R_GLCDC_Close ( display_ctrl_t *const  p_api_ctrl)

Close GLCDC module. Implements display_api_t::close.

Return values
FSP_SUCCESSDevice was closed successfully.
FSP_ERR_ASSERTIONPointer to the control block is NULL.
FSP_ERR_NOT_OPENThe function call is performed when the driver state is not equal to DISPLAY_STATE_CLOSED.
FSP_ERR_INVALID_UPDATE_TIMINGA function call is performed when the GLCDC is updating register values internally.
Note
This API can be called when the driver is not in DISPLAY_STATE_CLOSED state. It returns an error if the register update operation for the background screen generation block is being held.

◆ R_GLCDC_Start()

fsp_err_t R_GLCDC_Start ( display_ctrl_t *const  p_api_ctrl)

Start GLCDC module. Implements display_api_t::start.

Return values
FSP_SUCCESSDevice was started successfully.
FSP_ERR_NOT_OPENGLCDC module has not been opened.
FSP_ERR_ASSERTIONPointer to the control block is NULL.
Note
This API can be called when the driver is not in DISPLAY_STATE_OPENED status.

◆ R_GLCDC_Stop()

fsp_err_t R_GLCDC_Stop ( display_ctrl_t *const  p_api_ctrl)

Stop GLCDC module. Implements display_api_t::stop.

Return values
FSP_SUCCESSDevice was stopped successfully
FSP_ERR_ASSERTIONPointer to the control block is NULL
FSP_ERR_INVALID_MODEFunction call is performed when the driver state is not DISPLAY_STATE_DISPLAYING.
FSP_ERR_INVALID_UPDATE_TIMINGThe function call is performed while the GLCDC is updating register values internally.
Note
This API can be called when the driver is in the DISPLAY_STATE_DISPLAYING state. It returns an error if the register update operation for the background screen generation blocks, the graphics data I/F blocks, or the output control block is being held.

◆ R_GLCDC_LayerChange()

fsp_err_t R_GLCDC_LayerChange ( display_ctrl_t const *const  p_api_ctrl,
display_runtime_cfg_t const *const  p_cfg,
display_frame_layer_t  layer 
)

Change layer parameters of GLCDC module at runtime. Implements display_api_t::layerChange.

Return values
FSP_SUCCESSChanged layer parameters of GLCDC module successfully.
FSP_ERR_ASSERTIONPointer to the control block or the configuration structure is NULL.
FSP_ERR_INVALID_MODEA function call is performed when the driver state is not DISPLAY_STATE_DISPLAYING.
FSP_ERR_INVALID_UPDATE_TIMINGA function call is performed while the GLCDC is updating register values internally.
Note
This API can be called when the driver is in DISPLAY_STATE_DISPLAYING state. It returns an error if the register update operation for the background screen generation blocks or the graphics data I/F block is being held.

◆ R_GLCDC_BufferChange()

fsp_err_t R_GLCDC_BufferChange ( display_ctrl_t const *const  p_api_ctrl,
uint8_t *const  framebuffer,
display_frame_layer_t  layer 
)

Change the framebuffer pointer for a layer. Implements display_api_t::bufferChange.

Return values
FSP_SUCCESSChanged layer parameters of GLCDC module successfully.
FSP_ERR_ASSERTIONPointer to the control block is NULL.
FSP_ERR_INVALID_MODEA function call is performed when the driver state is not DISPLAY_STATE_DISPLAYING.
FSP_ERR_INVALID_ALIGNMENTThe framebuffer pointer is not 64-byte aligned.
FSP_ERR_INVALID_UPDATE_TIMINGA function call is performed while the GLCDC is updating register values internally.
Note
This API can be called when the driver is in DISPLAY_STATE_OPENED state or higher. It returns an error if the register update operation for the background screen generation blocks or the graphics data I/F block is being held.

◆ R_GLCDC_ColorCorrection()

fsp_err_t R_GLCDC_ColorCorrection ( display_ctrl_t const *const  p_api_ctrl,
display_correction_t const *const  p_correction 
)

Perform color correction through the GLCDC module. Implements display_api_t::correction.

Return values
FSP_SUCCESSColor correction by GLCDC module was performed successfully.
FSP_ERR_ASSERTIONPointer to the control block or the display correction structure is NULL.
FSP_ERR_INVALID_MODEFunction call is performed when the driver state is not DISPLAY_STATE_DISPLAYING.
FSP_ERR_INVALID_UPDATE_TIMINGA function call is performed while the GLCDC is updating registers internally.
FSP_ERR_UNSUPPORTEDFeature not supported with the current configuration.
FSP_ERR_INVALID_BRIGHTNESS_SETTINGInvalid brightness correction setting found
Note
This API can be called when the driver is in the DISPLAY_STATE_DISPLAYING state. It returns an error if the register update operation for the background screen generation blocks or the output control block is being held.

◆ R_GLCDC_ClutUpdate()

fsp_err_t R_GLCDC_ClutUpdate ( display_ctrl_t const *const  p_api_ctrl,
display_clut_cfg_t const *const  p_clut_cfg,
display_frame_layer_t  layer 
)

Write an entire color look-up table (CLUT) in the GLCDC module. Implements display_api_t::clut.

Return values
FSP_SUCCESSCLUT written successfully.
FSP_ERR_ASSERTIONPointer to the control block or CLUT source data is NULL.
FSP_ERR_INVALID_UPDATE_TIMINGR_GLCDC_ClutEdit was already used to edit the specified CLUT this frame.
FSP_ERR_INVALID_CLUT_ACCESSIllegal CLUT entry or size is specified.
Note
This API can be called any time. The written data will be used after the next vertical sync event.

◆ R_GLCDC_ClutEdit()

fsp_err_t R_GLCDC_ClutEdit ( display_ctrl_t const *const  p_api_ctrl,
display_frame_layer_t  layer,
uint8_t  index,
uint32_t  color 
)

Update an element of a color look-up table (CLUT) in the GLCDC module. Implements display_api_t::clutEdit.

Return values
FSP_SUCCESSCLUT element updated successfully.
FSP_ERR_ASSERTIONPointer to the control block is NULL.
Note
This API can be called any time. The written data will be used after the next vertical sync event.

◆ R_GLCDC_ColorKeySet()

fsp_err_t R_GLCDC_ColorKeySet ( display_ctrl_t const *const  p_api_ctrl,
display_colorkeying_layer_t  key_cfg,
display_frame_layer_t  layer 
)

Configuring color key is not supported for GLCDC.

Return values
FSP_ERR_UNSUPPORTED

◆ R_GLCDC_StatusGet()

fsp_err_t R_GLCDC_StatusGet ( display_ctrl_t const *const  p_api_ctrl,
display_status_t *const  p_status 
)

Get status of GLCDC module. Implements display_api_t::statusGet.

Return values
FSP_SUCCESSGot status successfully.
FSP_ERR_ASSERTIONPointer to the control block or the status structure is NULL.
Note
The GLCDC hardware starts the fading processing at the first Vsync after the previous LayerChange() call is held. Due to this behavior of the hardware, this API may not return DISPLAY_FADE_STATUS_FADING_UNDERWAY as the fading status, if it is called before the first Vsync after LayerChange() is called. In this case, the API returns DISPLAY_FADE_STATUS_PENDING, instead of DISPLAY_FADE_STATUS_NOT_UNDERWAY.