53static const char*
const s_tag =
"EPAPER";
59typedef enum : uint16_t {
68typedef enum : uint8_t {
84typedef enum : uint8_t {
133 const size_t row_bytes = (((size_t)area->
width * bpp) + (bits_per_byte - 1U)) / bits_per_byte;
134 *out_bytes = row_bytes * (size_t)area->
height;
141 if (area ==
nullptr) {
148 return ((area->
x % grid) == 0U) && ((area->
width % grid) == 0U);
155 if (panel_width == 0U) {
158 if (((uint32_t)area->
x + (uint32_t)area->
width) > (uint32_t)panel_width) {
165 const uint32_t right = (uint32_t)area->
x + (uint32_t)area->
width;
166 const uint32_t x_lo = ((uint32_t)area->
x / grid) * grid;
168 uint32_t x_hi = ((right + grid - 1U) / grid) * grid;
169 if (x_hi > (uint32_t)panel_width) {
170 x_hi = (uint32_t)panel_width;
172 if ((x_hi <= x_lo) || (((x_hi - x_lo) % grid) != 0U)) {
177 area->
x = (uint16_t)x_lo;
178 area->
width = (uint16_t)(x_hi - x_lo);
188 for (uint32_t i = 0U;
s_lut_m641[i] !=
'\0'; i++) {
227 if ((wf->
du == 0U) || (wf->
gc16 == 0U) || (wf->
a2 == 0U)) {
253 if ((info ==
nullptr) || (cfg ==
nullptr)) {
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).
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.
IT8951 e-paper controller SPI driver – public API.
ra8_epaper_pixel_format_t
Source pixel depth for a ra8_epaper_load_image transfer.
@ k_ra8_epaper_pf_1bpp
1 bpp bi-level, 8 px per byte (A2).
@ k_ra8_epaper_pf_4bpp
4 bpp, 2 px per byte – preferred.
@ k_ra8_epaper_pf_2bpp
2 bpp, 4 px per byte.
@ k_ra8_epaper_pf_8bpp
8 bpp, one byte per pixel.
@ k_ra8_epaper_wf_mode_max
Highest valid LUT mode number.
@ k_ra8_epaper_align_1bpp_px
4-byte (32 px) X/W grid for 1 bpp.
ra8_epaper_bpp_t
Bit depth of each ra8_epaper_pixel_format_t.
@ k_ra8_epaper_bpp_4
k_ra8_epaper_pf_4bpp.
@ k_ra8_epaper_bpp_8
k_ra8_epaper_pf_8bpp.
@ k_ra8_epaper_bpp_1
k_ra8_epaper_pf_1bpp.
@ k_ra8_epaper_bpp_2
k_ra8_epaper_pf_2bpp.
ra8_err_t ra8_epaper_align_area(ra8_epaper_area_t *area, ra8_epaper_pixel_format_t pf, uint16_t panel_width)
Grow area outward onto the alignment grid its depth requires.
ra8_epaper_geom_const_t
Packing arithmetic constants (no magic numbers).
@ k_ra8_epaper_geom_panel_max_dim
Sanity ceiling on cfg dims.
@ k_ra8_epaper_geom_bits_per_byte
Row-packing denominator.
ra8_err_t ra8_epaper_validate_cfg(const ra8_epaper_cfg_t *cfg)
Validate a panel descriptor without touching any hardware.
static ra8_err_t internal_ra8_epaper_validate_waveform(const ra8_epaper_waveform_cfg_t *wf)
Validate the caller's waveform map against the LUT mode range.
static const char *const s_lut_m641
LUT-version token identifying the 6 inch / 6 inch HD waveform set.
bool ra8_epaper_area_is_aligned(const ra8_epaper_area_t *area, ra8_epaper_pixel_format_t pf)
Report whether area satisfies the depth's X/width alignment.
ra8_epaper_lut_mode_t
Waveform LUT mode numbers the vendor documents.
@ k_ra8_epaper_lut_gc16
GC16 on every documented LUT.
@ k_ra8_epaper_lut_a2_m641
A2 on the M641 LUT.
@ k_ra8_epaper_lut_init
INIT on every documented LUT.
@ k_ra8_epaper_lut_a2_gen
A2 on the vendor generic LUT.
@ k_ra8_epaper_lut_du
DU on every documented LUT.
ra8_err_t ra8_epaper_waveform_cfg_for_lut(const char *lut_version, ra8_epaper_waveform_cfg_t *out_cfg)
Fill a waveform map from a controller-reported LUT version.
uint8_t ra8_epaper_bits_per_pixel(ra8_epaper_pixel_format_t pf)
Bits per pixel carried by a ra8_epaper_pixel_format_t.
bool ra8_epaper_geometry_agrees(const ra8_epaper_dev_info_t *info, const ra8_epaper_cfg_t *cfg)
Report whether reported panel geometry matches the descriptor.
ra8_err_t ra8_epaper_image_bytes(const ra8_epaper_area_t *area, ra8_epaper_pixel_format_t pf, size_t *out_bytes)
Bytes a packed source buffer needs for area at depth pf.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_invalid_size
Invalid size parameter (too large, too small, or misaligned).
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Rectangle descriptor (top-left + size) used by load + display.
uint16_t x
Top-left X in panel coords (0 = left).
uint16_t height
Height in pixels.
uint16_t width
Width in pixels.
Configuration descriptor for ra8_epaper_init.
uint16_t panel_height
Native panel height in pixels.
uint16_t panel_width
Native panel width in pixels.
ra8_epaper_waveform_cfg_t waveform
Panel's LUT waveform mode numbers.
ra8_spi_bus_ops_t bus
Injected SPI transfer seam (app-bound).
Decoded GET_DEV_INFO (0x0302) response.
uint16_t panel_width
Reported panel width (px).
uint16_t panel_height
Reported panel height (px).
ra8_err_t(* xfer8)(void *ctx, uint8_t tx, uint8_t *rx)
Full-duplex single-byte exchange on the bound bus.