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

MIPI CSI-2 receiver HAL driver – FIFO, ISR dispatch, framing, power. More...

#include <stdint.h>
#include "ra8_err.h"
#include "ra8_mipi_csi_regs.h"
#include "ra8_mipi_csi_types.h"
Include dependency graph for ra8_mipi_csi_isr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ra8_err_t ra8_mipi_csi_short_packet_configure (uint8_t threshold, bool store_enable)
 Programme GSCT (short-packet FIFO threshold + store flag).
ra8_err_t ra8_mipi_csi_short_packet_set_irq_enable (uint32_t mask)
 Programme GSIE (short-packet IRQ enable).
ra8_err_t ra8_mipi_csi_short_packet_get_status (uint32_t *out_mask)
 Read GSST (short-packet status).
ra8_err_t ra8_mipi_csi_short_packet_clear_status (uint32_t mask)
 W1C-clear GSST.GOV (FIFO overflow) via GSSC.
ra8_err_t ra8_mipi_csi_read_short_packet (ra8_mipi_csi_short_packet_t *out)
 Drain one stored short-packet header from the FIFO.
ra8_err_t ra8_mipi_csi_short_packet_clear_fifo (void)
 Request a clear of the entire short-packet FIFO (GSIU.GFCLR).
ra8_err_t ra8_mipi_csi_short_packet_re_enable_store (void)
 Re-enable storing into the FIFO after a GOV overflow (GSIU.GFEN).
ra8_err_t ra8_mipi_csi_attach_handler (ra8_mipi_csi_event_fn_t fn, void *ctx)
 Attach the receive-status callback (MIPI CSI RX vector).
ra8_err_t ra8_mipi_csi_attach_dl_handler (ra8_mipi_csi_dl_event_fn_t fn, void *ctx)
 Attach the per-data-lane callback (MIPI CSI DL vector).
ra8_err_t ra8_mipi_csi_attach_vc_handler (ra8_mipi_csi_vc_event_fn_t fn, void *ctx)
 Attach the per-VC callback (MIPI CSI VC vector).
ra8_err_t ra8_mipi_csi_attach_pm_handler (ra8_mipi_csi_pm_event_fn_t fn, void *ctx)
 Attach the power-management callback (MIPI CSI PM vector).
ra8_err_t ra8_mipi_csi_attach_short_packet_handler (ra8_mipi_csi_short_event_fn_t fn, void *ctx)
 Attach the short-packet FIFO callback (MIPI CSI GST vector).
void ra8_mipi_csi_dispatch (void)
 ISR-side dispatcher for the receive vector.
void ra8_mipi_csi_dispatch_dl (void)
 ISR-side dispatcher for the data-lane vector.
void ra8_mipi_csi_dispatch_vc (void)
 ISR-side dispatcher for the per-VC vector.
void ra8_mipi_csi_dispatch_pm (void)
 ISR-side dispatcher for the power-management vector.
void ra8_mipi_csi_dispatch_short_packet (void)
 ISR-side dispatcher for the generic-short-packet vector.
ra8_err_t ra8_mipi_csi_set_virtual_channels (uint16_t vc_mask)
 Filter which CSI-2 virtual channels the receiver will surface.
ra8_err_t ra8_mipi_csi_set_data_format (uint8_t vc, ra8_mipi_csi_data_format_t format)
 Select the CSI-2 payload format the receiver should accept on a specific virtual channel.
ra8_err_t ra8_mipi_csi_attach_error_handler (ra8_mipi_csi_error_fn_t fn, void *ctx)
 Register a callback invoked on ECC / CRC error reports.
ra8_err_t ra8_mipi_csi_enter_stop (void)
 Gate the peripheral via MSTP (low-power entry helper).
ra8_err_t ra8_mipi_csi_exit_stop (void)
 Ungate the peripheral via MSTP (low-power exit helper).

Detailed Description

MIPI CSI-2 receiver HAL driver – FIFO, ISR dispatch, framing, power.

Tag
[Ring 3 / HAL] {World: NS}

Generic short-packet FIFO control, the ISR-side dispatchers, the per-VC framing helpers + error-reporting attach, and the low-power MSTP transition helpers for the RA8D2 MIPI CSI-2 receiver HAL. Split out of ra8_mipi_csi.h to keep each header within the per-file line budget; consumers continue to include ra8_mipi_csi.h.

Since
0.1.0

Definition in file ra8_mipi_csi_isr.h.

Function Documentation

◆ ra8_mipi_csi_attach_dl_handler()

ra8_err_t ra8_mipi_csi_attach_dl_handler ( ra8_mipi_csi_dl_event_fn_t fn,
void * ctx )
nodiscard

Attach the per-data-lane callback (MIPI CSI DL vector).

Parameters
[in]fnCallback fired by ra8_mipi_csi_dispatch_dl.
[in]ctxCaller context forwarded to fn.
Returns
ra8_err_t error code.
Return values
k_ra8_okAlways.
Precondition
Caller is in single-threaded init context.
fn is either nullptr or a valid function pointer.
Postcondition
ra8_mipi_csi_dispatch_dl will invoke fn for matching lanes.
No hardware state is modified.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 199 of file ra8_mipi_csi_irq.c.

References k_ra8_ok, s_mipi_csi_dl_ctx, and s_mipi_csi_dl_fn.

◆ ra8_mipi_csi_attach_error_handler()

ra8_err_t ra8_mipi_csi_attach_error_handler ( ra8_mipi_csi_error_fn_t fn,
void * ctx )
nodiscard

Register a callback invoked on ECC / CRC error reports.

The CSI VC dispatcher already surfaces VCST contents. This helper filters those events down to the ECC + CRC error subset and decodes them into a ra8_mipi_csi_error_report_t for the caller. Pass fn = nullptr to detach.

Parameters
[in]fnCallback to invoke (or NULL to detach).
[in]ctxCaller-owned context forwarded to fn.
Returns
ra8_err_t outcome.
Return values
k_ra8_okAlways.
Precondition
Caller's fn is ISR-safe.
Caller owns the ctx lifetime for as long as fn is attached.
Postcondition
Subsequent ra8_mipi_csi_dispatch_vc calls forward ECC/CRC errors to fn in addition to the VC callback.
Detaching with NULL silently swallows further errors.
Note
ISR-safe.
Since
0.1.0

Definition at line 489 of file ra8_mipi_csi_irq.c.

References k_ra8_ok, s_mipi_csi_err_ctx, and s_mipi_csi_err_fn.

◆ ra8_mipi_csi_attach_handler()

ra8_err_t ra8_mipi_csi_attach_handler ( ra8_mipi_csi_event_fn_t fn,
void * ctx )
nodiscard

Attach the receive-status callback (MIPI CSI RX vector).

Parameters
[in]fnCallback fired by ra8_mipi_csi_dispatch.
[in]ctxCaller context forwarded to fn.
Returns
ra8_err_t error code.
Return values
k_ra8_okAlways (passing fn = nullptr is the way to detach).
Precondition
Caller is in single-threaded init context.
fn is either nullptr (detach) or a valid function pointer.
Postcondition
The dispatcher will invoke fn(ctx, rxst) until detached.
No hardware state is modified.
Note
Thread safety: not thread-safe.
Since
0.1.0

Attach the receive-status callback (MIPI CSI RX vector).

Stores the supplied callback and opaque context for later invocation by ra8_mipi_csi_dispatch when a module-level event fires.

Parameters
[in]fnEvent-callback function pointer (NULL to detach).
[in]ctxOpaque context passed back to the callback.
Returns
ra8_err_t outcome.
Return values
k_ra8_okAlways returned in the current implementation.
Precondition
Module has been initialized via ra8_mipi_csi_init.
Caller serialises with the IRQ source if registering at runtime.
Postcondition
Subsequent ra8_mipi_csi_dispatch calls invoke fn with ctx.
Previously registered callback (if any) is overwritten.
Note
Not thread-safe; the caller must serialise concurrent access.
Since
0.1.0

Definition at line 192 of file ra8_mipi_csi_irq.c.

References k_ra8_ok, s_mipi_csi_ctx, and s_mipi_csi_fn.

