ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_drw_internal.h
Go to the documentation of this file.
1
11
12#pragma once
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include <stdint.h>
19
20#include "ra8_attributes.h"
21#include "ra8_drw.h"
22
42
54typedef enum : uint32_t {
58
82RA8_INTERNAL static inline uint32_t internal_to_subpixel(int32_t px)
83{
84 /* Cast to unsigned BEFORE the shift: px can be negative, and left-shifting a
85 * negative signed value is undefined behaviour. The two's-complement result
86 * is bit-identical to the intended px << 4. */
87 return (uint32_t)px << k_ra8_drw_subpixel_shift;
88}
89
110RA8_INTERNAL static inline int32_t internal_iabs(int32_t v)
111{
112 return (v < 0) ? -v : v;
113}
114
140
165
197
229RA8_PRIV bool
230priv_ra8_drw_internal_rect_below_min(uint16_t min_dim, uint16_t width, uint16_t height);
231
265 uint16_t max_h,
266 uint16_t width,
267 uint16_t height);
268
292
313RA8_PRIV void priv_ra8_drw_internal_color1_write(uint32_t argb8888);
314
315#ifdef __cplusplus
316}
317#endif
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
2D Drawing Engine (DRW / D/AVE 2D) HAL driver – public API
ra8_drw_internal_const_t
Driver-internal numeric constants – avoid bare literals.
@ k_ra8_drw_internal_byte_mask
8-bit channel mask.
@ k_ra8_drw_internal_clut_max
CLUT entries (HUM 62.5.4).
@ k_ra8_drw_internal_dlist_align
4-byte alignment of DLIST.
@ k_ra8_drw_internal_one_subpx
1 px == 16 sub-pixels.
@ k_ra8_drw_internal_perfev_max
0x1F is "every clock".
static int32_t internal_iabs(int32_t v)
Compute integer absolute value with no library calls.
bool priv_ra8_drw_internal_rect_off_surface(const ra8_drw_rect_t *rect)
Reject a rectangle that would rasterize outside the framebuffer.
Definition ra8_drw.c:225
bool priv_ra8_drw_internal_rect_above_max(uint16_t max_w, uint16_t max_h, uint16_t width, uint16_t height)
Pure predicate for the "rect exceeds max dim" rejection.
Definition ra8_drw.c:97
ra8_drw_internal_mask32_t
32-bit driver-internal masks.
@ k_ra8_drw_internal_color_alpha_mask
0x00RRGGBB low bits.
@ k_ra8_drw_internal_align_mask
4-byte alignment.
uint32_t priv_ra8_drw_internal_origin(void)
Read the cached ORIGIN (framebuffer base) render-trigger value.
Definition ra8_drw.c:212
void priv_program_rect_bbox(const ra8_drw_rect_t *rect)
Programme the bounding box that describes an axis-aligned rect.
Definition ra8_drw.c:416
uint32_t priv_ra8_drw_internal_rect_origin(const ra8_drw_rect_t *rect)
Framebuffer byte address of a rectangle's top-left pixel.
Definition ra8_drw.c:217
bool priv_ra8_drw_internal_rect_below_min(uint16_t min_dim, uint16_t width, uint16_t height)
Pure predicate for the "rect is below min dim" rejection.
Definition ra8_drw.c:75
void priv_ra8_drw_internal_color1_write(uint32_t argb8888)
Write COLOR1 through the software shadow (write-only register).
Definition ra8_drw.c:238
static uint32_t internal_to_subpixel(int32_t px)
Convert a signed pixel coordinate to the DRW Q12.4 sub-pixel grid.
@ k_ra8_drw_subpixel_shift
1 pixel == 16 sub-pixels.
Rectangle parameters for ra8_drw_fill_rect.
Definition ra8_drw.h:96