|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
MIPI DSI-2 host driver – video mode, status, IRQ dispatch, and convenience surfaces. More...
#include <stddef.h>#include <stdint.h>#include <string.h>#include "ra8_attributes.h"#include "ra8_check.h"#include "ra8_err.h"#include "ra8_log.h"#include "ra8_mipi_dsi.h"#include "ra8_mipi_dsi_internal.h"#include "ra8_mipi_dsi_regs.h"#include "ra8_mstp.h"Go to the source code of this file.
Enumerations | |
| enum | ra8_mipi_dsi_timing_limits_t : uint16_t { k_ra8_mipi_dsi_timing_max_sync = 0x0FFFU , k_ra8_mipi_dsi_timing_max_porch = 0x1FFFU , k_ra8_mipi_dsi_timing_max_active = 0x7FFFU } |
| Per-field bit-width caps for ra8_mipi_dsi_video_timing_t. More... | |
Functions | |
| static void | internal_ra8_mipi_dsi_decode_rx (uint32_t raw, ra8_mipi_dsi_rx_result_t *out_result) |
| Decode an RXRSS slot register into a struct. | |
| ra8_err_t | ra8_mipi_dsi_video_configure (const ra8_mipi_dsi_video_cfg_t *vcfg) |
| Programme every video-mode timing register from a single config. | |
| ra8_err_t | ra8_mipi_dsi_video_start (const ra8_mipi_dsi_video_cfg_t *vcfg) |
| Start video-mode operation. | |
| ra8_err_t | ra8_mipi_dsi_video_stop (void) |
| Request a video-mode stop and wait for it. | |
| ra8_err_t | ra8_mipi_dsi_get_status (uint32_t *out_mask) |
| Read the top-level Interrupt Status Register. | |
| ra8_err_t | ra8_mipi_dsi_link_status_get (ra8_mipi_dsi_link_status_t *out_status) |
| Decode LINKSR into a struct. | |
| ra8_err_t | ra8_mipi_dsi_clear_status (uint32_t mask) |
| Clear bits in any of the sub-status registers. | |
| ra8_err_t | ra8_mipi_dsi_ack_error_get (ra8_mipi_dsi_ack_error_t *out_err) |
| Read the latest accumulated ack/error report and clear it. | |
| ra8_err_t | ra8_mipi_dsi_rx_result_get (uint8_t slot, ra8_mipi_dsi_rx_result_t *out_result) |
| Decode and consume an RXRSS slot. | |
| ra8_err_t | ra8_mipi_dsi_rx_payload_read (uint8_t *dest, uint16_t max_len, uint16_t *out_len) |
| Copy out the most-recent long-packet RX payload (RXPPD0..3R). | |
| ra8_err_t | ra8_mipi_dsi_te_event_pending (bool *out_pending) |
| Check if a tearing-effect (TE) trigger was received. | |
| ra8_err_t | ra8_mipi_dsi_te_event_clear (void) |
| Clear the latched tearing-effect bits in RXSR. | |
| ra8_err_t | ra8_mipi_dsi_irq_enable (ra8_mipi_dsi_event_t event, uint32_t mask, bool enable) |
| Toggle a sub-class IER bit. | |
| ra8_err_t | ra8_mipi_dsi_attach_handler (ra8_mipi_dsi_event_fn_t fn, void *ctx) |
| Attach a callback for MIPI DSI interrupt events. | |
| static void | internal_ra8_mipi_dsi_call_user (ra8_mipi_dsi_event_t event, uint32_t mask) |
| Common helper that fires the registered callback. | |
| void | ra8_mipi_dsi_dispatch_seq0 (void) |
| Sequence-channel-0 IRQ handler (LP path). | |
| void | ra8_mipi_dsi_dispatch_seq1 (void) |
| Sequence-channel-1 IRQ handler (HS path). | |
| void | ra8_mipi_dsi_dispatch_video (void) |
| Video-mode IRQ handler. | |
| void | ra8_mipi_dsi_dispatch_receive (void) |
| Receive IRQ handler. | |
| void | ra8_mipi_dsi_dispatch_fatal (void) |
| Fatal-error IRQ handler. | |
| void | ra8_mipi_dsi_dispatch_phy (void) |
| PHY-protocol-interface IRQ handler. | |
| void | ra8_mipi_dsi_dispatch (void) |
| Snapshot ISR, clear sub-status, fan out per-class callbacks. | |
| ra8_err_t | ra8_mipi_dsi_set_video_timing (const ra8_mipi_dsi_video_timing_t *timing) |
| Load only the HSA/HBP/HACT/HFP/VSA/VBP/VACT/VFP video-timing registers from a compact descriptor. | |
| ra8_err_t | ra8_mipi_dsi_send_command_short (ra8_mipi_dsi_dt_t dt, const uint8_t params[2]) |
| Send a DSI command-mode short packet on VC0 (LP escape). | |
| ra8_err_t | ra8_mipi_dsi_send_command_long (ra8_mipi_dsi_dt_t dt, const uint8_t *payload, uint16_t len) |
| Send a DSI command-mode long packet on VC0 (HS path). | |
| ra8_err_t | ra8_mipi_dsi_send_command_payload (ra8_mipi_dsi_dt_t packet_type, const uint8_t *payload, uint16_t len) |
| Send a DSI command-mode packet (short or long) on VC0 in LP escape. | |
| ra8_err_t | ra8_mipi_dsi_enter_ulps (void) |
| Drive the entire link (clock + data lanes) into ULPS. | |
| ra8_err_t | ra8_mipi_dsi_exit_ulps (void) |
| Wake the entire link out of ULPS. | |
| ra8_err_t | ra8_mipi_dsi_get_link_status (ra8_mipi_dsi_link_status_t *out) |
| Snapshot the link state (running flags + busy flags + accumulated ack/error report) into a single struct. | |
Variables | |
| static const char * | s_tag = "MIPI_DSI" |
| Component tag used by the ra8_log_* family. | |
MIPI DSI-2 host driver – video mode, status, IRQ dispatch, and convenience surfaces.
Second translation unit of the hand-written HAL for the RA8D2 MIPI DSI Host module (HUM Ch 65, p 3839-3934). The configuration, link, HS-clock, sequence-channel command, and ULPS paths live in the sibling ra8_mipi_dsi.c; this file carries:
The mutable state shared with the command-submission path (the registered callback + the pending receive buffer) and the bounded register-poll helper used by video mode are declared in ra8_mipi_dsi_internal.h.
Every register access carries a HUM Ch 65 citation in the form required by scripts/checks/cite_check.py:
/* HUM Ch 65.X "name", p NNNN *\/
Definition in file ra8_mipi_dsi_dispatch.c.
| enum ra8_mipi_dsi_timing_limits_t : uint16_t |
Per-field bit-width caps for ra8_mipi_dsi_video_timing_t.
HUM Ch 65.2 register fields impose these maxima: VSA/HSA = 12 bits, V/HBP + V/HFP = 13 bits, V/HACT = 15 bits. Used by ra8_mipi_dsi_set_video_timing to range-check inputs.
| Enumerator | |
|---|---|
| k_ra8_mipi_dsi_timing_max_sync | 12-bit field. |
| k_ra8_mipi_dsi_timing_max_porch | 13-bit field. |
| k_ra8_mipi_dsi_timing_max_active | 15-bit field. |
Definition at line 554 of file ra8_mipi_dsi_dispatch.c.
|
static |
Common helper that fires the registered callback.
| [in] | event | Class enum. |
| [in] | mask | Status bits captured before clearing. |
See implementation.
Definition at line 414 of file ra8_mipi_dsi_dispatch.c.
References s_mipi_dsi_event_ctx, and s_mipi_dsi_event_fn.
Referenced by ra8_mipi_dsi_dispatch(), ra8_mipi_dsi_dispatch_fatal(), ra8_mipi_dsi_dispatch_phy(), ra8_mipi_dsi_dispatch_receive(), ra8_mipi_dsi_dispatch_seq0(), ra8_mipi_dsi_dispatch_seq1(), and ra8_mipi_dsi_dispatch_video().
|
static |
Decode an RXRSS slot register into a struct.
| [in] | raw | Raw 32-bit RXRSS?R word. |
| [out] | out_result | Populated by the caller. |
See implementation.
Definition at line 82 of file ra8_mipi_dsi_dispatch.c.
References ra8_mipi_dsi_rx_result_t::cmd_id, ra8_mipi_dsi_rx_result_t::data, ra8_mipi_dsi_rx_result_t::info_overwritten, k_ra8_mipi_dsi_rxrss_data0_mask, k_ra8_mipi_dsi_rxrss_data1_mask, k_ra8_mipi_dsi_rxrss_dt_mask, k_ra8_mipi_dsi_rxrss_fmt, k_ra8_mipi_dsi_rxrss_infoow, k_ra8_mipi_dsi_rxrss_rxake, k_ra8_mipi_dsi_rxrss_rxcerr, k_ra8_mipi_dsi_rxrss_rxfail, k_ra8_mipi_dsi_rxrss_rxferr, k_ra8_mipi_dsi_rxrss_rxpfail, k_ra8_mipi_dsi_rxrss_rxsuc, k_ra8_mipi_dsi_rxrss_vc_mask, k_rxrss_data1_shift, k_rxrss_dt_shift, k_rxrss_vc_shift, ra8_mipi_dsi_rx_result_t::long_packet, ra8_mipi_dsi_rx_result_t::rx_ack_and_error, ra8_mipi_dsi_rx_result_t::rx_correctable_error, ra8_mipi_dsi_rx_result_t::rx_fail, ra8_mipi_dsi_rx_result_t::rx_fatal_error, ra8_mipi_dsi_rx_result_t::rx_packet_data_fail, ra8_mipi_dsi_rx_result_t::rx_success, and ra8_mipi_dsi_rx_result_t::virtual_channel.
Referenced by ra8_mipi_dsi_rx_result_get().
|
nodiscard |
Read the latest accumulated ack/error report and clear it.
| [out] | out_err | Decoded report. |
Definition at line 256 of file ra8_mipi_dsi_dispatch.c.
References r_mipi_dsi_regs_t::AKEPACMSR, r_mipi_dsi_regs_t::AKEPSCR, ra8_mipi_dsi_ack_error_t::error_report, k_akep_vc_shift, k_ra8_mipi_dsi_akep_erep_mask, k_ra8_mipi_dsi_akep_vc_mask, k_ra8_mipi_dsi_vc_mask, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_mipi_dsi(), s_tag, and ra8_mipi_dsi_ack_error_t::virtual_channel.
|
nodiscard |
Attach a callback for MIPI DSI interrupt events.
| [in] | fn | Function to call (or nullptr to detach). |
| [in] | ctx | Opaque context passed back to fn. |
Definition at line 387 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_ok, s_mipi_dsi_event_ctx, and s_mipi_dsi_event_fn.
|
nodiscard |
Clear bits in any of the sub-status registers.
Fans mask out across SQCH0SCR, SQCH1SCR, VMSCR, RXSCR, FERRSCR, PLSCR so callers do not need to track which bit lives where.
| [in] | mask | OR of ra8_mipi_dsi_isr_mask_t bits to clear. |
Definition at line 226 of file ra8_mipi_dsi_dispatch.c.
References r_mipi_dsi_regs_t::FERRSCR, k_ra8_mipi_dsi_ferrsr_clear_all, k_ra8_mipi_dsi_isr_ferr, k_ra8_mipi_dsi_isr_ppi, k_ra8_mipi_dsi_isr_rcv, k_ra8_mipi_dsi_isr_sq0, k_ra8_mipi_dsi_isr_sq1, k_ra8_mipi_dsi_isr_vm, k_ra8_mipi_dsi_plsr_clear_all, k_ra8_mipi_dsi_rxsr_clear_all, k_ra8_mipi_dsi_sqch_clear_all, k_ra8_mipi_dsi_vmsr_clear_all, k_ra8_ok, r_mipi_dsi_regs_t::PLSCR, ra8_mipi_dsi(), r_mipi_dsi_regs_t::RXSCR, r_mipi_dsi_regs_t::SQCH0SCR, r_mipi_dsi_regs_t::SQCH1SCR, and r_mipi_dsi_regs_t::VMSCR.
| void ra8_mipi_dsi_dispatch | ( | void | ) |
Snapshot ISR, clear sub-status, fan out per-class callbacks.
Convenience trampoline that calls every per-class ra8_mipi_dsi_dispatch_* whose ISR bit is set. The platform's NVIC stub may also call individual _dispatch_* directly when wired up per-IRQ.
Definition at line 511 of file ra8_mipi_dsi_dispatch.c.
References internal_ra8_mipi_dsi_call_user(), r_mipi_dsi_regs_t::ISR, k_ra8_mipi_dsi_event_phy, k_ra8_mipi_dsi_isr_all, k_ra8_mipi_dsi_isr_ferr, k_ra8_mipi_dsi_isr_ppi, k_ra8_mipi_dsi_isr_rcv, k_ra8_mipi_dsi_isr_sq0, k_ra8_mipi_dsi_isr_sq1, k_ra8_mipi_dsi_isr_vm, ra8_mipi_dsi(), ra8_mipi_dsi_dispatch_fatal(), ra8_mipi_dsi_dispatch_phy(), ra8_mipi_dsi_dispatch_receive(), ra8_mipi_dsi_dispatch_seq0(), ra8_mipi_dsi_dispatch_seq1(), and ra8_mipi_dsi_dispatch_video().
| void ra8_mipi_dsi_dispatch_fatal | ( | void | ) |
Fatal-error IRQ handler.
Snapshots FERRSR, clears the latched bits and invokes the registered fatal callback. Safe to call from a spurious IRQ.
Definition at line 489 of file ra8_mipi_dsi_dispatch.c.
References r_mipi_dsi_regs_t::FERRSCR, r_mipi_dsi_regs_t::FERRSR, internal_ra8_mipi_dsi_call_user(), k_ra8_mipi_dsi_event_fatal, k_ra8_mipi_dsi_ferrsr_clear_all, and ra8_mipi_dsi().
Referenced by ra8_mipi_dsi_dispatch().
| void ra8_mipi_dsi_dispatch_phy | ( | void | ) |
PHY-protocol-interface IRQ handler.
Snapshots PLSR, clears the latched bits and invokes the registered phy callback. Safe to call from a spurious IRQ.
Definition at line 500 of file ra8_mipi_dsi_dispatch.c.
References internal_ra8_mipi_dsi_call_user(), k_ra8_mipi_dsi_event_phy, k_ra8_mipi_dsi_plsr_clear_all, r_mipi_dsi_regs_t::PLSCR, r_mipi_dsi_regs_t::PLSR, and ra8_mipi_dsi().
Referenced by ra8_mipi_dsi_dispatch().
| void ra8_mipi_dsi_dispatch_receive | ( | void | ) |
Receive IRQ handler.
Snapshots RXSR, clears the latched bits and invokes the registered receive callback. Safe to call from a spurious IRQ.
Definition at line 464 of file ra8_mipi_dsi_dispatch.c.
References internal_ra8_mipi_dsi_call_user(), k_ra8_mipi_dsi_event_receive, k_ra8_mipi_dsi_rxrinfoow_sl0, k_ra8_mipi_dsi_rxsr_clear_all, k_ra8_mipi_dsi_rxsr_rxresp, ra8_mipi_dsi(), ra8_mipi_dsi_rx_payload_read(), r_mipi_dsi_regs_t::RXRINFOOWSCR, r_mipi_dsi_regs_t::RXSCR, r_mipi_dsi_regs_t::RXSR, s_mipi_dsi_pending_rx_buffer, and s_mipi_dsi_pending_rx_len.
Referenced by ra8_mipi_dsi_dispatch().
| void ra8_mipi_dsi_dispatch_seq0 | ( | void | ) |
Sequence-channel-0 IRQ handler (LP path).
Snapshots SQCH0SR, clears the latched bits and invokes the registered seq0 callback. Safe to call from a spurious IRQ.
Definition at line 424 of file ra8_mipi_dsi_dispatch.c.
References internal_ra8_mipi_dsi_call_user(), k_ra8_mipi_dsi_event_seq0, k_ra8_mipi_dsi_sqch_clear_all, ra8_mipi_dsi(), r_mipi_dsi_regs_t::SQCH0SCR, and r_mipi_dsi_regs_t::SQCH0SR.
Referenced by ra8_mipi_dsi_dispatch().
| void ra8_mipi_dsi_dispatch_seq1 | ( | void | ) |
Sequence-channel-1 IRQ handler (HS path).
Snapshots SQCH1SR, clears the latched bits and invokes the registered seq1 callback. Safe to call from a spurious IRQ.
Definition at line 435 of file ra8_mipi_dsi_dispatch.c.
References internal_ra8_mipi_dsi_call_user(), k_ra8_mipi_dsi_event_seq1, k_ra8_mipi_dsi_sqch_clear_all, ra8_mipi_dsi(), r_mipi_dsi_regs_t::SQCH1SCR, and r_mipi_dsi_regs_t::SQCH1SR.
Referenced by ra8_mipi_dsi_dispatch().
| void ra8_mipi_dsi_dispatch_video | ( | void | ) |
Video-mode IRQ handler.
Snapshots VMSR, clears the latched bits and invokes the registered video callback. Safe to call from a spurious IRQ.
Definition at line 446 of file ra8_mipi_dsi_dispatch.c.
References internal_ra8_mipi_dsi_call_user(), k_ra8_mipi_dsi_event_video, k_ra8_mipi_dsi_rstcr_swrst, k_ra8_mipi_dsi_vmsr_clear_all, k_ra8_mipi_dsi_vmsr_vbufovf, k_ra8_mipi_dsi_vmsr_vbufudf, ra8_mipi_dsi(), r_mipi_dsi_regs_t::RSTCR, r_mipi_dsi_regs_t::VMSCR, and r_mipi_dsi_regs_t::VMSR.
Referenced by ra8_mipi_dsi_dispatch().
|
nodiscard |
Drive the entire link (clock + data lanes) into ULPS.
Convenience equivalent to ra8_mipi_dsi_ulps_enter(k_ra8_mipi_dsi_lane_all). Honours the same continuous-clock-mode guard as the underlying call.
| k_ra8_ok | Both lanes pulsed into ULPS. |
| k_ra8_err_invalid_arg | Continuous-clock mode active and clock lane requested – HW prohibits it. |
Definition at line 644 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_mipi_dsi_lane_all, and ra8_mipi_dsi_ulps_enter().
|
nodiscard |
Wake the entire link out of ULPS.
Convenience equivalent to ra8_mipi_dsi_ulps_exit(k_ra8_mipi_dsi_lane_all).
| k_ra8_ok | Both lanes woken. |
Definition at line 649 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_mipi_dsi_lane_all, and ra8_mipi_dsi_ulps_exit().
|
nodiscard |
Snapshot the link state (running flags + busy flags + accumulated ack/error report) into a single struct.
Convenience around ra8_mipi_dsi_link_status_get – some callers want the more direct "get_link_status" name from the FSP surface.
| [out] | out | Decoded link status. |
| k_ra8_ok | Status returned. |
| k_ra8_err_null_ptr | out == nullptr. |
Definition at line 654 of file ra8_mipi_dsi_dispatch.c.
References ra8_mipi_dsi_link_status_get().
|
nodiscard |
Read the top-level Interrupt Status Register.
| [out] | out_mask | Receives the raw ISR value. |
Definition at line 205 of file ra8_mipi_dsi_dispatch.c.
References r_mipi_dsi_regs_t::ISR, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_mipi_dsi(), and s_tag.
|
nodiscard |
Toggle a sub-class IER bit.
| [in] | event | Which class (k_ra8_mipi_dsi_event_*). |
| [in] | mask | Bits inside the class IER register to update. |
| [in] | enable | true -> set selected bits, false -> clear. |
Definition at line 347 of file ra8_mipi_dsi_dispatch.c.
References r_mipi_dsi_regs_t::FERRIER, k_ra8_err_invalid_arg, k_ra8_mipi_dsi_event_fatal, k_ra8_mipi_dsi_event_phy, k_ra8_mipi_dsi_event_receive, k_ra8_mipi_dsi_event_seq0, k_ra8_mipi_dsi_event_seq1, k_ra8_mipi_dsi_event_video, k_ra8_ok, r_mipi_dsi_regs_t::PLIER, ra8_mipi_dsi(), r_mipi_dsi_regs_t::RXIER, r_mipi_dsi_regs_t::SQCH0IER, r_mipi_dsi_regs_t::SQCH1IER, and r_mipi_dsi_regs_t::VMIER.
|
nodiscard |
Decode LINKSR into a struct.
| [out] | out_status | Decoded status. |
Definition at line 213 of file ra8_mipi_dsi_dispatch.c.
References ra8_mipi_dsi_link_status_t::hs_busy, k_ra8_mipi_dsi_link_hsbusy, k_ra8_mipi_dsi_link_lpbusy, k_ra8_mipi_dsi_link_sq0run, k_ra8_mipi_dsi_link_sq1run, k_ra8_mipi_dsi_link_vrun, k_ra8_ok, r_mipi_dsi_regs_t::LINKSR, ra8_mipi_dsi_link_status_t::lp_busy, RA8_CHECK_NULL_PTR, ra8_mipi_dsi(), s_tag, ra8_mipi_dsi_link_status_t::sequence_ch0_running, ra8_mipi_dsi_link_status_t::sequence_ch1_running, and ra8_mipi_dsi_link_status_t::video_running.
Referenced by ra8_mipi_dsi_get_link_status().
|
nodiscard |
Copy out the most-recent long-packet RX payload (RXPPD0..3R).
| [out] | dest | Caller buffer. |
| [in] | max_len | Bytes available in dest (capped at 16). |
| [out] | out_len | Bytes actually read. |
Definition at line 310 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_mipi_dsi_byte_mask, k_ra8_mipi_dsi_payload_max, k_ra8_ok, k_shift_8, RA8_CHECK_NULL_PTR, ra8_mipi_dsi(), r_mipi_dsi_regs_t::RXPPD0R, r_mipi_dsi_regs_t::RXPPD1R, r_mipi_dsi_regs_t::RXPPD2R, r_mipi_dsi_regs_t::RXPPD3R, and s_tag.
Referenced by ra8_mipi_dsi_dispatch_receive().
|
nodiscard |
Decode and consume an RXRSS slot.
| [in] | slot | 0..3 – which RXRSS register. |
| [out] | out_result | Decoded packet header. |
Definition at line 271 of file ra8_mipi_dsi_dispatch.c.
References internal_ra8_mipi_dsi_decode_rx(), k_ra8_err_invalid_arg, k_ra8_err_no_data, k_ra8_mipi_dsi_rx_slots, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_mipi_dsi(), r_mipi_dsi_regs_t::RXRINFOOWSCR, r_mipi_dsi_regs_t::RXRSS0R, r_mipi_dsi_regs_t::RXRSS1R, r_mipi_dsi_regs_t::RXRSS2R, r_mipi_dsi_regs_t::RXRSS3R, r_mipi_dsi_regs_t::RXRSSCR, r_mipi_dsi_regs_t::RXRSSR, and s_tag.
|
nodiscard |
Send a DSI command-mode long packet on VC0 (HS path).
Convenience surface around ra8_mipi_dsi_send_long_packet – always uses VC0 and the high-speed sequence channel 1, which is what every command-mode panel programming sequence wants. Use the lower-level helper if you need LP routing or a non-zero VC. HUM Ch 65 "Long packet write" p 3839+.
| [in] | dt | k_ra8_mipi_dsi_dt_gen_long_write or k_ra8_mipi_dsi_dt_dcs_long_write. |
| [in] | payload | Payload bytes (len bytes long). |
| [in] | len | Payload length in bytes (max 1024 in HS mode). |
| k_ra8_ok | Packet queued, START asserted. |
| k_ra8_err_null_ptr | payload == nullptr and len > 0. |
| k_ra8_err_invalid_arg | len > 1024. |
| k_ra8_err_busy | Sequence engine running. |
Definition at line 613 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_err_null_ptr, k_ra8_mipi_dsi_vc0, and ra8_mipi_dsi_send_long_packet().
|
nodiscard |
Send a DSI command-mode packet (short or long) on VC0 in LP escape.
Routes a command-mode payload through the LP-escape sequence channel. Short writes (len <= 2) use the short-packet path; longer writes go through the long-packet path with the payload staged into TXPPD0..3R. Mirrors HUM Ch 65 "Command-mode packet TX" pp 3839-3934.
| [in] | packet_type | DSI Data Type (see k_ra8_mipi_dsi_dt_*). |
| [in] | payload | Payload bytes (len bytes). |
| [in] | len | Payload length in bytes (LP cap = 128). |
| k_ra8_ok | Packet queued. |
| k_ra8_err_null_ptr | payload == nullptr and len > 0. |
| k_ra8_err_invalid_arg | len > 128 (LP cap). |
| k_ra8_err_busy | Sequence engine still running. |
< RA8 mipi dsi short payload maximum.
Definition at line 622 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_err_null_ptr, k_ra8_mipi_dsi_vc0, ra8_mipi_dsi_send_long_packet(), and ra8_mipi_dsi_send_short_packet().
|
nodiscard |
Send a DSI command-mode short packet on VC0 (LP escape).
Convenience surface around ra8_mipi_dsi_send_short_packet that matches the FSP "command short" signature: a Data Type plus a 2-byte parameter array. Always sent on virtual channel 0 in low power escape mode. HUM Ch 65 "Command-mode short packet" p 3839+.
| [in] | dt | One of the k_ra8_mipi_dsi_dt_*_short_* constants. |
| [in] | params | 2-element array carrying parameter 0 / 1. |
| k_ra8_ok | Packet queued. |
| k_ra8_err_null_ptr | params == nullptr. |
| k_ra8_err_busy | Sequence engine still running. |
| k_ra8_err_invalid_state | Video mode running (LP rejected). |
Definition at line 605 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_mipi_dsi_vc0, RA8_CHECK_NULL_PTR, ra8_mipi_dsi_send_short_packet(), and s_tag.
|
nodiscard |
Load only the HSA/HBP/HACT/HFP/VSA/VBP/VACT/VFP video-timing registers from a compact descriptor.
Wraps ra8_mipi_dsi_video_configure with sensible defaults (RGB888 pixel format on VC0, sync-pulse mode off, HSA/HBP/HFP-no-LP all set so the link stays HS through blanking). The remaining VMSET1R / VMPPSETR fields keep their power-on defaults.
| [in] | timing | Compact timing descriptor. |
| k_ra8_ok | Timing registers loaded. |
| k_ra8_err_null_ptr | timing == nullptr. |
| k_ra8_err_invalid_arg | A field is wider than the target register. |
Definition at line 560 of file ra8_mipi_dsi_dispatch.c.
References ra8_mipi_dsi_video_timing_t::horizontal_active, ra8_mipi_dsi_video_timing_t::horizontal_back_porch, ra8_mipi_dsi_video_timing_t::horizontal_front_porch, ra8_mipi_dsi_video_timing_t::horizontal_sync, k_ra8_err_invalid_arg, k_ra8_mipi_dsi_dt_pixel_rgb888, k_ra8_mipi_dsi_timing_max_active, k_ra8_mipi_dsi_timing_max_porch, k_ra8_mipi_dsi_timing_max_sync, k_ra8_mipi_dsi_vc0, RA8_CHECK_NULL_PTR, ra8_mipi_dsi_video_configure(), s_tag, ra8_mipi_dsi_video_timing_t::vertical_active, ra8_mipi_dsi_video_timing_t::vertical_back_porch, ra8_mipi_dsi_video_timing_t::vertical_front_porch, and ra8_mipi_dsi_video_timing_t::vertical_sync.
|
nodiscard |
Clear the latched tearing-effect bits in RXSR.
Definition at line 339 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_mipi_dsi_rxsr_extedet, k_ra8_mipi_dsi_rxsr_rxte, k_ra8_ok, ra8_mipi_dsi(), and r_mipi_dsi_regs_t::RXSCR.
|
nodiscard |
Check if a tearing-effect (TE) trigger was received.
| [out] | out_pending | Receives true if RXSR.RXTE (rx TE trigger) or RXSR.EXTEDET (external TE pin) is set. |
Definition at line 329 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_mipi_dsi_rxsr_extedet, k_ra8_mipi_dsi_rxsr_rxte, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_mipi_dsi(), r_mipi_dsi_regs_t::RXSR, and s_tag.
|
nodiscard |
Programme every video-mode timing register from a single config.
Touches VMSET1R, VMPPSETR, VMVSSETR, VMVPSETR, VMHSSETR, VMHPSETR. Does not assert VMSET0R.VSTART – call ra8_mipi_dsi_video_start() for that.
| [in] | vcfg | Pointer to video-mode timing struct. |
Definition at line 106 of file ra8_mipi_dsi_dispatch.c.
References ra8_mipi_dsi_video_cfg_t::horizontal_active_pixels, ra8_mipi_dsi_video_cfg_t::horizontal_back_porch, ra8_mipi_dsi_video_cfg_t::horizontal_front_porch, ra8_mipi_dsi_video_cfg_t::horizontal_sync_lines, ra8_mipi_dsi_video_cfg_t::hsync_active_high, k_ra8_err_invalid_arg, k_ra8_mipi_dsi_vc3, k_ra8_mipi_dsi_vmhp_hbp_mask, k_ra8_mipi_dsi_vmhp_hfp_mask, k_ra8_mipi_dsi_vmhp_hfp_shift, k_ra8_mipi_dsi_vmhs_hact_mask, k_ra8_mipi_dsi_vmhs_hact_shift, k_ra8_mipi_dsi_vmhs_hsa_mask, k_ra8_mipi_dsi_vmhs_hspol, k_ra8_mipi_dsi_vmpp_dt_mask, k_ra8_mipi_dsi_vmpp_dt_shift, k_ra8_mipi_dsi_vmpp_txesync, k_ra8_mipi_dsi_vmpp_vc_mask, k_ra8_mipi_dsi_vmpp_vc_shift, k_ra8_mipi_dsi_vmset1_dly_mask, k_ra8_mipi_dsi_vmset1_dly_shift, k_ra8_mipi_dsi_vmvp_vbp_mask, k_ra8_mipi_dsi_vmvp_vfp_mask, k_ra8_mipi_dsi_vmvp_vfp_shift, k_ra8_mipi_dsi_vmvs_vact_mask, k_ra8_mipi_dsi_vmvs_vact_shift, k_ra8_mipi_dsi_vmvs_vsa_mask, k_ra8_mipi_dsi_vmvs_vspol, k_ra8_ok, ra8_mipi_dsi_video_cfg_t::pixel_format, RA8_CHECK_NULL_PTR, ra8_mipi_dsi(), s_tag, ra8_mipi_dsi_video_cfg_t::sync_pulse, ra8_mipi_dsi_video_cfg_t::vertical_active_lines, ra8_mipi_dsi_video_cfg_t::vertical_back_porch, ra8_mipi_dsi_video_cfg_t::vertical_front_porch, ra8_mipi_dsi_video_cfg_t::vertical_sync_lines, ra8_mipi_dsi_video_cfg_t::video_mode_delay, ra8_mipi_dsi_video_cfg_t::virtual_channel, r_mipi_dsi_regs_t::VMHPSETR, r_mipi_dsi_regs_t::VMHSSETR, r_mipi_dsi_regs_t::VMPPSETR, r_mipi_dsi_regs_t::VMSET1R, r_mipi_dsi_regs_t::VMVPSETR, r_mipi_dsi_regs_t::VMVSSETR, and ra8_mipi_dsi_video_cfg_t::vsync_active_high.
Referenced by ra8_mipi_dsi_set_video_timing().
|
nodiscard |
Start video-mode operation.
Writes VMSET0R with the HSA/HBP/HFP no-LP bits and the VSTART bit. Polls VMSR.VIRDY until set (bounded).
Definition at line 162 of file ra8_mipi_dsi_dispatch.c.
References ra8_mipi_dsi_video_cfg_t::hbp_no_lp, ra8_mipi_dsi_video_cfg_t::hfp_no_lp, ra8_mipi_dsi_video_cfg_t::hsa_no_lp, k_ra8_mipi_dsi_vmset0_hbpnolp, k_ra8_mipi_dsi_vmset0_hfpnolp, k_ra8_mipi_dsi_vmset0_hsanolp, k_ra8_mipi_dsi_vmset0_vstart, k_ra8_mipi_dsi_vmsr_virdy, priv_ra8_mipi_dsi_internal_wait_eq(), RA8_CHECK_NULL_PTR, ra8_mipi_dsi(), s_tag, r_mipi_dsi_regs_t::VMSET0R, and r_mipi_dsi_regs_t::VMSR.
|
nodiscard |
Request a video-mode stop and wait for it.
Sets VMSET0R.VSTOP, polls VMSR.STOP until 1, then scrubs the VMSCR latches. Equivalent to FSP dsi_stop.
Definition at line 184 of file ra8_mipi_dsi_dispatch.c.
References k_ra8_mipi_dsi_vmset0_vstop, k_ra8_mipi_dsi_vmsr_clear_all, k_ra8_mipi_dsi_vmsr_stop, k_ra8_ok, priv_ra8_mipi_dsi_internal_wait_eq(), ra8_mipi_dsi(), r_mipi_dsi_regs_t::VMSCR, r_mipi_dsi_regs_t::VMSET0R, and r_mipi_dsi_regs_t::VMSR.
|
static |
Component tag used by the ra8_log_* family.
Static so the linker keeps it confined to this TU. Same convention as every other ra8_hal driver (see ra8_glcdc.c, ra8_doc.c). The sibling ra8_mipi_dsi.c keeps its own identical copy – read-only constants are not shared across TUs.
Definition at line 65 of file ra8_mipi_dsi_dispatch.c.