43static const char*
const s_tag =
"ra8_display_pal_lcd";
46typedef enum : uint32_t {
56typedef enum : uint32_t {
102#ifndef RA8_OFF_TARGET
103 __asm__
volatile(
"dsb 0xF" :::
"memory");
153 const uint32_t need_bytes =
203 .framebuffer_addr = (uint32_t)(uintptr_t)cfg->
framebuffer,
251 s_lcd_ctx.caps.refresh_latency_us_typ = 0U;
252 s_lcd_ctx.caps.supports_partial_update =
true;
253 s_lcd_ctx.caps.continuous_refresh =
true;
295 if ((uint32_t)r.
x + (uint32_t)r.
w > (uint32_t)caps->
width_px) {
298 if ((uint32_t)r.
y + (uint32_t)r.
h > (uint32_t)caps->
height_px) {
460#ifdef RA8_BOOT_ENABLE_CACHE_MPU
508 uint16_t* pixels = (uint16_t*)c->
fb.
pixels;
511 for (uint32_t i = 0U; i < pixels_total; ++i) {
514#ifdef RA8_BOOT_ENABLE_CACHE_MPU
static void internal_lcd_bringup_panel(void)
Bring up SDRAM, panel power, GLCDC and prime the BG plane.
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_lcd_panel_power_on(void)
Pulse the J1 panel's RESET_L line and assert BLEN backlight.
ra8_err_t ra8_board_glcdc_init(ra8_board_glcdc_fmt_t fmt)
Program every J1 pin for fmt to its GLCDC alternate function.
@ k_ra8_board_glcdc_fmt_rgb888
24-bit, 8 bits/colour.
Cortex-M85 L1 cache maintenance, enable/disable, and I-cache invalidate.
ra8_err_t ra8_cache_dcache_clean_by_addr(const void *addr, uint32_t size)
Clean (write back) the D-cache lines covering a byte range.
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.
Display Platform Abstraction Layer for the RA8D2.
@ k_display_pixfmt_rgb565
16 bpp, 5/6/5 packed.
struct display_backend_iface display_backend_iface_t
display_refresh_hint_t
Intent passed into display_flush; backends map this onto whatever waveform/mode their controller offe...
Internal vtable + handle types for the display PAL.
disp_lcd_mask_t
RGB565 pixel mask.
@ k_rgb565_mask
Rgb565 mask.
static ra8_err_t internal_lcd_check_rect(const display_caps_t *caps, display_rect_t r)
Confirm a rectangle stays inside the active framebuffer.
static ra8_err_t internal_lcd_validate_cfg(const display_cfg_t *cfg)
Validate the caller's display_cfg_t against the LCD backend's expectations.
static void internal_lcd_dsb(void)
DSB memory barrier on Cortex-M, no-op on the host test build.
static void internal_lcd_snapshot(const display_cfg_t *cfg)
Populate s_lcd_ctx from the validated cfg.
static ra8_err_t internal_lcd_get_framebuffer(void *ctx, display_fb_t *out)
Vtable get_framebuffer – hand back the FB descriptor.
ra8_display_pal_lcd_const_t
Numeric constants used by the LCD backend bring-up.
@ k_lcd_bringup_settle_ms
Pin/clock settle after board_glcdc_init.
@ k_lcd_fb_align_bytes
AXI burst alignment (HUM Ch 63).
@ k_lcd_bg_color_black
24-bit ARGB for BG plane.
@ k_lcd_rgb565_bpp
Bytes per RGB565 pixel.
static ra8_err_t internal_lcd_flush(void *ctx, display_rect_t rect, display_refresh_hint_t hint)
Vtable flush – DSB barrier, validate rect.
static ra8_err_t internal_lcd_deinit(void *ctx)
Vtable deinit – tear the GLCDC down and drop state.
static lcd_ctx_t s_lcd_ctx
Single LCD backend context – one display per board.
static ra8_err_t internal_lcd_clear(void *ctx, uint32_t color)
Vtable clear – fill the framebuffer with a uniform RGB565 value.
static ra8_err_t internal_lcd_get_caps(const void *ctx, display_caps_t *out)
Vtable get_caps – O(1) copy from s_lcd_ctx.caps.
static ra8_err_t internal_lcd_init(const display_cfg_t *cfg, void **out_ctx)
LCD backend init – validate, panel bring-up, snapshot.
LCD backend (ra8_glcdc) for the display PAL.
const display_backend_iface_t k_display_backend_lcd_ra8_glcdc
LCD backend vtable – pass its address through display_cfg_t.iface to drive the EK-RA8D2 panel.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_not_supported
Requested feature not compiled in, not wired, or not supported by this MCU variant.
@ k_ra8_err_busy
Resource busy – blocking operation cannot proceed.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ 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.
Graphics LCD Controller driver (two-layer with alpha blending).
ra8_err_t ra8_glcdc_init(const ra8_glcdc_config_t *cfg)
Initialise GLCDC with the EK-RA8D2 1024x600 timings and the supplied graphics layer 1 framebuffer.
ra8_err_t ra8_glcdc_set_background_color(uint32_t argb)
Set the panel-wide background colour shown where neither layer covers a pixel.
ra8_err_t ra8_glcdc_start(bool enable)
Start or stop the panel output.
ra8_err_t ra8_glcdc_layer1_show(uintptr_t fb_addr)
Make graphics layer 1 visible by pointing it at a framebuffer.
ra8_err_t ra8_glcdc_deinit(void)
Tear down GLCDC (stop + MSTP release).
@ k_ra8_glcdc_fmt_rgb565
16-bit RGB565.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_error(tag, message)
RA8 log error.
SysTick-based tick counter, delay and timestamp helpers.
void ra8_delay_ms(uint32_t ms)
Busy-wait for at least ms milliseconds.
Capabilities a backend reports after display_init.
uint16_t width_px
Display visible width.
uint16_t height_px
Display visible height.
Configuration descriptor passed into display_init.
void * framebuffer
Application framebuffer storage (caller owns).
display_pixfmt_t pixfmt
Pixel format of framebuffer.
uint16_t width_px
Visible framebuffer width in pixels.
uint32_t framebuffer_bytes
Size of the framebuffer buffer in bytes.
uint16_t height_px
Visible framebuffer height in pixels.
const void * panel_timing
Panel RGB timing for parallel-RGB backends, opaque here so the generic PAL stays HAL-agnostic.
Framebuffer descriptor returned by display_get_framebuffer.
uint16_t width_px
Framebuffer width.
uint16_t height_px
Framebuffer height.
uint32_t stride_bytes
Row stride in bytes.
void * pixels
Base of pixel data (RGB565 unless noted).
Rectangle in framebuffer coordinates passed into display_flush.
uint16_t h
Height in pixels.
uint16_t w
Width in pixels.
uint16_t y
Top edge in pixels.
uint16_t x
Left edge in pixels.
LCD backend private context attached to the PAL handle.
Minimal GLCDC configuration for a single-layer panel.
Panel RGB timing the driver programs (accessory parameters).