专家
公告
财富商城
电子网
旗下网站
首页
问题库
专栏
标签库
话题
专家
NEW
门户
发布
提问题
发文章
STM32
原子大大, 为什么OV7670无法全屏
2019-07-20 06:29
发布
×
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
站内问答
/
STM32/STM8
6238
16
1158
原子大大, 为什么OV7670无法全屏;
目前只能设置320x320以下,但是我记得ov7670好像支持640x480的;
友情提示:
此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
16条回答
wlq390934605
2019-07-20 10:10
这样我们就可以写一个简单的函数来设置 OV7670 的分辨率了
输入图像的行起始点,场起始点, 宽度 ,高度计算得到相应寄存器的值
编译环境:keil mdk
void OV7670_config_window(u16 startx,u16 starty,u16 width, u16 height) {
u16 endx=(startx+width*2)%784;
u16 endy=(starty+height*2);
u8 x_reg, y_reg;
u8 state,temp;
state= rdOV7670Reg(0x32, &x_reg ); x_reg&= 0xC0;
state= rdOV7670Reg(0x03, &y_reg ); y_reg&= 0xF0;
//设置 HREF
temp = x_reg|((endx&0x7)<<3)|(startx&0x7); state = wrOV7670Reg(0x32, temp );
temp = (startx&0x7F8)>>3;
state = wrOV7670Reg(0x17, temp );
temp = (endx&0x7F8)>>3;
state = wrOV7670Reg(0x18, temp );
//设置 VREF
temp = y_reg|((endy&0x3)<<2)|(starty&0x3); state = wrOV7670Reg(0x03, temp );
temp = (starty&0x3FC)>>2;
state = wrOV7670Reg(0x19, temp );
temp = (endy&0x3FC)>>2;
state = wrOV7670Reg(0x1A, temp );
}
加载中...
查看其它16个回答
一周热门
更多
>
相关问题
STM32F4上I2C(在PROTEUS中模拟)调试不通的问题
6 个回答
芯片供应紧张,准备换个MCU,MM32L系列替换STM32L系列的怎么样?
7 个回答
STM32同时使用两个串口进行数据收发时数据丢包的问题
5 个回答
STM32F103串口通信死机问题
4 个回答
STM32WLE5CC连接SX1268在LoRa模式下能与 SX1278互通吗?
2 个回答
相关文章
ST公司第一款无线低功耗单片机模块有效提高物联网设计生产效率
0个评论
如何实现对单片机寄存器的访问
0个评论
通过USB用STM32片内自带Bootloader下载程序及注意事项
0个评论
欲练此功必先自宫之STM32汇编启动,放慢是为了更好的前行
0个评论
×
关闭
采纳回答
向帮助了您的知道网友说句感谢的话吧!
非常感谢!
确 认
×
关闭
编辑标签
最多设置5个标签!
STM32
保存
关闭
×
关闭
举报内容
检举类型
检举内容
检举用户
检举原因
广告推广
恶意灌水
回答内容与提问无关
抄袭答案
其他
检举说明(必填)
提交
关闭
×
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
×
付费偷看金额在0.1-10元之间
确定
×
关闭
您已邀请
0
人回答
查看邀请
擅长该话题的人
回答过该话题的人
我关注的人
输入图像的行起始点,场起始点, 宽度 ,高度计算得到相应寄存器的值
编译环境:keil mdk
void OV7670_config_window(u16 startx,u16 starty,u16 width, u16 height) {
u16 endx=(startx+width*2)%784;
u16 endy=(starty+height*2);
u8 x_reg, y_reg;
u8 state,temp;
state= rdOV7670Reg(0x32, &x_reg ); x_reg&= 0xC0;
state= rdOV7670Reg(0x03, &y_reg ); y_reg&= 0xF0;
//设置 HREF
temp = x_reg|((endx&0x7)<<3)|(startx&0x7); state = wrOV7670Reg(0x32, temp );
temp = (startx&0x7F8)>>3;
state = wrOV7670Reg(0x17, temp );
temp = (endx&0x7F8)>>3;
state = wrOV7670Reg(0x18, temp );
//设置 VREF
temp = y_reg|((endy&0x3)<<2)|(starty&0x3); state = wrOV7670Reg(0x03, temp );
temp = (starty&0x3FC)>>2;
state = wrOV7670Reg(0x19, temp );
temp = (endy&0x3FC)>>2;
state = wrOV7670Reg(0x1A, temp );
}
一周热门 更多>