1˵
    1ADCPA5ԶעPA4ŵģѹTIM1 CC2¼´
    2йתͨDMA_CH1ͨȡADC_RegularConvertedValueTab[32]
           עתͨתж϶ȡADC_InjectedConvertedValueTab[32]
2ʹû
      KEIL MDK-ARM V5.30.0.0
    Ӳ      N32G031C8L7-STB V1.0
3ʹ˵
    ϵͳã
        1ʱԴ
                    HSE=8M,PLL=48M,AHB=48M,APB1=48M,APB2=48M,ADC CLK=48M/16,ADC 1M CLK=HSI/8,DMA CLK=48M
        2жϣ
                    ADCעתжϴ, ȼ0
                    жϺнעȡADC_InjectedConvertedValueTab[32]飬תPA6ƽ
        3˿ã
                    PA4ѡΪģ⹦ADCתͨ
                    PA5ѡΪģ⹦ADCתͨ
                    PA6ѡΪͨIO
                    PA9ѡΪTIM1 CH2 PWM
        4DMA
                    DMA_CH1ͨѭģʽ32ֵADC1תADC_RegularConvertedValueTab[32]
        5ADC
                    ADC TIM1 CC212λҶ룬תͨPA5ԶעתͨPA4ģѹ
        6TIM
                    TIM1CH2CH2ADCת        
    ʹ÷
        1򿪵ģʽADC_RegularConvertedValueTab[32],ADC_InjectedConvertedValueTab[32]ӵwatchڹ۲
        2ͨıPA4 PA5ŵĵѹÿCC2¼ʱתһιעͨڶӦСͬʱPA9 ԿTIM1 CH2 PWM 
4ע
    ϵͳHSEʱʱһHSIҲǴ򿪵ģRCC_ConfigAdc1mClk(RCC_ADC1MCLK_SRC_HSE, RCC_ADC1MCLK_DIV8)ΪHSEHSI
    ϵͳHSIʱʱһHSEǹرյģRCC_ConfigAdc1mClk(RCC_ADC1MCLK_SRC_HSI, RCC_ADC1MCLK_DIV8)ֻΪHSI


1. Function description
    1. The ADC regularly samples PA5, automatically injects and samples the analog voltage of the PA4 pin, and triggers sampling under the TIM1 CC2 event
    2. The regular conversion result is read into the variable ADC_RegularConvertedValueTab[32] array through the DMA_CH1 channel
           The result of the injection conversion is read into the variable ADC_InjectedConvertedValueTab[32] array through the conversion end interrupt

2. Use environment
    Software development environment: KEIL MDK-ARM V5.30.0.0
    Hardware environment: Developed based on the development board N32G031C8L7-STB V1.0

3. Instructions for use
    System Configuration;
        1. Clock source:
                    HSE=8M, PLL=48M, AHB=48M, APB1=48M, APB2=48M, ADC CLK=48M/16, ADC 1M CLK=HSI/8, DMA CLK=48M
        2. Interrupt:
                    ADC injection conversion result complete interrupt is turned on, interrupt priority is 0
                    In the interrupt function, the injection result is read into the ADC_InjectedConvertedValueTab[32] array, and the PA6 level is flipped
        3. Port configuration:
                    PA4 is selected as the analog function, ADC conversion channel
                    PA5 is selected as the analog function, ADC conversion channel
                    PA6 is selected as general IO output
                    PA9 is selected as TIM1 CH2 PWM output
        4. DMA:
                    DMA1_CH1 channel is configuered as circular mode,carries 32 half-word ADC1 conversion results to ADC_RegularConvertedValueTab[32] array
        5. ADC:
                    ADC configuration: TIM1 CC2 trigger, 12-bit data right-aligned, regular conversion channel PA5, automatic injection of analog voltage data of conversion channel PA4
        6. TIM:
                    TIM1 turns on CH2 output, and CH2 is used to trigger ADC conversion
    Instructions:
        1. Open the debug mode after compiling and add the variables ADC_RegularConvertedValueTab[32], ADC_InjectedConvertedValueTab[32] to the watch window for observation
        2. By changing the voltage of the PA4 PA5 pin, the rule and injection channel are converted once every CC2 event occurs, and the variables are stored in the corresponding array. At the same time, you can see the PWM waveform of TIM1 CH2 on PA9

4. Matters needing attention
    When the system uses the HSE clock (HSI is generally enabled), ), RCC_ConfigAdc1mClk (RCC_ADC1MCLK_SRC_HSE, RCC_ADC1MCLK_DIV8) can be configured as HSE or HSI
    When the system uses the HSI clock(HSE is generally disabled), RCC_ConfigAdc1mClk(RCC_ADC1MCLK_SRC_HSI, RCC_ADC1MCLK_DIV8) can only be configured as HSI