欢迎来到天天文库
浏览记录
ID:16513160
大小:506.50 KB
页数:76页
时间:2018-08-13
《ov9650摄像头(能拍摄bmp图片)代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、CmosOv9650摄像头代码:此文档包括驱动与测试程序。能拍摄高清的bmp图片:开发板为:s3c2440文件包括:ov9650.hov9650.cCamera_test.cvideodev.hvideodev2.hMakefile本人用此摄像头拍的照片:驱动部分:Ov9650.c#include#include#include#include#include#include#include
2、#include#include#include#include#include#include#include#include#ifdefCONFIG_VIDEO_V4L1_COMPAT#include#endif#include3、nterrupt.h>#include#include#include#include#include#include#include#include#include#include#include"ov9650.h"/*debugprint4、macro.*//*hardware&drivername,versionetc.*/#defineCARD_NAME"camera"staticunsignedhas_ov9650;unsignedlongcamif_base_addr;/*cameradevice(s)*/staticstructtx2440_camif_devcamera;/*imagebufferforpreviewing.*/structtx2440_camif_bufferimg_buff[]={{.state=CAMIF_BUFF_INVALID,.img_size=0,.order5、=0,.virt_base=(unsignedlong)NULL,.phy_base=(unsignedlong)NULL},{.state=CAMIF_BUFF_INVALID,.img_size=0,.order=0,.virt_base=(unsignedlong)NULL,.phy_base=(unsignedlong)NULL},{.state=CAMIF_BUFF_INVALID,.img_size=0,.order=0,.virt_base=(unsignedlong)NULL,.phy_base=(unsignedlong)NULL},{.stat6、e=CAMIF_BUFF_INVALID,.img_size=0,.order=0,.virt_base=(unsignedlong)NULL,.phy_base=(unsignedlong)NULL}};/*softwareresetcamerainterface.*/staticvoid__inline__soft_reset_camif(void){u32cigctrl;cigctrl=(1<<31)7、(1<<29);iowrite32(cigctrl,S3C244X_CIGCTRL);mdelay(10);cigctrl=(1<<29);iowrite328、(cigctrl,S3C244X_CIGCTRL);mdelay(10);}/*softwareresetcamerainterface.*/staticvoid__inline__hw_reset_camif(void){u32cigctrl;cigctrl=(1<<30)9、(1<<29);iowrite32(cigctrl,S3C244X_CIGCTRL);mdelay(10);cigctrl=(1<<29);iowrite32(cigctrl,S3C244X_CIGCTRL);mdelay(10);}/*switchcamiffromcodecpathtop10、revie
3、nterrupt.h>#include#include#include#include#include#include#include#include#include#include#include"ov9650.h"/*debugprint
4、macro.*//*hardware&drivername,versionetc.*/#defineCARD_NAME"camera"staticunsignedhas_ov9650;unsignedlongcamif_base_addr;/*cameradevice(s)*/staticstructtx2440_camif_devcamera;/*imagebufferforpreviewing.*/structtx2440_camif_bufferimg_buff[]={{.state=CAMIF_BUFF_INVALID,.img_size=0,.order
5、=0,.virt_base=(unsignedlong)NULL,.phy_base=(unsignedlong)NULL},{.state=CAMIF_BUFF_INVALID,.img_size=0,.order=0,.virt_base=(unsignedlong)NULL,.phy_base=(unsignedlong)NULL},{.state=CAMIF_BUFF_INVALID,.img_size=0,.order=0,.virt_base=(unsignedlong)NULL,.phy_base=(unsignedlong)NULL},{.stat
6、e=CAMIF_BUFF_INVALID,.img_size=0,.order=0,.virt_base=(unsignedlong)NULL,.phy_base=(unsignedlong)NULL}};/*softwareresetcamerainterface.*/staticvoid__inline__soft_reset_camif(void){u32cigctrl;cigctrl=(1<<31)
7、(1<<29);iowrite32(cigctrl,S3C244X_CIGCTRL);mdelay(10);cigctrl=(1<<29);iowrite32
8、(cigctrl,S3C244X_CIGCTRL);mdelay(10);}/*softwareresetcamerainterface.*/staticvoid__inline__hw_reset_camif(void){u32cigctrl;cigctrl=(1<<30)
9、(1<<29);iowrite32(cigctrl,S3C244X_CIGCTRL);mdelay(10);cigctrl=(1<<29);iowrite32(cigctrl,S3C244X_CIGCTRL);mdelay(10);}/*switchcamiffromcodecpathtop
10、revie
此文档下载收益归作者所有