◆ ra8_mipi_csi_attach_pm_handler()

ra8_err_t ra8_mipi_csi_attach_pm_handler ( ra8_mipi_csi_pm_event_fn_t fn,
void * ctx )
nodiscard

Attach the power-management callback (MIPI CSI PM vector).

Parameters
[in]fnCallback fired by ra8_mipi_csi_dispatch_pm.
[in]ctxCaller context forwarded to fn.
Returns
ra8_err_t error code.
Return values
k_ra8_okAlways.
Precondition
Caller is in single-threaded init context.
fn is either nullptr or a valid function pointer.
Postcondition
ra8_mipi_csi_dispatch_pm will invoke fn until detached.
No hardware state is modified.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 213 of file ra8_mipi_csi_irq.c.

References k_ra8_ok, s_mipi_csi_pm_ctx, and s_mipi_csi_pm_fn.

◆ ra8_mipi_csi_attach_short_packet_handler()

ra8_err_t ra8_mipi_csi_attach_short_packet_handler ( ra8_mipi_csi_short_event_fn_t fn,
void * ctx )
nodiscard

Attach the short-packet FIFO callback (MIPI CSI GST vector).

Parameters
[in]fnCallback fired by ra8_mipi_csi_dispatch_short_packet.
[in]ctxCaller context forwarded to fn.
Returns
ra8_err_t error code.
Return values
k_ra8_okAlways.
Precondition
Caller is in single-threaded init context.
fn is either nullptr or a valid function pointer.
Postcondition
ra8_mipi_csi_dispatch_short_packet will invoke fn until detached.
No hardware state is modified.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 220 of file ra8_mipi_csi_irq.c.

References k_ra8_ok, s_mipi_csi_gst_ctx, and s_mipi_csi_gst_fn.

◆ ra8_mipi_csi_attach_vc_handler()

ra8_err_t ra8_mipi_csi_attach_vc_handler ( ra8_mipi_csi_vc_event_fn_t fn,
void * ctx )
nodiscard

Attach the per-VC callback (MIPI CSI VC vector).

Parameters
[in]fnCallback fired by ra8_mipi_csi_dispatch_vc.
[in]ctxCaller context forwarded to fn.
Returns
ra8_err_t error code.
Return values
k_ra8_okAlways.
Precondition
Caller is in single-threaded init context.
fn is either nullptr or a valid function pointer.
Postcondition
ra8_mipi_csi_dispatch_vc will invoke fn per VC + once for generic.
No hardware state is modified.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 206 of file ra8_mipi_csi_irq.c.

References k_ra8_ok, s_mipi_csi_vc_ctx, and s_mipi_csi_vc_fn.

◆ ra8_mipi_csi_dispatch()

void ra8_mipi_csi_dispatch ( void )

ISR-side dispatcher for the receive vector.

Designed to be called from the wired-up MIPI CSI receive ISR (mipi_csi_rx_isr in the FSP layout). Reads RXST once, writes RACTDETC to RXSC to clear the sticky detect bit, then forwards the RXST snapshot to the registered callback.

Precondition
ra8_mipi_csi_init has succeeded.
Caller is the IRQ context owned by the MIPI CSI RX vector.
Postcondition
RXSC.RACTDETC has been written 1.
If a handler is attached, it has run synchronously.
Note
Thread safety: ISR-only; do not call from threads.
Since
0.1.0

Definition at line 228 of file ra8_mipi_csi_irq.c.

References k_ra8_mipi_csi_off_rxsc, k_ra8_mipi_csi_off_rxst, k_ra8_mipi_csi_rxsc_ractdetc_mask, ra8_mipi_csi_reg32(), s_mipi_csi_ctx, and s_mipi_csi_fn.

◆ ra8_mipi_csi_dispatch_dl()

void ra8_mipi_csi_dispatch_dl ( void )

ISR-side dispatcher for the data-lane vector.

Reads MIST + DLST0 + DLST1, W1C-clears DLSC0/DLSC1 (preserving the RO ULP bit), and invokes the data-lane callback once per lane that showed up in MIST.

