Skip to content

Commit 0312c3c

Browse files
authored
Update HALConfig.cpp
Added hal_enable_dual_mode() routine to access LL driver.
1 parent 817c33d commit 0312c3c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/HALConfig.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ static uint32_t ADC_RANK_LUT[] = {
166166
ADC_REGULAR_RANK_1, ADC_REGULAR_RANK_2, ADC_REGULAR_RANK_3, ADC_REGULAR_RANK_4, ADC_REGULAR_RANK_5
167167
};
168168

169+
int hal_enable_dual_mode()
170+
{
171+
LL_ADC_SetMultimode(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_MULTI_DUAL_REG_SIMULT);
172+
return(1);
173+
}
174+
169175
int hal_adc_config(ADC_HandleTypeDef *adc, uint32_t resolution, uint32_t trigger, PinName *adc_pins, uint32_t n_channels) {
170176
// Set ADC clock source.
171177
__HAL_RCC_ADC_CONFIG(RCC_ADCCLKSOURCE_CLKP);

0 commit comments

Comments
 (0)