55static const char*
s_tag =
"drw_demo";
58typedef enum : uint32_t {
66typedef enum : uint16_t {
122 __asm__
volatile(
"wfi");
135 uint32_t cpuclk0_hz = 0U;
174 .framebuffer_addr = (uintptr_t)
g_drw_fb,
177 .enable_caches =
false,
178 .enable_buffered_writes =
false,
250 const uint8_t good = (err ==
k_ra8_ok && ok != 0U) ? 1U : 0U;
void main(void)
Secure fallback main entry point.
static uint32_t drw_demo_px(uint16_t x, uint16_t y)
Index of pixel (x, y) within the framebuffer.
static const uint8_t k_drw_demo_bad_msg[]
static ra8_err_t drw_demo_configure(void)
Bring up the DRW engine pointed at g_drw_fb.
static const uint8_t k_drw_demo_ok_msg[]
Output line tags.
volatile uint32_t g_drw_rev
DRW HWREVISION register snapshot (confirms the engine is present).
volatile uint32_t g_drw_match
1 when the filled rectangle read back as expected.
volatile uint32_t g_drw_heartbeat
Bumps once per main-loop pass – liveness for headless probes.
drw_demo_config_t
Compile-time settings.
@ k_drw_demo_fill_argb
Opaque green fill colour.
@ k_drw_demo_period_ms
Delay between fills.
@ k_drw_demo_baud
SCI8 baud rate.
@ k_drw_demo_idle_budget
Bounded wait_idle poll budget.
static void drw_demo_setup_or_halt(void)
Bring CGC + SysTick + SCI8 + LEDs + MSTP up.
static void drw_demo_panic_halt(void)
Park forever after a fatal init failure.
drw_demo_geom_t
Framebuffer + rectangle geometry (pixels).
@ k_drw_demo_center
Centre pixel (16, 16) is inside.
@ k_drw_demo_rect_xy
Rect top-left (8, 8).
@ k_drw_demo_rect_wh
Rect 16 x 16 -> covers [8,24).
@ k_drw_demo_fb_dim
32 x 32 framebuffer.
static ra8_err_t drw_demo_fill_and_check(uint8_t *out_ok)
Clear the framebuffer, fill the centre rectangle, and verify.
volatile uint32_t g_drw_fill_err
Non-zero if a DRW call returned an error.
static uint32_t g_drw_fb[(uint32_t) k_drw_demo_fb_dim *(uint32_t) k_drw_demo_fb_dim]
32 x 32 ARGB8888 framebuffer the DRW rasterizes into.
static const char * s_tag
Logging / check tag.
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
ra8_err_t ra8_board_led_init(ra8_board_led_id_t led)
Configure led as a digital output, initial level low (off).
@ k_ra8_board_led2
LED2, GREEN, P303 (jumper E26).
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
Boot entry points shared between a vector table and its startup code.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
2D Drawing Engine (DRW / D/AVE 2D) HAL driver – public API
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_get_hwrevision(uint32_t *out)
Read the read-only HWREVISION register into *out.
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_wait_idle(uint32_t poll_budget)
Poll STATUS until all "busy" bits clear or budget runs out.
@ k_ra8_drw_writefmt_argb8888
32 bpp ARGB8888.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_init(void)
Re-establish the ra8_mstp ref-count table from current hardware state.
SysTick-based tick counter, delay and timestamp helpers.
ra8_err_t ra8_time_init(uint32_t cpu_hz)
Initialise SysTick for a 1 kHz tick interrupt.
void ra8_delay_ms(uint32_t ms)
Busy-wait for at least ms milliseconds.
Minimal DRW configuration captured by ra8_drw_init.
Rectangle parameters for ra8_drw_fill_rect.