@@ -110,7 +110,6 @@ const PinName digitalPin[] = {
110
110
ANA_1, // A3 - D22, D50 - ADC1_INP1
111
111
PC_3, // A4 - D23, D51 - ADC1_INP13, or PA_12 (D14) with SB23 ON / SB24 OFF
112
112
PF_12 // A5 - D24, D52 - ADC1_INP6, or PA_11 (D15) with SB25 ON / SB26 OFF
113
- // // Duplicated pins in order to be aligned with PinMap_ADC
114
113
};
115
114
116
115
#ifdef __cplusplus
@@ -150,6 +149,7 @@ void SystemClock_Config(void)
150
149
151
150
RCC_OscInitTypeDef RCC_OscInitStruct = {};
152
151
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
152
+ RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
153
153
154
154
/* *Configure LSE Drive Capability
155
155
*/
@@ -254,6 +254,19 @@ void SystemClock_Config(void)
254
254
/* *Set the HSE division factor for RTC clock
255
255
*/
256
256
__HAL_RCC_RTC_HSEDIV (24 );
257
+
258
+ /* Configure ADCx clock prescaler */
259
+ PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
260
+ PeriphClkInit.AdcClockSelection = RCC_ADCCLKSOURCE_PER;
261
+ if (HAL_RCCEx_PeriphCLKConfig (&PeriphClkInit) != HAL_OK) {
262
+ Error_Handler ();
263
+ }
264
+
265
+ /* Configure VREFBUF */
266
+ __HAL_RCC_VREF_CLK_ENABLE ();
267
+ HAL_SYSCFG_VREFBUF_HighImpedanceConfig (SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE);
268
+ HAL_SYSCFG_EnableVREFBUF ();
269
+
257
270
}
258
271
259
272
#ifdef __cplusplus
0 commit comments