Board based instantiation of chip drivers and interrupt mappings: Stm32f3 #2187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Overview
This pull request ports the stm32f3xx chip and the stm32f3discovery board to the new peripheral instantiation approach that does not rely on global variables (first proposed in #2069).
This chip was more challenging than most of the previous ones I have switched over, because it extensively relied on shared use of global statics for GPIO Pins / Ports, the clock manager (RCC), and the interrupt controller (EXTI). As a result I had to do a semi-significant refactoring of the GPIO driver to not rely on the assumption that references to gpio pins could be created from anywhere. The GPIO driver is now closer to the design of the GPIO driver for most other chips, but the "ports" and "pins" are still stored separately so that I could minimize the total amount of code I had to change.
Bright side: This PR removes 60 uses of
unsafe
across thestm32f3xx
andstm32f3discovery
crates!Testing Strategy
This pull request was tested by compiling. But there are enough changes in this PR that hardware testing would be greatly appreciated.
TODO or Help Wanted
N/A
Documentation Updated
Formatting
make prepush
.