Add support for STM32G0

This commit is contained in:
Ben Gamari
2021-07-30 16:48:13 -04:00
committed by Dario Nieuwenhuis
parent 174c51f097
commit e2f71ffbbd
7 changed files with 354 additions and 12 deletions

View File

@ -444,7 +444,9 @@ pub fn gen(options: Options) {
Some(clock) => clock.as_str(),
None => {
// No clock was specified, derive the clock name from the enable register name.
Regex::new("([A-Z]+\\d*).*")
// N.B. STM32G0 has only one APB bus but split ENR registers
// (e.g. APBENR1).
Regex::new("([A-Z]+\\d*)ENR\\d*")
.unwrap()
.captures(enable_reg)
.unwrap()