Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[HAL][DSI] Provide a way to get the HAL_DSI_DataRate entry matching a lane rate

Aperta
#8 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
c
Ambito
embedded-iot

Direzione di ricerca

Start by reviewing the referenced pull request, then inspect stm32mp2xx_hal_dsi.c and stm32mp2xx_hal_dsi.h where the helper and prototype would belong. Check the existing HAL_DSI_DataRate enumeration and confirm the requested NULL handling and lane-rate boundary behavior. Done means the public API is implemented consistently with the enumeration and validated by the project’s available checks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Context

On STM32MP2, HAL_DSI_Init() uses DSI_InitTypeDef.PhyDataRate to select the PLL
and PHY regulation settings. This field is of type HAL_DSI_DataRate, whose values
are plain indexes (HAL_DSI_DT_80, HAL_DSI_DT_90, ... HAL_DSI_DT_2500). The lane
rate of each entry only appears in the enumerator names. The table of rates is not
exposed by the HAL.

Problem

A driver that computes the DSI lane rate at runtime from the PLL configuration (for
example the Zephyr STM32 LTDC/DSI display driver, which derives it from the
devicetree clock settings) has to pick the matching HAL_DSI_DataRate entry. The only
way to do that today is to copy the full list of rates (63 entries, from 80 to
2500 Mbps) into the driver and keep it in sync with the enumeration by hand.

This duplicates HAL-internal knowledge in every user and can break silently if the
enumeration changes in a future STM32CubeMP2 release.

Proposal

Add a helper to the DSI HAL that returns the HAL_DSI_DataRate entry for a given lane
rate, so the table stays next to the enumeration it describes:

HAL_StatusTypeDef HAL_DSI_GetPhyDataRate(uint32_t LaneRateMbps,
                                         HAL_DSI_DataRate *PhyDataRate);
  • Returns HAL_ERROR if PhyDataRate is NULL.
  • Returns HAL_DSI_DT_2500 for lane rates of 2450 Mbps and above.
  • The result can be written directly to DSI_InitTypeDef.PhyDataRate.

A reference implementation (about 40 lines in stm32mp2xx_hal_dsi.c plus a prototype
in stm32mp2xx_hal_dsi.h) is available here:
Pull request

Motivation / downstream

We plan to carry this change as a local patch in Zephyr's hal_stm32 module
(stm32cube/stm32mp2xx, based on STM32CubeMP2 v1.3.0) for the STM32MP2 DSI driver.
Zephyr asks that such patches be reported upstream first. Having this API (or an
equivalent, such as exposing the rate table) in STM32CubeMP2 would let us drop the
patch at the next Cube update.

We would also like to know if ST prefers another approach, for example a macro or a
public table.

Lingua principale
C
Stelle
19
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di STMicroelectronics/STM32CubeMP2

Tutte le issue di STMicroelectronics/STM32CubeMP2

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.