Precondition
ra8_mipi_csi_init has succeeded.
Caller is the IRQ context owned by the MIPI CSI DL vector.
Postcondition
DLSC0 / DLSC1 have been W1C-cleared.
Handler ran once per lane that flagged in MIST.
Note
Thread safety: ISR-only.
Since
0.1.0

Definition at line 244 of file ra8_mipi_csi_irq.c.

References k_ra8_mipi_csi_dlsc_all_mask, k_ra8_mipi_csi_mist_dl0s_mask, k_ra8_mipi_csi_mist_dl1s_mask, k_ra8_mipi_csi_off_dlsc0, k_ra8_mipi_csi_off_dlsc1, k_ra8_mipi_csi_off_dlst0, k_ra8_mipi_csi_off_dlst1, k_ra8_mipi_csi_off_mist, ra8_mipi_csi_reg32(), s_mipi_csi_dl_ctx, and s_mipi_csi_dl_fn.

◆ ra8_mipi_csi_dispatch_pm()

void ra8_mipi_csi_dispatch_pm ( void )

ISR-side dispatcher for the power-management vector.

Reads PMST, W1C-clears the lower 8 bits via PMSC, then invokes the PM callback.

Precondition
ra8_mipi_csi_init has succeeded.
Caller is the IRQ context owned by the MIPI CSI PM vector.
Postcondition
PMSC has been written with the W1C-clearable bits.
Handler ran once with the PMST snapshot.
Note
Thread safety: ISR-only.
Since
0.1.0

Definition at line 330 of file ra8_mipi_csi_irq.c.

References k_ra8_mipi_csi_off_pmsc, k_ra8_mipi_csi_off_pmst, k_ra8_mipi_csi_pmst_w1c_mask, ra8_mipi_csi_reg32(), s_mipi_csi_pm_ctx, and s_mipi_csi_pm_fn.

◆ ra8_mipi_csi_dispatch_short_packet()

void ra8_mipi_csi_dispatch_short_packet ( void )

ISR-side dispatcher for the generic-short-packet vector.

Reads GSST, W1C-clears GOV via GSSC, then invokes the GST callback. The handler is expected to drain the FIFO via ra8_mipi_csi_read_short_packet.

Precondition
ra8_mipi_csi_init has succeeded.
Caller is the IRQ context owned by the MIPI CSI GST vector.
Postcondition
GSSC has been written with the W1C-clearable bits.
Handler ran once with the GSST snapshot.
Note
Thread safety: ISR-only.
Since
0.1.0

Definition at line 346 of file ra8_mipi_csi_irq.c.

References k_ra8_mipi_csi_gssc_govc_mask, k_ra8_mipi_csi_off_gssc, k_ra8_mipi_csi_off_gsst, ra8_mipi_csi_reg32(), s_mipi_csi_gst_ctx, and s_mipi_csi_gst_fn.

◆ ra8_mipi_csi_dispatch_vc()

void ra8_mipi_csi_dispatch_vc ( void )

ISR-side dispatcher for the per-VC vector.

Reads MIST, then for every VC bit that is set walks the per-channel registers, clears each VCSC(M), and invokes the per-VC callback. Generic errors (MLF + ECD) are accumulated and delivered as a final callback with vc = 0xFF.

Precondition
ra8_mipi_csi_init has succeeded.
Caller is the IRQ context owned by the MIPI CSI VC vector.
Postcondition
Every flagged VCSC(M) has been written.
Handler ran once per VC plus once for the generic-error summary.
Note
Thread safety: ISR-only.
Since
0.1.0

Definition at line 273 of file ra8_mipi_csi_irq.c.

References k_ra8_mipi_csi_mist_vc_mask, k_ra8_mipi_csi_mist_vc_shift, k_ra8_mipi_csi_off_mist, k_ra8_mipi_csi_off_vcsc0, k_ra8_mipi_csi_off_vcst0, k_ra8_mipi_csi_vc_count, k_ra8_mipi_csi_vc_invalid_idx, k_ra8_mipi_csi_vcsc_per_vc_mask, k_ra8_mipi_csi_vcst_crc_mask, k_ra8_mipi_csi_vcst_ecc_mask, k_ra8_mipi_csi_vcst_ecd_mask, k_ra8_mipi_csi_vcst_generic_err_mask, ra8_mipi_csi_reg32(), ra8_mipi_csi_vc_off(), s_mipi_csi_err_ctx, s_mipi_csi_err_fn, s_mipi_csi_vc_ctx, and s_mipi_csi_vc_fn.

