-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add STM32 peripheral RCC enable bit enums #76
Comments
You can derive this from parsing the CMSIS-SVD files. modm parses the CMSIS header files for STM32 (since the SVD files are less accurate) and uses that to provide such an API. However, some manual fixing is still required as the mapping is a little fuzzy. |
We've integrated bit fields before for the STM32F1 AFIO remap groups, so moving the RCC bit fields into here would probably be useful. |
Yes, so basically what I'm asking is the same as what's already suggested in the modm parser/generator. |
Just FYI: I'm currently writing my master's thesis so I don't have the head space to refactor this. I'm happy to review pull requests though, if you want to give it a shot. There is an effort by me to add a much better, proper Python API to this repo, but it hasn't been a big enough priority for me to finish it: #35 |
One of the most important thing for any peripheral driver is to be able to enable the root clock for the peripheral. On STM32's this is done via RCC A[H/P]nBENR registers. It would be nice if the database contained an enum like in https://github.com/IntergatedCircuits/STM32_XPD/blob/master/STM32F0_XPD/inc/xpd_rcc.h#L78, where the position consists of a register offset from the lowest A[H/P]nBENR register, and a bit offset within the register. Then the appropriate enum values should be bound to the peripheral instances, allowing a peripheral driver to call a uniform RCC driver API to enable/reset/enable in sleep mode a peripheral.
The text was updated successfully, but these errors were encountered: