| 1 |
.. include:: /include/substitutions.txt |
| 2 |
.. _renesas_glcdc: |
| 3 |
|
| 4 |
============= |
| 5 |
Renesas GLCDC |
| 6 |
============= |
| 7 |
|
| 8 |
Overview |
| 9 |
******** |
| 10 |
|
| 11 |
.. image:: /_static/images/renesas/glcdc.png |
| 12 |
:alt: Architectural overview of Renesas GLCDC |
| 13 |
:align: center |
| 14 |
|
| 15 |
GLCDC is a multi-stage graphics output peripheral used in Renesas MCUs. |
| 16 |
It is designed to automatically generate timing and data signals for different LCD panels. |
| 17 |
|
| 18 |
- Supports LCD panels with RGB interface (up to 24 bits) and sync signals (HSYNC, VSYNC and Data Enable optional) |
| 19 |
- Supports various color formats for input graphics planes (RGB888, ARGB8888, RGB565, ARGB1555, ARGB4444, CLUT8, CLUT4, CLUT1) |
| 20 |
- Supports the Color Look-Up Table (CLUT) usage for input graphics planes (ARGB8888) with 512 words (32 bits/word) |
| 21 |
- Supports various color formats for output (RGB888, RGB666, RGB565, Serial RGB888) |
| 22 |
- Can input two graphics planes on top of the background plane and blend them on the screen |
| 23 |
- Generates a dot clock to the panel. The clock source is selectable from internal or external (LCD_EXTCLK) |
| 24 |
- Supports brightness adjustment, contrast adjustment, and gamma correction |
| 25 |
- Supports GLCDC interrupts to handle frame-buffer switching or underflow detection |
| 26 |
|
| 27 |
|
| 28 |
Setting up a project and further integration with Renesas' ecosystem is described in detail on :ref:`page Renesas <renesas>`. |
| 29 |
Check out the following repositories for ready-to-use examples: |
| 30 |
|
| 31 |
- `EK-RA8D1 <https://github.com/lvgl/lv_port_renesas_ek-ra8d1_gcc>`__ |
| 32 |
- `EK-RA6M3G <https://github.com/lvgl/lv_port_renesas_ek-ra6m3g>`__ |
| 33 |
- `RX72N Envision Kit <https://github.com/lvgl/lv_port_renesas_rx72n-envision-kit>`__ |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
Prerequisites |
| 38 |
************* |
| 39 |
|
| 40 |
- This driver relies on code generated by e\ |sup2| studio. Missing the step while setting up the project will cause a compilation error. |
| 41 |
- Activate the driver by setting :c:macro:`LV_USE_RENESAS_GLCDC` to ``1`` in your ``lv_conf.h``. |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
Usage |
| 46 |
***** |
| 47 |
|
| 48 |
There is no need to implement any platform-specific functions. |
| 49 |
|
| 50 |
The following code demonstrates using the driver in :cpp:enumerator:`LV_DISPLAY_RENDER_MODE_DIRECT` mode. |
| 51 |
|
| 52 |
.. code-block:: c |
| 53 |
|
| 54 |
lv_display_t * disp = lv_renesas_glcdc_direct_create(); |
| 55 |
lv_display_set_default(disp); |
| 56 |
|
| 57 |
To use the driver in :cpp:enumerator:`LV_DISPLAY_RENDER_MODE_PARTIAL` mode, an extra buffer must be allocated, |
| 58 |
preferably in the fastest available memory region. |
| 59 |
|
| 60 |
Buffer swapping can be activated by passing a second buffer of same size instead of the :cpp:expr:`NULL` argument. |
| 61 |
|
| 62 |
.. code-block:: c |
| 63 |
|
| 64 |
static lv_color_t partial_draw_buf[DISPLAY_HSIZE_INPUT0 * DISPLAY_VSIZE_INPUT0 / 10] BSP_PLACE_IN_SECTION(".sdram") BSP_ALIGN_VARIABLE(1024); |
| 65 |
|
| 66 |
lv_display_t * disp = lv_renesas_glcdc_partial_create(partial_draw_buf, NULL, sizeof(partial_draw_buf)); |
| 67 |
lv_display_set_default(disp); |
| 68 |
|
| 69 |
.. note:: |
| 70 |
|
| 71 |
Partial mode can be activated via the macro in ``src/board_init.c`` file of the demo projects. |
| 72 |
|
| 73 |
|
| 74 |
Screen rotation |
| 75 |
--------------- |
| 76 |
|
| 77 |
Software based screen rotation is supported in partial mode. It uses the common API, no extra configuration is required: |
| 78 |
|
| 79 |
.. code-block:: c |
| 80 |
|
| 81 |
lv_display_set_rotation(lv_display_get_default(), LV_DISP_ROTATION_90); |
| 82 |
/* OR */ |
| 83 |
lv_display_set_rotation(lv_display_get_default(), LV_DISP_ROTATION_180); |
| 84 |
/* OR */ |
| 85 |
lv_display_set_rotation(lv_display_get_default(), LV_DISP_ROTATION_270); |
| 86 |
|
| 87 |
Make sure the heap is large enough, as a buffer with the same size as the partial buffer will be allocated. |