请教一下,我想用OV5640,将数据发送到电脑上进行图片显示,采用RGB565数据发送,在山外串口调试助手上显示,一直是灰 {MOD}的,有几个问题没搞明白
1,F4开发板的例子上DMA_BUFFER,单位是字, 意识是说是两个像素点?
下面是我设置的DMA,定义一个uint32_t数组,将数组地址作为DMA数据地址入口,是否有问题?
uint32_t DMA_Memory0BaseAddrr[400]={0,0};
void OV5640_DMA_Config(uint32_t DMA_Memory0BaseAddr,uint16_t DMA_BufferSize)
{
DMA_InitTypeDef DMA_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);
DMA_Cmd(DMA2_Stream1,DISABLE);
while (DMA_GetCmdStatus(DMA2_Stream1) != DISABLE){}
DMA_InitStructure.DMA_Channel = DMA_Channel_1;
DMA_InitStructure.DMA_PeripheralBaseAddr = DCMI_DR_ADDRESS; //
DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)DMA_Memory0BaseAddrr; //
DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;
DMA_InitStructure.DMA_BufferSize =400; //
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_HalfWord;
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Enable;
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_INC8;
DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
/*DMAÖD¶ÏÅäÖà */
DMA_Init(DMA2_Stream1, &DMA_InitStructure);
DMA_Cmd(DMA2_Stream1,ENABLE);
while(DMA_GetCmdStatus(DMA2_Stream1) != ENABLE){}
}
这个DMA数据是否就是RGB565数据?
2,在摄像头寄存器设置中看到RGB565输出,但是看到输出格式是这样的,有点看不懂
0x6: RGB565
0XF:{g[2:0],b[4:0]}
{r[4:0],g[5:3]}
这是什么意思?OV5640输出RGB格式怎么理解?那在DMA中的数据该怎么理解?
3,假设现在得到了RGB565数据,我直接在DMA中断中进行行数据发送,一行一行发送到上位机,是否有问题?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
感谢原子哥指导
一周热门 更多>