embassy-rs / stm32-data

76 stars 116 forks source link

Add missing STM32U5 SYSCFG and PWR registers #538

Closed MDr164 closed 2 weeks ago

MDr164 commented 2 weeks ago

This adds some missing register definitions as noted in #519 to enable the USB OTG_HS PHY on some STM32U5 platforms.

Dirbaio commented 2 weeks ago

lgtm, any reason it's draft?

MDr164 commented 2 weeks ago

Those registers are not available on all STM32U5 chips, only the ones with an internal USB OTG_HS PHY. Not sure if there needs to be some check somewhere?

MDr164 commented 2 weeks ago

lgtm, any reason it's draft?

I'm not sure if I need to implement handling of this note from the datasheet here:

This bit is only available on some devices in the STM32U5 Series. Refer to the device datasheet for availability of its associated peripheral. If not present, consider this bit reserved and keep it at reset value.

Dirbaio commented 2 weeks ago

no need! we usually "merge" all the syscfg, rcc registers from a family into a single version, otherwise there'd be way too many versions. The user/hal is trusted to not access those on chips where they're not present.

(Only need to split is when they're actually incompatible, for example bit X is at one address in chip A and in another in chip B)