stm32---DMA存储器到存储器传输数据
DMA_InitTypeDef dma_InitStruct; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1,ENABLE); dma_InitStruct.DMA_PeripheralBaseAddr = (uint32_t)DMA_S_Const_Buffer;//当内存传内存时可看作数据的源 dma_InitStruct.DMA_MemoryBaseAddr = (uint32_t)DMA_D_Buffer; dma_InitStruct.DMA_DIR = DMA_DIR_PeripheralSRC; dma_InitStruct.DMA_BufferSize = BufferSIze; //传输数目 dma_InitStruct.DMA_PeripheralInc = DMA_PeripheralInc_Enable; //外设地址增量模式 dma_InitStruct.DMA_MemoryInc = DMA_MemoryInc_Enable; dma_InitStruct.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word; dma_InitStruct.DMA_MemoryDataSize = DMA_MemoryDataSize_Word; dma_InitStruct.DMA_Mode = DMA_Mode_Normal; dma_InitStruct.DMA_M2M = DMA_M2M_Enable; dma_InitStruct.DMA_Priority = DMA_Priority_High ; DMA_Init(DMA1_Channel6,&dma_InitStruct); DMA_ClearFlag(DMA1_FLAG_TC6); DMA_Cmd(DMA1_Channel6, ENABLE);
微信扫码关注
更新实时通知