Advertisement
slotamarcin

Untitled

Oct 23rd, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. void ADC_SetActiveChannel(ADC_HandleTypeDef *hadc, uint32_t AdcChannel) {
  2. ADC_ChannelConfTypeDef sConfig = {0};
  3. sConfig.Channel = AdcChannel;
  4. sConfig.Rank = 1;
  5. sConfig.SamplingTime = ADC_SAMPLETIME_12CYCLES_5;
  6. if (HAL_ADC_ConfigChannel(hadc, &sConfig) != HAL_OK)
  7. {
  8. Error_Handler();
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement