lee_hwa 发表于 2013-12-19 17:29
DMA_InitStructure.DMA_Mode =DMA_Mode_Normal; 你用的是这个么?
是的
DMA_Struc.DMA_Channel = DMA_Channel_3; //Channel3 of DMA2
DMA_Struc.DMA_PeripheralBaseAddr = (uint32)(&(SPI1->DR)); //SPI1 data register(SPI1_BASE+0x0C)
DMA_Struc.DMA_Memory0BaseAddr = (uint32)(ADC_RX_Buffer); //Memory address
DMA_Struc.DMA_DIR = DMA_DIR_PeripheralToMemory;
DMA_Struc.DMA_BufferSize = (uint32)(ADC_RX_SIZE); //Memory buffer size
DMA_Struc.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_Struc.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_Struc.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_Struc.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
DMA_Struc.DMA_Mode = DMA_Mode_Normal;
DMA_Struc.DMA_Priority = DMA_Priority_High; //Priority_High
DMA_Struc.DMA_FIFOMode = DMA_FIFOMode_Disable; //Disable FIFO mode
DMA_Struc.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
DMA_Struc.DMA_MemoryBurst = DMA_MemoryBurst_Single;
DMA_Struc.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
DMA_Init(DMA2_Stream0, &DMA_Struc);
|