ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_camera_source_ceu.h File Reference

RA8 CEU capture backend for the transport-neutral camera facade. More...

#include <stdint.h>
#include "ra8_camera.h"
#include "ra8_ceu.h"
#include "ra8_err.h"
Include dependency graph for ra8_camera_source_ceu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_camera_source_ceu_cfg_t
 Backend configuration, including native CEU register descriptor. More...
struct  ra8_camera_source_ceu_state_t
 Caller-owned CEU source state. More...

Functions

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_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.

Detailed Description

RA8 CEU capture backend for the transport-neutral camera facade.

Tag
[Ring 4 / Service] {World: NS}

Binds the Ring-3 CEU HAL as a ra8_camera_source_t. The backend accepts either fixed-size synchronous frames or variable-size JPEG/data streams and always DMA-writes into storage supplied by the caller.

Since
0.1.0

Definition in file ra8_camera_source_ceu.h.

Function Documentation

◆ ra8_camera_source_ceu_get_last_events()

ra8_err_t ra8_camera_source_ceu_get_last_events ( const ra8_camera_source_ceu_state_t * state,
uint32_t * out_events )
nodiscard

Read the most recent CEU event snapshot retained by the backend.

Returns caller-owned diagnostic state only; it does not touch CEU registers or clear hardware event latches.

Parameters
[in]stateInitialized caller-owned backend state.
[out]out_eventsReceives raw ra8_ceu_event_t bits.
Returns
Error code.
Return values
k_ra8_okA snapshot was returned.
k_ra8_err_null_ptrAn argument was nullptr.
k_ra8_err_not_initializedThe backend is not bound.
Precondition
No capture is concurrently mutating state.
out_events points to writable storage.
Postcondition
Hardware registers are not accessed or modified.
On success out_events equals the last observed raw CEU event bits.
Note
Thread-safe only while the caller prevents concurrent capture updates.
Since
0.1.0

Definition at line 222 of file ra8_camera_source_ceu.c.

References ra8_camera_source_ceu_state_t::initialized, k_ra8_err_not_initialized, k_ra8_err_null_ptr, k_ra8_ok, and ra8_camera_source_ceu_state_t::last_events.

Referenced by c6_cam_camera_report_last_error(), cam_capture_frame_and_report(), and internal_report_capture_events().

◆ ra8_camera_source_ceu_init()

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 )
nodiscard

Initialize the CEU and bind it as a generic camera source.

Validates fixed-frame versus data-enable metadata, initializes the CEU HAL, then binds the facade handle to caller-owned backend state.

Parameters
[out]sourceGeneric source handle to bind.
[out]stateCaller-owned backend state.
[in]cfgCEU and output metadata configuration.
Returns
ra8_err_t Error code.
Return values
k_ra8_okCEU initialized and source bound.
k_ra8_err_null_ptrAn argument was nullptr.
k_ra8_err_invalid_argMetadata or poll bounds are invalid.
otherForwarded from ra8_ceu_init.
Precondition
source and state remain alive for every later source operation.
cfg describes storage bounds matching its CEU capture format.
Postcondition
On success source dispatches through the CEU backend.
On success state owns all mutable backend state; no heap is used.
Note
Not thread-safe with respect to the same source, state, or CEU.
Since
0.1.0

Definition at line 294 of file ra8_camera_source_ceu.c.

References ra8_ceu_config_t::capture_format, ra8_camera_source_ceu_cfg_t::ceu, internal_ceu_cfg_valid(), k_ra8_err_null_ptr, k_ra8_ok, ra8_camera_source_ceu_cfg_t::output, ra8_camera_source_ceu_cfg_t::poll_attempts, ra8_camera_source_ceu_cfg_t::poll_interval_ms, ra8_ceu_init(), and s_ceu_source_iface.

Referenced by c6_cam_camera_init(), cam_capture_source_bind(), and internal_bring_up_capture_pipeline().