Commit 1dbe8e8
committed
Implement Deref and DerefMut for Rcc
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-L671 parent 8eda864 commit 1dbe8e8
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
48 | 64 | | |
49 | 65 | | |
50 | 66 | | |
| |||
0 commit comments