The LCDC is a graphic 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, and converted to from a wide variety of pixel formats.
This module can be added to the Stacks tab via New Stack > Graphics > Display (r_lcdc).
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. |
Interrupts > Frame End Interrupt Priority | MCU Specific Options | | Input the frame end interrupt priority. |
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. |
Input > Graphics Layer 1 > General > Horizontal size | Value must be an integer from 1 to 1920 | 1280 | Specify the number of horizontal pixels. |
Input > Graphics Layer 1 > General > Vertical size | Value must be an integer from 1 to 1080 | 720 | Specify the number of vertical pixels. |
Input > Graphics Layer 1 > General > Horizontal position | Value must be an integer from -1919 to 1919 | 0 | Specify the horizontal offset in pixels of the graphics layer from the background layer. |
Input > Graphics Layer 1 > General > Vertical position | Value must be an integer from -1079 to 1079 | 0 | Specify the vertical offset in pixels of the graphics layer from the background layer. |
Input > Graphics Layer 1 > General > Color format | Refer to the RZT Configuration tool for available options. | YCbCr422 interleaved YUYV (16-bit) | Specify the graphics layer Input format. |
Input > Graphics Layer 1 > General > 64bit swap |
| Disabled | Select Used if enable 64bits swap input data. |
Input > Graphics Layer 1 > General > 32bit swap |
| Disabled | Select Used if enable 32bits swap input data. |
Input > Graphics Layer 1 > General > 16bit swap |
| Disabled | Select Used if enable 16bits swap input data. |
Input > Graphics Layer 1 > General > 8bit swap |
| Disabled | Select Used if enable 8bits swap input data. |
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. |
Input > Graphics Layer 1 > Framebuffer > Number of buffers | Value must be an integer from 0 to 8 | 1 | Specify the number of buffers to create.When user select 0,the buffer set in user application can be used. |
Input > Graphics Layer 1 > Framebuffer > Section for framebuffer allocation | Manual Entry | .lcdc_frame_buffer | The LCDC module uses non-cached data located in the DDR mirror region.
Do not change the following FSP Configurator settings:
# The cache settings for the MPU (CR52) or MMU (CA55) in the DDR mirror region.
Change the following FSP Configurator settings:
# Region enable settings of DDR mirror 1 in CPU MPU must be set to Enable. |
Input > Graphics Layer 2 > General > Enabled |
| Yes | 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. |
Input > Graphics Layer 2 > General > Horizontal size | Value must be an integer from 1 to 1920 | 1280 | Specify the number of horizontal pixels. |
Input > Graphics Layer 2 > General > Vertical size | Value must be an integer from 1 to 1080 | 800 | Specify the number of vertical pixels. |
Input > Graphics Layer 2 > General > Horizontal position | Value must be an integer from -1919 to 1919 | 0 | Specify the horizontal offset in pixels of the graphics layer from the background layer. |
Input > Graphics Layer 2 > General > Vertical position | Value must be an integer from -1079 to 1079 | 0 | Specify the vertical offset in pixels of the graphics layer from the background layer. |
Input > Graphics Layer 2 > General > Color format | Refer to the RZT Configuration tool for available options. | YCbCr422 interleaved YUYV (16-bit) | Specify the graphics layer Input format. |
Input > Graphics Layer 2 > General > 64bit swap |
| Disabled | Select Used if enable 64bits swap input data. |
Input > Graphics Layer 2 > General > 32bit swap |
| Disabled | Select Used if enable 32bits swap input data. |
Input > Graphics Layer 2 > General > 16bit swap |
| Disabled | Select Used if enable 16bits swap input data. |
Input > Graphics Layer 2 > General > 8bit swap |
| Disabled | Select Used if enable 8bits swap input data. |
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. |
Input > Graphics Layer 2 > Framebuffer > Number of buffers | Value must be an integer from 0 to 8 | 1 | Specify the number of buffers to create.When user select 0,the buffer set in user application can be used. |
Input > Graphics Layer 2 > Framebuffer > Section for framebuffer allocation | Manual Entry | .lcdc_frame_buffer | The LCDC module uses non-cached data located in the DDR mirror region.
Do not change the following FSP Configurator settings:
# The cache settings for the MPU (CR52) or MMU (CA55) in the DDR mirror region.
Change the following FSP Configurator settings:
# Region enable settings of DDR mirror 1 in CPU MPU must be set to Enable. |
Output > Timing > Horizontal total cycles | Value must be an integer from 3 to 28668 | 1650 | 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 |
Output > Timing > Horizontal active video cycles | Value must be an integer from 1 to 8190 | 1280 | 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. |
Output > Timing > Horizontal back porch cycles | Value must be an integer from 0 to 12286 | 260 | 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. |
Output > Timing > Horizontal sync signal cycles | Value must be an integer from 0 to 4095 | 40 | 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. |
Output > Timing > Horizontal sync signal polarity |
| High active | Select the polarity of Hsync signal to match your system. |
Output > Timing > Vertical total lines | Value must be an integer from 0 to 28668 | 750 | Specify number of total lines in a frame (including front and back porch). |
Output > Timing > Vertical active video lines | Value must be an integer from 1 to 8190 | 720 | Specify the number of active video lines in a frame. |
Output > Timing > Vertical back porch lines | Value must be an integer from 0 to 12286 | 25 | 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. |
Output > Timing > Vertical sync signal lines | Value must be an integer from 0 to 4095 | 5 | Specify the Vsync signal assertion lines in a frame. |
Output > Timing > Vertical sync signal polarity |
| High active | Select the polarity of Vsync signal to match to your system. |
Output > Timing > Data Enable Signal Polarity |
| High active | Select the polarity of Data Enable signal to match to your system. |
Output > Timing > Sync edge |
| Falling edge | Select the polarity of Sync signals to match to your system. |
Output > Background > Red | Value must be an integer from 0 to 255 | 0 | Red component of the background color. |
Output > Background > Green | Value must be an integer from 0 to 255 | 0 | Green component of the background color. |
Output > Background > Blue | Value must be an integer from 0 to 255 | 0 | Blue component of the background color. |
Color Keying > Graphics Layer 1 > Source Color > Red | Value must be an integer from 0 to 255 | 0 | Red component of the soucre color for color keying. |
Color Keying > Graphics Layer 1 > Source Color > Green | Value must be an integer from 0 to 255 | 0 | Green component of the soucre color for color keying. |
Color Keying > Graphics Layer 1 > Source Color > Blue | Value must be an integer from 0 to 255 | 0 | Blue component of the soucre color for color keying. |
Color Keying > Graphics Layer 1 > Destination Color > Alpha | Value must be an integer from 0 to 255 | 0 | Alpha component of the destination color for color keying. |
Color Keying > Graphics Layer 1 > Destination Color > Red | Value must be an integer from 0 to 255 | 0 | Red component of the soucre color for color keying. |
Color Keying > Graphics Layer 1 > Destination Color > Green | Value must be an integer from 0 to 255 | 0 | Green component of the soucre color for color keying. |
Color Keying > Graphics Layer 1 > Destination Color > Blue | Value must be an integer from 0 to 255 | 0 | Blue component of the soucre color for color keying. |
Color Keying > Graphics Layer 1 > Enable |
| Disabled | Enable Color Keying. |
Color Keying > Graphics Layer 2 > Source Color > Red | Value must be an integer from 0 to 255 | 0 | Red component of the soucre color for color keying. |
Color Keying > Graphics Layer 2 > Source Color > Green | Value must be an integer from 0 to 255 | 0 | Green component of the soucre color for color keying. |
Color Keying > Graphics Layer 2 > Source Color > Blue | Value must be an integer from 0 to 255 | 0 | Blue component of the soucre color for color keying. |
Color Keying > Graphics Layer 2 > Destination Color > Alpha | Value must be an integer from 0 to 255 | 0 | Alpha component of the destination color for color keying. |
Color Keying > Graphics Layer 2 > Destination Color > Red | Value must be an integer from 0 to 255 | 0 | Red component of the soucre color for color keying. |
Color Keying > Graphics Layer 2 > Destination Color > Green | Value must be an integer from 0 to 255 | 0 | Green component of the soucre color for color keying. |
Color Keying > Graphics Layer 2 > Destination Color > Blue | Value must be an integer from 0 to 255 | 0 | Blue component of the soucre color for color keying. |
Color Keying > Graphics Layer 2 > Enable |
| Disabled | Enable Color Keying. |
The pixel clock is typically a divided clock generated from PLL3 (maximum output frequency of 430 MHz). The M-, P-, S-Divider and Delta-Sigma Modulator value need to be set for divided clock setting. These settings are configurable in the Clocks tab. Consult Section "PLL Circuit" in the RZ microprocessor Manual for PLL3 output frequency details.
This module controls a variety of pins necessary for LCD data and timing signal output:
This is a basic example showing the minimum code required to initialize and start the LCDC module. If the entire display can be drawn within the vertical blanking period no further code may be necessary.
This is a example using the YUV420 Planar format. If you use this format, you should set 0 into Number of buffers and configure the base address for Y, Cr and Cr Plane.