1˵
    1ADCתPA1ŵģѹ
    2ADCתͨDMA_CH1ͨȡADCConvertedValue
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˿ã
                    PA1ѡΪģ⹦ADCתͨ1
        3DMA
                    DMA_CH1ͨѭģʽһֵADCתADCConvertedValue
        4ADC
                    ADCתɨģʽ12λҶ룬תͨ1PA1ģѹ
    ʹ÷
        1򿪵ģʽADCConvertedValueӵwatchڹ۲
        2ͨıPA1ŵĵѹԿתͬı
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. ADC samples and converts the analog voltage of the PA1 pin
    2. The ADC conversion result is read to the variable ADCConvertedValue through the DMA_CH1 channel

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. Port configuration:
                    PA1 is selected as analog function, ADC conversion channel 1
        3. DMA:
                    DMA1_CH1 channel is configuered as circular mode, carries a half-word ADC conversion result to ADCConvertedValue variable
        4. ADC:
                    ADC configuration: continuous conversion, scan mode, software trigger, 12-bit data right-aligned, conversion channel 1 is the analog voltage data of PA1
    Instructions:
        1. Open the debug mode after compiling and add the variable ADCConvertedValue to the watch window for observation
        2. By changing the voltage of the PA1 pin, you can see that the conversion result variable changes synchronously

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