DMA_InitTypeDef DMA_InitStruct;
//打开DMA的时钟
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1,ENABLE);
//
//参数初始化 )
DMA_InitStruct.DMA_PeripheralBaseAddr=(0x40012400+0x4c); /*!< Specifies the peripheral base address for DMAy Channelx. */
DMA_InitStruct.DMA_MemoryBaseAddr=(u32)&adc_buf; /*!< Specifies the memory base address for DMAy Channelx. */
DMA_InitStruct.DMA_DIR=DMA_DIR_PeripheralSRC; /*!< Specifies if the peripheral is the source or destination.
This parameter can be a value of @ref DMA_data_transfer_direction */
DMA_InitStruct.DMA_BufferSize=64; /*!< Specifies the buffer size, in data unit, of the specified Channel.
The data unit is equal to the configuration set in DMA_PeripheralDataSize
or DMA_MemoryDataSize members depending in the transfer direction. */
DMA_InitStruct.DMA_PeripheralInc=DMA_PeripheralInc_Disable; /*!< Specifies whether the Peripheral address register is incremented or not.
This parameter can be a value of @ref DMA_peripheral_incremented_mode */
//DMA_PeripheralInc_Disable;
DMA_InitStruct.DMA_MemoryInc=DMA_PeripheralInc_Enable; /*!< Specifies whether the memory address register is incremented or not.
This parameter can be a value of @ref DMA_memory_incremented_mode */
DMA_InitStruct.DMA_PeripheralDataSize=DMA_PeripheralDataSize_HalfWord; /*!< Specifies the Peripheral data width.
This parameter can be a value of @ref DMA_peripheral_data_size */
DMA_InitStruct.DMA_MemoryDataSize=DMA_MemoryDataSize_HalfWord; /*!< Specifies the Memory data width.
This parameter can be a value of @ref DMA_memory_data_size */
DMA_InitStruct.DMA_Mode=DMA_Mode_Circular; /*!< Specifies the operation mode of the DMAy Channelx.
This parameter can be a value of @ref DMA_circular_normal_mode.
@note: The circular buffer mode cannot be used if the memory-to-memory
data transfer is configured on the selected Channel */
DMA_InitStruct.DMA_Priority=DMA_Priority_Medium; /*!< Specifies the software priority for the DMAy Channelx.
This parameter can be a value of @ref DMA_priority_level */