大学生
最后登录1970-1-1
在线时间 小时
注册时间2014-4-1
|
火哥,DMA在传输数据的时候速率最快能达到多大?以下是我的程序,结果看图片
SendBuff[0] = 0x0000ffff;
SendBuff[1] = 0xffff0000;
SendBuff[2] = 0x0000ffff;
SendBuff[3] = 0xffff0000;
/**
DMA设置 读取 GPIOC 引脚的值到 SendBuff
*/
void TIM4_DMA_Config(void)
{
DMA_InitTypeDef DMA_InitStructure;
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
DMA_InitStructure.DMA_PeripheralBaseAddr = (u32) &GPIOC->ODR;
DMA_InitStructure.DMA_MemoryBaseAddr = (u32)SendBuff;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
DMA_InitStructure.DMA_BufferSize = 4;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Word;
// DMA_InitStructure.DMA_Mode = DMA_Mode_Normal ;
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;
DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
DMA_Init(DMA1_Channel5, &DMA_InitStructure);
DMA_Cmd (DMA1_Channel5,ENABLE);
// DMA_ITConfig(DMA1_Channel5,DMA_IT_TC,ENABLE); //ÅäÖÃDMA·¢Ëííê3éoó2úéúÖD¶Ï
}
|
-
|