最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

BananaPi上ov5640摄像头自动对焦功能的实现

IT圈 admin 38浏览 0评论

2024年1月13日发(作者:索寻菱)

_num[1] = 0x04; ret = sensor_read(sd,_num,); if(ret < 0) { csi_dev_err("sensor_read err at register 0x%x%xn",_num[0],_num[1]); return ret; } csi_dev_print("register 0x3004 = 0x%xn",[0]); [0] |= 0x01 <<5; [0] |= 0x01 <<6; ret = sensor_write(sd,_num,); if(ret < 0) { csi_dev_err("sensor_write err at register 0x%x%xn",_num[0],_num[1]); return ret; }

_num[0] = 0x30; //set 0x3001 BIT6=0

_num[1] = 0x01; ret = sensor_read(sd,_num,); if(ret < 0) { csi_dev_err("sensor_read err at register 0x%x%xn",_num[0],_num[1]); return ret; } csi_dev_print("register 0x%x%x = 0x%2xn",_num[0],_num[1],[0]); [0] &= ~(0x01 <<6); ret = sensor_write(sd,_num,); if(ret < 0) { csi_dev_err("sensor_write err at register 0x%x%xn",_num[0],_num[1]); return ret; }

_num[0] = 0x30; //set 0x3005 BIT6=1

_num[1] = 0x05; ret = sensor_read(sd,_num,); if(ret < 0) { csi_dev_err("sensor_read err at register 0x%x%xn",_num[0],_num[1]); return ret; } csi_dev_print("register 0x%x%x = 0x%xn",_num[0],_num[1],[0]); [0] |= 0x01 <<6; ret = sensor_write(sd,_num,); if(ret < 0) { csi_dev_err("sensor_write err at register 0x%x%xn",_num[0],_num[1]); return ret; }

_num[0] = 0x30; //Write 0x03 to 0x3022, start singal af _num[1] = 0x22;

[0] = 0x03; ret = sensor_write(sd,_num,); if(ret < 0) { csi_dev_err("sensor_write err at start a single afn"); return ret; }

while([0] !=0 && i < 50) { i++; msleep(100); ret = sensor_read(sd, _num, ); if (ret < 0) {

2024年1月13日发(作者:索寻菱)

_num[1] = 0x04; ret = sensor_read(sd,_num,); if(ret < 0) { csi_dev_err("sensor_read err at register 0x%x%xn",_num[0],_num[1]); return ret; } csi_dev_print("register 0x3004 = 0x%xn",[0]); [0] |= 0x01 <<5; [0] |= 0x01 <<6; ret = sensor_write(sd,_num,); if(ret < 0) { csi_dev_err("sensor_write err at register 0x%x%xn",_num[0],_num[1]); return ret; }

_num[0] = 0x30; //set 0x3001 BIT6=0

_num[1] = 0x01; ret = sensor_read(sd,_num,); if(ret < 0) { csi_dev_err("sensor_read err at register 0x%x%xn",_num[0],_num[1]); return ret; } csi_dev_print("register 0x%x%x = 0x%2xn",_num[0],_num[1],[0]); [0] &= ~(0x01 <<6); ret = sensor_write(sd,_num,); if(ret < 0) { csi_dev_err("sensor_write err at register 0x%x%xn",_num[0],_num[1]); return ret; }

_num[0] = 0x30; //set 0x3005 BIT6=1

_num[1] = 0x05; ret = sensor_read(sd,_num,); if(ret < 0) { csi_dev_err("sensor_read err at register 0x%x%xn",_num[0],_num[1]); return ret; } csi_dev_print("register 0x%x%x = 0x%xn",_num[0],_num[1],[0]); [0] |= 0x01 <<6; ret = sensor_write(sd,_num,); if(ret < 0) { csi_dev_err("sensor_write err at register 0x%x%xn",_num[0],_num[1]); return ret; }

_num[0] = 0x30; //Write 0x03 to 0x3022, start singal af _num[1] = 0x22;

[0] = 0x03; ret = sensor_write(sd,_num,); if(ret < 0) { csi_dev_err("sensor_write err at start a single afn"); return ret; }

while([0] !=0 && i < 50) { i++; msleep(100); ret = sensor_read(sd, _num, ); if (ret < 0) {

发布评论

评论列表 (0)

  1. 暂无评论