|
刚才看了DMA资料我也改成了,发现没动静
void LCD_DMA_Init(void) { DMA_InitTypeDef DMA_InitStructure; u16 CurrDataCounter_Begin = 0, CurrDataCounter_End = 0; /* Enable DMA clock */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
DMA_DeInit(DMA1_Channel6); DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)BMP_BUF; DMA_InitStructure.DMA_MemoryBaseAddr = (u32)DET_BUF; DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC; DMA_InitStructure.DMA_BufferSize = 320; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Enable; //DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord; DMA_InitStructure.DMA_MemoryDataSize = DMA_PeripheralDataSize_HalfWord; DMA_InitStructure.DMA_Mode = DMA_Mode_Normal; DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_M2M = DMA_M2M_Enable; DMA_Init(DMA1_Channel6, &DMA_InitStructure);
/* Enable DMA Channel6 Transfer Complete interrupt */ DMA_ITConfig(DMA1_Channel6, DMA_IT_TC, ENABLE);
/* Get Current Data Counter value before transfer begins */ CurrDataCounter_Begin = DMA_GetCurrDataCounter(DMA1_Channel6);
/* Enable DMA Channel6 transfer */ DMA_Cmd(DMA1_Channel6, ENABLE); BSP_IntVectSet(BSP_INT_ID_DMA1_CH6, DMA1_CH6_ISRHandler); // Assign ISR handler // Enable interrupt }
void DMA1_CH6_ISRHandler(void) { .... DMA_ClearFlag(DMA1_FLAG_GL6); }
看看 我的设置上问题吗?谢谢 |
|