|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
MIPI D-PHY driver – shared enums, structs, and callback typedef. More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_mipi_phy_status_decoded_t |
| Decoded DPHYSFR snapshot returned by ra8_mipi_phy_get_status_decoded. More... | |
| struct | ra8_mipi_phy_pll_t |
| D-PHY PLL coefficients written into DPHYPLFCR. More... | |
| struct | ra8_mipi_phy_timing_t |
| D-PHY HS/LP transition timing values (DPHYTIM1..6). More... | |
| struct | ra8_mipi_phy_config_t |
| Top-level configuration for ra8_mipi_phy_init. More... | |
Typedefs | |
| typedef void(* | ra8_mipi_phy_event_fn_t) (void *ctx, ra8_mipi_phy_event_t event, uint32_t sfr) |
| MIPI PHY status callback (LDO ready / PLL lock / PLL drop). | |
MIPI D-PHY driver – shared enums, structs, and callback typedef.
Type definitions for the RA8D2 MIPI PHY block (HUM Ch 64, p 3822-3838). This sub-header carries every typed enum, register-mirror struct, and the status-callback typedef shared by the DSI and CSI clients of the PHY. The function prototypes that consume these types live in ra8_mipi_phy_api.h; both are re-exported by the thin umbrella ra8_mipi_phy.h.
Definition in file ra8_mipi_phy_types.h.
| typedef void(* ra8_mipi_phy_event_fn_t) (void *ctx, ra8_mipi_phy_event_t event, uint32_t sfr) |
MIPI PHY status callback (LDO ready / PLL lock / PLL drop).
| [in] | ctx | Caller context registered via ra8_mipi_phy_attach_handler. |
| [in] | event | Decoded event source from ra8_mipi_phy_event_t. |
| [in] | sfr | Snapshot of DPHYSFR at dispatch time. |
Definition at line 332 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_clk_mode_t : uint8_t |
HS clock-lane operating mode.
D-PHY allows two clock-lane behaviours:
The PHY block does not select this directly (DSI / CSI host drivers own the actual lane state machine), but the driver records the caller's choice so other modules can query it via ra8_mipi_phy_get_clock_mode.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_clk_noncontinuous | Drop to LP-11 between bursts. |
| k_ra8_mipi_phy_clk_continuous | Keep HS clock running. |
Definition at line 109 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_dual_mode_t : uint8_t |
Arbitration policy when both DSI and CSI want the PHY.
The RA8D2 silicon hosts a single D-PHY shared between DSI host (Ch 65) and CSI device (Ch 66). MIPI-DSI and MIPI-CSI cannot be active simultaneously – DPHYMDC.MASTEREN is a single bit. To cover the brief's "dual-mode" requirement, the PHY driver tracks an arbitration policy that the higher-level stack can consult before it requests the PHY. alternate switches per request, dsi_priority and csi_priority lock to one client.
The driver does not implement queueing – it simply records the policy so the consumer can decide what to do when a conflict arises (typically: drop the lower-priority client, switch the PHY mode, then promote the higher-priority client).
Definition at line 227 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_eotp_t : uint8_t |
End-of-Transmission Packet emission setting (DSI host only).
MIPI DSI 1.2 spec section 8.8.2 makes the EoTP packet optional. Some panels require it, others ignore it. The PHY driver does not generate the packet itself (that is a DSI-host responsibility), but tracks the setting so the DSI driver can read it back without duplicating state.
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_eotp_disabled | Do not append EoTP. |
| k_ra8_mipi_phy_eotp_enabled | Append EoTP packet. |
Definition at line 125 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_event_t : uint8_t |
Event source codes pushed through ra8_mipi_phy_event_fn_t.
The MIPI PHY itself does not raise NVIC vectors; DSI / CSI hosts forward their interrupts here and the dispatcher translates the raw DPHYSFR snapshot into one of these codes for higher-level consumers.
Definition at line 182 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_lane_count_t : uint8_t |
Number of D-PHY data lanes activated for a transfer.
HUM Ch 64.1 Table 64.1 p 3822: this part exposes "Up to 2 lanes". The DSI host (Ch 65) and CSI receiver (Ch 66) each own a separate lane-enable register; the PHY driver tracks the requested count here so callers can reason about it consistently. 1-lane and 2-lane configurations are the only legal silicon settings.
The 3-lane / 4-lane enumerators are accepted by the public API (the brief mandates "every lane configuration") but the driver returns k_ra8_err_not_supported because the silicon physically cannot drive more than 2 lanes – attempting 3/4 lanes on this MCU group is a misconfiguration that the HAL should refuse loudly rather than silently fall back.
Definition at line 64 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_lane_id_t : uint8_t |
Per-lane identifier passed to ra8_mipi_phy_set_lane_enable.
Lane 0 / Lane 1 are the two data lanes. The clock lane is implicit and always enabled when DPHYOCR.DPHYEN = 1 (HUM Ch 64.2.7 p 3827); the public API still exposes a k_ra8_mipi_phy_lane_clk value for symmetry so callers can write transfer code that loops over every lane.
Definition at line 82 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_mode_t : uint8_t |
D-PHY host vs device mode select (DPHYMDC.MASTEREN).
Mirrors HUM Ch 64.2.14 p 3836-3837 and the FSP boolean mipi_phy_cfg_t.dsi_mode: 0 = device (CSI), 1 = host (DSI).
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_mode_csi_device | Device mode used by MIPI CSI. |
| k_ra8_mipi_phy_mode_dsi_host | Host mode used by MIPI DSI. |
Definition at line 41 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_pll_idiv_t : uint8_t |
DPHYPLFCR.IDIV[1:0] – input frequency divisor.
HUM Ch 64.2.2 p 3823: divides the MOSC input. The 8..24 MHz post-divisor band must be respected (HUM 64.2.2 note p 3824).
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_idiv_1 | IDIV = 1 (no division). |
| k_ra8_mipi_phy_idiv_2 | IDIV = 1/2. |
| k_ra8_mipi_phy_idiv_3 | IDIV = 1/3. |
| k_ra8_mipi_phy_idiv_4 | IDIV = 1/4. |
Definition at line 138 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_pll_nfmul_t : uint8_t |
DPHYPLFCR.NFMUL[1:0] – fractional multiplier (NF).
| Enumerator | |
|---|---|
| k_ra8_mipi_phy_nfmul_0_00 | NF = 0.00. |
| k_ra8_mipi_phy_nfmul_0_33 | NF = 0.33. |
| k_ra8_mipi_phy_nfmul_0_66 | NF = 0.66. |
| k_ra8_mipi_phy_nfmul_0_50 | NF = 0.50. |
Definition at line 165 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_pll_pmul_t : uint8_t |
DPHYPLFCR.PMUL[1:0] – output frequency divisor.
HUM Ch 64.2.2 p 3823. Each value maps to a different VCO band (HUM 64.2.2 note p 3824). The driver enforces the band mapping via ra8_mipi_phy_validate_pll_band.
Definition at line 154 of file ra8_mipi_phy_types.h.
| enum ra8_mipi_phy_state_t : uint8_t |
Lifecycle position of the D-PHY block.
Tracks the start-up procedure (HUM Ch 64.3.1 p 3837) one stage at a time so that callers can reason about where the driver is without having to re-read DPHYSFR. State transitions follow the
Definition at line 200 of file ra8_mipi_phy_types.h.