◆ ra8_mipi_csi_enter_stop()

ra8_err_t ra8_mipi_csi_enter_stop ( void )
nodiscard

Gate the peripheral via MSTP (low-power entry helper).

Returns
ra8_err_t error code.
Return values
k_ra8_okPeripheral gated.
k_ra8_err_invalid_statera8_mstp ref-count was already 0.
Precondition
ra8_mipi_csi_init has succeeded at least once.
Reception has been stopped via ra8_mipi_csi_stop_receive.
Postcondition
MSTP bit for MIPI CSI is set.
Register access is undefined until exit_stop.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 759 of file ra8_mipi_csi.c.

References k_ra8_mstp_mipi_csi, and ra8_mstp_disable().

◆ ra8_mipi_csi_exit_stop()

ra8_err_t ra8_mipi_csi_exit_stop ( void )
nodiscard

Ungate the peripheral via MSTP (low-power exit helper).

Returns
ra8_err_t error code.
Return values
k_ra8_okPeripheral clocked.
k_ra8_err_hw_init_failedMSTP enable failed.
Precondition
ra8_mipi_csi_enter_stop was called previously.
Caller is in single-threaded resume context.
Postcondition
MSTP bit for MIPI CSI is cleared.
Register access is valid again.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 765 of file ra8_mipi_csi.c.

References k_ra8_mstp_mipi_csi, and ra8_mstp_enable().

◆ ra8_mipi_csi_read_short_packet()

ra8_err_t ra8_mipi_csi_read_short_packet ( ra8_mipi_csi_short_packet_t * out)
nodiscard

Drain one stored short-packet header from the FIFO.

Reads GSST.PNUM first; if non-zero, sets GSIU.FINC (advance read pointer) then reads GSHT to retrieve the next header. The returned raw field is the unprocessed GSHT snapshot and the other fields are decoded for caller convenience.

Parameters
[out]outOn success, the decoded short-packet header.
Returns
ra8_err_t error code.
Return values
k_ra8_okHeader drained into *out.
k_ra8_err_null_ptrout was nullptr.
k_ra8_err_emptyFIFO had no stored packets.
Precondition
out is non-NULL.
ra8_mipi_csi_init has succeeded.
Postcondition
On success, GSIU.FINC was pulsed and *out holds a valid header.
GSST.PNUM is decremented by 1 on success.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 700 of file ra8_mipi_csi.c.

References ra8_mipi_csi_short_packet_t::data_type, k_ra8_err_empty, k_ra8_mipi_csi_gsht_dtyp_mask, k_ra8_mipi_csi_gsht_dtyp_shift, k_ra8_mipi_csi_gsht_spdt_mask, k_ra8_mipi_csi_gsht_spdt_shift, k_ra8_mipi_csi_gsht_spvc_mask, k_ra8_mipi_csi_gsht_spvc_shift, k_ra8_mipi_csi_gsiu_finc_mask, k_ra8_mipi_csi_gsst_pnum_mask, k_ra8_mipi_csi_gsst_pnum_shift, k_ra8_mipi_csi_off_gsht, k_ra8_mipi_csi_off_gsiu, k_ra8_mipi_csi_off_gsst, k_ra8_ok, ra8_mipi_csi_short_packet_t::payload, RA8_CHECK_NULL_PTR, ra8_mipi_csi_reg32(), ra8_mipi_csi_short_packet_t::raw, s_tag, and ra8_mipi_csi_short_packet_t::vc.

◆ ra8_mipi_csi_set_data_format()

ra8_err_t ra8_mipi_csi_set_data_format ( uint8_t vc,
ra8_mipi_csi_data_format_t format )
nodiscard

Select the CSI-2 payload format the receiver should accept on a specific virtual channel.

