27typedef enum : uintptr_t {
32typedef enum : uint32_t {
55 if (state ==
nullptr) {
61 *out_info = state->
info;
116 for (uint32_t attempt = 0U; attempt < state->
poll_attempts; attempt += 1U) {
170 if (state ==
nullptr) {
189 .y_top = buffer->
data,
195 uint32_t captured_bytes = 0U;
200 if (captured_bytes == 0U) {
203 if (captured_bytes > buffer->
capacity) {
211 .data = buffer->
data,
212 .bytes = captured_bytes,
223 uint32_t* out_events)
225 if (state ==
nullptr) {
228 if (out_events ==
nullptr) {
298 if (source ==
nullptr) {
301 if (state ==
nullptr) {
304 if (cfg ==
nullptr) {
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Cortex-M85 L1 cache maintenance, enable/disable, and I-cache invalidate.
ra8_err_t ra8_cache_dcache_invalidate_by_addr(const void *addr, uint32_t size)
Invalidate (drop) the D-cache lines covering a byte range.
ra8_err_t ra8_cache_dcache_clean_invalidate_by_addr(const void *addr, uint32_t size)
Clean and invalidate the D-cache lines covering a byte range.
struct ra8_camera_source_iface ra8_camera_source_iface_t
Opaque source vtable; concrete source backends define its rows.
@ k_ra8_camera_format_jpeg
Complete encoded JPEG byte stream.
Private source and codec vtables for ra8_camera backends.
ra8_camera_ceu_alignment_t
@ k_ceu_buffer_alignment_mask
Eight-byte CEU buffer alignment mask.
ra8_err_t ra8_camera_source_ceu_get_last_events(const ra8_camera_source_ceu_state_t *state, uint32_t *out_events)
Read the most recent CEU event snapshot retained by the backend.
static ra8_err_t internal_ceu_capture(void *ctx, const ra8_camera_buffer_t *buffer, ra8_camera_frame_t *out_frame)
Capture one CEU frame into caller-owned storage.
ra8_err_t ra8_camera_source_ceu_init(ra8_camera_source_t *source, ra8_camera_source_ceu_state_t *state, const ra8_camera_source_ceu_cfg_t *cfg)
Initialize the CEU and bind it as a generic camera source.
ra8_camera_ceu_event_t
CEU faults that make a pending capture unusable immediately.
@ k_ceu_fatal_events
Events that invalidate captured storage.
static ra8_err_t internal_ceu_get_info(void *ctx, ra8_camera_source_info_t *out_info)
Return validated CEU source metadata.
static void internal_ceu_frame_bytes(const ra8_camera_source_ceu_state_t *state, const ra8_ceu_status_t *status, uint32_t *out_bytes)
Derive the captured byte count for one completed CPE event.
static ra8_err_t internal_ceu_cfg_valid(const ra8_camera_source_ceu_cfg_t *cfg)
Validate CEU capture-source configuration bounds and format pairing.
static ra8_err_t internal_ceu_wait_for_frame(ra8_camera_source_ceu_state_t *state, uint32_t *out_bytes)
Poll bounded CEU status until completion, error, or timeout.
static const ra8_camera_source_iface_t s_ceu_source_iface
RA8 CEU capture backend for the transport-neutral camera facade.
Capture Engine Unit (CEU) camera-capture driver.
ra8_err_t ra8_ceu_status_snapshot(ra8_ceu_status_t *out)
Snapshot CSTSR + CDSSR + the active plane into one struct.
ra8_err_t ra8_ceu_clear_status(uint32_t mask)
Clear the CETCR event flags identified by mask.
ra8_err_t ra8_ceu_init(const ra8_ceu_config_t *cfg)
Power on the CEU and write the full configuration.
ra8_err_t ra8_ceu_reset(void)
Issue a software reset of the capture state machine.
ra8_err_t ra8_ceu_capture_start_ex(const ra8_ceu_buffers_t *bufs)
Arm a capture using a full address bundle.
@ k_ra8_ceu_evt_mask_all
RA8 CEU evt mask all.
@ k_ra8_ceu_evt_firewall
FWF: firewall-address fault.
@ k_ra8_ceu_evt_igrw
IGRW: illegal register write.
@ k_ra8_ceu_evt_cram_overflow
CDTOF: CRAM overflow.
@ k_ra8_ceu_evt_vd_error
VBP: invalid VD condition.
@ k_ra8_ceu_evt_cpe
CPE: one-frame capture end.
@ k_ra8_ceu_fmt_data_enable
JPEG / data-enable fetch.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_hw_timeout
Hardware timed out waiting for a flag or handshake.
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
@ k_ra8_err_null_ptr
Pointer was NULL where a valid pointer was required.
@ k_ra8_err_hw_error
Generic hardware fault detected (error flag set, fault interrupt).
@ 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.
SysTick-based tick counter, delay and timestamp helpers.
void ra8_delay_ms(uint32_t ms)
Busy-wait for at least ms milliseconds.
Caller-owned writable byte-buffer description.
uint32_t capacity
Writable byte capacity.
uint8_t * data
First writable byte, or NULL when capacity is zero.
Immutable view of one captured or encoded image.
Backend configuration, including native CEU register descriptor.
uint32_t poll_attempts
Maximum completion polls.
ra8_ceu_config_t ceu
HAL descriptor programmed at bind.
ra8_camera_source_info_t output
Frame metadata exposed to callers.
uint32_t poll_interval_ms
Delay between completion polls.
Caller-owned CEU source state.
uint32_t poll_attempts
Maximum completion polls.
bool initialized
Backend binding completed.
ra8_camera_source_info_t info
Validated output metadata.
uint32_t last_events
Latest raw CEU event snapshot.
uint32_t poll_interval_ms
Completion polling interval.
ra8_ceu_capture_format_t capture_format
Fixed-frame or data-enable mode.
Native geometry and worst-case storage required by a source.
ra8_camera_format_t format
Native output format.
uint32_t frame_bytes_max
Required capture-buffer capacity.
uint16_t width
Native width in pixels.
uint32_t stride_bytes
Native row stride, or zero/JPEG.
uint16_t height
Native height in pixels.
Caller-owned handle binding one source backend and its context.
Address bundle programmed into the CDAYR / CDACR family.
ra8_ceu_capture_format_t capture_format
CAMCR.JPG.
uint32_t image_area_size
For data-enable firewall window.
Snapshot of the CEU live-status registers.
uint32_t events
CETCR raw value (event flags).
uint32_t data_size
CDSSR last-write byte count.