RA Flexible Software Package Documentation
Release v5.7.0
|
|
Driver for the GLCDC peripheral on RA MCUs. This module implements the Display Interface.
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.
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 | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected, code for parameter checking is included in the build. |
Color Correction |
| 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. |
Configuration | Options | Default | Description |
---|---|---|---|
General | |||
Name | Name must be a valid C symbol | g_display0 | Module name. |
Interrupts | |||
Callback Function | Name must be a valid C symbol | NULL | A user callback function can be defined here. |
Line Detect Interrupt Priority | MCU Specific Options | Select the line detect (Vsync) interrupt priority. | |
Underflow 1 Interrupt Priority | MCU Specific Options | Select the underflow interrupt priority for layer 1. | |
Underflow 2 Interrupt Priority | MCU Specific Options | Select the underflow interrupt priority for layer 2. | |
Input | |||
Input > Graphics Layer 1 | |||
Input > Graphics Layer 1 > General | |||
Enabled |
| 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 size | Value must be an integer from 16 to 2040 | 480 | Specify the number of horizontal pixels. |
Vertical size | Value must be an integer from 16 to 2043 | 854 | Specify the number of vertical pixels. |
Horizontal position | Must be a valid non-negative integer with a maximum configurable value of 4091 | 0 | Specify the horizontal offset in pixels of the graphics layer from the background layer. |
Vertical position | Must be a valid non-negative integer with a maximum configurable value of 4094 | 0 | Specify the vertical offset in pixels of the graphics layer from the background layer. |
Color format |
| 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 |
| Disabled | Select Used if the framebuffer starts from the bottom of the line. |
Input > Graphics Layer 1 > Framebuffer | |||
Framebuffer name | This property must be a valid C symbol | fb_background | Specify the name for the framebuffer for Layer 1. |
Number of framebuffers | Must be a valid non-negative integer | 2 | Number of framebuffers allocated for Graphics Layer 1. |
Section for framebuffer allocation | Manual 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 |
| Off | Select On if the display will be repeated from a smaller section of the framebuffer. |
Repeat count | Must 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 size | 0 | Specify the number of times the image is repeated. |
Input > Graphics Layer 1 > Fading | |||
Mode |
| None | Select the fade method. |
Speed | Value must be an integer from 0 to 255 | 0 | Specify the number of frames for the fading transition to complete. |
Input > Graphics Layer 2 | |||
Input > Graphics Layer 2 > General | |||
Enabled |
| 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 size | Value must be be an integer from 16 to 2040 | 480 | Specify the number of horizontal pixels. |
Vertical size | Value must be be an integer from 16 to 2043 | 854 | Specify the number of vertical pixels. |
Horizontal position | Must be a valid non-negative integer with a maximum configurable value of 4091 | 0 | Specify the horizontal offset in pixels of the graphics layer from the background layer. |
Vertical position | Must be a valid non-negative integer with a maximum configurable value of 4094 | 0 | Specify the vertical offset in pixels of the graphics layer from the background layer. |
Color format |
| 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 |
| Disabled | Select Used if the framebuffer starts from the bottom of the line. |
Input > Graphics Layer 2 > Framebuffer | |||
Framebuffer name | This property must be a valid C symbol | fb_foreground | Specify the name for the framebuffer for Layer 2. |
Number of framebuffers | Must be a valid non-negative integer | 2 | Number of framebuffers allocated for Graphics Layer 2. |
Section for framebuffer allocation | Manual 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 |
| Off | Select On if the display will be repeated from a smaller section of the framebuffer. |
Repeat count | Must 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 size | 0 | Specify the number of times the image is repeated. |
Input > Graphics Layer 2 > Fading | |||
Mode |
| None | Select the fade method. |
Speed | Value must be an integer from 0 to 255 | 0 | Specify the number of frames for the fading transition to complete. |
Output | |||
Output > Timing | |||
Horizontal total cycles | Value must be an integer from 24 to 2047 | 559 | 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 cycles | Value must be an integer from 16 to 2040 | 480 | 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 cycles | Value must be an integer from 5 to 2029 | 5 | 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 cycles | Value must be an integer from 0 to 2046 | 2 | 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 | Select the polarity of Hsync signal to match your system. |
Vertical total lines | Value must be an integer from 20 to 2047 | 894 | Specify number of total lines in a frame (including front and back porch). |
Vertical active video lines | Value must be an integer from 16 to 2043 | 854 | Specify the number of active video lines in a frame. |
Vertical back porch lines | Value must be an integer from 3 to 2030 | 20 | 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 lines | Value must be an integer from 0 to 2046 | 3 | Specify the Vsync signal assertion lines in a frame. |
Vertical sync signal polarity |
| Low active | Select the polarity of Vsync signal to match to your system. |
Data Enable Signal Polarity |
| High active | Select the polarity of Data Enable signal to match to your system. |
Sync edge |
| Falling edge | Select the polarity of Sync signals to match to your system. |
Output > Format | |||
Color format |
| 24bits RGB888 | Specify the graphics layer output format to match to your LCD panel. |
Color order |
| RGB | Select data order for output signal to LCD panel. |
Endian |
| Little endian | Select data endianness for output signal to LCD panel. |
Output > Background | |||
Alpha | Value must be an integer from 0 to 255 | 255 | Alpha component of the background color. |
Red | Value must be an integer from 0 to 255 | 0 | Red component of the background color. |
Green | Value must be an integer from 0 to 255 | 0 | Green component of the background color. |
Blue | Value must be an integer from 0 to 255 | 0 | Blue component of the background color. |
CLUT | |||
Enabled |
| 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. |
Size | Must be a valid non-negative integer with a maximum configurable value of 256 | 256 | Specify the number of entries for the CLUT source data buffer. Each entry consumes 4 bytes (1 word). |
TCON | |||
Hsync pin select |
| LCD_TCON1 | Select the TCON pin used for the Hsync signal to match to your system. |
Vsync pin select |
| LCD_TCON0 | Select TCON pin used for Vsync signal to match to your system. |
Data enable (DE) pin select |
| LCD_TCON2 | Select TCON pin used for DataEnable signal to match to your system. |
Panel clock source |
| Internal clock (GLCDCLK) | Choose between an internal GLCDCLK generated from PCLKA or an external clock provided to the LCD_EXTCLK pin. |
Panel clock division ratio | Refer to the RA Configuration tool for available options. | 1/8 | Select the clock source divider value. |
Color Correction | |||
Color Correction > Brightness | |||
Enabled |
| No | Enable brightness color correction. |
Red channel | Value must be an integer from 0 to 1023 | 512 | Red component of the brightness calibration. This value is divided by 512 to determine gain. |
Green channel | Value must be an integer from 0 to 1023 | 512 | Green component of the brightness calibration. This value is divided by 512 to determine gain. |
Blue channel | Value must be an integer from 0 to 1023 | 512 | Blue component of the brightness calibration. This value is divided by 512 to determine gain. |
Color Correction > Contrast | |||
Enabled |
| No | Enable contrast color correction. |
Red channel gain | Value must be an integer from 0 to 255 | 128 | Red component of the contrast calibration. This value is divided by 128 to determine gain. |
Green channel gain | Value must be an integer from 0 to 255 | 128 | Green component of the contrast calibration. This value is divided by 128 to determine gain. |
Blue channel gain | Value must be an integer from 0 to 255 | 128 | 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 | |||
0 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
1 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
2 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
3 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
4 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
5 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
6 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
7 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
8 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
9 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
10 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
11 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
12 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
13 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
14 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
15 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
Color Correction > Gamma > Tables > Red > Threshold | |||
1 | Value must be an integer from 0 to 1023 | 64 | Enter a threshold value between the surrounding values less than or equal to 1023. |
2 | Value must be an integer from 0 to 1023 | 128 | Enter a threshold value between the surrounding values less than or equal to 1023. |
3 | Value must be an integer from 0 to 1023 | 192 | Enter a threshold value between the surrounding values less than or equal to 1023. |
4 | Value must be an integer from 0 to 1023 | 256 | Enter a threshold value between the surrounding values less than or equal to 1023. |
5 | Value must be an integer from 0 to 1023 | 320 | Enter a threshold value between the surrounding values less than or equal to 1023. |
6 | Value must be an integer from 0 to 1023 | 384 | Enter a threshold value between the surrounding values less than or equal to 1023. |
7 | Value must be an integer from 0 to 1023 | 448 | Enter a threshold value between the surrounding values less than or equal to 1023. |
8 | Value must be an integer from 0 to 1023 | 512 | Enter a threshold value between the surrounding values less than or equal to 1023. |
9 | Value must be an integer from 0 to 1023 | 576 | Enter a threshold value between the surrounding values less than or equal to 1023. |
10 | Value must be an integer from 0 to 1023 | 640 | Enter a threshold value between the surrounding values less than or equal to 1023. |
11 | Value must be an integer from 0 to 1023 | 704 | Enter a threshold value between the surrounding values less than or equal to 1023. |
12 | Value must be an integer from 0 to 1023 | 768 | Enter a threshold value between the surrounding values less than or equal to 1023. |
13 | Value must be an integer from 0 to 1023 | 832 | Enter a threshold value between the surrounding values less than or equal to 1023. |
14 | Value must be an integer from 0 to 1023 | 896 | Enter a threshold value between the surrounding values less than or equal to 1023. |
15 | Value must be an integer from 0 to 1023 | 960 | 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 | |||
0 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
1 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
2 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
3 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
4 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
5 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
6 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
7 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
8 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
9 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
10 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
11 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
12 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
13 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
14 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
15 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
Color Correction > Gamma > Tables > Green > Threshold | |||
1 | Value must be an integer from 0 to 1023 | 64 | Enter a threshold value between the surrounding values less than or equal to 1023. |
2 | Value must be an integer from 0 to 1023 | 128 | Enter a threshold value between the surrounding values less than or equal to 1023. |
3 | Value must be an integer from 0 to 1023 | 192 | Enter a threshold value between the surrounding values less than or equal to 1023. |
4 | Value must be an integer from 0 to 1023 | 256 | Enter a threshold value between the surrounding values less than or equal to 1023. |
5 | Value must be an integer from 0 to 1023 | 320 | Enter a threshold value between the surrounding values less than or equal to 1023. |
6 | Value must be an integer from 0 to 1023 | 384 | Enter a threshold value between the surrounding values less than or equal to 1023. |
7 | Value must be an integer from 0 to 1023 | 448 | Enter a threshold value between the surrounding values less than or equal to 1023. |
8 | Value must be an integer from 0 to 1023 | 512 | Enter a threshold value between the surrounding values less than or equal to 1023. |
9 | Value must be an integer from 0 to 1023 | 576 | Enter a threshold value between the surrounding values less than or equal to 1023. |
10 | Value must be an integer from 0 to 1023 | 640 | Enter a threshold value between the surrounding values less than or equal to 1023. |
11 | Value must be an integer from 0 to 1023 | 704 | Enter a threshold value between the surrounding values less than or equal to 1023. |
12 | Value must be an integer from 0 to 1023 | 768 | Enter a threshold value between the surrounding values less than or equal to 1023. |
13 | Value must be an integer from 0 to 1023 | 832 | Enter a threshold value between the surrounding values less than or equal to 1023. |
14 | Value must be an integer from 0 to 1023 | 896 | Enter a threshold value between the surrounding values less than or equal to 1023. |
15 | Value must be an integer from 0 to 1023 | 960 | 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 | |||
0 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
1 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
2 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
3 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
4 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
5 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
6 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
7 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
8 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
9 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
10 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
11 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
12 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
13 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
14 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
15 | Value must be an integer from 0 to 2047 | 1024 | Enter a gain value from 0 to 2047 (corresponding to gain of 0 and 1.999, respectively). |
Color Correction > Gamma > Tables > Blue > Threshold | |||
1 | Value must be an integer from 0 to 1023 | 64 | Enter a threshold value between the surrounding values less than or equal to 1023. |
2 | Value must be an integer from 0 to 1023 | 128 | Enter a threshold value between the surrounding values less than or equal to 1023. |
3 | Value must be an integer from 0 to 1023 | 192 | Enter a threshold value between the surrounding values less than or equal to 1023. |
4 | Value must be an integer from 0 to 1023 | 256 | Enter a threshold value between the surrounding values less than or equal to 1023. |
5 | Value must be an integer from 0 to 1023 | 320 | Enter a threshold value between the surrounding values less than or equal to 1023. |
6 | Value must be an integer from 0 to 1023 | 384 | Enter a threshold value between the surrounding values less than or equal to 1023. |
7 | Value must be an integer from 0 to 1023 | 448 | Enter a threshold value between the surrounding values less than or equal to 1023. |
8 | Value must be an integer from 0 to 1023 | 512 | Enter a threshold value between the surrounding values less than or equal to 1023. |
9 | Value must be an integer from 0 to 1023 | 576 | Enter a threshold value between the surrounding values less than or equal to 1023. |
10 | Value must be an integer from 0 to 1023 | 640 | Enter a threshold value between the surrounding values less than or equal to 1023. |
11 | Value must be an integer from 0 to 1023 | 704 | Enter a threshold value between the surrounding values less than or equal to 1023. |
12 | Value must be an integer from 0 to 1023 | 768 | Enter a threshold value between the surrounding values less than or equal to 1023. |
13 | Value must be an integer from 0 to 1023 | 832 | Enter a threshold value between the surrounding values less than or equal to 1023. |
14 | Value must be an integer from 0 to 1023 | 896 | Enter a threshold value between the surrounding values less than or equal to 1023. |
15 | Value must be an integer from 0 to 1023 | 960 | Enter a threshold value between the surrounding values less than or equal to 1023. |
Red |
| Off | Enable gamma color correction for the red channel. |
Green |
| Off | Enable gamma color correction for the green channel. |
Blue |
| Off | Enable gamma color correction for the blue channel. |
Table Mode |
| 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 | Select the color correction processing order. |
Dithering | |||
Enabled |
| No | Enable dithering to reduce the effect of color banding. |
Mode |
| Truncate | Select the dithering mode. |
Pattern A |
| Pattern 11 | Select the dithering pattern. |
Pattern B |
| Pattern 11 | Select the dithering pattern. |
Pattern C |
| Pattern 11 | Select the dithering pattern. |
Pattern D |
| Pattern 11 | Select the dithering pattern. |
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.
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. |
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.
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.
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:
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.
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.
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 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:
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:
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:
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".
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) |
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
Developers should be aware of the following limitations when using the GLCDC API:
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.
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.
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.
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 |
struct glcdc_instance_ctrl_t |
Display control block. DO NOT INITIALIZE.
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. |
enum glcdc_clk_src_t |
Clock frequency division ratio
enum glcdc_tcon_pin_t |
enum glcdc_clut_plane_t |
Output interface format
Output interface format
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.
FSP_SUCCESS | Device was opened successfully. |
FSP_ERR_ALREADY_OPEN | Device was already open. |
FSP_ERR_ASSERTION | Pointer to the control block or the configuration structure is NULL. |
FSP_ERR_CLOCK_GENERATION | Dot clock cannot be generated from clock source. |
FSP_ERR_INVALID_TIMING_SETTING | Invalid panel timing parameter. |
FSP_ERR_INVALID_LAYER_SETTING | Invalid layer setting found. |
FSP_ERR_INVALID_ALIGNMENT | Input buffer alignment invalid. |
FSP_ERR_INVALID_GAMMA_SETTING | Invalid gamma correction setting found |
FSP_ERR_INVALID_BRIGHTNESS_SETTING | Invalid brightness correction setting found |
fsp_err_t R_GLCDC_Close | ( | display_ctrl_t *const | p_api_ctrl | ) |
Close GLCDC module. Implements display_api_t::close.
FSP_SUCCESS | Device was closed successfully. |
FSP_ERR_ASSERTION | Pointer to the control block is NULL. |
FSP_ERR_NOT_OPEN | The function call is performed when the driver state is not equal to DISPLAY_STATE_CLOSED. |
FSP_ERR_INVALID_UPDATE_TIMING | A function call is performed when the GLCDC is updating register values internally. |
fsp_err_t R_GLCDC_Start | ( | display_ctrl_t *const | p_api_ctrl | ) |
Start GLCDC module. Implements display_api_t::start.
FSP_SUCCESS | Device was started successfully. |
FSP_ERR_NOT_OPEN | GLCDC module has not been opened. |
FSP_ERR_ASSERTION | Pointer to the control block is NULL. |
fsp_err_t R_GLCDC_Stop | ( | display_ctrl_t *const | p_api_ctrl | ) |
Stop GLCDC module. Implements display_api_t::stop.
FSP_SUCCESS | Device was stopped successfully |
FSP_ERR_ASSERTION | Pointer to the control block is NULL |
FSP_ERR_INVALID_MODE | Function call is performed when the driver state is not DISPLAY_STATE_DISPLAYING. |
FSP_ERR_INVALID_UPDATE_TIMING | The function call is performed while the GLCDC is updating register values internally. |
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.
FSP_SUCCESS | Changed layer parameters of GLCDC module successfully. |
FSP_ERR_ASSERTION | Pointer to the control block or the configuration structure is NULL. |
FSP_ERR_INVALID_MODE | A function call is performed when the driver state is not DISPLAY_STATE_DISPLAYING. |
FSP_ERR_INVALID_UPDATE_TIMING | A function call is performed while the GLCDC is updating register values internally. |
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.
FSP_SUCCESS | Changed layer parameters of GLCDC module successfully. |
FSP_ERR_ASSERTION | Pointer to the control block is NULL. |
FSP_ERR_INVALID_MODE | A function call is performed when the driver state is not DISPLAY_STATE_DISPLAYING. |
FSP_ERR_INVALID_ALIGNMENT | The framebuffer pointer is not 64-byte aligned. |
FSP_ERR_INVALID_UPDATE_TIMING | A function call is performed while the GLCDC is updating register values internally. |
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.
FSP_SUCCESS | Color correction by GLCDC module was performed successfully. |
FSP_ERR_ASSERTION | Pointer to the control block or the display correction structure is NULL. |
FSP_ERR_INVALID_MODE | Function call is performed when the driver state is not DISPLAY_STATE_DISPLAYING. |
FSP_ERR_INVALID_UPDATE_TIMING | A function call is performed while the GLCDC is updating registers internally. |
FSP_ERR_UNSUPPORTED | Feature not supported with the current configuration. |
FSP_ERR_INVALID_BRIGHTNESS_SETTING | Invalid brightness correction setting found |
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.
FSP_SUCCESS | CLUT written successfully. |
FSP_ERR_ASSERTION | Pointer to the control block or CLUT source data is NULL. |
FSP_ERR_INVALID_UPDATE_TIMING | R_GLCDC_ClutEdit was already used to edit the specified CLUT this frame. |
FSP_ERR_INVALID_CLUT_ACCESS | Illegal CLUT entry or size is specified. |
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.
FSP_SUCCESS | CLUT element updated successfully. |
FSP_ERR_ASSERTION | Pointer to the control block is NULL. |
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.
FSP_ERR_UNSUPPORTED |
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.
FSP_SUCCESS | Got status successfully. |
FSP_ERR_ASSERTION | Pointer to the control block or the status structure is NULL. |