[mw_shl_code=c,true]* 配置 DCMIC 参数 */
DCMI_InitStructure.DCMI_CaptureMode = DCMI_CaptureMode_Continuous;
DCMI_InitStructure.DCMI_SynchroMode = DCMI_SynchroMode_Hardware;
DCMI_InitStructure.DCMI_PCKPolarity = DCMI_PCKPolarity_Rising;//像素时钟下降沿有效
DCMI_InitStructure.DCMI_VSPolarity = DCMI_VSPolarity_Low;//垂直同步低有效
DCMI_InitStructure.DCMI_HSPolarity = DCMI_HSPolarity_Low;//水平同步低有效
DCMI_InitStructure.DCMI_CaptureRate = DCMI_CaptureRate_All_Frame;//所有帧捕获
DCMI_InitStructure.DCMI_ExtendedDataMode = DCMI_ExtendedDataMode_8b;//8位数据宽度一个像素时钟
DCMI_Init(&DCMI_InitStructure);//DCMI 初始化
DCMI_ITConfig(DCMI_IT_OVF, ENABLE);//配置帧中断
DCMI_ITConfig(DCMI_IT_FRAME, ENABLE);//配置帧中断
NVIC_InitStructure.NVIC_IRQChannel = DCMI_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=1;//?à??ó??è??1
NVIC_InitStructure.NVIC_IRQChannelSubPriority =2; //×óó??è??3
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQí¨μàê1?ü
NVIC_Init(&NVIC_InitStructure); //?ù?Y???¨μ?2?êy3?ê??ˉVIC??′??÷?¢
DMA_DeInit(DMA2_Stream1);//DMA配置缺省状态
while (DMA_GetCmdStatus(DMA2_Stream1) != DISABLE){}//μè′yDMA2_Stream1?é????
DMA_InitStructure.DMA_Channel = DMA_Channel_1;
DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)&DCMI->DR;//外围地址
DMA_InitStructure.DMA_Memory0BaseAddr =0x6C000000;// RA8875_GetDispMemAddr();//内存地址(uint32_t)&dcmi_val;
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;//数据传送方向 外围到内存
DMA_InitStructure.DMA_BufferSize = 1;//一次传输数据量大小 1字节
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;//外围地址 不增长
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;//内存地址 不增长
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Word;//外围数据长度一个字 4byte
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;//内存数据长度半字 2byte
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;//DMA环形模式
DMA_InitStructure.DMA_Priority = DMA_Priority_High;//DMA优先级高
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable;//FIFO模式使能
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;//FIFO开始装满
DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
DMA_Init(DMA2_Stream1, &DMA_InitStructure);[/mw_shl_code]
为什么老是跳进数据溢出中断
彩条测试产生的图片变成这样了,有没有人遇到过这种情况的,或者能大概猜测是什么原因的都可以留言告诉我
一周热门 更多>