|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
2D Drawing Engine (DRW / D/AVE 2D) register layout for the RA8D2 More...
Go to the source code of this file.
Functions | |
| static volatile uint32_t * | ra8_drw_reg32 (ra8_drw_off_t off) |
| Pointer to a 32-bit register inside the DRW block. | |
2D Drawing Engine (DRW / D/AVE 2D) register layout for the RA8D2
The RA8D2 carries a Renesas D/AVE 2D vector / BitBLT drawing engine at base 0x40444000 (Secure alias) / 0x50444000 (Non-Secure alias). The block size is 0x104 bytes (260 bytes).
This header models the full register surface documented in HUM Ch 62 "2D Drawing Engine (DRW)" pages 3685-3743:
R7KA8D2KF_core0.h lines 5881-6571, register descriptions cross- checked against the HUM 62.2 series)
| Offset | Name (W) | Name (R) | Purpose |
|---|---|---|---|
| 0x00 | CONTROL | STATUS | Geometry ctl / engine st |
| 0x04 | CONTROL2 | HWREVISION | Surface ctl / hw rev |
| 0x10.. | L1..L6 START | Limiter start values | |
| 0x28.. | L1..L6 XADD | Limiter X-axis increment | |
| 0x40.. | L1..L6 YADD | Limiter Y-axis increment | |
| 0x58 | L1BAND | Limiter 1 band width | |
| 0x5C | L2BAND | Limiter 2 band width | |
| 0x64 | COLOR1 | Base RGBA color | |
| 0x68 | COLOR2 | Secondary RGBA color | |
| 0x74 | PATTERN | Pattern bitmap | |
| 0x78 | SIZE | Bounding box (W,H) | |
| 0x7C | PITCH | FB pitch + spanstore del | |
| 0x80 | ORIGIN | Framebuffer base addr | |
| 0x90 | LUSTART | U limiter start | |
| 0x94 | LUXADD | U limiter X increment | |
| 0x98 | LUYADD | U limiter Y increment | |
| 0x9C | LVSTARTI | V limiter start integer | |
| 0xA0 | LVSTARTF | V limiter start fraction | |
| 0xA4 | LVXADDI | V limiter X int | |
| 0xA8 | LVYADDI | V limiter Y int | |
| 0xAC | LVYXADDF | V limiter X/Y fraction | |
| 0xB4 | TEXPITCH | Texels per texture line | |
| 0xB8 | TEXMASK | Texture U/V mask | |
| 0xBC | TEXORIGIN | Texture base addr | |
| 0xC0 | IRQCTL | Interrupt control | |
| 0xC4 | CACHECTL | Cache enable / flush | |
| 0xC8 | DLISTSTART | Display list start addr | |
| 0xCC | PERFCOUNT1 | PERFCOUNT1 | Performance counter 1 |
| 0xD0 | PERFCOUNT2 | PERFCOUNT2 | Performance counter 2 |
| 0xD4 | PERFTRIGGER | Performance trigger sel | |
| 0xDC | TEXCLADDR | CLUT start address | |
| 0xE0 | TEXCLDATA | CLUT entry data | |
| 0xE4 | TEXCLOFFSET | CLUT index offset | |
| 0xE8 | COLKEY | Color key value | |
| 0x100 | DBWER | DBWER | Bufferable write enable |
Definition in file ra8_drw_regs.h.
| enum ra8_drw_addr_t : uintptr_t |
Memory-mapped base addresses for the DRW block.
The Secure alias (S = 0x40444000) is what the bare-metal HAL uses today. The Non-Secure alias would be selected by the secure- world arbiter once TrustZone partitioning lands.
| Enumerator | |
|---|---|
| k_ra8_drw_base_addr | DRW Secure base. |
| k_ra8_drw_ns_base_addr | DRW Non-Secure base. |
Definition at line 94 of file ra8_drw_regs.h.
| enum ra8_drw_blocksize_t : uint16_t |
Total DRW window size, used by static-assert clients.
| Enumerator | |
|---|---|
| k_ra8_drw_block_bytes | 260 bytes – matches FSP R_DRW_Type. |
Definition at line 166 of file ra8_drw_regs.h.
| enum ra8_drw_cachectl_mask_t : uint32_t |
CACHECTL register bit masks (write-only).
HUM Ch 62.2.4 p 3694 documents four bits:
Definition at line 254 of file ra8_drw_regs.h.
| enum ra8_drw_control2_mask_t : uint32_t |
CONTROL2 (Surface Control) field masks for every documented bit.
HUM Ch 62.2.2 p 3690-3693. The 32-bit register packs every blend mode, texture/CLUT/RLE/color-key knob, plus the 3-bit framebuffer format and 4-bit texture format selectors.
Definition at line 281 of file ra8_drw_regs.h.
| enum ra8_drw_control_mask_t : uint32_t |
CONTROL (Geometry Control) field masks for every documented bit.
HUM Ch 62.2.1 p 3689-3690. Six edge limiters (LIM1..LIM6), three quadratic-coupling pairs (QUAD1=L1+L2, QUAD2=L3+L4, QUAD3=L5+L6), six per-limiter "threshold" enables, two band post-process enables, five union/intersect select bits (UNION12 -> A, UNION34 -> B, UNION56 -> D, UNIONAB -> C, UNIONCD -> final), and the SPANABORT / SPANSTORE optimisations.
Solid-fill rectangle uses LIM1..LIM4 with the default INTERSECT for (1,2) and (3,4) and INTERSECT for (A,B), giving a filled axis-aligned quad. Lines use UNION12. Triangles use LIM1..LIM3 with all intersects.
Definition at line 340 of file ra8_drw_regs.h.
| enum ra8_drw_dbwer_mask_t : uint32_t |
DBWER (DRW Bufferable Write Enable) field masks.
HUM Ch 62.2.35 p 3707. Only one usable bit (BWE @ bit 2). Bits 1:0 and 31:3 are RAZ/WI.
| Enumerator | |
|---|---|
| k_ra8_drw_dbwer_bwe | Enable bufferable writes. |
Definition at line 676 of file ra8_drw_regs.h.
| enum ra8_drw_dim_limits_t : uint16_t |
Hardware bounds documented by HUM Ch 62.
Definition at line 639 of file ra8_drw_regs.h.
| enum ra8_drw_dlr_index_t : uint8_t |
Register indices a display-list entry addresses (byte offset / 4).
The DLR names registers by word index, not byte offset. Each value equals the matching k_ra8_drw_off_* divided by four (e.g. ORIGIN 0x80 -> 32). Only the registers the solid-fill display-list path programs are listed; add more here as further primitives gain a display-list encoding.
Definition at line 575 of file ra8_drw_regs.h.
| enum ra8_drw_dlr_word_t : uint32_t |
Display-list tag and end-of-list word constants.
k_ra8_drw_dlr_tag_one_index OR-ed with a ra8_drw_dlr_index_t forms a tag for a single-register entry (byte 1 carries bit 7, the boundary marker, so the DLR reads exactly one value word after it). An end-of-list word is k_ra8_drw_dlr_eol_byte OR-ed with an argument shifted by k_ra8_drw_dlr_eol_arg_pos.
Definition at line 599 of file ra8_drw_regs.h.
| enum ra8_drw_geom_layout_t : uint8_t |
Bit positions / masks shared by SIZE and PITCH.
Definition at line 624 of file ra8_drw_regs.h.
| enum ra8_drw_hwrev_mask_t : uint32_t |
HWREVISION feature-set bit masks (read-only).
HUM Ch 62.2.6 p 3696. Reset value on the RA8D2 is documented as 0x1FBE_0017 (DLR=1, FBCACHE=1, TXCACHE=1, PERFCOUNT=1, TEXCLUT=1, RLEUNIT=1, TEXCLUT256=1, COLORKEY=1, ACBLEND=1, REV=0x017).
Definition at line 391 of file ra8_drw_regs.h.
| enum ra8_drw_irqctl_mask_t : uint32_t |
IRQCTL register bit masks (write-only).
Verified against HUM Ch 62.2.3 p 3693 and FSP R_DRW_Type::IRQCTL_b in R7KA8D2KF_core0.h lines 5443-5450. Note that ENUMIRQEN (bit 0) is the enable for ENUMIRQ; the *CLR bits are write-1-to-acknowledge.
Definition at line 223 of file ra8_drw_regs.h.
| enum ra8_drw_off_t : uint16_t |
Absolute register offsets inside the DRW window.
Names mirror the FSP R_DRW_Type field names so a reader can cross-reference directly against the CMSIS device header.
Definition at line 107 of file ra8_drw_regs.h.
| enum ra8_drw_perfcounter_id_t : uint8_t |
Selector for the two PERFCOUNTk registers.
| Enumerator | |
|---|---|
| k_ra8_drw_perfctr_1 | PERFCOUNT1 @ +0xCC. |
| k_ra8_drw_perfctr_2 | PERFCOUNT2 @ +0xD0. |
Definition at line 538 of file ra8_drw_regs.h.
| enum ra8_drw_perftrigger_t : uint16_t |
Internal events that increment a PERFCOUNT register.
HUM Ch 62.2.33 p 3706. 14 documented event sources plus "every clock" (0x1F). Two counters are independently programmed via PERFTRIGGER[15:0] (counter 1) and PERFTRIGGER[31:16] (counter 2).
Definition at line 516 of file ra8_drw_regs.h.
| enum ra8_drw_pixel_stride_t : uint8_t |
Framebuffer pixel stride in bytes per WRITEFORMAT class.
HUM Ch 62.3.1.1 "Color Formats" p 3707. Needed to advance ORIGIN to a primitive's top-left pixel, because the engine scans the bounding box anchored at ORIGIN (HUM Ch 62.6.2 p 3716).
| Enumerator | |
|---|---|
| k_ra8_drw_bytes_px_8bpp | A8. |
| k_ra8_drw_bytes_px_16bpp | RGB565 / ARGB4444. |
| k_ra8_drw_bytes_px_32bpp | ARGB8888. |
Definition at line 662 of file ra8_drw_regs.h.
| enum ra8_drw_readformat_t : uint8_t |
Texture pixel format codes (4-bit field).
HUM Ch 62.2.2 p 3692. Spans CONTROL2.READFORMAT_H[3:2] (bits 5:4) and CONTROL2.READFORMAT_L[1:0] (bits 19:18). Encoded as one contiguous 4-bit value here; the driver splits it on write.
| Code | Bits | Format |
|---|---|---|
| 0x0 | 8 | A (8) |
| 0x1 | 16 | RGB565 |
| 0x2 | 32 | ARGB8888 |
| 0x3 | 16 | ARGB4444 |
| 0x4 | 16 | ARGB1555 |
| 0x5 | 8 | ACLUT44 (4-bit alpha + 4-bit i) |
| 0x9 | 8 | CLUT8/I8 |
| 0xA | 4 | CLUT4/I4 |
| 0xB | 2 | CLUT2/I2 |
| 0xC | 1 | CLUT1/I1 |
Definition at line 457 of file ra8_drw_regs.h.
| enum ra8_drw_rlepixel_t : uint8_t |
RLEPIXELWIDTH[1:0] – bytes per RLE-encoded texel.
HUM Ch 62.2.2 p 3693 + HUM Ch 62.5.2.1 p 3712 "Texel formats supported by the RLE unit". RLE source width 1..4 bytes per texel.
Definition at line 493 of file ra8_drw_regs.h.
| enum ra8_drw_status_mask_t : uint32_t |
STATUS register bit masks (read-only).
Verified against HUM Ch 62.2.5 p 3695 and FSP R_DRW_Type::STATUS_b in R7KA8D2KF_core0.h lines 5925-5939. The status register shares its offset with CONTROL: a write at offset 0 hits CONTROL, a read returns STATUS.
Definition at line 187 of file ra8_drw_regs.h.
| enum ra8_drw_subpixel_t : uint8_t |
DRW limiter sub-pixel constants (Q12.4 fixed-point space).
The DRW limiters work in 4-bit sub-pixel coordinates – shift pixel coordinates left by 4 before writing LnSTART / LnXADD / LnYADD. HUM Ch 62.4.2 "Limiters" p 3724 documents the fixed-point grid.
| Enumerator | |
|---|---|
| k_ra8_drw_subpixel_shift | 1 pixel == 16 sub-pixels. |
| k_ra8_drw_subpixel_unit | 1 pixel value (1 << 4). |
Definition at line 689 of file ra8_drw_regs.h.
| enum ra8_drw_writealpha_t : uint8_t |
WRITEALPHA[1:0] writeback alpha source select.
HUM Ch 62.2.2 p 3693. Two bits select where the alpha channel of each writeback pixel comes from.
| Enumerator | |
|---|---|
| k_ra8_drw_writealpha_color2 | Use COLOR2 alpha. |
| k_ra8_drw_writealpha_pixel_cov | Use source coverage. |
| k_ra8_drw_writealpha_zero | Force 0.0. |
| k_ra8_drw_writealpha_fb | Use framebuffer alpha. |
Definition at line 478 of file ra8_drw_regs.h.
| enum ra8_drw_writeformat_t : uint8_t |
Framebuffer pixel format codes (3-bit field).
HUM Ch 62.2.2 p 3692. The 3-bit code spans CONTROL2.WRITEFORMAT2 (bit 8) and CONTROL2.WRITEFORMAT[1:0] (bits 21:20). Codes 4..7 are marked "Setting prohibited".
| Code | Format |
|---|---|
| 0 | A (8) – 8 bpp |
| 1 | RGB (565) – 16 bpp |
| 2 | ARGB (8888) – 32 bpp |
| 3 | ARGB (4444) – 16 bpp |
| Enumerator | |
|---|---|
| k_ra8_drw_writefmt_a8 | 8 bpp A(8). |
| k_ra8_drw_writefmt_rgb565 | 16 bpp RGB565. |
| k_ra8_drw_writefmt_argb8888 | 32 bpp ARGB8888. |
| k_ra8_drw_writefmt_argb4444 | 16 bpp ARGB4444. |
Definition at line 428 of file ra8_drw_regs.h.
|
inlinestatic |
Pointer to a 32-bit register inside the DRW block.
| [in] | off | One of the k_ra8_drw_off_* values (low 12 bits of the absolute address). |
Definition at line 708 of file ra8_drw_regs.h.
References k_ra8_drw_base_addr.
Referenced by internal_control2_rmw(), internal_drw_program_cache_options(), internal_program_line_limiters(), priv_program_rect_bbox(), priv_ra8_drw_internal_color1_write(), ra8_drw_blit_textured_rect(), ra8_drw_cache_flush(), ra8_drw_clear_status(), ra8_drw_deinit(), ra8_drw_dispatch(), ra8_drw_draw_line(), ra8_drw_draw_triangle(), ra8_drw_enter_stop(), ra8_drw_fill_rect(), ra8_drw_get_hwrevision(), ra8_drw_get_status(), ra8_drw_init(), ra8_drw_load_clut(), ra8_drw_perf_arm(), ra8_drw_perf_read(), ra8_drw_perf_reset(), ra8_drw_reset(), ra8_drw_run_dlist(), ra8_drw_set_color_key(), ra8_drw_set_gradient(), ra8_drw_set_irq_enables(), ra8_drw_set_pattern(), ra8_drw_set_texture(), and ra8_drw_wait_idle().