Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#8 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
c
Área
embedded-iot

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C
Estrellas
19
Forks
6
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de STMicroelectronics/STM32CubeMP2

Todos los issues de STMicroelectronics/STM32CubeMP2

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.