展锐平台的camera sensor驱动代码设计解析(1)

  • Post author:
  • Post category:其他



展锐平台的camera sensor驱动代码设计解析(1)



展锐平台的camera sensor驱动代码设计解析(2)



展锐平台的camera sensor驱动代码设计解析(3)



Camera驱动的基本配置及文件路径说明

  1. 驱动的配置在路径:\device\sprd\platform\board\camera\sensor_config.xml
  2. 驱动代码的路径在:\vendor\sprd\modules\libcamera\sensor\sensor_drv\classic下,里面有各个sensor厂商的驱动,比如Galaxycore,Superpix,Samsung等。



.xml 文件的配置解析

  <root>
  <!-->
  sensor id 0
  <-->
      <CameraModuleCfg>
        <SlotId>0</SlotId>
        <SensorName>ov8856</SensorName>
        <Facing>BACK</Facing>
        <Orientation>90</Orientation>
        <Resource_cost>50</Resource_cost>
        <OTP>
            <E2prom>
                <OtpName>general</OtpName>
                <I2cAddr>0xa0</I2cAddr>
                <E2promNum>2</E2promNum>
                <E2promSize>8192</E2promSize>
            </E2prom>
        </OTP>
        <VCM>
            <AfName>cn3927e</AfName>
            <Mode>0</Mode>
        </VCM>
        <TuningParameter>
            <TuningName>ov8856_shine</TuningName>
        </TuningParameter>
      </CameraModuleCfg>

SlotId : 表示配置camera id 0,

SensorName :表示配置了sensor ov8856,

Facing:表示配置 camera 为后摄,

Orientation:表示配置竖屏的基础旋转角度为90,

Resource_cost:表示打开所占资源为50,

OTP:general是平台端otp的驱动,

I2cAddr:表示i2c地址为0xa0,

E2promNum:2表示几个eeprom,

E2promSize: 8192表示eeprom的大小,

AfName :马达是cn3927e,

Mode:马达模式是0,

TuningName:Tuning参数文件夹是ov8856_shine.

在这里插入图片描述



BoardConfig.mk

#------section 2: sensor & flash config------

#camera auto detect sensor
TARGET_BOARD_CAMERA_AUTO_DETECT_SENSOR := true

#select camera 2M,3M,5M,8M,13M,16M,21M
CAMERA_SUPPORT_SIZE := 32M
FRONT_CAMERA_SUPPORT_SIZE := 16M
BACK_EXT_CAMERA_SUPPORT_SIZE := 16M
FRONT_EXT_CAMERA_SUPPORT_SIZE := 8M
TARGET_BOARD_NO_FRONT_SENSOR := false
TARGET_BOARD_SENSOR2_SUPPORT := true
TARGET_BOARD_SENSOR3_SUPPORT := true

#camera dual sensor
TARGET_BOARD_CAMERA_DUAL_SENSOR_MODULE := true
#dual camera 3A sync
#TARGET_BOARD_CONFIG_CAMERA_DUAL_SYNC := true
#sensor multi-instance
#TARGET_BOARD_CAMERA_SENSOR_MULTI_INSTANCE_SUPPORT := ture
TARGET_BOARD_CAMERA_SENSOR_MULTI_INSTANCE_SUPPORT := false

#camera sensor support list
#example
#CAMERA_SENSOR_TYPE_BACK :="ov8856,ov8858"
CAMERA_SENSOR_TYPE_BACK := "ov32a1q,ov16885_normal,imx351,imx363,imx258,ov13855,ov0210,ov8856"
CAMERA_SENSOR_TYPE_FRONT := "s5ks3p92"
CAMERA_SENSOR_TYPE_BACK_EXT := "ov16885_normal,ov9282_irdual"
CAMERA_SENSOR_TYPE_FRONT_EXT := "ov8856_shine"

#tuning param support list
TUNING_PARAM_LIST := "ov32a1q_back_main,ov16885_normal,imx351_back_main,imx363_back_main,imx258_back_main,ov13855_back_main,s5ks3p92_front_main, \
ov7251,ov7251_dual,ov0210,ov8856"

sensor型号需与存放driver文件夹同名

CAMERA_SUPPORT_SIZE:后摄分辨率

FRONT_CAMERA_SUPPORT_SIZE:前摄分辨率BACK_EXT_CAMERA_SUPPORT_SIZE:后辅摄分辨率FRONT_EXT_CAMERA_SUPPORT_SIZE:前辅摄分辨率

CAMERA_SENSOR_TYPE_BACK:后摄sensor型号CAMERA_SENSOR_TYPE_FRONT:前摄sensor型号CAMERA_SENSOR_TYPE_BACK_EXT:后辅摄sensor型号CAMERA_SENSOR_TYPE_FRONT_EXT:前辅摄sensor型号

TUNING_PARAM_LIST :依次添加对应sensor参数名称Note:sensor参数名称需与存放tuning parameter中sensor名相同



版权声明:本文为qq_29890089原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。