Core/Src/main.c
static void MX_ADC1_Init(void)
{

  /* USER CODE BEGIN ADC1_Init 0 */

  /* USER CODE END ADC1_Init 0 */

  ADC_MultiModeTypeDef multimode = {0};
  ADC_ChannelConfTypeDef sConfig = {0};

  /* USER CODE BEGIN ADC1_Init 1 */

  /* USER CODE END ADC1_Init 1 */
  /** Common config
  */
  hadc1.Instance = ADC1;
  hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV256;
  hadc1.Init.Resolution = ADC_RESOLUTION_16B;
  hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
  hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
  hadc1.Init.LowPowerAutoWait = DISABLE;
  hadc1.Init.ContinuousConvMode = DISABLE;
  hadc1.Init.NbrOfConversion = 3;
  hadc1.Init.DiscontinuousConvMode = DISABLE;
  hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
  hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
  hadc1.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DR;
  hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED;
  hadc1.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;
  hadc1.Init.OversamplingMode = DISABLE;
  if (HAL_ADC_Init(&hadc1) != HAL_OK)
  {
    Error_Handler();
  }
  /** Configure the ADC multi-mode
  */
  multimode.Mode = ADC_MODE_INDEPENDENT;
  if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK)
  {
    Error_Handler();
  }
  /** Configure Regular Channel
  */
  sConfig.Channel = ADC_CHANNEL_15;
  sConfig.Rank = ADC_REGULAR_RANK_1;
  sConfig.SamplingTime = ADC_SAMPLETIME_810CYCLES_5;
  sConfig.SingleDiff = ADC_SINGLE_ENDED;
  sConfig.OffsetNumber = ADC_OFFSET_NONE;
  sConfig.Offset = 0;
  sConfig.OffsetSignedSaturation = DISABLE;
  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
  {
    Error_Handler();
  }
  /** Configure Regular Channel
  */
  sConfig.Channel = ADC_CHANNEL_10;
  sConfig.Rank = ADC_REGULAR_RANK_2;
  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
  {
    Error_Handler();
  }
  /** Configure Regular Channel
  */
  sConfig.Channel = ADC_CHANNEL_5;
  sConfig.Rank = ADC_REGULAR_RANK_3;
  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
  {
    Error_Handler();
  }
  /* USER CODE BEGIN ADC1_Init 2 */

  /* USER CODE END ADC1_Init 2 */

}
/**
  * @brief ADC1 Initialization Function
  * @param None
  * @retval None
  */
@brief ADC1 Initialization Function
@param None
@retval None
@brief ADC1 Initialization Function @param None @retval None
static void MX_ADC1_Init(void)
{
  ADC_MultiModeTypeDef multimode = {0};
  ADC_ChannelConfTypeDef sConfig = {0};
  hadc1.Instance = ADC1;
  hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV256;
  hadc1.Init.Resolution = ADC_RESOLUTION_16B;
  hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
  hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
  hadc1.Init.LowPowerAutoWait = DISABLE;
  hadc1.Init.ContinuousConvMode = DISABLE;
  hadc1.Init.NbrOfConversion = 3;
  hadc1.Init.DiscontinuousConvMode = DISABLE;
  hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
  hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
  hadc1.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DR;
  hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED;
  hadc1.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;
  hadc1.Init.OversamplingMode = DISABLE;
  if (HAL_ADC_Init(&hadc1) != HAL_OK)
  {
    Error_Handler();
  }
  multimode.Mode = ADC_MODE_INDEPENDENT;
  if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK)
  {
    Error_Handler();
  }
  sConfig.Channel = ADC_CHANNEL_15;
  sConfig.Rank = ADC_REGULAR_RANK_1;
  sConfig.SamplingTime = ADC_SAMPLETIME_810CYCLES_5;
  sConfig.SingleDiff = ADC_SINGLE_ENDED;
  sConfig.OffsetNumber = ADC_OFFSET_NONE;
  sConfig.Offset = 0;
  sConfig.OffsetSignedSaturation = DISABLE;
  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
  {
    Error_Handler();
  }
  sConfig.Channel = ADC_CHANNEL_10;
  sConfig.Rank = ADC_REGULAR_RANK_2;
  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
  {
    Error_Handler();
  }
  sConfig.Channel = ADC_CHANNEL_5;
  sConfig.Rank = ADC_REGULAR_RANK_3;
  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
  {
    Error_Handler();
  }
}
static void MX_ADC1_Init ( void ) { ADC_MultiModeTypeDef multimode = { 0 } ; ADC_ChannelConfTypeDef sConfig = { 0 } ; hadc1 . Instance = ADC1 ; hadc1 . Init . ClockPrescaler = ADC_CLOCK_ASYNC_DIV256 ; hadc1 . Init . Resolution = ADC_RESOLUTION_16B ; hadc1 . Init . ScanConvMode = ADC_SCAN_ENABLE ; hadc1 . Init . EOCSelection = ADC_EOC_SINGLE_CONV ; hadc1 . Init . LowPowerAutoWait = DISABLE ; hadc1 . Init . ContinuousConvMode = DISABLE ; hadc1 . Init . NbrOfConversion = 3 ; hadc1 . Init . DiscontinuousConvMode = DISABLE ; hadc1 . Init . ExternalTrigConv = ADC_SOFTWARE_START ; hadc1 . Init . ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE ; hadc1 . Init . ConversionDataManagement = ADC_CONVERSIONDATA_DR ; hadc1 . Init . Overrun = ADC_OVR_DATA_PRESERVED ; hadc1 . Init . LeftBitShift = ADC_LEFTBITSHIFT_NONE ; hadc1 . Init . OversamplingMode = DISABLE ; if ( HAL_ADC_Init ( & hadc1 ) != HAL_OK ) { Error_Handler ( ) ; } multimode . Mode = ADC_MODE_INDEPENDENT ; if ( HAL_ADCEx_MultiModeConfigChannel ( & hadc1 , & multimode ) != HAL_OK ) { Error_Handler ( ) ; } sConfig . Channel = ADC_CHANNEL_15 ; sConfig . Rank = ADC_REGULAR_RANK_1 ; sConfig . SamplingTime = ADC_SAMPLETIME_810CYCLES_5 ; sConfig . SingleDiff = ADC_SINGLE_ENDED ; sConfig . OffsetNumber = ADC_OFFSET_NONE ; sConfig . Offset = 0 ; sConfig . OffsetSignedSaturation = DISABLE ; if ( HAL_ADC_ConfigChannel ( & hadc1 , & sConfig ) != HAL_OK ) { Error_Handler ( ) ; } sConfig . Channel = ADC_CHANNEL_10 ; sConfig . Rank = ADC_REGULAR_RANK_2 ; if ( HAL_ADC_ConfigChannel ( & hadc1 , & sConfig ) != HAL_OK ) { Error_Handler ( ) ; } sConfig . Channel = ADC_CHANNEL_5 ; sConfig . Rank = ADC_REGULAR_RANK_3 ; if ( HAL_ADC_ConfigChannel ( & hadc1 , & sConfig ) != HAL_OK ) { Error_Handler ( ) ; } }
@brief ADC1 Initialization Function
 @param None
 @retval None
@brief ADC1 Initialization Function @param None @retval None
/* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Common config
  */ /** Configure the ADC multi-mode
  */ /** Configure Regular Channel
  */ /** Configure Regular Channel
  */ /** Configure Regular Channel
  */ /* USER CODE BEGIN ADC1_Init 2 */ /* USER CODE END ADC1_Init 2 */