embassy-rs / stm32-data

66 stars 94 forks source link

Add registers for SDADC #487

Closed Stupremee closed 2 weeks ago

Stupremee commented 1 month ago

This pull requests adds the register block for the Sigma-Delta ADC on the STM32F373 and STM32F301. The documentation for the registers can be found in RM0313 I've never done a pull request to this repository, so I hope I've done everything correctly.

Before merging, there are a few open questions I have:

embassy-ci[bot] commented 1 month ago

diff: https://ci.embassy.dev/jobs/e0a0289a0bc4/artifacts/diff.html

embassy-ci[bot] commented 1 month ago

diff: https://ci.embassy.dev/jobs/03d9764a25bb/artifacts/diff.html

embassy-ci[bot] commented 1 month ago

diff: https://ci.embassy.dev/jobs/ff94d9a0bb2d/artifacts/diff.html

Dirbaio commented 2 weeks ago

I want to remove the {R,J}DATA{12,13}R registers, because they only exist on the SDADC1 instance, and are not really necessary because they are just mirrors for the registers from other instances. Is there a way to do that via the transformations or can I do this manually?

what we usually do is just keep the registers. it's up to higher layers (the HAL) to know they can't access some.

In the reference manual, there is a "Register Write protection" table for some registers, how is stuff like this handled inside this crate?

there's the access field on registers, but it can't dynamically protect based on the value of other regs. so let's just leave them as readwrite and leave higher layers to handle it too.