软件-rk原厂福州瑞芯微电子股份_第1页
软件-rk原厂福州瑞芯微电子股份_第2页
软件-rk原厂福州瑞芯微电子股份_第3页
软件-rk原厂福州瑞芯微电子股份_第4页
软件-rk原厂福州瑞芯微电子股份_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

密级状态: 公开(√(技术部,图形显示中心文件状态当前版本[√] ] 者完成日期2017-11- 核完成日期2017-11-福州瑞芯微FuzhouRockchipsElectronicsCo版本作修改日修改说审备2017-11-发布初文档适用平 CAMERA文 说 CAMERA设备 MIPISENSORDVPSENSORCAMERA设备驱 数据类型简要说 struct struct struct struct API简要说 _ _ _stop 驱动移植简单步骤说 文档适用平平系支持情Linux(Kernel-YLinux(Kernel-Y此类平台ispdriverisp硬件版本来区分,具体命名如RK3288/RK3399ISPDriverCamera文 说RK3288/RK3399Linux| DTS配置文||platform/rk- Camera设备MIPISensorcamera0:camera-module@36status="okay";//是否加载模块compatible="omnivision,ov2710-v4l2-i2c-//omnivisionsensor类//ov2710-v4l2-i2c-subdevov2710sensor型//需要与驱动名reg<0x36SensorI2Cdevice_type="v4l2-i2c-subdev";//设备类型clocks&clk_cif_out>;//sensorclickin配置clock-names="clk_cif_out";pinctrl-names="rockchip,camera_default","rockchip,camera_sleep";pinctrl-0=<&cif_dvp_clk_out>;pinctrl-1=rockchip,pd-gpio=<&gpio3GPIO_B0//powerdown管脚分配及有效电rockchip,pwr-gpio=<&gpio3GPIO_B5//power管脚分配及有效电rockchip,rst-gpio=<&gpio3GPIO_D1//reset管脚分配及有效电rockchip,camera-module-facing="back";//前后置配置rockchip,camera-module-name="LA6110PA";//Camera模组名称rockchip,camera-module-len-name="YM6011P";//Camera模组镜头rockchip,camera-module-fov-h="128";//模组水平可视角度配置rockchip,camera-module-fov-v="55.7";//模组垂直可视角度配置rockchip,camera-module-orientation=<0>;//模组角度设置rockchip,camera-module-flip=<0>;//以上2个属性控制头驱动中的镜像配置,如果图像旋转180度,可以将这2个属性修改成相反的值即可旋转180;/*resolution.w,resolution.h,defrect.left,defrect.top,defrect.w,defrect.h*/rockchip,camera-module-defrect0=<192010800019201080>;resolution.wsensor输出列数//resolution.h:sensor输出行数//defrect.left:输出偏移列数//defrect.top:输出偏移行数defrect.w:输出列数//defrect.h:输出行数resolution//具体如resolutionhrockchip,camera-module-flash-support0>;//flashhrockchip,camera-module-mipi-dphy-index=//sensor实际使用的phy,要与硬件实际连接对status="okay";//是否加载i2c模块,默认开启#include"rv1108-camb-&cif_isp0rockchip,camera-modules-attached=<&camera0&camera1//配置需要使camera列表,连接ISP设备节status=DVPSensor{status=reg=<0x1a>;clocks=<&clk_cif_out>;clock-names=pinctrl-names="rockchip,camera_default","rockchip,camera_sleep";pinctrl-0=<&cif_dvp_d0d1&cif_dvp_d2d9&cif_dvp_d10d11&cif_dvp_clk_in&cif_dvp_clk_out&cif_dvp_sync>;pinctrl-1=<&cif_dvp_d0d1_sleep&cif_dvp_d2d9_sleep&cif_dvp_d10d11_sleep&cif_dvp_clk_in_sleep其它配置和MIPISensor相同rockchip,pd-gpio=<&gpio3GPIO_D1GPIO_ACTIVE_LOW>;rockchip,pwr-gpio=<&gpio3GPIO_B5GPIO_ACTIVE_HIGH>;rockchip,rst-gpio=<&gpio3GPIO_B0GPIO_ACTIVE_LOW>;rockchip,camera-module-mclk-name="clk_cif_out";rockchip,camera-module-facing="back";rockchip,camera-module-name="LA6114PA";rockchip,camera-module-orientation=rockchip,camera-module-iq-mirror=/*resolution.w,resolution.h,defrect.left,defrect.top,defrect.w,defrect.h*/rockchip,camera-module-defrect0=<22001125481319201080>;rockchip,camera-module-flash-support=Camera设备驱现,sensordriverv4l2subdev的方式实现与hostdriver之间的交互。文件列表如下文件名描OVSensor驱动公共函数文ov4689_v4l2-i2c-OV4689Sensor驱AptinaSensor驱动公共函ar0330cs_v4l2-i2c-SonySensor驱动公共函imx323_v4l2-i2c-IMX323Sensor驱动文Sensor驱动公共函数数据类型简要说struct[说明[定义structi2c_driver/*Standarddrivermodelinterfacesint(*probe)(structi2c_client*,conststructi2c_device_id*);int(*remove)(structi2c_client*);structdevice_driverconststructi2c_device_id[关键成员成员名描Devicedrivermodel主要包含驱动名称和与DTS设备进行匹配的of_match_table。当of_match_table中的compatible域和dts文件的compatible域匹配时,/r/be函数才会被调用ListofI2CdevicessupportedbythisCallbackfordeviceCallbackfordevice[示例staticconststructi2c_device_idov4689_id[]={ov4689_DRIVER_NAME,0{staticstructof_device_idov4689_of_match[]={.compatible="omnivision,ov4689-v4l2-i2c-staticstructi2c_driverov4689_i2c_driver=.driver=/r/=.owner=.of_match_table=/r/be=.remove=.id_table=struct[说明Definecoreopscallbacksforsubdevsstructv4l2_subdev_core_opsint(*g_ctrl)(structv4l2_subdev*sd,structv4l2_control*ctrl);int(*s_ctrl)(structv4l2_subdev*sd,structv4l2_control*ctrl);int(*s_ext_ctrls)(structv4l2_subdev*sd,structv4l2_ext_controls*ctrls);long(*ioctl)(structv4l2_subdev*sd,unsignedintcmd,void*arg);int(*s_power)(structv4l2_subdev*sd,int[关键成员成员名描callbackforVIDIOC_G_CTRLioctlhandlercallbackforVIDIOC_S_CTRLioctlhandlercallbackforVIDIOC_S_EXT_CTRLSioctlhandlerputssubdeviceinpowersavingmode(on==0)oroperationmode(on==calledatofioctl()syscallhandlerattheV4L2core.usedtoprovidesupportforprivateioctlsusedon[示例staticstructv4l2_subdev_core_opsov4689_camera_module_core_ops=.g_ctrl=.s_ctrl=.s_ext_ctrls=.s_power=.ioctl=[说明Callbacksusedwhenv4ldevicewasopenedinmode.structv4l2_subdev__opsint(*s_stream)(structv4l2_subdev*sd,intint(*g_frame_interval)(structv4l2_subdevint(*s_frame_interval)(structv4l2_subdev*sd,structv4l2_subdev_frame_interval[关键成员成员名描callbackforVIDIOC_S_FRAMEINTERVALioctlusedtonotifythedriverthatastreamwillstarthas[示例staticstructv4l2_subdev__opsov4689_camera_module__ops=.s_frame_interval=.s_stream=struct[说明v4l2-subdevpadleveloperationsstructv4l2_subdev_pad_opsint(*enum_frame_interval)(structv4l2_subdev*sd,structv4l2_subdev_pad_config*cfg,int(*get_fmt)(structv4l2_subdev*sd,structv4l2_subdev_pad_config*cfg,int(*set_fmt)(structv4l2_subdevstructv4l2_subdev_pad_config*cfg,[关键成员成员名描.callbackforioctlhandlercallbackforVIDIOC_SUBDEV_G_FMTioctlhandlercallbackforVIDIOC_SUBDEV_S_FMTioctlhandler[示例staticstructv4l2_subdev_pad_opsov4689_camera_module_pad_ops=.enum_frame_interval=.get_fmt=.set_fmt=staticstructv4l2_subdev_opsov4689_camera_module_ops=.core= .pad=struct[说明[定义structov_camera_module_custom_configint(*start_streaming)(structov_camera_module*cam_mod);int(*stop_streaming)(structov_camera_module*cam_mod);int(*check_camera_id)(structov_camera_module*cam_mod);int(*s_ctrl)(structov_camera_module*cam_mod,u32ctrl_id);int(*g_ctrl)(structov_camera_module*cam_mod,u32ctrl_id);int(*g_timings)(structov_camera_module*cam_mod,int(*g_exposure_valid_frame)(structov_camera_moduleint(*s_ext_ctrls)(structov_camera_module*cam_mod,structov_camera_module_ext_ctrls*ctrls);intstructov_camera_module*cam_mod,intlen);int(* mon)(structov_camera_module*cam_mod);int(*read_otp)(structov_camera_module*cam_mod);u32num_configs;void*priv;[关键成员成员名描start_streaming:(mandatory)willbecalledwhensensorshouldbeputintostreamingmoderightafterthebaseconfighasbeenwrittentothesensor.Afterasuccessfulcallofthisfunction,thesensorshouldstartdeliveringframedata.调用该函数前,Sensor不允许输出数据stop_streaming:(mandatory)willbecalledwhensensorshouldstopdeliveringdata.Afterasuccessfulcallofthisfunction,thesensorshouldnotdeliveranymoreframedata.调用该函数后,Sensor不允许输出数据Sensor控制函数 callbackforVIDIOC_S_EXT_CTRLShandlercode(V4L2_CID_GAIN、Sensortiming相关参数,例如check_camera_id:(optional)willbecalledwhenthesensorispoweredon.IfprovidedshouldcheckthesensorID/versionrequiredbythecustomdriver.RegisteraccessshouldbepossiblewhenthisfunctionisSensor镜 Sensor操作时power_up_delays_ms[0]:上电后时延power_up_delays_ms[2]:Streamon[示例staticstruct 4689_custom_config=.start_streaming=.stop_streaming=.s_ctrl=.s_ext_ctrls=.g_ctrl=.g_timings=.check_camera_id=.set_flip=.configs=.num_configs=.power_up_delays_ms={5,20,struct[说明[定义struct{constcharstructv4l2_mbus_framefmtboolauto_exp_enabled;boolauto_wb_enabled;u32reg_table_num_entries;u32reg_diff_table_num_entries;u32line_length_pck;u32frame_length_lines;boolsoft_reset;structpltfrm_cam_itfitf_cfg;[关键成员成员名描当前配置名当前配置数据格式,参考structv4l2_mbus_framefmt定.width:frame.code:dataformatcode(fromPad-levelframerate(fromstruct当前配置寄存器当前配置场消隐硬件接口属性定义,参考struct[示例staticstructov_camera_module_confi4689_configs[]=/r/=.frm_fmt=.width=.height=.code=.frm_intrvl=/r/erval=.numerator=.denominator=}.auto_exp_enabled=.auto_gain_enabled=.auto_wb_enabled=.reg_table=(void.reg_table_num_entries=.v_blanking_time_us=PLTFRM_CAM_ITF_MIPI_CFG(0,2,999,[说明MIPI硬件接口属[定义#definePLTFRM_CAM_ITF_MIPI_CFG(vnbbr,mk)成员名描vmipivisualchannelnumbermipilanesmipibitrate(单位Sensor工作参考时钟频率(单位[示例PLTFRM_CAM_ITF_MIPI_CFG(0,2,999,[说明DVP并口硬件接口属[定义#definePLTFRM_CAM_ITF_DVP_CFG(tyvs,hsck,ck_hz,mk)成员名描并口类 =0x20000071,//8bit位宽BT601 =0x20000072,//8bit位宽BT656PLTFRM_CAM_ITF_BT601_10=0x20000091,//10bit位宽BT601PLTFRM_CAM_ITF_BT656_10=0x20000092,PLTFRM_CAM_ITF_BT601_12=0x200000B1,PLTFRM_CAM_ITF_BT656_12=0x200000B2,PLTFRM_CAM_ITF_BT601_16=0x200000F1,PLTFRM_CAM_ITF_BT656_16=0x200000F2,PLTFRM_CAM_ITF_BT656_8I=0x20000172//8bitBT656格硬件场同步信号有效电平 有效硬件行同步信号有效电平 有效Pclk有效边Sensor工作参考时钟频率(单位API[描述获取当前VTS[语法staticinsor_g_VTS(structov_camera_module*cam_mod,u32*vts)参数名描输入输structov_camera_module结构体指输输[返回值返回描0成失[描述根据设置时间调整帧[语法staticinsor_auto_adjust_fps(structov_camera_module*cam_mod,u32exp_time)[参数参数名描输入输structov_camera_module结构体指输sensor行输[返回值返回描0成失[描述设置sensor时间、增益。时间以及增益值的寄存器换算由上层算法实现,驱动设置[语法staticinsor_write_aec(structov_camera_module*cam_mod)参数名描输入输structov_camera_module结构体指输[返回值返回描0成失[描述根据sensor的配置寄存器表,按照寄存器地址匹配方式查询时序参数,填写入相应的结 参数名描输入输structov_camera_module结构体指输[返回值返回描0成失[描述Sensor时序参[语法 strucov_ca

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论