ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_display_pal.h
Go to the documentation of this file.
1
70
71#pragma once
72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77#include <stdint.h>
78
79#include "ra8_err.h"
80
81/* =============================================================================
82 * Public enums
83 * =============================================================================
84 */
85
104
126
127/* =============================================================================
128 * Public structs
129 * =============================================================================
130 */
131
154
167typedef struct {
168 void* pixels;
169 uint16_t width_px;
170 uint16_t height_px;
171 uint32_t stride_bytes;
174
188typedef struct {
189 uint16_t x;
190 uint16_t y;
191 uint16_t w;
192 uint16_t h;
194
209
223
262
263/* =============================================================================
264 * Public API
265 * =============================================================================
266 */
267
300[[nodiscard]] ra8_err_t display_init(const display_cfg_t* cfg, display_handle_t** out_handle);
301
321[[nodiscard]] ra8_err_t display_get_caps(const display_handle_t* d, display_caps_t* out);
322
353
387[[nodiscard]] ra8_err_t
389
416[[nodiscard]] ra8_err_t display_clear(const display_handle_t* d, uint32_t color);
417
441[[nodiscard]] ra8_err_t display_deinit(const display_handle_t* d);
442
469
470#ifdef __cplusplus
471}
472#endif
display_pixfmt_t
Canonical pixel formats the PAL understands.
@ k_display_pixfmt_rgb888
24 bpp, 8/8/8 packed.
@ k_display_pixfmt_rgb565
16 bpp, 5/6/5 packed.
@ k_display_pixfmt_grey4
4 bpp greyscale (2 px / byte).
@ k_display_pixfmt_grey1
1 bpp greyscale (8 px / byte).
ra8_err_t display_get_caps(const display_handle_t *d, display_caps_t *out)
Query the bound backend's runtime capabilities.
display_rect_t display_full_rect(const display_handle_t *d)
Convenience helper returning the rect covering the whole framebuffer.
ra8_err_t display_deinit(const display_handle_t *d)
Release the backend and invalidate the PAL handle.
ra8_err_t display_get_framebuffer(const display_handle_t *d, display_fb_t *out)
Return the framebuffer descriptor the backend is targeting.
ra8_err_t display_clear(const display_handle_t *d, uint32_t color)
Clear the entire framebuffer to color.
ra8_err_t display_flush(const display_handle_t *d, display_rect_t rect, display_refresh_hint_t hint)
Commit pending framebuffer changes to the panel.
struct display_handle display_handle_t
struct display_backend_iface display_backend_iface_t
ra8_err_t display_init(const display_cfg_t *cfg, display_handle_t **out_handle)
Initialise the display PAL and bring the selected backend up to a state where display_flush succeeds.
display_refresh_hint_t
Intent passed into display_flush; backends map this onto whatever waveform/mode their controller offe...
@ k_display_refresh_fast
Prioritise latency.
@ k_display_refresh_init
Full reset of the panel.
@ k_display_refresh_quality
Prioritise final quality.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Opaque to applications – backends implement this internally and export a const instance through their...
Capabilities a backend reports after display_init.
uint32_t refresh_latency_us_typ
Typical flush() cost in usec.
bool supports_partial_update
true => sub-rect flush honoured.
uint32_t stride_bytes
Framebuffer row stride in bytes.
display_pixfmt_t pixfmt
App-facing canonical format.
bool continuous_refresh
true => panel scans continuously.
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.
const display_backend_iface_t * iface
Backend vtable (one of the k_display_backend_* consts).
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.
display_pixfmt_t pixfmt
Pixel format of pixels.
void * pixels
Base of pixel data (RGB565 unless noted).
Opaque handle returned by display_init.
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.