399 const uint8_t* cb_table,
400 const uint8_t* cr_table,
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_err_t ra8_vin_set_window(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
Programme a region-of-interest pre-clip window.
ra8_err_t ra8_vin_set_data_mode(const ra8_vin_data_mode_t *mode)
Programme the DMR (Data Mode Register).
ra8_err_t ra8_vin_set_yc_to_rgb(const ra8_vin_yc_to_rgb_t *coeffs)
Programme the YC -> RGB matrix coefficients (CSCE1..4).
ra8_err_t ra8_vin_deinit(void)
Tear down VIN: stop capture, mask interrupts, drop MSTP.
void ra8_vin_dispatch(void)
Snapshot INTS, fire callback, then W1C the latched bits.
ra8_err_t ra8_vin_init(const ra8_vin_config_t *cfg)
Initialise VIN with the supplied descriptor.
ra8_err_t ra8_vin_enable_scaling(bool enable)
Toggle the MC.SCLE main scaling-enable bit.
ra8_err_t ra8_vin_set_uds_ctrl(const ra8_vin_uds_ctrl_t *ctrl)
Programme UDS interpolation control (UDS_CTRL).
ra8_err_t ra8_vin_set_scanline_compare(uint16_t line)
Programme the SI (Scanline Interrupt) compare register.
ra8_err_t ra8_vin_lut_program(const uint8_t *y_table, const uint8_t *cb_table, const uint8_t *cr_table, bool enable)
Programme all 256 entries of the Y / Cb / Cr conversion LUT.
ra8_err_t ra8_vin_set_csi_input(const ra8_vin_csi_input_t *input)
Programme CSI_IFMD (virtual channel + data type + extension).
ra8_err_t ra8_vin_exit_stop(void)
Re-enable the VIN clock gate after ra8_vin_enter_stop.
ra8_err_t ra8_vin_set_preclip(const ra8_vin_preclip_t *window)
Programme the pre-clip window (SLPRC / ELPRC / SPPRC / EPPRC).
ra8_err_t ra8_vin_set_interrupt_enable(uint32_t mask)
Update the IE (Interrupt Enable) mask at runtime.
ra8_err_t ra8_vin_set_field_detect(const ra8_vin_field_detect_t *detect)
Programme CSIFLD (field detection).
ra8_err_t ra8_vin_set_yuv444_mode(uint8_t mode)
Configure the YUV-444 conversion mode (MC.YUV444).
ra8_err_t ra8_vin_set_uds_scale(const ra8_vin_uds_scale_t *scale)
Programme the UDS scaling factor (UDS_SCALE).
ra8_err_t ra8_vin_enter_stop(void)
Quiesce VIN and disable its module-stop clock gate.
ra8_err_t ra8_vin_set_rgb_to_yc(uint8_t channel, const ra8_vin_rgb_to_yc_chan_t *row)
Programme one row of the RGB -> YC matrix.
ra8_err_t ra8_vin_capture_arm(ra8_vin_capture_mode_t mode)
Start a capture operation.
ra8_err_t ra8_vin_capture_start(void *buf, uint16_t w, uint16_t h, ra8_vin_input_fmt_t format)
Start a single-frame capture into buf with the supplied geometry.
ra8_err_t ra8_vin_capture_disarm(void)
Stop the current capture and drain outstanding AXI traffic.
ra8_err_t ra8_vin_get_line_count(uint16_t *out_count)
Read the LC (line count) register.
ra8_err_t ra8_vin_attach_handler(ra8_vin_event_fn_t fn, void *ctx)
Attach a VIN event callback (shared between status + error IRQs).
ra8_err_t ra8_vin_set_framebuffers(uint32_t mb1, uint32_t mb2, uint32_t mb3)
Re-programme MB1 / MB2 / MB3 (ping-pong framebuffers).
ra8_err_t ra8_vin_clear_status(uint32_t mask)
Clear write-1-to-clear bits in the INTS register.
ra8_err_t ra8_vin_get_active_buffer(uint8_t *out_id)
Return the active framebuffer index from MS.FBS.
ra8_err_t ra8_vin_set_uv_offset(uint32_t uv_addr)
Programme UVAOF (UV plane address offset for YC-separated mode).
ra8_err_t ra8_vin_attach_frame_handler(ra8_vin_frame_fn_t fn, void *ctx)
Register the frame-end IRQ callback.
ra8_err_t ra8_vin_get_status(uint32_t *out_mask)
Snapshot the INTS register.
ra8_err_t ra8_vin_capture_stop(void)
Stop the in-flight capture started via ra8_vin_capture_start.
ra8_err_t ra8_vin_set_dithering(uint8_t mode, bool direction)
Configure the dithering mode (MC.DC + MC.DC2).
ra8_err_t ra8_vin_set_uds_passband(uint8_t v_bwidth, uint8_t h_bwidth)
Programme the UDS pass-band bandwidth (UDS_PASS_BWIDTH).
ra8_err_t ra8_vin_set_interlace_mode(uint8_t mode)
Set the interlace mode (MC.IM).
ra8_err_t ra8_vin_reset(void)
Issue a soft reset by re-running the MC.ST settle sequence.
ra8_err_t ra8_vin_set_uds_clip(uint16_t v_size, uint16_t h_size)
Programme the UDS output clipping (UDS_CLIP_SIZE).
ra8_err_t ra8_vin_get_module_status(ra8_vin_module_status_t *out_status)
Decode the MS register into a typed snapshot.
Video Input Module (VIN) register layout for the RA8D2.
Video Input Module (VIN) configuration descriptors and types.
void(* ra8_vin_frame_fn_t)(void *ctx, void *buf, uint32_t len)
Frame-end callback registered via ra8_vin_attach_frame_handler.
ra8_vin_capture_mode_t
Single frame vs.
ra8_vin_input_fmt_t
Camera input format for the MC.INF[2:0] field.
void(* ra8_vin_event_fn_t)(void *ctx, uint32_t status_mask)
VIN event callback (frame complete / overflow / VSYNC).
Initial configuration for ra8_vin_init.
Decoded view of the DMR (Data Mode) register.
Decoded snapshot of the MS (Module Status) register.
Pre-clip window (SLPRC / ELPRC / SPPRC / EPPRC).
One RGB-to-YC matrix row (Y, Cb, or Cr).
UDS interpolation control bits.
UDS scaling factors for the V and H axes.
Coefficients for the YC -> RGB matrix (CSCEn).