90static const char*
s_tag =
"MIPI_DSI";
352 if ((*reg & mask) == expect) {
581 uint32_t ulpscr = 0U;
600 uint32_t ulpscr = 0U;
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_RETURN_ON_ERROR(err, tag, message)
Early return on error, propagating the code upward.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
static bool s_initialized
True once display_init has succeeded.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
@ k_ra8_err_hw_timeout
Hardware timed out waiting for a flag or handshake.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_info(tag, message)
RA8 log info.
#define ra8_log_error(tag, message)
RA8 log error.
ra8_err_t ra8_mipi_dsi_exit_stop(void)
Re-enable the MIPI DSI block clock from MSTP.
ra8_err_t ra8_mipi_dsi_deinit(void)
Tear down the MIPI DSI host link layer.
static void internal_program_timeouts(const ra8_mipi_dsi_config_t *cfg)
Program the peripheral-response and transmit-side timeouts.
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.
static bool s_continuous_clock
Cache of cfg->clock_mode == continuous from the last init.
static uint32_t internal_ra8_mipi_dsi_make_dsisetr(const ra8_mipi_dsi_config_t *cfg)
Compose DSISETR from a config.
ra8_err_t ra8_mipi_dsi_ulps_exit(uint8_t lanes)
Wake the selected lanes out of ULPS.
void * s_mipi_dsi_event_ctx
Single definition of the shared IRQ callback context.
uint16_t s_mipi_dsi_pending_rx_len
Single definition of the shared pending receive capacity.
static void internal_program_link(const ra8_mipi_dsi_config_t *cfg)
Pulse the RSTCR software reset and program the steady-state link-level registers.
ra8_err_t priv_ra8_mipi_dsi_internal_wait_eq(volatile const uint32_t *reg, uint32_t mask, uint32_t expect)
Implementation of priv_ra8_mipi_dsi_internal_wait_eq() – bounded busy-poll.
ra8_err_t ra8_mipi_dsi_init(const ra8_mipi_dsi_config_t *cfg)
Bring up the MIPI DSI host link layer.
ra8_mipi_dsi_event_fn_t s_mipi_dsi_event_fn
Single definition of the shared IRQ callback pointer.
static bool s_clock_lanes_in_ulps
Software shadow of clock-lane ULPS state.
static ra8_err_t internal_ra8_mipi_dsi_validate_cfg(const ra8_mipi_dsi_config_t *cfg)
Validate a ra8_mipi_dsi_config_t argument.
static void internal_ra8_mipi_dsi_clear_all_status(void)
Clear every latched status bit in every sub-status register.
ra8_err_t ra8_mipi_dsi_enter_stop(void)
Gate the MIPI DSI block at the MSTP register.
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_hs_clock_stop(void)
Stop the high-speed differential clock.
uint8_t * s_mipi_dsi_pending_rx_buffer
Single definition of the shared pending receive buffer.
static uint32_t internal_ra8_mipi_dsi_make_txsetr(const ra8_mipi_dsi_config_t *cfg)
Compose TXSETR from a config (lane count + clock + data lane enable).
static bool s_data_lanes_in_ulps
Software shadow of data-lane ULPS state.
MIPI DSI-2 host driver – public API (full HUM Ch 65 surface).
Module-private link seam shared between the MIPI DSI-2 hostdriver translation units.
@ k_dsisetr_vc_crc_shift
Dsisetr vc CRC shift.
@ k_ulpssetr_wkup_shift
Ulpssetr wkup shift.
MIPI DSI Host (DSI-2) register layout for the RA8D2.
@ k_ra8_mipi_dsi_vmsr_clear_all
Mask of every defined VMSR bit – write to VMSCR to scrub.
@ k_ra8_mipi_dsi_hsclk_start
HSCLST: HS clock start.
@ k_ra8_mipi_dsi_hsclk_continuous
HSCLMD: continuous mode.
@ k_ra8_mipi_dsi_rstcr_swrst
Assert software reset.
@ k_ra8_mipi_dsi_busy_loop_max
Max iterations per wait.
@ k_ra8_mipi_dsi_ferrsr_clear_all
RW1C-able fields in FERRSCR (status-only bits 27/28 excluded).
@ k_ra8_mipi_dsi_txset_lane2
NUMLANE = 1: 2 data lanes.
@ k_ra8_mipi_dsi_txset_dlen
DLEN: data-lane enable.
@ k_ra8_mipi_dsi_txset_clen
CLEN: clock-lane enable.
static volatile r_mipi_dsi_regs_t * ra8_mipi_dsi(void)
Pointer to the RA8D2 MIPI DSI host register block.
@ k_ra8_mipi_dsi_clstpt_clkkpt_shift
CLKKPT pos.
@ k_ra8_mipi_dsi_clstpt_clkstpt_shift
CLKSTPT pos.
@ k_ra8_mipi_dsi_clstpt_clkstpt_mask
CLKSTPT[11:2].
@ k_ra8_mipi_dsi_clstpt_clkkpt_mask
CLKKPT[31:24] mask, sets the HS-to-LP clock keep time.
@ k_ra8_mipi_dsi_clstpt_clkbfht_mask
CLKBFHT[23:16] mask, sets the LP-to-HS clock guard time.
@ k_ra8_mipi_dsi_clstpt_clkbfht_shift
CLKBFHT pos.
@ k_ra8_mipi_dsi_lptrnst_golpbkt_mask
GOLPBKT[9:0].
@ k_ra8_mipi_dsi_ulpscr_dlexit
Data-lane ULPS exit.
@ k_ra8_mipi_dsi_ulpscr_dlent
Data-lane ULPS enter.
@ k_ra8_mipi_dsi_ulpscr_clexit
Clock-lane ULPS exit.
@ k_ra8_mipi_dsi_ulpscr_clent
Clock-lane ULPS enter.
@ k_ra8_mipi_dsi_rxsr_clear_all
Mask of every defined RXSR bit – write to RXSCR to scrub.
@ k_ra8_mipi_dsi_plsr_clhs2lp
CL HS-to-LP transition.
@ k_ra8_mipi_dsi_plsr_cllp2hs
CL LP-to-HS transition.
@ k_ra8_mipi_dsi_plsr_clear_all
Bit subset that is RW1C in PLSCR (steady-state lane bits aren't).
@ k_ra8_mipi_dsi_sqch_clear_all
Mask of every RW1C bit in SQCH*SCR.
@ k_ra8_mipi_dsi_dsisetr_extemd
External tearing detect.
@ k_ra8_mipi_dsi_dsisetr_vc_crc_mask
Mask for the four per-VC CRC enable bits.
@ k_ra8_mipi_dsi_dsisetr_mrpsz_mask
MRPSZ field mask.
@ k_ra8_mipi_dsi_dsisetr_eccen
ECC check enable.
@ k_ra8_mipi_dsi_dsisetr_scren
Data scramble enable.
@ k_ra8_mipi_dsi_dsisetr_eotpen
HS Tx EoTp enable.
@ k_ra8_mipi_dsi_clock_continuous
HS clock runs forever.
@ k_ra8_mipi_dsi_lane_data
All data lanes (1 or 2).
@ k_ra8_mipi_dsi_lane_none
No lanes selected.
@ k_ra8_mipi_dsi_lane_clock
Clock lane.
@ k_ra8_mipi_dsi_lanes_1
1 data lane + 1 clock lane.
@ k_ra8_mipi_dsi_lanes_2
2 data lanes + 1 clock lane.
void(* ra8_mipi_dsi_event_fn_t)(void *ctx, ra8_mipi_dsi_event_t event, uint32_t status_mask)
MIPI DSI ISR-context callback signature.
Ref-counted Module Stop Control wrapper for the RA8D2.
ra8_err_t ra8_mstp_enable(ra8_mstp_t id)
Reference-counted "ungate this peripheral" request.
ra8_err_t ra8_mstp_disable(ra8_mstp_t id)
Reference-counted "gate this peripheral" request.
@ k_ra8_mstp_mipi_dsi
MSTPC10 MIPI DSI.
MIPI DSI host register block (full layout).
volatile uint32_t RSTCR
+0x110 Software reset control.
volatile uint32_t DSISETR
+0x120 DSI link configuration.
volatile uint32_t CLSTPTSETR
+0x314 Clock-lane stop time.
volatile uint32_t TATOSETR
+0x2E8 Turnaround ack timeout.
volatile uint32_t LPTRNSTSETR
+0x318 LP transition time.
volatile uint32_t VMSCR
+0x414 Video-mode status clear.
volatile uint32_t TXSETR
+0x100 Lane enable + count.
volatile uint32_t SQCH0SCR
+0x5D4 Sequence ch 0 clear.
volatile uint32_t PRESPTOHSSETR
+0x218 Peripheral resp TO (HS).
volatile uint32_t RXSCR
+0x204 Receive status clear.
volatile uint32_t PLSR
+0x320 PHY (PPI) status (RO).
volatile uint32_t ULPSCR
+0x10C ULPS enter/exit pulses.
volatile uint32_t LRXHTOSETR
+0x2E4 LP-RX host timeout.
volatile uint32_t HSTXTOSETR
+0x2E0 HS Tx timeout count.
volatile uint32_t ULPSSETR
+0x108 ULPS wakeup period.
volatile uint32_t SQCH1SCR
+0x614 Sequence ch 1 clear.
volatile uint32_t HSCLKSETR
+0x104 HS clock control.
volatile uint32_t PLSCR
+0x324 PHY status clear.
volatile uint32_t PRESPTOLPSETR
+0x214 Peripheral resp TO (LP).
volatile uint32_t FERRSCR
+0x304 Fatal-error status clear.
volatile uint32_t PRESPTOBTASETR
+0x210 Peripheral resp TO (BTA).
Static configuration passed to ra8_mipi_dsi_init.
uint16_t max_return_packet_size
DSISETR.MRPSZ.
ra8_mipi_dsi_timeouts_t timeouts
Bus timeouts.
uint8_t crc_check_vc_mask
Bit i = VCi CRC.
ra8_mipi_dsi_timing_t timing
Guard timings.
bool ecc_check_enable
DSISETR.ECCEN.
ra8_mipi_dsi_clock_mode_t clock_mode
HS clock mode.
ra8_mipi_dsi_lane_count_t lane_count
1 or 2.
bool scramble_enable
DSISETR.SCREN.
uint8_t ulps_wakeup_period
ULPSSETR.WKUP.
bool eotp_enable
DSISETR.EOTPEN.
bool tearing_detect_enable
DSISETR.EXTEMD.
uint32_t lp_rx_host_timeout
LRXHTOSETR.
uint32_t turnaround_timeout
TATOSETR.
uint32_t hs_tx_timeout
HSTXTOSETR.
uint32_t hs_rw_timeout
PRESPTOHSSETR (split HSRTO|HSWTO).
uint32_t bta_timeout
PRESPTOBTASETR.
uint32_t lp_rw_timeout
PRESPTOLPSETR (split LPRTO|LPWTO).
uint16_t go_lp_and_back
LPTRNSTSETR.GOLPBKT[9:0].
uint8_t clock_beforehand_time
CLSTPTSETR.CLKBFHT[23:16].
uint16_t clock_stop_time
CLSTPTSETR.CLKSTPT[11:2].
uint8_t clock_keep_time
CLSTPTSETR.CLKKPT[31:24].