diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2022-12-13 12:36:26 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2023-01-17 18:22:21 -0500 |
commit | cef0b70c8814b67a376d2574e62b8e221cc94e89 (patch) | |
tree | 20773f7020f45be14a6162478224c1abd1b07c1a /src/stm32/stm32g4.c | |
parent | 1034f191348fb58a34ff2dbcfc37bf3976f54c68 (diff) | |
download | kutter-cef0b70c8814b67a376d2574e62b8e221cc94e89.tar.gz kutter-cef0b70c8814b67a376d2574e62b8e221cc94e89.tar.xz kutter-cef0b70c8814b67a376d2574e62b8e221cc94e89.zip |
stm32: Move clock line mapping from stm32h7_adc.c to lookup_clock_line()
Use the common lookup_clock_line() code to lookup the adc clock lines.
This also enables resets on the adc1/adc2 hardware block.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/stm32g4.c')
-rw-r--r-- | src/stm32/stm32g4.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stm32/stm32g4.c b/src/stm32/stm32g4.c index 4ed8bc6c..aed9ed8f 100644 --- a/src/stm32/stm32g4.c +++ b/src/stm32/stm32g4.c @@ -43,6 +43,10 @@ lookup_clock_line(uint32_t periph_base) .bit = 1 << pos}; } else { + if (periph_base == ADC12_COMMON_BASE) + return (struct cline){.en = &RCC->AHB2ENR, + .rst = &RCC->AHB2RSTR, + .bit = RCC_AHB2ENR_ADC12EN}; uint32_t pos = (periph_base - AHB2PERIPH_BASE) / 0x400; return (struct cline){.en = &RCC->AHB2ENR, .rst = &RCC->AHB2RSTR, |