Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ADC_SetActiveChannel(ADC_HandleTypeDef *hadc, uint32_t AdcChannel) {
- ADC_ChannelConfTypeDef sConfig = {0};
- sConfig.Channel = AdcChannel;
- sConfig.Rank = 1;
- sConfig.SamplingTime = ADC_SAMPLETIME_12CYCLES_5;
- if (HAL_ADC_ConfigChannel(hadc, &sConfig) != HAL_OK)
- {
- Error_Handler();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement