|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Module-private link seam shared between the MIPI DSI-2 hostdriver translation units. More...
#include <stdint.h>#include "ra8_attributes.h"#include "ra8_err.h"#include "ra8_mipi_dsi.h"#include "ra8_mipi_dsi_regs.h"Go to the source code of this file.
Enumerations | |
| enum | ra8_mipi_dsi_internal_t : uint32_t { k_ra8_mipi_dsi_clear_all = 0xFFFFFFFFUL , k_ra8_mipi_dsi_isr_all , k_ra8_mipi_dsi_byte_mask = 0xFFUL , k_ra8_mipi_dsi_vc_mask = 0x3UL , k_ra8_mipi_dsi_dt_mask = 0x3FUL , k_ra8_mipi_dsi_bta_mask = 0x3UL } |
| Numeric constants used by the implementation that don't belong in the public header. More... | |
| enum | ra8_mipi_dsi_shifts_t : uint8_t { k_shift_8 = 8U , k_ulpssetr_wkup_shift = 0U , k_dsisetr_mrpsz_shift = 0U , k_dsisetr_vc_crc_shift = 20U , k_rxrss_data1_shift = 8U , k_rxrss_dt_shift = 16U , k_rxrss_vc_shift = 22U , k_akep_vc_shift = 16U } |
| Common shift positions used across the MIPI DSI-2 driver. More... | |
Functions | |
| ra8_err_t | priv_ra8_mipi_dsi_internal_wait_eq (volatile const uint32_t *reg, uint32_t mask, uint32_t expect) |
| Bounded poll waiting for (reg & mask) == expect. | |
Variables | |
| ra8_mipi_dsi_event_fn_t | s_mipi_dsi_event_fn |
| Single definition of the shared IRQ callback pointer. | |
| void * | s_mipi_dsi_event_ctx |
| Single definition of the shared IRQ callback context. | |
| uint8_t * | s_mipi_dsi_pending_rx_buffer |
| Single definition of the shared pending receive buffer. | |
| uint16_t | s_mipi_dsi_pending_rx_len |
| Single definition of the shared pending receive capacity. | |
Module-private link seam shared between the MIPI DSI-2 host
driver translation units.
The MIPI DSI-2 host driver is implemented across more than one translation unit so that no single file exceeds the scripts/checks/check_file_size.py cap. The configuration / link / sequence-channel path lives in ra8_mipi_dsi.c; the status, IRQ dispatch, video-mode, and convenience surfaces live in ra8_mipi_dsi_dispatch.c. A handful of file-scope mutable state words and one bounded-poll helper are read and written from both TUs.
This header is private to the MIPI DSI-2 driver only – no other module includes it. It exports:
Read-only constants (the log tag) are intentionally NOT shared: each TU keeps its own static copy with an identical initialiser.
Definition in file ra8_mipi_dsi_internal.h.
| enum ra8_mipi_dsi_internal_t : uint32_t |
Numeric constants used by the implementation that don't belong in the public header.
Following the project's "no magic numbers" rule – every literal embedded in the driver code path lives here as a typed enum value. Shared between ra8_mipi_dsi.c and ra8_mipi_dsi_dispatch.c.
Definition at line 53 of file ra8_mipi_dsi_internal.h.
| enum ra8_mipi_dsi_shifts_t : uint8_t |
Common shift positions used across the MIPI DSI-2 driver.
Shared between ra8_mipi_dsi.c and ra8_mipi_dsi_dispatch.c so both TUs agree on the bit-field positions of the link, ULPS, DSI, receive-result, and ack/error registers.
Definition at line 73 of file ra8_mipi_dsi_internal.h.
| ra8_err_t priv_ra8_mipi_dsi_internal_wait_eq | ( | volatile const uint32_t * | reg, |
| uint32_t | mask, | ||
| uint32_t | expect ) |
Bounded poll waiting for (reg & mask) == expect.
Defined in ra8_mipi_dsi.c and shared with the video-mode path in ra8_mipi_dsi_dispatch.c. Spins at most k_ra8_mipi_dsi_busy_loop_max iterations so the loop bound is statically provable (NASA Power of 10 Rule 2).
| [in] | reg | Address of the register to poll. |
| [in] | mask | Bits to test. |
| [in] | expect | Required value of reg & mask. |
| k_ra8_ok | Condition satisfied before the iteration cap. |
| k_ra8_err_hw_timeout | Cap reached without the condition holding. |
Bounded poll waiting for (reg & mask) == expect.
Definition at line 349 of file ra8_mipi_dsi.c.
References k_ra8_err_hw_timeout, k_ra8_mipi_dsi_busy_loop_max, and k_ra8_ok.
Referenced by ra8_mipi_dsi_hs_clock_start(), ra8_mipi_dsi_hs_clock_stop(), ra8_mipi_dsi_video_start(), and ra8_mipi_dsi_video_stop().
|
extern |
Single definition of the shared IRQ callback context.
Opaque context handed back to the IRQ callback.
Declared extern (with the full contract) in ra8_mipi_dsi_internal.h. Lifetime is owned by the caller of ra8_mipi_dsi_attach_handler.
Single definition lives in ra8_mipi_dsi.c. Lifetime is owned by the caller of ra8_mipi_dsi_attach_handler.
Definition at line 121 of file ra8_mipi_dsi.c.
Referenced by internal_ra8_mipi_dsi_call_user(), ra8_mipi_dsi_attach_handler(), ra8_mipi_dsi_deinit(), and ra8_mipi_dsi_init().
|
extern |
Single definition of the shared IRQ callback pointer.
Currently registered IRQ callback, or nullptr.
Declared extern (with the full contract) in ra8_mipi_dsi_internal.h and read from IRQ context in ra8_mipi_dsi_dispatch.c. Mutated only from the single-threaded init / deinit / attach-handler call sites.
Single definition lives in ra8_mipi_dsi.c. Mutated from the single-threaded init / deinit / attach-handler call sites; read from IRQ context inside ra8_mipi_dsi_dispatch.c.
Definition at line 106 of file ra8_mipi_dsi.c.
Referenced by internal_ra8_mipi_dsi_call_user(), ra8_mipi_dsi_attach_handler(), ra8_mipi_dsi_deinit(), and ra8_mipi_dsi_init().
|
extern |
Single definition of the shared pending receive buffer.
Buffer the caller passed to ra8_mipi_dsi_read_packet().
Declared extern (with the full contract) in ra8_mipi_dsi_internal.h. The receive ISR in ra8_mipi_dsi_dispatch.c copies long-packet payload bytes from RXPPD0..3R into this buffer once the response arrives, then clears it to avoid stale-pointer use.
Single definition lives in ra8_mipi_dsi.c. The receive ISR in ra8_mipi_dsi_dispatch.c copies long-packet payload bytes into this buffer once the response arrives and then clears it to avoid stale-pointer use.
Definition at line 180 of file ra8_mipi_dsi.c.
Referenced by ra8_mipi_dsi_deinit(), ra8_mipi_dsi_dispatch_receive(), ra8_mipi_dsi_init(), ra8_mipi_dsi_read_packet(), and ra8_mipi_dsi_send_command().
|
extern |
Single definition of the shared pending receive capacity.
Capacity of s_mipi_dsi_pending_rx_buffer in bytes.
Declared extern (with the full contract) in ra8_mipi_dsi_internal.h. Cleared to zero once the response is consumed by the RX dispatch.
Single definition lives in ra8_mipi_dsi.c. Cleared to zero once the response is consumed by the RX dispatch.
Definition at line 195 of file ra8_mipi_dsi.c.
Referenced by ra8_mipi_dsi_deinit(), ra8_mipi_dsi_dispatch_receive(), ra8_mipi_dsi_init(), ra8_mipi_dsi_read_packet(), and ra8_mipi_dsi_send_command().