Skip to content

Conversation

ongun-kanat-egym
Copy link

Cordoning off access to RCC registers makes implementing certain software and drivers (e.g. a bootloader for STMF0 cores need SYSCFG) unnecessarily difficult.

A completely encapsulated RCC renders peripheral enable registers inaccessible and some drivers (e.g stm32_usbd) opt for using unsafe raw pointer accesses completely eliminating the safety and the structure provided by the HAL.

This commit copies an escape hatch from stm32f4xx-hal crate by implementing Deref and DerefMut for Rcc structure. The stm32f4xx-hal implementation can be seen at the link below: https://github.com/stm32-rs/stm32f4xx-hal/blob/0ba01f4fb3f19b0eea40d8ea2403e2e9d4e41609/src/rcc/mod.rs#L56-L67

Cordoning off access to RCC registers makes implementing certain
software and drivers (e.g. a bootloader for STMF0 cores need SYSCFG)
unnecessarily difficult.

A completely encapsulated RCC renders peripheral enable registers
inaccessible and some drivers (e.g stm32_usbd) opt for using
unsafe raw pointer accesses completely eliminating the safety
and the structure provided by the HAL.

This commit copies an escape hatch from stm32f4xx-hal crate by
implementing Deref and DerefMut for Rcc structure.
The stm32f4xx-hal implementation can be seen at the link below:
https://github.com/stm32-rs/stm32f4xx-hal/blob/0ba01f4fb3f19b0eea40d8ea2403e2e9d4e41609/src/rcc/mod.rs#L56-L67
@ongun-kanat-egym
Copy link
Author

Sorry, I was misguided by the Github UI. I'd like to get a in-company review first for the commits.

@ongun-kanat-egym
Copy link
Author

I got an approval in-company review. I'm reopening it with updated changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant