japaric / stm32f103xx-hal

HAL for the STM32F103xx family of microcontrollers
Apache License 2.0
115 stars 40 forks source link

Make RCC enr() and rstr() public #46

Open burrbull opened 6 years ago

burrbull commented 6 years ago

Functions for enable, reset peripherals can be used in other crates or in main.

japaric commented 6 years ago

Thanks for the PR, @burrbull.

I'd rather not make these public as they would let you break all the other abstractions. For example, you create / initialize an instance of Serial but a*b.rstr() lets you reset peripherals and undo the Serial configuration.

Is there a specific use case that you need these changes for? Perhaps there's some other way to achieve it.