|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Graphics LCD Controller (GLCDC) register layout for the RA8D2. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_glcdc_gam_t |
| Per-channel gamma correction register block (HUM Ch 63 p 3789-3793). More... | |
Functions | |
| static volatile uint32_t * | ra8_glcdc_reg32 (ra8_glcdc_block_off_t offset) |
| Pointer to a 32-bit register inside the GLCDC block. | |
| static volatile ra8_glcdc_gam_t * | ra8_glcdc_gam_regs (uint8_t channel_idx) |
| Return a volatile pointer to a per-channel gamma register block. | |
Graphics LCD Controller (GLCDC) register layout for the RA8D2.
GLCDC at 0x40342000 drives up to two RGB graphics layers with alpha blending, chroma key, dither, gamma correction, and parallel-RGB or MIPI-DSI output. The EK-RA8D2's 1024x600 7" parallel TFT connects here via the GLCDC expansion header. <h2>Block structure (verified against FSP R_GLCDC_Type in</h2> R7KA8D2KF_core0.h lines 6980-7045) <table class="markdownTable"> <tr class="markdownTableHead"> <th class="markdownTableHeadRight"> Offset
Block
Size
Purpose
0x0000
GR1_CLUT0[256]
0x0400
Graphics 1 CLUT plane 0
0x0400
GR1_CLUT1[256]
0x0400
Graphics 1 CLUT plane 1
0x0800
GR2_CLUT0[256]
0x0400
Graphics 2 CLUT plane 0
0x0C00
GR2_CLUT1[256]
0x0400
Graphics 2 CLUT plane 1
0x1000
BG
0x001C
Background timing + bgc
0x1100
GR[0]
0x0100
Graphics layer 0
0x1200
GR[1]
0x0100
Graphics layer 1
0x1300
GAM[0..2]
0x00C0
Gamma tables (3 channels)
0x13C0
OUT
0x0028
Output control
0x1400
TCON
0x002C
Timing controller
0x1440
SYSCNT
0x0014
System control / ints
The previous version of this header placed BG at offset 0x000, GR1 at 0x150, GR2 at 0x270, OUT at 0x390, SYSCNT at 0x420 – all of which landed inside GR1/GR2 CLUTs or reserved gaps. Every k_ra8_glcdc_off_* has been re-derived against FSP.
Definition in file ra8_glcdc_regs.h.
| enum ra8_display_addr_t : uintptr_t |
Definition at line 48 of file ra8_glcdc_regs.h.
| enum ra8_glcdc_block_off_t : uint16_t |
Absolute register offsets inside the GLCDC window.
Names mirror FSP's R_GLCDC_Type field names so a reader can cross-reference directly. Offsets are verified byte-for-byte against FSP's sub-type structs (R_GLCDC_BG_Type, R_GLCDC_GR_Type, R_GLCDC_OUT_Type, R_GLCDC_TCON_Type, R_GLCDC_SYSCNT_Type).
Definition at line 66 of file ra8_glcdc_regs.h.
| enum ra8_glcdc_ek_clk_t : uint32_t |
| Enumerator | |
|---|---|
| k_ra8_glcdc_ek_pixel_clk_hz | ~51.2 MHz pixel clock. |
Definition at line 304 of file ra8_glcdc_regs.h.
| enum ra8_glcdc_ek_timing_t : uint16_t |
Definition at line 293 of file ra8_glcdc_regs.h.
| enum ra8_glcdc_gam_field_t : uint32_t |
Shift and mask constants for the gamma LUT and AREA register fields.
LUT register layout (HUM Ch 63 "GAMx_LUTn" p 3790): bits[26:16] = GAIN0 (11 bits, coefficient for even entry index) bits[10:0] = GAIN1 (11 bits, coefficient for odd entry index)
AREA register layout (HUM Ch 63 "GAMx_AREAn" p 3793): bits[25:16] = TH1 (10 bits, boundary for even threshold index) bits[9:0] = TH2 (10 bits, boundary for odd threshold index)
Definition at line 242 of file ra8_glcdc_regs.h.
| enum ra8_glcdc_gam_size_t : uint8_t |
Byte size of one channel's GAM register block (LUT[8] + AREA[8]).
| Enumerator | |
|---|---|
| k_ra8_glcdc_gam_block_bytes | sizeof(ra8_glcdc_gam_t). |
Definition at line 222 of file ra8_glcdc_regs.h.
| enum ra8_glcdc_gamsw_bits_t : uint32_t |
Bit mask for the output-stage gamma-switch register (GAMSW).
HUM Ch 63 "OUT_GAMSW Gamma Correction Block Switch Register" p 3789: bit 0 (GAMON) enables the gamma correction pipeline for all channels.
| Enumerator | |
|---|---|
| k_ra8_glcdc_gamsw_gamon | GAMSW.GAMON: global gamma enable. |
Definition at line 257 of file ra8_glcdc_regs.h.
| enum ra8_glcdc_pixel_fmt_t : uint8_t |
Pixel format codes written to GRn_FLM6.FORMAT[30:28].
Verified against HUM Ch 63 "GLCDC" Table 63.11 "Graphics data format" and FSP r_glcdc.h glcdc_gr_format_t.
Definition at line 167 of file ra8_glcdc_regs.h.
|
inlinestatic |
Return a volatile pointer to a per-channel gamma register block.
Computes the base address of GAM[0] (R), GAM[1] (G), or GAM[2] (B) from the offset table. The caller must validate channel_idx before calling; an out-of-range index produces a pointer into unmapped MMIO.
| [in] | channel_idx | 0 = Red, 1 = Green, 2 = Blue. |
Definition at line 273 of file ra8_glcdc_regs.h.
References k_ra8_glcdc_base_addr, k_ra8_glcdc_off_gam0, k_ra8_glcdc_off_gam1, and k_ra8_glcdc_off_gam2.
Referenced by ra8_glcdc_set_gamma().
|
inlinestatic |
Pointer to a 32-bit register inside the GLCDC block.
| [in] | offset | One of the k_ra8_glcdc_off_* values. |
Definition at line 184 of file ra8_glcdc_regs.h.
References k_ra8_glcdc_base_addr.
Referenced by internal_clutint_reg(), internal_program_bg(), internal_program_gr1(), internal_program_gr2(), internal_program_out(), internal_program_tcon(), ra8_glcdc_clear_status(), ra8_glcdc_deinit(), ra8_glcdc_dispatch(), ra8_glcdc_enter_stop(), ra8_glcdc_gamma_enable(), ra8_glcdc_get_status(), ra8_glcdc_init(), ra8_glcdc_layer1_show(), ra8_glcdc_layer2_chroma_key_enable(), ra8_glcdc_layer2_show(), ra8_glcdc_set_background_color(), ra8_glcdc_set_blend(), ra8_glcdc_set_brightness(), ra8_glcdc_set_contrast(), ra8_glcdc_set_dithering(), ra8_glcdc_set_layer2(), and ra8_glcdc_start().