|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
2D Drawing Engine (DRW / D/AVE 2D) HAL driver – public API More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_drw_config_t |
| Minimal DRW configuration captured by ra8_drw_init. More... | |
| struct | ra8_drw_rect_t |
| Rectangle parameters for ra8_drw_fill_rect. More... | |
| struct | ra8_drw_blend_t |
| Per-pixel + global alpha blending parameters. More... | |
| struct | ra8_drw_texture_t |
| Texture parameters for ra8_drw_blit_textured_rect. More... | |
| struct | ra8_drw_line_t |
| Anti-aliased line parameters. More... | |
| struct | ra8_drw_triangle_t |
| Anti-aliased filled triangle parameters. More... | |
| struct | ra8_drw_gradient_t |
| COLOR1 + COLOR2 two-stop gradient. More... | |
| struct | ra8_drw_dlist_t |
| Builder state for composing a DRW display list in a caller buffer. More... | |
Typedefs | |
| typedef void(* | ra8_drw_event_fn_t) (void *ctx, uint32_t status_mask) |
| DRW asynchronous event callback signature. | |
Functions | |
| ra8_err_t | ra8_drw_init (const ra8_drw_config_t *cfg) |
| Power on the DRW block, install the supplied configuration, and arm the IRQ control register. | |
| ra8_err_t | ra8_drw_deinit (void) |
| Tear down the DRW block: disable IRQs, drop the registered callback, and request MSTP gate. | |
| ra8_err_t | ra8_drw_get_status (uint32_t *out_mask) |
| Read the DRW STATUS register into *out_mask. | |
| ra8_err_t | ra8_drw_get_hwrevision (uint32_t *out) |
| Read the read-only HWREVISION register into *out. | |
| ra8_err_t | ra8_drw_clear_status (uint32_t mask) |
| Acknowledge a subset of pending DRW interrupts via IRQCTL. | |
| ra8_err_t | ra8_drw_set_irq_enables (uint32_t enable_mask) |
| Set the IRQCTL enable bits (ENUMIRQEN, DLISTIRQEN, BUSIRQEN). | |
| ra8_err_t | ra8_drw_attach_handler (ra8_drw_event_fn_t fn, void *ctx) |
| Register a software callback for DRW IRQ events. | |
| void | ra8_drw_dispatch (void) |
| Snapshot STATUS, ack pending DRW IRQs, and fire callback. | |
| ra8_err_t | ra8_drw_wait_idle (uint32_t poll_budget) |
| Poll STATUS until all "busy" bits clear or budget runs out. | |
| ra8_err_t | ra8_drw_enter_stop (void) |
| Drop the DRW into MSTP-gated stop (clock removed). | |
| ra8_err_t | ra8_drw_exit_stop (void) |
| Re-enable the DRW MSTP gate (clock restored). | |
| ra8_err_t | ra8_drw_reset (void) |
| Software reset: drain pipeline, ack IRQs, reset PERFCOUNTers. | |
| ra8_err_t | ra8_drw_cache_flush (bool flush_fb, bool flush_texture) |
| Pulse FB and/or texture cache flush bits in CACHECTL. | |
| ra8_err_t | ra8_drw_set_gradient (const ra8_drw_gradient_t *grad) |
| Programme the COLOR1 and COLOR2 registers from a 2-stop gradient. | |
| ra8_err_t | ra8_drw_set_pattern (uint8_t pattern_byte) |
| Set the per-byte PATTERN bitmap (HUM Ch 62.2.9 p 3698). | |
| ra8_err_t | ra8_drw_set_pattern_enable (bool enable, bool source_from_l5) |
| Toggle CONTROL2.PATTERNENABLE / PATTERNSOURCEL5. | |
| ra8_err_t | ra8_drw_set_blend (const ra8_drw_blend_t *blend) |
| Configure the alpha-blend unit using ra8_drw_blend_t fields. | |
| ra8_err_t | ra8_drw_set_color_key (uint32_t key_rgb, bool enable) |
| Programme the COLKEY register and toggle COLKEYENABLE. | |
| ra8_err_t | ra8_drw_set_texture (const ra8_drw_texture_t *tex) |
| Programme TEXORIGIN, TEXPITCH, TEXMASK, U/V limiters and the CONTROL2 texture / CLUT / RLE / colour-key bits. | |
| ra8_err_t | ra8_drw_clear_texture (void) |
| Disable the texture unit (clear CONTROL2.TEXTUREENABLE / RLE / CLUT). | |
| ra8_err_t | ra8_drw_load_clut (uint8_t start_index, const uint32_t *entries, uint32_t count) |
| Load a CLUT entry pair (TEXCLADDR, TEXCLDATA, TEXCLOFFSET). | |
| ra8_err_t | ra8_drw_fill_rect (const ra8_drw_rect_t *rect) |
| Issue a solid-fill rectangle blit into the framebuffer. | |
| ra8_err_t | ra8_drw_blit_textured_rect (const ra8_drw_rect_t *rect) |
| Blit a textured rectangle (texture must be programmed first). | |
| ra8_err_t | ra8_drw_draw_line (const ra8_drw_line_t *line) |
| Issue an anti-aliased line stroke between two points. | |
| ra8_err_t | ra8_drw_draw_triangle (const ra8_drw_triangle_t *tri) |
| Issue an anti-aliased filled triangle. | |
| ra8_err_t | ra8_drw_run_dlist (const uint32_t *dlist_addr) |
| Trigger execution of a display list. | |
| ra8_err_t | ra8_drw_perf_arm (ra8_drw_perftrigger_t event_ctr1, ra8_drw_perftrigger_t event_ctr2) |
| Programme PERFTRIGGER for the two performance counters and reset both PERFCOUNTk registers. | |
| ra8_err_t | ra8_drw_perf_read (ra8_drw_perfcounter_id_t id, uint32_t *out) |
| Read one PERFCOUNTk register. | |
| ra8_err_t | ra8_drw_perf_reset (ra8_drw_perfcounter_id_t id) |
| Reset one PERFCOUNTk register to zero. | |
2D Drawing Engine (DRW / D/AVE 2D) HAL driver – public API
Bare-metal driver for the RA8D2 2D drawing engine ("D/AVE 2D"). After the expansion the API now covers every register the HUM Ch 62 documents, every operating mode (solid fill, textured blit, RLE source, CLUT lookup, color key, alpha blend, anti- aliased line / triangle, display list) and every IRQ source (enum complete, dlist complete, bus error).
Definition in file ra8_drw.h.
| typedef void(* ra8_drw_event_fn_t) (void *ctx, uint32_t status_mask) |
DRW asynchronous event callback signature.
Fired from ra8_drw_dispatch after the DRW IRQ snapshots and acknowledges the STATUS register. The status_mask argument carries the raw STATUS value the dispatcher observed before clearing it; consumers test bits with the k_ra8_drw_status_* masks from ra8_drw_regs.h.
|
nodiscard |
Register a software callback for DRW IRQ events.
| [in] | fn | Callback function pointer (may be nullptr to detach the previously registered callback). |
| [in] | ctx | Opaque caller context, passed back as the first argument of fn. |
|
nodiscard |
Blit a textured rectangle (texture must be programmed first).
The caller programmes the texture state via ra8_drw_set_texture (which also enables CONTROL2.TEXTUREENABLE). This function then writes the rectangle limiter set + SIZE and starts the engine via a write to CONTROL.
| [in] | rect | Destination rectangle. Must not be nullptr. |
| k_ra8_ok | Blit issued. |
| k_ra8_err_null_ptr | rect was nullptr. |
| k_ra8_err_invalid_arg | width/height out of range. |
Definition at line 98 of file ra8_drw_draw.c.
References ra8_drw_rect_t::height_px, k_ra8_drw_cachectl_cflushtx, k_ra8_drw_max_height_px, k_ra8_drw_max_width_px, k_ra8_drw_min_dim_px, k_ra8_drw_off_cachectl, k_ra8_drw_off_control, k_ra8_drw_off_lustart, k_ra8_drw_off_luxadd, k_ra8_drw_off_luyadd, k_ra8_drw_off_lvstartf, k_ra8_drw_off_lvstarti, k_ra8_drw_off_lvxaddi, k_ra8_drw_off_lvyaddi, k_ra8_drw_off_lvyxaddf, k_ra8_drw_off_origin, k_ra8_drw_subpixel_unit, k_ra8_err_invalid_arg, k_ra8_ok, priv_program_rect_bbox(), priv_ra8_drw_internal_rect_above_max(), priv_ra8_drw_internal_rect_below_min(), priv_ra8_drw_internal_rect_off_surface(), priv_ra8_drw_internal_rect_origin(), RA8_CHECK_NULL_PTR, ra8_drw_reg32(), s_tag, and ra8_drw_rect_t::width_px.
|
nodiscard |
Pulse FB and/or texture cache flush bits in CACHECTL.
| [in] | flush_fb | True to set CFLUSHFX (framebuffer flush). |
| [in] | flush_texture | True to set CFLUSHTX (texture flush). |
Definition at line 688 of file ra8_drw.c.
References k_ra8_drw_cachectl_cflushfx, k_ra8_drw_cachectl_cflushtx, k_ra8_drw_off_cachectl, k_ra8_ok, ra8_drw_reg32(), ra8_log_warn, and s_tag.
|
nodiscard |
Acknowledge a subset of pending DRW interrupts via IRQCTL.
Writes the supplied mask to IRQCTL (write-1-to-clear semantics for the *CLR bits). The mask should be one of the documented k_ra8_drw_irqctl_*_clr enum values; arbitrary other bits in the mask will set / clear the corresponding enable bits and the caller must be prepared for that.
| [in] | mask | IRQCTL bits to write (W1C for ENUMIRQCLR, DLISTIRQCLR, BUSIRQCLR). |
| k_ra8_ok | IRQCTL written. |
Definition at line 589 of file ra8_drw.c.
References k_ra8_drw_off_irqctl, k_ra8_ok, and ra8_drw_reg32().
|
nodiscard |
Disable the texture unit (clear CONTROL2.TEXTUREENABLE / RLE / CLUT).
Definition at line 938 of file ra8_drw.c.
References internal_control2_rmw(), k_ra8_drw_control2_clutenable, k_ra8_drw_control2_colkeyenable, k_ra8_drw_control2_rleenable, k_ra8_drw_control2_rlepixel_mask, k_ra8_drw_control2_textureenable, and k_ra8_ok.
|
nodiscard |
Tear down the DRW block: disable IRQs, drop the registered callback, and request MSTP gate.
| k_ra8_ok | DRW powered down successfully. |
Definition at line 545 of file ra8_drw.c.
References k_ra8_drw_irqctl_all_clr, k_ra8_drw_off_cachectl, k_ra8_drw_off_dbwer, k_ra8_drw_off_irqctl, k_ra8_mstp_drw, ra8_drw_reg32(), ra8_mstp_disable(), s_drw_bytes_px, s_drw_color1, s_drw_control2, s_drw_ctx, s_drw_fn, s_drw_origin, and s_drw_pitch_px.
| void ra8_drw_dispatch | ( | void | ) |
Snapshot STATUS, ack pending DRW IRQs, and fire callback.
Intended to be called from the DRW ISR (or from a host test). Reads STATUS, writes IRQCTL = all_clr to ack pending bits, then invokes the registered callback (if any) with the snapshot.
Definition at line 615 of file ra8_drw.c.
References k_ra8_drw_irqctl_all_clr, k_ra8_drw_off_irqctl, k_ra8_drw_off_status, ra8_drw_reg32(), s_drw_ctx, and s_drw_fn.
|
nodiscard |
Issue an anti-aliased line stroke between two points.
Pre-computes the four perpendicular limiters bounding the stroke, programmes COLOR1, then enables LIM1..LIM4 with the standard intersect topology. HUM Ch 62.4.4 "Lines" p 3725.
| [in] | line | Line parameters. Must not be nullptr. |
| k_ra8_ok | Line issued. |
| k_ra8_err_null_ptr | line was nullptr. |
| k_ra8_err_invalid_arg | width_px == 0 or > 1024. |
Definition at line 206 of file ra8_drw_draw.c.
References ra8_drw_line_t::color_argb8888, internal_program_line_limiters(), k_ra8_drw_cachectl_all_en, k_ra8_drw_cachectl_cflushfx, k_ra8_drw_control_line_quad, k_ra8_drw_max_width_px, k_ra8_drw_off_cachectl, k_ra8_drw_off_control, k_ra8_drw_off_origin, k_ra8_drw_off_size, k_ra8_drw_size_height_pos, k_ra8_err_invalid_arg, k_ra8_ok, priv_ra8_drw_internal_color1_write(), priv_ra8_drw_internal_origin(), RA8_CHECK_NULL_PTR, ra8_drw_reg32(), s_tag, ra8_drw_line_t::width_px, ra8_drw_line_t::x0, ra8_drw_line_t::x1, ra8_drw_line_t::y0, and ra8_drw_line_t::y1.
|
nodiscard |
Issue an anti-aliased filled triangle.
Computes the three edge limiters and writes CONTROL with LIM1..LIM3 enabled. HUM Ch 62.4.5 "Triangles" p 3726.
| [in] | tri | Triangle parameters. Must not be nullptr. |
| k_ra8_ok | Triangle issued. |
| k_ra8_err_null_ptr | tri was nullptr. |
Definition at line 245 of file ra8_drw_draw.c.
References ra8_drw_triangle_t::color_argb8888, internal_to_subpixel(), k_ra8_drw_cachectl_all_en, k_ra8_drw_cachectl_cflushfx, k_ra8_drw_control_triangle, k_ra8_drw_off_cachectl, k_ra8_drw_off_control, k_ra8_drw_off_l1start, k_ra8_drw_off_l1xadd, k_ra8_drw_off_l1yadd, k_ra8_drw_off_l2start, k_ra8_drw_off_l2xadd, k_ra8_drw_off_l2yadd, k_ra8_drw_off_l3start, k_ra8_drw_off_l3xadd, k_ra8_drw_off_l3yadd, k_ra8_drw_off_origin, k_ra8_drw_off_size, k_ra8_drw_size_height_pos, k_ra8_ok, priv_ra8_drw_internal_color1_write(), priv_ra8_drw_internal_origin(), RA8_CHECK_NULL_PTR, ra8_drw_reg32(), s_tag, ra8_drw_triangle_t::x0, ra8_drw_triangle_t::x1, ra8_drw_triangle_t::x2, ra8_drw_triangle_t::y0, ra8_drw_triangle_t::y1, and ra8_drw_triangle_t::y2.
|
nodiscard |
Drop the DRW into MSTP-gated stop (clock removed).
| k_ra8_ok | DRW gated. |
Definition at line 653 of file ra8_drw.c.
References k_ra8_drw_irqctl_all_clr, k_ra8_drw_off_irqctl, k_ra8_mstp_drw, ra8_drw_reg32(), and ra8_mstp_disable().
|
nodiscard |
Re-enable the DRW MSTP gate (clock restored).
| k_ra8_ok | DRW running. |
Definition at line 662 of file ra8_drw.c.
References k_ra8_mstp_drw, and ra8_mstp_enable().
|
nodiscard |
Issue a solid-fill rectangle blit into the framebuffer.
Programmes the DRW limiters to bound a rectangle, sets COLOR1 to the requested ARGB colour, then writes CONTROL with the four limiter-enable bits set to kick the engine.
| [in] | rect | Rectangle parameters. Must not be nullptr. |
| k_ra8_ok | Blit issued (engine may still be busy). |
| k_ra8_err_null_ptr | rect was nullptr. |
| k_ra8_err_invalid_arg | width/height was 0 or > 1024. |
Definition at line 59 of file ra8_drw_draw.c.
References ra8_drw_rect_t::color_argb8888, ra8_drw_rect_t::height_px, k_ra8_drw_max_height_px, k_ra8_drw_max_width_px, k_ra8_drw_min_dim_px, k_ra8_drw_off_control, k_ra8_drw_off_origin, k_ra8_err_invalid_arg, k_ra8_ok, priv_program_rect_bbox(), priv_ra8_drw_internal_color1_write(), priv_ra8_drw_internal_rect_off_surface(), priv_ra8_drw_internal_rect_origin(), RA8_CHECK_NULL_PTR, ra8_drw_reg32(), s_tag, and ra8_drw_rect_t::width_px.
Referenced by drw_blend_fill(), and drw_demo_fill_and_check().
|
nodiscard |
Read the read-only HWREVISION register into *out.
| [out] | out | Receives HWREVISION (HUM Ch 62.2.6 p 3696). Decode via k_ra8_drw_hwrev_* masks. |
| k_ra8_ok | HWREVISION read. |
| k_ra8_err_null_ptr | out was nullptr. |
Definition at line 581 of file ra8_drw.c.
References k_ra8_drw_off_hwrevision, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_drw_reg32(), and s_tag.
Referenced by demo_configure(), and drw_demo_configure().
|
nodiscard |
Read the DRW STATUS register into *out_mask.
| [out] | out_mask | Receives the raw 32-bit STATUS value. Must be non-null. Bits decode via k_ra8_drw_status_*. |
| k_ra8_ok | STATUS read into *out_mask. |
| k_ra8_err_null_ptr | out_mask was nullptr. |
Definition at line 572 of file ra8_drw.c.
References k_ra8_drw_off_status, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_drw_reg32(), and s_tag.
Referenced by main().
|
nodiscard |
Power on the DRW block, install the supplied configuration, and arm the IRQ control register.
Sequence performed:
| [in] | cfg | Pointer to the configuration. Must not be nullptr. |
| k_ra8_ok | DRW powered up + configured. |
| k_ra8_err_null_ptr | cfg was nullptr. |
| k_ra8_err_hw_init_failed | MSTP enable failed. |
Definition at line 491 of file ra8_drw.c.
References ra8_drw_config_t::format, ra8_drw_config_t::framebuffer_addr, internal_bytes_per_px(), internal_drw_program_cache_options(), internal_pack_surface_defaults(), k_ra8_drw_irqctl_all_clr, k_ra8_drw_off_control2, k_ra8_drw_off_irqctl, k_ra8_drw_off_origin, k_ra8_drw_off_pitch, k_ra8_lpm_pd_timeout_default, k_ra8_mstp_drw, k_ra8_ok, ra8_drw_config_t::pitch_px, RA8_CHECK_NULL_PTR, ra8_drw_reg32(), ra8_log_info_val, ra8_lpm_graphics_power_on(), ra8_mstp_enable(), RA8_RETURN_ON_ERROR, s_drw_bytes_px, s_drw_color1, s_drw_control2, s_drw_origin, s_drw_pitch_px, and s_tag.
Referenced by demo_configure(), drw_blend_configure(), and drw_demo_configure().
|
nodiscard |
Load a CLUT entry pair (TEXCLADDR, TEXCLDATA, TEXCLOFFSET).
Walks the supplied entries array, writing TEXCLADDR with the starting CLUT index then streaming each ARGB8888 entry into TEXCLDATA. The DRW auto-increments CLADDR after each TEXCLDATA write (HUM Ch 62.5.4 p 3717).
| [in] | start_index | Index of the first CLUT slot to write [0..255]. |
| [in] | entries | ARGB8888 entries to load (length = count). |
| [in] | count | Number of entries to write [1..256]. |
| k_ra8_ok | CLUT loaded. |
| k_ra8_err_null_ptr | entries was nullptr. |
| k_ra8_err_invalid_arg | start_index + count > 256, or count = 0. |
Definition at line 948 of file ra8_drw.c.
References k_ra8_drw_internal_clut_max, k_ra8_drw_off_texcladdr, k_ra8_drw_off_texcldata, k_ra8_err_invalid_arg, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_drw_reg32(), and s_tag.
|
nodiscard |
Programme PERFTRIGGER for the two performance counters and reset both PERFCOUNTk registers.
| [in] | event_ctr1 | Trigger event for PERFCOUNT1. |
| [in] | event_ctr2 | Trigger event for PERFCOUNT2. |
| k_ra8_ok | Counters armed. |
| k_ra8_err_invalid_arg | Either event > 0x1F. |
Definition at line 496 of file ra8_drw_draw.c.
References k_ra8_drw_internal_perfev_max, k_ra8_drw_off_perfcount1, k_ra8_drw_off_perfcount2, k_ra8_drw_off_perftrigger, k_ra8_drw_perftrigger2_pos, k_ra8_err_invalid_arg, k_ra8_ok, and ra8_drw_reg32().
|
nodiscard |
Read one PERFCOUNTk register.
| [in] | id | Counter identifier. |
| [out] | out | Receives the 32-bit count. |
| k_ra8_ok | Count read. |
| k_ra8_err_null_ptr | out was nullptr. |
| k_ra8_err_invalid_arg | id outside enum. |
Definition at line 515 of file ra8_drw_draw.c.
References k_ra8_drw_off_perfcount1, k_ra8_drw_off_perfcount2, k_ra8_drw_perfctr_1, k_ra8_drw_perfctr_2, k_ra8_err_invalid_arg, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_drw_reg32(), and s_tag.
|
nodiscard |
Reset one PERFCOUNTk register to zero.
| [in] | id | Counter identifier. |
| k_ra8_ok | Counter cleared. |
| k_ra8_err_invalid_arg | id outside enum. |
Definition at line 532 of file ra8_drw_draw.c.
References k_ra8_drw_off_perfcount1, k_ra8_drw_off_perfcount2, k_ra8_drw_perfctr_1, k_ra8_drw_perfctr_2, k_ra8_err_invalid_arg, k_ra8_ok, and ra8_drw_reg32().
|
nodiscard |
Software reset: drain pipeline, ack IRQs, reset PERFCOUNTers.
Definition at line 667 of file ra8_drw.c.
References k_ra8_drw_cachectl_all_flush, k_ra8_drw_irqctl_all_clr, k_ra8_drw_off_cachectl, k_ra8_drw_off_irqctl, k_ra8_drw_off_perfcount1, k_ra8_drw_off_perfcount2, k_ra8_ok, and ra8_drw_reg32().
|
nodiscard |
Trigger execution of a display list.
Writes DLISTSTART with the supplied address. The DRW pulls one 32-bit word at a time from RAM and decodes it as (register index, value) pairs until it hits a terminator. HUM Ch 62.6 "Display List Mode" p 3724-3725.
| [in] | dlist_addr | Pointer to the first display-list word in memory; must be 4-byte aligned and reside in a region the DRW bus initiator can read. |
| k_ra8_ok | Display list trigger written. |
| k_ra8_err_invalid_arg | Address null or unaligned. |
Definition at line 312 of file ra8_drw_draw.c.
References k_ra8_drw_cachectl_all_flush, k_ra8_drw_internal_align_mask, k_ra8_drw_off_cachectl, k_ra8_drw_off_dliststart, k_ra8_err_invalid_arg, k_ra8_ok, and ra8_drw_reg32().
Referenced by ra8_drw_dlist_run().
|
nodiscard |
Configure the alpha-blend unit using ra8_drw_blend_t fields.
| [in] | blend | Blend parameters. Must not be nullptr. |
| k_ra8_ok | CONTROL2 + COLOR1.A updated. |
| k_ra8_err_null_ptr | blend was nullptr. |
Definition at line 805 of file ra8_drw.c.
References ra8_drw_blend_t::global_alpha, internal_control2_rmw(), internal_pack_blend_bits(), k_ra8_drw_color_a_pos, k_ra8_drw_control2_bc2, k_ra8_drw_control2_bdf, k_ra8_drw_control2_bdfa, k_ra8_drw_control2_bdi, k_ra8_drw_control2_bdia, k_ra8_drw_control2_bsf, k_ra8_drw_control2_bsfa, k_ra8_drw_control2_bsi, k_ra8_drw_control2_bsia, k_ra8_drw_control2_useacb, k_ra8_drw_internal_color_alpha_mask, k_ra8_ok, priv_ra8_drw_internal_color1_write(), RA8_CHECK_NULL_PTR, s_drw_color1, and s_tag.
Referenced by drw_blend_arm().
|
nodiscard |
Programme the COLKEY register and toggle COLKEYENABLE.
| [in] | key_rgb | 0x00RRGGBB colour key value (alpha bits ignored). |
| [in] | enable | True to set CONTROL2.COLKEYENABLE. |
Definition at line 828 of file ra8_drw.c.
References internal_control2_rmw(), k_ra8_drw_control2_colkeyenable, k_ra8_drw_internal_color_alpha_mask, k_ra8_drw_off_colkey, k_ra8_ok, and ra8_drw_reg32().
|
nodiscard |
Programme the COLOR1 and COLOR2 registers from a 2-stop gradient.
| [in] | grad | Pointer to the gradient. Must not be nullptr. |
| k_ra8_ok | COLOR1/COLOR2 updated. |
| k_ra8_err_null_ptr | grad was nullptr. |
Definition at line 713 of file ra8_drw.c.
References ra8_drw_gradient_t::color1_argb8888, ra8_drw_gradient_t::color2_argb8888, k_ra8_drw_off_color2, k_ra8_ok, priv_ra8_drw_internal_color1_write(), RA8_CHECK_NULL_PTR, ra8_drw_reg32(), and s_tag.
Referenced by drw_blend_arm().
|
nodiscard |
Set the IRQCTL enable bits (ENUMIRQEN, DLISTIRQEN, BUSIRQEN).
Writes IRQCTL with the supplied combination of enable bits plus an unconditional W1C of every pending bit, so the caller cannot accidentally re-enable an interrupt while the corresponding flag is still latched.
| [in] | enable_mask | Bitwise OR of any of: k_ra8_drw_irqctl_enumirqen, k_ra8_drw_irqctl_dlistirqen, k_ra8_drw_irqctl_busirqen. |
| k_ra8_ok | IRQCTL updated. |
Definition at line 597 of file ra8_drw.c.
References k_ra8_drw_irqctl_all_clr, k_ra8_drw_off_irqctl, k_ra8_ok, and ra8_drw_reg32().
|
nodiscard |
Set the per-byte PATTERN bitmap (HUM Ch 62.2.9 p 3698).
| [in] | pattern_byte | Pattern bitmap; only the low 8 bits used. |
Definition at line 723 of file ra8_drw.c.
References k_ra8_drw_internal_byte_mask, k_ra8_drw_off_pattern, k_ra8_ok, and ra8_drw_reg32().
|
nodiscard |
Toggle CONTROL2.PATTERNENABLE / PATTERNSOURCEL5.
| [in] | enable | True to set CONTROL2.PATTERNENABLE. |
| [in] | source_from_l5 | True to set CONTROL2.PATTERNSOURCEL5. |
Definition at line 732 of file ra8_drw.c.
References internal_control2_rmw(), k_ra8_drw_control2_patternenable, k_ra8_drw_control2_patternsourcel5, and k_ra8_ok.
|
nodiscard |
Programme TEXORIGIN, TEXPITCH, TEXMASK, U/V limiters and the CONTROL2 texture / CLUT / RLE / colour-key bits.
| [in] | tex | Texture descriptor. Must not be nullptr. |
| k_ra8_ok | Texture programmed. |
| k_ra8_err_null_ptr | tex was nullptr. |
| k_ra8_err_invalid_arg | pitch_px > k_ra8_drw_max_texpitch_tx. |
Definition at line 900 of file ra8_drw.c.
References ra8_drw_texture_t::base_addr, ra8_drw_texture_t::clut_offset, ra8_drw_texture_t::color_key_rgb, ra8_drw_texture_t::enable_color_key, internal_control2_rmw(), internal_pack_texture_bits(), k_ra8_drw_control2_clutenable, k_ra8_drw_control2_clutformat_565, k_ra8_drw_control2_colkeyenable, k_ra8_drw_control2_readformath_mask, k_ra8_drw_control2_readformatl_mask, k_ra8_drw_control2_rleenable, k_ra8_drw_control2_rlepixel_mask, k_ra8_drw_control2_textureclampx, k_ra8_drw_control2_textureclampy, k_ra8_drw_control2_textureenable, k_ra8_drw_control2_texturefilterx, k_ra8_drw_control2_texturefiltery, k_ra8_drw_internal_byte_mask, k_ra8_drw_internal_color_alpha_mask, k_ra8_drw_max_texpitch_tx, k_ra8_drw_off_colkey, k_ra8_drw_off_texcloffset, k_ra8_drw_off_texmask, k_ra8_drw_off_texorigin, k_ra8_drw_off_texpitch, k_ra8_err_invalid_arg, k_ra8_ok, ra8_drw_texture_t::pitch_px, RA8_CHECK_NULL_PTR, ra8_drw_reg32(), s_tag, ra8_drw_texture_t::u_mask, and ra8_drw_texture_t::v_mask.
|
nodiscard |
Poll STATUS until all "busy" bits clear or budget runs out.
Bounded wait (NASA Rule 2). Returns k_ra8_err_hw_timeout if the engine remains busy after poll_budget reads.
| [in] | poll_budget | Maximum number of STATUS reads before timeout. |
| k_ra8_ok | Engine idle. |
| k_ra8_err_hw_timeout | Budget exhausted. |
Definition at line 631 of file ra8_drw.c.
References k_ra8_drw_off_status, k_ra8_drw_status_busy_mask, k_ra8_err_hw_timeout, k_ra8_err_invalid_arg, k_ra8_ok, ra8_drw_reg32(), ra8_log_error, and s_tag.
Referenced by drw_blend_fill(), drw_demo_fill_and_check(), and main().