The hardware filter (DTEL/DTEH) is global across virtual channels – selecting a format on one VC therefore enables the matching DT bit for the entire receiver. The driver records the per-VC selection in a software shadow so a subsequent call with k_ra8_mipi_csi_format_off can re-compute the union and clear the DT bit if no other VC still wants it. HUM Ch 66.3.10/66.3.11 pp 3943-3944.

Parameters
[in]vcVirtual channel index (0..15).
[in]formatPayload format to accept (or _off to disable).
Returns
ra8_err_t outcome.
Return values
k_ra8_okFilter updated.
k_ra8_err_invalid_argvc > 15 or unknown format value.
Precondition
ra8_mipi_csi_init has succeeded.
vc is in 0..15.
Postcondition
DTEL/DTEH reflect the union of all per-VC selections.
Future calls to ra8_mipi_csi_set_data_type_filter override these contributions with explicit masks.
Note
Not thread-safe.
Since
0.1.0

Definition at line 473 of file ra8_mipi_csi_irq.c.

References internal_format_to_bit(), internal_recompute_dt_filter(), k_ra8_err_invalid_arg, k_ra8_mipi_csi_vc_count, k_ra8_ok, and s_mipi_csi_vc_format.

◆ ra8_mipi_csi_set_virtual_channels()

ra8_err_t ra8_mipi_csi_set_virtual_channels ( uint16_t vc_mask)
nodiscard

Filter which CSI-2 virtual channels the receiver will surface.

Each bit i of vc_mask enables VCi (i = 0..15). The driver disables VCIE on every channel whose bit is clear (so spurious traffic does not raise IRQs) and restores the previous IRQ mask on channels that are re-enabled. HUM Ch 66.3.20 "VCIE(M)" p 3952.

Parameters
[in]vc_maskBitmap of accepted virtual channels (bit 0 = VC0).
Returns
ra8_err_t outcome.
Return values
k_ra8_okVCIE updated for every channel.
k_ra8_err_invalid_argvc_mask == 0 (would silence the receiver).
Precondition
ra8_mipi_csi_init has succeeded.
Caller is in single-threaded init / reconfigure context.
Postcondition
VCIE for every selected VC is non-zero (default mask restored).
VCIE for every unselected VC is zero.
Note
Not thread-safe.
See also
ra8_mipi_csi_set_data_format
Since
0.1.0

Definition at line 444 of file ra8_mipi_csi_irq.c.

References k_ra8_err_invalid_arg, k_ra8_mipi_csi_off_vcie0, k_ra8_mipi_csi_vc_count, k_ra8_ok, ra8_log_error, ra8_mipi_csi_reg32(), ra8_mipi_csi_vc_off(), s_mipi_csi_vcie_saved, and s_tag.

◆ ra8_mipi_csi_short_packet_clear_fifo()

ra8_err_t ra8_mipi_csi_short_packet_clear_fifo ( void )
nodiscard

Request a clear of the entire short-packet FIFO (GSIU.GFCLR).

Writes 1 to GSIU.GFCLR, then waits for GSST.GCD to read 1 (clear complete) and writes 0 to GSIU.GFCLR to release the request line.

Returns
ra8_err_t error code.
Return values
k_ra8_okCleared.
k_ra8_err_hw_timeoutGCD did not assert within budget.
Precondition
ra8_mipi_csi_init has succeeded.
Caller is in single-threaded context.
Postcondition
FIFO is empty (GSST.PNUM = 0).
GSIU.GFCLR is back to 0.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 725 of file ra8_mipi_csi.c.

References k_ra8_err_hw_timeout, k_ra8_mipi_csi_gfclr_spin_max, k_ra8_mipi_csi_gsiu_gfclr_mask, k_ra8_mipi_csi_gsst_gcd_mask, k_ra8_mipi_csi_off_gsiu, k_ra8_mipi_csi_off_gsst, k_ra8_ok, and ra8_mipi_csi_reg32().

◆ ra8_mipi_csi_short_packet_clear_status()

ra8_err_t ra8_mipi_csi_short_packet_clear_status ( uint32_t mask)
nodiscard

