/******************
function name:ADC1_GPIO_Config()
discribe :ADC1 config function
(1)enable ADC,GPIO,DMA's clock,
(2)ADC1's IO is PC1,Mode is analog
input(AIN)
input:null
output:null
return: null
*******************/
void ADC1_GPIO_Config(void)
{
/*******config DMA channel 1 ********/
DMA_DeInit(DMA_Channel1); //reset DMA channel register
//define the peripheral base address
DMA_InitStructure.DMA_PeripheralBaseAddr=ADC1_DR_Address;
//define the memory base address
DMA_InitStructure.DMA_MemoryBaseAddr=(u32)&ADC1_ConvertedValue;
//choose the peripheral is the destination or source
DMA_InitStructure.DMA_DIR=DMA_DIR_PeripheralSRC;
//set the DMA buffer size 缓存大小
DMA_InitStructure.DMA_BufferSize=1; //16bits
//set the peripheral address register is incremented or not 递增与否
DMA_InitStructure.DMA_PeripheralInc=DMA_PeripheralInc_Disable;
//set the memory address register is incremented or not
DMA_InitStructure.DMA_MemoryInc=DMA_MemoryInc_Disable;
//set the peripheral data size as 16bits(halfword)
DMA_InitStructure.DMA_PeripheralDataSize=DMA_PeripheralDataSize_HlafWord;
//set the memory data size
DMA_InitStructure.DMA_MemoryDataSize=DMA_MemoryDataSize_HlafWord;
//set DMA mode
DMA_InitStructure.DMA_Mode=DMA_Mode_Circular;
//set the channel priority
DMA_InitStructure.DMA_Priority=DMA_Priority_High;
//enable the DMA memory to memory transfer
DMA_InitStructure.DMA_M2M=DMA_M2M_Disable;