|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
MIPI DSI-2 host driver – public function surface (full HUM Ch 65). More...
#include <stdint.h>#include "ra8_err.h"#include "ra8_mipi_dsi_regs.h"#include "ra8_mipi_dsi_types.h"Go to the source code of this file.
Data Structures | |
| struct | ra8_mipi_dsi_video_timing_t |
| Compact video-mode timing block (HSA/HBP/HACT/HFP + VSA/VBP/VACT/VFP). More... | |
Functions | |
| ra8_err_t | ra8_mipi_dsi_init (const ra8_mipi_dsi_config_t *cfg) |
| Bring up the MIPI DSI host link layer. | |
| ra8_err_t | ra8_mipi_dsi_deinit (void) |
| Tear down the MIPI DSI host link layer. | |
| ra8_err_t | ra8_mipi_dsi_enter_stop (void) |
| Gate the MIPI DSI block at the MSTP register. | |
| ra8_err_t | ra8_mipi_dsi_exit_stop (void) |
| Re-enable the MIPI DSI block clock from MSTP. | |
| ra8_err_t | ra8_mipi_dsi_soft_reset (void) |
| Pulse RSTCR.SWRST to take the protocol-layer state back to a clean slate (registers retained). | |
| ra8_err_t | ra8_mipi_dsi_hs_clock_start (void) |
| Start the high-speed differential clock to the panel. | |
| ra8_err_t | ra8_mipi_dsi_hs_clock_stop (void) |
| Stop the high-speed differential clock. | |
| ra8_err_t | ra8_mipi_dsi_send_short_packet (ra8_mipi_dsi_dt_t cmd_id, ra8_mipi_dsi_vc_t vc, uint8_t param0, uint8_t param1) |
| Send a DSI short packet on sequence channel 0 (LP escape). | |
| ra8_err_t | ra8_mipi_dsi_send_long_packet (ra8_mipi_dsi_dt_t cmd_id, ra8_mipi_dsi_vc_t vc, const uint8_t *data, uint16_t tx_len, bool low_power) |
| Send a DSI long-packet write (Generic Long / DCS Long). | |
| ra8_err_t | ra8_mipi_dsi_send_command (const ra8_mipi_dsi_command_t *cmd) |
| Send any sequence-channel command (full-feature path). | |
| ra8_err_t | ra8_mipi_dsi_read_packet (ra8_mipi_dsi_dt_t cmd_id, ra8_mipi_dsi_vc_t vc, uint8_t param0, uint8_t param1, uint8_t *p_rx_buffer, uint16_t rx_len) |
| Issue a BTA-then-read on sequence channel 0 and return the captured response payload. | |
| ra8_err_t | ra8_mipi_dsi_ulps_enter (uint8_t lanes) |
| Drive the selected lanes into Ultra-Low-Power State. | |
| ra8_err_t | ra8_mipi_dsi_ulps_exit (uint8_t lanes) |
| Wake the selected lanes out of ULPS. | |
| 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. | |
| void | ra8_mipi_dsi_dispatch (void) |
| Snapshot ISR, clear sub-status, fan out per-class callbacks. | |
| 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. | |
| 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. | |
MIPI DSI-2 host driver – public function surface (full HUM Ch 65).
Function-prototype split of the MIPI DSI host public API (HUM Ch 65, p 3839-3934). Carries every lifecycle / HS-clock / sequence-channel / ULPS / video-mode / status-IRQ / dispatch prototype plus the Sweep-6 convenience surface and its compact video-timing struct. Pulled out of ra8_mipi_dsi.h so the umbrella stays a thin include shim; consumers keep including ra8_mipi_dsi.h unchanged.
Definition in file ra8_mipi_dsi_api.h.
|
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.
|
nodiscard |
Tear down the MIPI DSI host link layer.
Detaches any IRQ handler, asserts RSTCR.SWRST, then disables the MSTP gate. Idempotent: calling twice in a row is harmless.
| k_ra8_ok | Block stopped, MSTP gated. |
| k_ra8_err_hw_timeout | MSTP read-back loop timed out. |
Definition at line 466 of file ra8_mipi_dsi.c.
References k_ra8_mipi_dsi_rstcr_swrst, k_ra8_mstp_mipi_dsi, k_ra8_ok, ra8_mipi_dsi(), ra8_mstp_disable(), r_mipi_dsi_regs_t::RSTCR, s_clock_lanes_in_ulps, s_continuous_clock, s_data_lanes_in_ulps, s_initialized, s_mipi_dsi_event_ctx, s_mipi_dsi_event_fn, s_mipi_dsi_pending_rx_buffer, and s_mipi_dsi_pending_rx_len.
| 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 |
Gate the MIPI DSI block at the MSTP register.
| k_ra8_ok | Block gated. |
| k_ra8_err_hw_timeout | MSTP read-back loop timed out. |
Definition at line 495 of file ra8_mipi_dsi.c.
References k_ra8_err_invalid_state, k_ra8_mstp_mipi_dsi, k_ra8_ok, ra8_mstp_disable(), and s_initialized.
|
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 |
Re-enable the MIPI DSI block clock from MSTP.
| k_ra8_ok | Block clocked again. |
| k_ra8_err_hw_timeout | MSTP read-back loop timed out. |
Definition at line 510 of file ra8_mipi_dsi.c.
References k_ra8_err_invalid_state, k_ra8_mstp_mipi_dsi, k_ra8_ok, ra8_mstp_enable(), and s_initialized.
|
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 |
Start the high-speed differential clock to the panel.
Sets HSCLKSETR.HSCLST = 1 and, if the init config selected continuous mode, also sets HSCLMD = 1. Polls PLSR.CLLP2HS until the clock-lane LP-to-HS event fires (bounded by k_ra8_mipi_dsi_busy_loop_max).
Definition at line 539 of file ra8_mipi_dsi.c.
References r_mipi_dsi_regs_t::HSCLKSETR, k_ra8_mipi_dsi_hsclk_continuous, k_ra8_mipi_dsi_hsclk_start, k_ra8_mipi_dsi_plsr_cllp2hs, r_mipi_dsi_regs_t::PLSR, priv_ra8_mipi_dsi_internal_wait_eq(), ra8_mipi_dsi(), and s_continuous_clock.
Referenced by ra8_board_mipi_dsi_init().
|
nodiscard |
Stop the high-speed differential clock.
Clears HSCLKSETR.HSCLST and waits for PLSR.CLHS2LP.
Definition at line 554 of file ra8_mipi_dsi.c.
References r_mipi_dsi_regs_t::HSCLKSETR, k_ra8_mipi_dsi_plsr_clhs2lp, r_mipi_dsi_regs_t::PLSR, priv_ra8_mipi_dsi_internal_wait_eq(), and ra8_mipi_dsi().
|
nodiscard |
Bring up the MIPI DSI host link layer.
The HS clock is not started by this function; call ra8_mipi_dsi_hs_clock_start() separately so the application can insert PHY-level steps in between.
| [in] | cfg | Static driver configuration. Must not be nullptr. |
| k_ra8_ok | Driver initialized, link up. |
| k_ra8_err_null_ptr | cfg == nullptr. |
| k_ra8_err_invalid_arg | Lane count outside [1,2]. |
| k_ra8_err_hw_timeout | MSTP read-back loop timed out. |
Definition at line 439 of file ra8_mipi_dsi.c.
References ra8_mipi_dsi_config_t::clock_mode, internal_program_link(), internal_program_timeouts(), internal_ra8_mipi_dsi_clear_all_status(), internal_ra8_mipi_dsi_validate_cfg(), k_ra8_mipi_dsi_clock_continuous, k_ra8_mstp_mipi_dsi, k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_log_info, ra8_mstp_enable(), RA8_RETURN_ON_ERROR, s_clock_lanes_in_ulps, s_continuous_clock, s_data_lanes_in_ulps, s_initialized, s_mipi_dsi_event_ctx, s_mipi_dsi_event_fn, s_mipi_dsi_pending_rx_buffer, s_mipi_dsi_pending_rx_len, and s_tag.
Referenced by ra8_board_mipi_dsi_init().
|
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 |
Issue a BTA-then-read on sequence channel 0 and return the captured response payload.
Builds a Generic / DCS read descriptor with BTA = bta_read, kicks the sequence, then leaves response collection to the IRQ – the caller polls ra8_mipi_dsi_rx_result_get() for the slot containing the result.
| [in] | cmd_id | k_ra8_mipi_dsi_dt_gen_read_* or k_ra8_mipi_dsi_dt_dcs_read. |
| [in] | vc | Virtual channel. |
| [in] | param0 | First parameter byte. |
| [in] | param1 | Second parameter byte. |
| [out] | p_rx_buffer | Buffer the IRQ handler will copy RXPPD into. |
| [in] | rx_len | Maximum bytes the buffer can hold. |
| k_ra8_ok | Read kicked off. |
| k_ra8_err_null_ptr | p_rx_buffer == nullptr. |
| k_ra8_err_invalid_arg | vc > 3 or rx_len == 0. |
| k_ra8_err_busy | Sequence engine running. |
Definition at line 434 of file ra8_mipi_dsi_cmd.c.
References k_ra8_err_invalid_arg, k_ra8_mipi_dsi_bta_read, RA8_CHECK_NULL_PTR, ra8_mipi_dsi_send_command(), s_mipi_dsi_pending_rx_buffer, s_mipi_dsi_pending_rx_len, and s_tag.
|
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 any sequence-channel command (full-feature path).
Assembles a descriptor from cmd – handles short / long / aux-op / BTA / ack-request / LP vs HS / read-with-rx-buffer in one entry point. This is the FSP-equivalent surface; the helpers above just wrap it.
| [in] | cmd | Validated command descriptor. |
| k_ra8_ok | Packet queued. |
| k_ra8_err_null_ptr | cmd == nullptr. |
| k_ra8_err_invalid_arg | cmd->virtual_channel > 3, or LP and tx_len > 128, or HS and tx_len > 1024, or aux op while video running. |
| k_ra8_err_busy | Sequence engine running. |
| k_ra8_err_invalid_state | LP requested while video mode running. |
Definition at line 370 of file ra8_mipi_dsi_cmd.c.
References internal_check_link_state(), internal_ra8_mipi_dsi_validate_cmd(), internal_send_stage_and_pulse(), k_ra8_mipi_dsi_payload_max, k_ra8_ok, ra8_mipi_dsi_command_t::p_rx_buffer, RA8_CHECK_NULL_PTR, RA8_RETURN_ON_ERROR, s_mipi_dsi_pending_rx_buffer, s_mipi_dsi_pending_rx_len, and s_tag.
Referenced by ra8_mipi_dsi_read_packet(), ra8_mipi_dsi_send_long_packet(), and ra8_mipi_dsi_send_short_packet().
|
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 |
Send a DSI long-packet write (Generic Long / DCS Long).
Stages the payload bytes into TXPPD0..3R (max 16 bytes) and points the descriptor at the packet RAM. For payloads > 16 bytes the descriptor word D carries an external buffer pointer.
| [in] | cmd_id | k_ra8_mipi_dsi_dt_gen_long_write or k_ra8_mipi_dsi_dt_dcs_long_write. |
| [in] | vc | Virtual channel (0..3). |
| [in] | data | Payload bytes (tx_len long). |
| [in] | tx_len | Payload length in bytes (max 65535 per spec). |
| [in] | low_power | true to send via channel 0 (LP), false for channel 1 (HS). |
| k_ra8_ok | Packet queued, START asserted. |
| k_ra8_err_null_ptr | data == nullptr and tx_len > 0. |
| k_ra8_err_invalid_arg | vc > 3 or LP and tx_len > 128. |
| k_ra8_err_busy | Sequence engine already running. |
Definition at line 410 of file ra8_mipi_dsi_cmd.c.
References k_ra8_err_null_ptr, k_ra8_mipi_dsi_bta_none, and ra8_mipi_dsi_send_command().
Referenced by ra8_mipi_dsi_send_command_long(), and ra8_mipi_dsi_send_command_payload().
|
nodiscard |
Send a DSI short packet on sequence channel 0 (LP escape).
Backwards-compat helper – assembles a default LP descriptor with SPD=1, BTA=none, no ack, no aux, then pulses START. Equivalent to ra8_mipi_dsi_send_command() with the matching ra8_mipi_dsi_command_t.
| [in] | cmd_id | One of the k_ra8_mipi_dsi_dt_* short-write constants. |
| [in] | vc | Virtual channel (0..3). |
| [in] | param0 | First parameter byte. |
| [in] | param1 | Second parameter byte. |
| k_ra8_ok | Packet queued and START asserted. |
| k_ra8_err_invalid_arg | vc > 3. |
| k_ra8_err_busy | Sequence engine already running. |
Definition at line 389 of file ra8_mipi_dsi_cmd.c.
References k_ra8_mipi_dsi_bta_none, and ra8_mipi_dsi_send_command().
Referenced by ra8_mipi_dsi_send_command_payload(), and ra8_mipi_dsi_send_command_short().
|
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 |
Pulse RSTCR.SWRST to take the protocol-layer state back to a clean slate (registers retained).
Definition at line 524 of file ra8_mipi_dsi.c.
References k_ra8_mipi_dsi_rstcr_swrst, k_ra8_ok, ra8_mipi_dsi(), and r_mipi_dsi_regs_t::RSTCR.
|
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 |
Drive the selected lanes into Ultra-Low-Power State.
| [in] | lanes | OR of k_ra8_mipi_dsi_lane_clock / k_ra8_mipi_dsi_lane_data. |
Definition at line 570 of file ra8_mipi_dsi.c.
References k_ra8_err_invalid_arg, k_ra8_mipi_dsi_lane_clock, k_ra8_mipi_dsi_lane_data, k_ra8_mipi_dsi_lane_none, k_ra8_mipi_dsi_ulpscr_clent, k_ra8_mipi_dsi_ulpscr_dlent, k_ra8_ok, ra8_log_error, ra8_mipi_dsi(), s_clock_lanes_in_ulps, s_continuous_clock, s_data_lanes_in_ulps, s_tag, and r_mipi_dsi_regs_t::ULPSCR.
Referenced by ra8_mipi_dsi_enter_ulps().
|
nodiscard |
Wake the selected lanes out of ULPS.
| [in] | lanes | OR of k_ra8_mipi_dsi_lane_* bits. |
Definition at line 595 of file ra8_mipi_dsi.c.
References k_ra8_err_invalid_arg, k_ra8_mipi_dsi_lane_clock, k_ra8_mipi_dsi_lane_data, k_ra8_mipi_dsi_lane_none, k_ra8_mipi_dsi_ulpscr_clexit, k_ra8_mipi_dsi_ulpscr_dlexit, k_ra8_ok, ra8_mipi_dsi(), s_clock_lanes_in_ulps, s_data_lanes_in_ulps, and r_mipi_dsi_regs_t::ULPSCR.
Referenced by ra8_mipi_dsi_exit_ulps().
|
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.