example/example.c
static void MX_ADC1_Init(void) {

    /* USER CODE BEGIN ADC1_Init 0 */

    /* USER CODE END ADC1_Init 0 */

    LL_ADC_InitTypeDef ADC_InitStruct = {0};
    LL_ADC_REG_InitTypeDef ADC_REG_InitStruct = {0};
    LL_ADC_CommonInitTypeDef ADC_CommonInitStruct = {0};

    LL_GPIO_InitTypeDef GPIO_InitStruct = {0};

    /* Peripheral clock enable */
    LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1);

    LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOA);
    /**ADC1 GPIO Configuration
    PA0-WKUP   ------> ADC1_IN0
    PA1   ------> ADC1_IN1
    PA2   ------> ADC1_IN2
    */
    GPIO_InitStruct.Pin = LL_GPIO_PIN_0 | LL_GPIO_PIN_1 | LL_GPIO_PIN_2;
    GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG;
    GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
    LL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    /* USER CODE BEGIN ADC1_Init 1 */

    /* USER CODE END ADC1_Init 1 */
    /** Common config
    */
    ADC_InitStruct.Resolution = LL_ADC_RESOLUTION_12B;
    ADC_InitStruct.DataAlignment = LL_ADC_DATA_ALIGN_RIGHT;
    ADC_InitStruct.SequencersScanMode = LL_ADC_SEQ_SCAN_DISABLE;
    LL_ADC_Init(ADC1, &ADC_InitStruct);
    ADC_REG_InitStruct.TriggerSource = LL_ADC_REG_TRIG_SOFTWARE;
    ADC_REG_InitStruct.SequencerLength = LL_ADC_REG_SEQ_SCAN_DISABLE;
    ADC_REG_InitStruct.SequencerDiscont = LL_ADC_REG_SEQ_DISCONT_DISABLE;
    ADC_REG_InitStruct.ContinuousMode = LL_ADC_REG_CONV_SINGLE;
    ADC_REG_InitStruct.DMATransfer = LL_ADC_REG_DMA_TRANSFER_NONE;
    LL_ADC_REG_Init(ADC1, &ADC_REG_InitStruct);
    LL_ADC_REG_SetFlagEndOfConversion(ADC1, LL_ADC_REG_FLAG_EOC_UNITARY_CONV);
    ADC_CommonInitStruct.CommonClock = LL_ADC_CLOCK_SYNC_PCLK_DIV4;
    LL_ADC_CommonInit(__LL_ADC_COMMON_INSTANCE(ADC1), &ADC_CommonInitStruct);
    /** Configure Regular Channel
    */
    LL_ADC_REG_SetSequencerRanks(ADC1, LL_ADC_REG_RANK_1, LL_ADC_CHANNEL_0);
    LL_ADC_SetChannelSamplingTime(ADC1, LL_ADC_CHANNEL_0, LL_ADC_SAMPLINGTIME_3CYCLES);
    /* 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) {
    LL_ADC_InitTypeDef ADC_InitStruct = {0};
    LL_ADC_REG_InitTypeDef ADC_REG_InitStruct = {0};
    LL_ADC_CommonInitTypeDef ADC_CommonInitStruct = {0};
    LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
    LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1);
    LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOA);
    GPIO_InitStruct.Pin = LL_GPIO_PIN_0 | LL_GPIO_PIN_1 | LL_GPIO_PIN_2;
    GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG;
    GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
    LL_GPIO_Init(GPIOA, &GPIO_InitStruct);
    ADC_InitStruct.Resolution = LL_ADC_RESOLUTION_12B;
    ADC_InitStruct.DataAlignment = LL_ADC_DATA_ALIGN_RIGHT;
    ADC_InitStruct.SequencersScanMode = LL_ADC_SEQ_SCAN_DISABLE;
    LL_ADC_Init(ADC1, &ADC_InitStruct);
    ADC_REG_InitStruct.TriggerSource = LL_ADC_REG_TRIG_SOFTWARE;
    ADC_REG_InitStruct.SequencerLength = LL_ADC_REG_SEQ_SCAN_DISABLE;
    ADC_REG_InitStruct.SequencerDiscont = LL_ADC_REG_SEQ_DISCONT_DISABLE;
    ADC_REG_InitStruct.ContinuousMode = LL_ADC_REG_CONV_SINGLE;
    ADC_REG_InitStruct.DMATransfer = LL_ADC_REG_DMA_TRANSFER_NONE;
    LL_ADC_REG_Init(ADC1, &ADC_REG_InitStruct);
    LL_ADC_REG_SetFlagEndOfConversion(ADC1, LL_ADC_REG_FLAG_EOC_UNITARY_CONV);
    ADC_CommonInitStruct.CommonClock = LL_ADC_CLOCK_SYNC_PCLK_DIV4;
    LL_ADC_CommonInit(__LL_ADC_COMMON_INSTANCE(ADC1), &ADC_CommonInitStruct);
    LL_ADC_REG_SetSequencerRanks(ADC1, LL_ADC_REG_RANK_1, LL_ADC_CHANNEL_0);
    LL_ADC_SetChannelSamplingTime(ADC1, LL_ADC_CHANNEL_0, LL_ADC_SAMPLINGTIME_3CYCLES);
}
static void MX_ADC1_Init ( void ) { LL_ADC_InitTypeDef ADC_InitStruct = { 0 } ; LL_ADC_REG_InitTypeDef ADC_REG_InitStruct = { 0 } ; LL_ADC_CommonInitTypeDef ADC_CommonInitStruct = { 0 } ; LL_GPIO_InitTypeDef GPIO_InitStruct = { 0 } ; LL_APB2_GRP1_EnableClock ( LL_APB2_GRP1_PERIPH_ADC1 ) ; LL_AHB1_GRP1_EnableClock ( LL_AHB1_GRP1_PERIPH_GPIOA ) ; GPIO_InitStruct . Pin = LL_GPIO_PIN_0 | LL_GPIO_PIN_1 | LL_GPIO_PIN_2 ; GPIO_InitStruct . Mode = LL_GPIO_MODE_ANALOG ; GPIO_InitStruct . Pull = LL_GPIO_PULL_NO ; LL_GPIO_Init ( GPIOA , & GPIO_InitStruct ) ; ADC_InitStruct . Resolution = LL_ADC_RESOLUTION_12B ; ADC_InitStruct . DataAlignment = LL_ADC_DATA_ALIGN_RIGHT ; ADC_InitStruct . SequencersScanMode = LL_ADC_SEQ_SCAN_DISABLE ; LL_ADC_Init ( ADC1 , & ADC_InitStruct ) ; ADC_REG_InitStruct . TriggerSource = LL_ADC_REG_TRIG_SOFTWARE ; ADC_REG_InitStruct . SequencerLength = LL_ADC_REG_SEQ_SCAN_DISABLE ; ADC_REG_InitStruct . SequencerDiscont = LL_ADC_REG_SEQ_DISCONT_DISABLE ; ADC_REG_InitStruct . ContinuousMode = LL_ADC_REG_CONV_SINGLE ; ADC_REG_InitStruct . DMATransfer = LL_ADC_REG_DMA_TRANSFER_NONE ; LL_ADC_REG_Init ( ADC1 , & ADC_REG_InitStruct ) ; LL_ADC_REG_SetFlagEndOfConversion ( ADC1 , LL_ADC_REG_FLAG_EOC_UNITARY_CONV ) ; ADC_CommonInitStruct . CommonClock = LL_ADC_CLOCK_SYNC_PCLK_DIV4 ; LL_ADC_CommonInit ( __LL_ADC_COMMON_INSTANCE ( ADC1 ) , & ADC_CommonInitStruct ) ; LL_ADC_REG_SetSequencerRanks ( ADC1 , LL_ADC_REG_RANK_1 , LL_ADC_CHANNEL_0 ) ; LL_ADC_SetChannelSamplingTime ( ADC1 , LL_ADC_CHANNEL_0 , LL_ADC_SAMPLINGTIME_3CYCLES ) ; }
@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 */ /* Peripheral clock enable */ /**ADC1 GPIO Configuration
    PA0-WKUP   ------> ADC1_IN0
    PA1   ------> ADC1_IN1
    PA2   ------> ADC1_IN2
    */ /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Common config
    */ /** Configure Regular Channel
    */ /* USER CODE BEGIN ADC1_Init 2 */ /* USER CODE END ADC1_Init 2 */