W1C-clear GSST.GOV (FIFO overflow) via GSSC.

Parameters
[in]maskBits to clear (only GOV bit is W1C).
Returns
ra8_err_t error code.
Return values
k_ra8_okAlways.
Precondition
ra8_mipi_csi_init has succeeded.
Caller knows which GSST bits are W1C.
Postcondition
GSSC has been written.
GSST.GOV will eventually deassert.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 692 of file ra8_mipi_csi.c.

References k_ra8_mipi_csi_gssc_govc_mask, k_ra8_mipi_csi_off_gssc, k_ra8_ok, and ra8_mipi_csi_reg32().

◆ ra8_mipi_csi_short_packet_configure()

ra8_err_t ra8_mipi_csi_short_packet_configure ( uint8_t threshold,
bool store_enable )
nodiscard

Programme GSCT (short-packet FIFO threshold + store flag).

Parameters
[in]thresholdFIFO depth-1 reported in GSST.PNUM that asserts the GTH IRQ. Range 0..15.
[in]store_enable1 = store incoming short packets in FIFO.
Returns
ra8_err_t error code.
Return values
k_ra8_okUpdated.
k_ra8_err_invalid_argthreshold > 15.
Precondition
ra8_mipi_csi_init has succeeded.
threshold <= 15.
Postcondition
GSCT.SHTH = threshold.
GSCT.GFIF = store_enable.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 663 of file ra8_mipi_csi.c.

References k_ra8_err_invalid_arg, k_ra8_mipi_csi_gsct_gfif_mask, k_ra8_mipi_csi_gsct_shth_mask, k_ra8_mipi_csi_gsct_shth_max, k_ra8_mipi_csi_off_gsct, k_ra8_ok, and ra8_mipi_csi_reg32().

◆ ra8_mipi_csi_short_packet_get_status()

ra8_err_t ra8_mipi_csi_short_packet_get_status ( uint32_t * out_mask)
nodiscard

Read GSST (short-packet status).

Parameters
[out]out_maskLive GSST value.
Returns
ra8_err_t error code.
Return values
k_ra8_okStatus returned.
k_ra8_err_null_ptrout_mask was nullptr.
Precondition
out_mask is non-NULL.
ra8_mipi_csi_init has succeeded.
Postcondition
*out_mask holds the GSST value.
No hardware state is modified.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 684 of file ra8_mipi_csi.c.

References k_ra8_mipi_csi_off_gsst, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_mipi_csi_reg32(), and s_tag.

◆ ra8_mipi_csi_short_packet_re_enable_store()

ra8_err_t ra8_mipi_csi_short_packet_re_enable_store ( void )
nodiscard

Re-enable storing into the FIFO after a GOV overflow (GSIU.GFEN).

Returns
ra8_err_t error code.
Return values
k_ra8_okAlways.
Precondition
ra8_mipi_csi_init has succeeded.
Caller has cleared the GOV flag via clear_status.
Postcondition
GSIU.GFEN was pulsed (W1).
Hardware will resume queuing packets.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 747 of file ra8_mipi_csi.c.

References k_ra8_mipi_csi_gsiu_gfen_mask, k_ra8_mipi_csi_off_gsiu, k_ra8_ok, and ra8_mipi_csi_reg32().

◆ ra8_mipi_csi_short_packet_set_irq_enable()

ra8_err_t ra8_mipi_csi_short_packet_set_irq_enable ( uint32_t mask)
nodiscard

Programme GSIE (short-packet IRQ enable).

Parameters
[in]maskBits to set in GSIE.
Returns
ra8_err_t error code.
Return values
k_ra8_okAlways.
Precondition
ra8_mipi_csi_init has succeeded.
Caller is in single-threaded init context.
Postcondition
GSIE = mask.
Subsequent matching GST events trigger the GST IRQ vector.
Note
Thread safety: not thread-safe.
Since
0.1.0

Definition at line 677 of file ra8_mipi_csi.c.

References k_ra8_mipi_csi_gsie_all_mask, k_ra8_mipi_csi_off_gsie, k_ra8_ok, and ra8_mipi_csi_reg32().