From c7666a7cd83d590a067d8cbbe4a7e4eb93d155d6 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Wed, 15 Sep 2021 17:45:46 +0000 Subject: adc: stm32wb: add old style ADC has not been converted to new style, so leveraging legacy f3 code for now. Signed-off-by: Karl Palsson --- adc/adc_f3.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/adc/adc_f3.h b/adc/adc_f3.h index bc75711..1f9f98e 100644 --- a/adc/adc_f3.h +++ b/adc/adc_f3.h @@ -8,7 +8,7 @@ struct ADC_t { volatile uint32_t IER; volatile uint32_t CR; volatile uint32_t CFGR; - uint32_t _reserved; + volatile uint32_t CFGR2; volatile uint32_t SMPR1; volatile uint32_t SMPR2; uint32_t _reserved1; @@ -41,11 +41,20 @@ struct ADC_t { volatile uint32_t CALFACT; }; +struct ADC_COMMON_t { + volatile uint32_t CSR; + uint32_t _reserved1; + volatile uint32_t CCR; +}; + #if defined(STM32F3) static ADC_t& ADC1 = *(ADC_t*)0x50000000; static ADC_t& ADC2 = *(ADC_t*)0x50000100; static ADC_t& ADC3 = *(ADC_t*)0x50000400; static ADC_t& ADC4 = *(ADC_t*)0x50000500; +#elif defined(STM32WB) +static ADC_t& ADC1 = *(ADC_t*)0x50040000; +static ADC_COMMON_t& ADC_COMMON = *(ADC_COMMON_t*)0x50040300; #endif #endif -- cgit v1.2.3