高通Camera点亮2——Sensor点亮

ops/2024/12/16 11:35:49/

高通Camera的点亮可以参考说明文档《80-P9301-97_REV_Y_Camera_Sensor_Driver_Bringup_Guide.pdf》,但是实际发现其中有些内容不够详细,因此这里进行重新补充,也作为自己知识的整理。

Sensor配置获取

要想点亮Sensor,需要向Sensor厂商获取Sensor的配置,一般需要确认:

  • 输出分辨率与帧率
  • 输入时钟(MCLK):一般情况Sensor的输入时钟是ISP提供,需要确认ISP支持那些时钟输出;一般是可以配置的,保险起见最好选择像24M这样的标准时钟。
  • 输出格式:RAW/RGB/YUV
  • 宽动态模式:线性/build-in/DCG/HDR
  • 数据输出方式:MIPI/LVDS
  • Lane数量:1/2/4
  • 输出最大传输速率限制:Sensor接不同的serders或者ISP芯片对最大传输速率限制各不相同;
  • RAW图的位数(8/10/12/14/16):线性模式下主要限制是传输;而宽动态模式下位数的限制主要是后端ISP能支持几位的数据处理,尤其是Sensor build-in模式下2帧合成和4帧合成输出ISP解压缩模块要求完全不同;
  • 是否binning:高分辨率用作低分辨率时会用到binning,比如将800W像素,每2*2个像素合成一个;
  • 镜像/翻转;
  • 画面位置及裁剪,根据实际需求不同提需求;
  • 该配置是否在其他平台上对接过?如果确定某配置是出图正常的,会让对接过程顺利不少;
    如果有多个配置需求可以一起提出来,能节省时间。

Sensor XML配置

Sensor xml中包括了

<?xml version="1.0" encoding="utf-8" ?>
<sensorDriverDataxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="../../../../api/sensor/camxsensordriver.xsd"><module_version major_revision="1" minor_revision="0" incr_revision="0"/><!--Sensor slave information --><slaveInfo><!--Name of the sensor--><!--Sensor名字,与module文件中指定的需要完全对应上,如果有2颗一样是Sensor,推荐sensorName也有区分--><sensorName>ov13b10</sensorName><!--8-bit or 10-bit write slave address--><!-- Sensor的I2C地址,重要--><slaveAddress>0x6c</slaveAddress><!--Register address / data size in bytes --><regAddrType range="[1,4]">2</regAddrType><!--Register address / data size in bytes --><regDataType range="[1,4]">2</regDataType><!--Register address for sensor Id --><sensorIdRegAddr>0x300b</sensorIdRegAddr><!--Sensor Id--><!--在Sensor驱动加载时会去读取sensorId,如果读取的sensorId不对会直接导致驱动加载失败--><sensorId>0x0D42</sensorId><!--Mask for sensor id. Sensor Id may only be few bits --><!--这个Mask=0xFFFFFFFF,表明sensorId有效位是4字节--><sensorIdMask>4294967295</sensorIdMask><!--I2C frequency mode of slaveSupported modes are: STANDARD (100 KHz), FAST (400 KHz), FAST_PLUS (1 MHz), CUSTOM (Custom frequency in DTSI) --><!--I2C频率,根据实际设置--><i2cFrequencyMode>FAST</i2cFrequencyMode><!--Sequence of power configuration type and configuration value required to control power to the device --><!--上电的时序,根据Sensor的datasheet进行设置;可以先参考高通代码中其他同一厂商的Sensor配置进行设置--><powerUpSequence><!--Power setting configurationContains: configType, configValue and delay in milli seconds --><powerSetting><!--Power configuration typeSupported types are: MCLK, VANA, VDIG, VIO, VAF, RESET, STANDBY --><configType>RESET</configType><!--Configuration value for the type of configuration --><configValue>0</configValue><!--Delay in milli seconds --><delayMs>10</delayMs></powerSetting><powerSetting><configType>VANA</configType><configValue>0</configValue><delayMs>0</delayMs></powerSetting><powerSetting><configType>VDIG</configType><configValue>0</configValue><delayMs>0</delayMs></powerSetting><powerSetting><configType>VIO</configType><configValue>0</configValue><delayMs>0</delayMs></powerSetting><powerSetting><configType>MCLK</configType><configValue>24000000</configValue><delayMs>1</delayMs></powerSetting><powerSetting><configType>RESET</configType><configValue>1</configValue><delayMs>30</delayMs></powerSetting></powerUpSequence><!--Sequence of power configuration type and configuration value required to control power to the device --><!--下电时序--><powerDownSequence><!--Power setting configurationContains: configType, configValue and delay in milli seconds --><powerSetting><!--Power configuration typeSupported types are: MCLK, VANA, VDIG, VIO, VAF, RESET, STANDBY --><configType>MCLK</configType><!--Configuration value for the type of configuration --><configValue>0</configValue><delayMs>0</delayMs></powerSetting><powerSetting><configType>RESET</configType><configValue>0</configValue><!--Delay in milli seconds --><delayMs>1</delayMs></powerSetting><powerSetting><configType>VIO</configType><configValue>0</configValue><delayMs>0</delayMs></powerSetting><powerSetting><configType>VDIG</configType><configValue>0</configValue><delayMs>0</delayMs></powerSetting><powerSetting><configType>VANA</configType><configValue>0</configValue><delayMs>0</delayMs></powerSetting></powerDownSequence></slaveInfo><!--Addresses for various sensor registers --><!--Sensor寄存器相关的配置,设置曝光和增益需要根据这里的配置进行设置,因此跟曝光相关的寄存器都不能设置错--><regAddrInfo><!--Register address to program width --><xOutput>0x3808</xOutput><!--Register address to program height --><yOutput>0x380A</yOutput><!--Register address to program Frame length lines --><!--这里的Frame length lines是Sony的称呼,OV叫HTS(Horizontal timing size)--><frameLengthLines>0x380E</frameLengthLines><!--Register address to program Line length pixel clock --><!--这里的Line length pixel也是Sony的称呼,OV叫VTS(Verical timing size)--><lineLengthPixelClock>0x380C</lineLengthPixelClock><!--Register address to program coarse integration time --><!--曝光时间--><coarseIntgTimeAddr>0x3500</coarseIntgTimeAddr><!--Register address to program gain channel --><!--AG--><globalGainAddr>0x3508</globalGainAddr><!--Register address to program digital gain channel --><!--DG--><digitalGlobalGainAddr>0x350A</digitalGlobalGainAddr><!--Register address to program manual test pattern value for Red channel --><!--这些test pattern的寄存器不设置不影响出图--><testPatternRAddr>0x8006</testPatternRAddr><!--Register address to program manual test pattern value for Green Red channel --><testPatternGRAddr>0x8004</testPatternGRAddr><!--Register address to program manual test pattern value for Blue channel --><testPatternBAddr>0x8000</testPatternBAddr><!--Register address to program manual test pattern value for Green Blue channel --><testPatternGBAddr>0x8002</testPatternGBAddr></regAddrInfo><!--Information of all the resolutionsNumber of resolutions is detected from number of resolutionData nodes --><!--分辨率的设置,一个Sensor可以支持多个分辨率设置,不同分辨率的配置都在这里配置--><resolutionInfo><!--Specify which sensor version can support this setting--><sensorVersion>0</sensorVersion><!-- Res 0 --><resolutionData><!--如果支持PDAF,这里的PDModeKey需要跟pdaf中的配置对应起来--><PDModeKey>0</PDModeKey><!--Color filter arrangement of the sensorSupported filter arrangements are: BAYER_BGGR, BAYER_GBRG, BAYER_GRBG, BAYER_RGGB, BAYER_Y, YUV_UYVY, YUV_YUYV --><colorFilterArrangement>BAYER_BGGR</colorFilterArrangement><!--Stream information --><!--都需要设置正确--><streamInfo><!--Information for a stream data --><streamConfiguration><!--Virtual Channel of the dataValid values for virtual channel are: 0, 1, 2 and 3 --><vc range="[0,3]">0</vc><!--Data type of the stream. Default value is 0x2B (10-bit RAW) --><dt>0x2B</dt><!--Frame dimension: contains xStart, yStart, width and height --><frameDimension><xStart>0</xStart><yStart>0</yStart><width>4208</width><height>3120</height></frameDimension><!--Bit width of the data --><bitWidth>10</bitWidth><!--Type of the streamSupported stream types are: BLOB, IMAGE, BAYER_GRBG, BAYER_RGGB, BAYER_Y, YUV_UYVY, YUV_YUYV --><type>IMAGE</type></streamConfiguration></streamInfo><!--Line length pixel clock of frameTypically this value is the active width + blanking width --><!--根据实际配置--><lineLengthPixelClock>4704</lineLengthPixelClock><!--Frame length lines of frameTypically this value is the active height + blanking height --><!--根据实际配置--><frameLengthLines>3196</frameLengthLines><!--Minimum horizontal blanking interval in pixels --><!--参照80-P9301-97_REV_Y_Camera_Sensor_Driver_Bringup_Guide.pdf中的说明计算得到,HBI--><minHorizontalBlanking>520</minHorizontalBlanking><!--Minimum horizontal blanking interval in lines --><!--参照80-P9301-97_REV_Y_Camera_Sensor_Driver_Bringup_Guide.pdf中的说明计算得到,VBI--><minVerticalBlanking>53</minVerticalBlanking><!--Output pixel clock:lineLengthPixelClock * frameLengthLines * fps --><outputPixelClock>451000000</outputPixelClock><!--Horizontal binning value --><horizontalBinning>1</horizontalBinning><!--Vertical binning value --><verticalBinning>1</verticalBinning><!--Maximum frame rate --><frameRate>30</frameRate><!--Number of lanes in which the data is streamed --><!--MIPI lane数--><laneCount>4</laneCount><!--The value is a ratio, and the sensors are able only to downscale.It must be 1.00 or greater at all times.--><downScaleFactor>1.0</downScaleFactor><!--Settle time in nano seconds --><!--参照80-P9301-97_REV_Y_Camera_Sensor_Driver_Bringup_Guide.pdf中的说明计算得到,一般不改也不影响出图--><settleTimeNs>26</settleTimeNs><!--Flag to know if the sensor is a 3phase sensor --><!--表面目前物理上接的是否为CPHY,1-CPHY,0-DPHY--><is3Phase>0</is3Phase><!--这里设置的是该分辨率下特有的设置;--><resSettings><regSetting><registerAddr>0x3800</registerAddr> <!--X start settings --><registerData>0x00</registerData><regAddrType range="[1,4]">2</regAddrType><regDataType range="[1,4]">1</regDataType><operation>WRITE</operation><delayUs>0x00</delayUs></regSetting></resSettings><!--Crop information for the frame --><cropInfo><left>0</left><right>0</right><top>0</top><bottom>0</bottom></cropInfo><!--List of features / capabilities supported by sensor --><capability>NORMAL</capability></resolutionData></resolutionInfo><!--Exposure control information --><exposureControlInfo><!--Maximum analog again supported by sensor --><!--最大AG,这些信息都来源于Sensor datasheet--><maxAnalogGain>15.5</maxAnalogGain><!--Maximum digital again supported by sensor --><!--最大DG--><maxDigitalGain>4.0</maxDigitalGain><!--Minimum offset to be maintained between line count and frame length lines --><verticalOffset>4</verticalOffset><!--Maximum line count supported by sensor --><!--最大曝光行设置,这里的VTS-4 --><maxLineCount>3188</maxLineCount><!--Minimum line count supported by sensor --><!--最小曝光行--><minLineCount>4</minLineCount><!--Conversion factor to convert real digital gain to register digital gain --><realToRegDigitalGainConversionFactor>256</realToRegDigitalGainConversionFactor><!--Real gain to register gain equationThe equation must contain "realGain" in its equationEx:= 512 - (512 / realGain) --><realToRegGain></realToRegGain><!--Register gain to real gain equationThe equation must contain "regGain" in its equationEx:= 512 / (512 - regGain) --><regToRealGain></regToRealGain></exposureControlInfo><!--Sequence of register settings to configure the device --><!--输出图像流的寄存器设置--><streamOnSettings><!--Register setting configurationContains: register address, register data, register address type, register data type,operation and delay in micro seconds --><regSetting><!--Register address that is accessed --><registerAddr>0x0100</registerAddr><!--If operation is WRITE, registerData is the data value to be written into the specified register addressIf operation is READ, registerData is the number of bytes to be read from the specified register address --><registerData>0x1</registerData><!--Register address / data size in bytes --><regAddrType range="[1,4]">2</regAddrType><!--Register address / data size in bytes --><regDataType range="[1,4]">1</regDataType><!--Type of the operationValid values are: WRITE, READ, POLL --><operation>WRITE</operation><!--Delay in micro seconds. Delay is 0 if not explicitly provided --><delayUs>0</delayUs></regSetting></streamOnSettings><!--Sequence of register settings to configure the device --><!--关闭图像流的设置--><streamOffSettings><!--Register setting configurationContains: register address, register data, register address type, register data type,operation and delay in micro seconds --><regSetting><!--Register address that is accessed --><registerAddr>0x0100</registerAddr><!--If operation is WRITE, registerData is the data value to be written into the specified register addressIf operation is READ, registerData is the number of bytes to be read from the specified register address --><registerData>0x0</registerData><!--Register address / data size in bytes --><regAddrType range="[1,4]">2</regAddrType><!--Register address / data size in bytes --><regDataType range="[1,4]">1</regDataType><!--Type of the operationValid values are: WRITE, READ, POLL --><operation>WRITE</operation><!--Delay in micro seconds. Delay is 0 if not explicitly provided --><delayUs>0</delayUs></regSetting></streamOffSettings><!--Sequence of register settings to configure the device --><!--这里的寄存器设置是为了同时写多个寄存器时同时写的功能,避免不同时写导致的曝光闪烁问题,这部分的设置在ov13b10_sensor.cpp中设置增益时会用到--><groupHoldOnSettings><!--Register setting configurationContains: register address, register data, register address type, register data type,operation and delay in micro seconds --><regSetting><!--Register address that is accessed --><registerAddr>0x3208</registerAddr><!--If operation is WRITE, registerData is the data value to be written into the specified register addressIf operation is READ, registerData is the number of bytes to be read from the specified register address --><registerData>0x0</registerData><!--Register address / data size in bytes --><regAddrType range="[1,4]">2</regAddrType><!--Register address / data size in bytes --><regDataType range="[1,4]">1</regDataType><!--Type of the operationValid values are: WRITE, READ, POLL --><operation>WRITE</operation><!--Delay in micro seconds. Delay is 0 if not explicitly provided --><delayUs>0</delayUs></regSetting></groupHoldOnSettings><!--Sequence of register settings to configure the device --><groupHoldOffSettings><!--Register setting configurationContains: register address, register data, register address type, register data type,operation and delay in micro seconds --><regSetting><!--Register address that is accessed --><registerAddr>0x3208</registerAddr><!--If operation is WRITE, registerData is the data value to be written into the specified register addressIf operation is READ, registerData is the number of bytes to be read from the specified register address --><registerData>0x10</registerData><!--Register address / data size in bytes --><regAddrType range="[1,4]">2</regAddrType><!--Register address / data size in bytes --><regDataType range="[1,4]">1</regDataType><!--Type of the operationValid values are: WRITE, READ, POLL --><operation>WRITE</operation><!--Delay in micro seconds. Delay is 0 if not explicitly provided --><delayUs>0</delayUs></regSetting><regSetting><!--Register address that is accessed --><registerAddr>0x3208</registerAddr><!--If operation is WRITE, registerData is the data value to be written into the specified register addressIf operation is READ, registerData is the number of bytes to be read from the specified register address --><registerData>0xa0</registerData><!--Register address / data size in bytes --><regAddrType range="[1,4]">2</regAddrType><!--Register address / data size in bytes --><regDataType range="[1,4]">1</regDataType><!--Type of the operationValid values are: WRITE, READ, POLL --><operation>WRITE</operation><!--Delay in micro seconds. Delay is 0 if not explicitly provided --><delayUs>0</delayUs></regSetting></groupHoldOffSettings><!--Sequence of register settings to configure the device --><!--Sensor的初始化设置,注意不要在这里的配置中直接让Sensor出图,可能会出现Sensor出图了而后端芯片还没有准备好而导致的出图问题--><initSettings><!--Specify which sensor version can support this setting--><sensorVersion>0</sensorVersion><initSetting><regSetting><registerAddr>0x0103</registerAddr> <!--software_reset --><registerData>0x01</registerData><regAddrType range="[1,4]">2</regAddrType><regDataType range="[1,4]">1</regDataType><operation>WRITE</operation><delayUs>0x00</delayUs></regSetting><regSetting><registerAddr>0x5049</registerAddr><registerData>0xa4</registerData><regAddrType range="[1,4]">2</regAddrType><regDataType range="[1,4]">1</regDataType><operation>WRITE</operation><delayUs>0x00</delayUs></regSetting></initSetting></initSettings><testPatternInfo><testPatternData><!--Test pattern modeSupported modes are: OFF, SOLID_COLOR, COLOR_BARS, COLOR_BARS_FADE_TO_GRAY, PN9, CUSTOM1 --><mode>OFF</mode><!--Sequence of register settings to configure the device --><settings><!--Register setting configurationContains: register address, register data, register address type, register data type,operation and delay in micro seconds --><regSetting><!--Register address that is accessed --><registerAddr>0x5040</registerAddr><!--If operation is WRITE, registerData is the data value to be written into the specified register addressIf operation is READ, registerData is the number of bytes to be read from the specified register address --><registerData>0</registerData><!--Register address / data size in bytes --><regAddrType range="[1,4]">2</regAddrType><!--Register address / data size in bytes --><regDataType range="[1,4]">1</regDataType><!--Type of the operationValid values are: WRITE, READ, POLL --><operation>WRITE</operation><!--Delay in micro seconds. Delay is 0 if not explicitly provided --><delayUs>0</delayUs></regSetting><regSetting><!--Register address that is accessed --><registerAddr>0x8008</registerAddr><!--If operation is WRITE, registerData is the data value to be written into the specified register addressIf operation is READ, registerData is the number of bytes to be read from the specified register address --><registerData>0</registerData><!--Register address / data size in bytes --><regAddrType range="[1,4]">2</regAddrType><!--Register address / data size in bytes --><regDataType range="[1,4]">1</regDataType><!--Type of the operationValid values are: WRITE, READ, POLL --><operation>WRITE</operation><!--Delay in micro seconds. Delay is 0 if not explicitly provided --><delayUs>0</delayUs></regSetting></settings></testPatternData></testPatternInfo><!--Color level informationThese are the default currents in various channels in complete dark light --><colorLevelInfo><!--White level value --><whiteLevel>1023</whiteLevel><!--Pedestal value for Red channel --><rPedestal>64</rPedestal><!--Pedestal value for GreenRed channel --><grPedestal>64</grPedestal><!--Pedestal value for Blue channel --><bPedestal>64</bPedestal><!--Pedestal value for Green Blue channel --><gbPedestal>64</gbPedestal></colorLevelInfo><!--Information about black regionsMultiple black regions can be provided if applicable --><opticalBlackRegionInfo><!--Frame dimension: contains xStart, yStart, width and height --><dimension><xStart>0</xStart><yStart>0</yStart><width>0</width><height>0</height></dimension></opticalBlackRegionInfo><!--Information about the pixel arrayActive dimension and dummy pixels width are provided --><pixelArrayInfo><!--Width and height of the frame or subframe --><activeDimension><width>4208</width><height>3120</height></activeDimension><!--Dummy pixels surrounding the active pixel array --><dummyInfo><left>0</left><right>0</right><top>0</top><bottom>0</bottom></dummyInfo></pixelArrayInfo><!--Application delay information --><delayInfo><!--Number of frames required to apply the linecount --><linecount>0</linecount><!--Number of frames required to apply the gain --><gain>0</gain><!--Maximum pipeline delay in number of frames --><maxPipeline>2</maxPipeline><!--Number of frames to skip --><frameSkip>2</frameSkip></delayInfo><sensorProperty><!--Pixel size in micro meters --><pixelSize>1.0</pixelSize><!--Crop factor --><cropFactor>1.0</cropFactor><!--Sensing method of senosorSupported sensing methods: UNDEFINED, ONE_CHIP_COLOR_AREA, TWO_CHIP_COLOR_AREATHREE_CHIP_COLOR_AREA, COLOR_SEQUENCE_AREA, TRILINEAR, COLOR_SEQUENCE_LINEAR --><sensingMethod>ONE_CHIP_COLOR_AREA</sensingMethod></sensorProperty><noiseCoefficent><gradient_S>3.738032e-06</gradient_S><offset_S>3.651935e-04</offset_S><gradient_O>4.499952e-07</gradient_O><offset_O>-2.968624e-04</offset_O></noiseCoefficent>
</sensorDriverData>
Sensor Clock 说明

Sensor点亮相关的有3个Clock:Input Clock、Pixel Clock和MIPI Data Clock。
Sensor Input Clock就是上面Sensor XML中的MCLK,一般的CMOS Sensor都不带晶振,时钟源是由其他芯片提供的,上面配置的是24M,也是最常见的时钟。
Pixel Clock是上面配置中的outputPixelClock,它表示的含义是:1秒钟内这颗Sensor能打点的总个数。
这里把Sensor输出的一个个pixel当成在纸片上打点一样来看,目前这颗Sensor(ov13b10)输出实际分辨率4208x3120分辨率,即打了3120行,每行4208个实际输出点。聪明人一算4208x3120x30=394M跟上面配置的451M不一样呀。因为Pixel Clock的含义其实是时间,这里只算了实际输出点的时间,没有算打点的针头从一行结束的末尾移动到下一行开头的时间,也没有算打点的针头从画面末尾移动到画面开头的时间。这里没有算的2个时间,前者叫行消隐,后者叫列消隐。
总行长(lineLengthPixelClock) = image width + 行消隐;
总列长(frameLengthLines)= image height + 列消隐;
Pixel Clock的公式:

Pixel Clock = lineLengthPixelClock  *   frameLengthLines  *  fps

lineLengthPixelClock在Sony 的Sensor中一般称为LINE_LENGTH_PCK,而在OV的Sensor中一般称为HTS;frameLengthLines在Sony 的Sensor中一般称为FRAME_LENGTH_LINES,而在OV的Sensor中一般称为VTS。而APP需要一个更低的Sensor帧率而分辨率不变,也是直接通过上面的公式更改frameLengthLines 来更改帧率的。你可以想象一下,要想帧率低,让一帧结束到下一帧开始之间的时间变成长一些就可以做到。
这里还有一个点说明:有些Sensor是支持lineLengthPixelClock是支持多倍的,尤其是lineLengthPixelClock配置比输出分辨率的行长还要小的时候。比如这里的ov13b10,HTS的实际配置为0x0498(1176),比实际输出的4208还要小,但是实际的lineLengthPixelClock为1176*4=4704,这部分可以跟Sensor厂商确认。

Sensor CPP

Sensor CPP中定义了Sensor曝光时间和增益变化相关的设置,
这里需要注意:

  • 最大增益和最小增益;
  • 生效增益的顺序:一般是先AG后DG;
  • 增益单位;
    这些需要参考Sensor的Datasheet和Gain table一起确认。
BOOL FillExposureSettings(RegSettingsInfo*        pRegSettingsInfo,SensorFillExposureData* pExposureData)
{UINT32  index     = 0;UINT    regCount  = 0;if ((NULL == pRegSettingsInfo) || (NULL == pExposureData)){return FALSE;}for (index = 0; index < pExposureData->pRegInfo->groupHoldOnSettings.regSettingCount; index++){pRegSettingsInfo->regSetting[regCount].registerAddr =pExposureData->pRegInfo->groupHoldOnSettings.regSetting[index].registerAddr;pRegSettingsInfo->regSetting[regCount].registerData =pExposureData->pRegInfo->groupHoldOnSettings.regSetting[index].registerData;pRegSettingsInfo->regSetting[regCount].regAddrType  =pExposureData->pRegInfo->groupHoldOnSettings.regSetting[index].regAddrType;pRegSettingsInfo->regSetting[regCount].regDataType  =pExposureData->pRegInfo->groupHoldOnSettings.regSetting[index].regDataType;pRegSettingsInfo->regSetting[regCount].delayUs      =pExposureData->pRegInfo->groupHoldOnSettings.regSetting[index].delayUs;regCount++;}pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->frameLengthLinesAddr;pRegSettingsInfo->regSetting[regCount].registerData  = (pExposureData->frameLengthLines & 0xFF00) >> 8;regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->frameLengthLinesAddr + 1;pRegSettingsInfo->regSetting[regCount].registerData  = (pExposureData->frameLengthLines & 0xFF);regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->coarseIntgTimeAddr;pRegSettingsInfo->regSetting[regCount].registerData  = (pExposureData->lineCount >> 16) & 0x0F;regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->coarseIntgTimeAddr + 1;pRegSettingsInfo->regSetting[regCount].registerData  = (pExposureData->lineCount >> 8) & 0xFF;regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr = pExposureData->pRegInfo->coarseIntgTimeAddr + 2;pRegSettingsInfo->regSetting[regCount].registerData = pExposureData->lineCount & 0xFF;regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->globalAnalogGainAddr;pRegSettingsInfo->regSetting[regCount].registerData  = (pExposureData->analogRegisterGain & 0xFF00) >> 8;regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->globalAnalogGainAddr+ 1;pRegSettingsInfo->regSetting[regCount].registerData  = pExposureData->analogRegisterGain & 0xFF;regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->GlobalDigitalGainAddr;pRegSettingsInfo->regSetting[regCount].registerData  = (pExposureData->digitalRegisterGain / 1024) & 0x03;regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->GlobalDigitalGainAddr+ 1;pRegSettingsInfo->regSetting[regCount].registerData  = ((pExposureData->digitalRegisterGain % 1024) & 0x3FC) >> 2;regCount++;pRegSettingsInfo->regSetting[regCount].registerAddr  = pExposureData->pRegInfo->GlobalDigitalGainAddr+ 2;pRegSettingsInfo->regSetting[regCount].registerData  = (pExposureData->digitalRegisterGain % 1024) & 0x03;regCount++;for (index = 0; (pExposureData->pRegInfo->groupHoldOnSettings.regSettingCount + index) < regCount; index++){pRegSettingsInfo->regSetting[pExposureData->pRegInfo->groupHoldOnSettings.regSettingCount + index].regAddrType  =I2CRegAddressDataTypeWord;pRegSettingsInfo->regSetting[pExposureData->pRegInfo->groupHoldOnSettings.regSettingCount + index].regDataType  =I2CRegAddressDataTypeByte;pRegSettingsInfo->regSetting[pExposureData->pRegInfo->groupHoldOnSettings.regSettingCount + index].delayUs      =0;}for (index = 0; index < pExposureData->pRegInfo->groupHoldOffSettings.regSettingCount; index++){pRegSettingsInfo->regSetting[regCount].registerAddr  =pExposureData->pRegInfo->groupHoldOffSettings.regSetting[index].registerAddr;pRegSettingsInfo->regSetting[regCount].registerData  =pExposureData->pRegInfo->groupHoldOffSettings.regSetting[index].registerData;pRegSettingsInfo->regSetting[regCount].regAddrType  =pExposureData->pRegInfo->groupHoldOffSettings.regSetting[index].regAddrType;pRegSettingsInfo->regSetting[regCount].regDataType=pExposureData->pRegInfo->groupHoldOffSettings.regSetting[index].regDataType;regCount++;}pRegSettingsInfo->regSettingCount = regCount;if (MAX_REG_SETTINGS <= regCount){return FALSE;}else{return TRUE;}
}

Sensor CPP中常见的需要写的寄存器地址:

  • frameLengthLinesAddr:帧率切换时设置;
  • coarseIntgTimeAddr:曝光时间设置;
  • globalAnalogGainAddr:Sensor Analog Gain;
  • GlobalDigitalGainAddr: Sensor Digital Gain;
  • digitalGainGreenBlueAddr:
  • digitalGainGreenRedAddr:
  • digitalGainRedAddr:
  • digitalGainBlueAddr:有些Sensor的Digital Gain是通过这四个寄存器设置的。

这些需要设置的寄存器都要在Sensor XML中配制好寄存器地址。


http://www.ppmy.cn/ops/142359.html

相关文章

评估一套呼叫中心大模型呼出机器人的投入回报比?

评估一套呼叫中心大模型呼出机器人的投入回报比&#xff1f; 原作者&#xff1a;开源呼叫中心FreeIPCC&#xff0c;其Github&#xff1a;https://github.com/lihaiya/freeipcc 评估一套呼叫中心大模型呼出机器人的投入回报比&#xff08;ROI&#xff09;&#xff0c;是一个涉…

JS-手写new

我们先再来理一理原型 Object1 {name:deng,age:18 } Object2 {name:ru,age:18 } const Person function(){} Person.prototype Object1; const p1 new Person(); console.log(p1.name); //deng Person.prototype null; console.log(p1.name); //deng上面给Person的构造函…

画图,matlab,

clear;close all;clc;tic;dirOutput dir(*.dat); % 罗列所有后缀-1.dat的文件列表&#xff0c;罗列BDDATA的数据 filenames string({dirOutput.name}); % 提取文件名%% 丢包统计 FILENAMES [""]; LOSS_YTJ [ ]; LOSS_RAD [ ]; LOSS_ETH [ ]…

FastAPI 应用安全性:多层防护

FastAPI 应用安全性&#xff1a;多层防护 目录 &#x1f6e1;️ 防御 SQL 注入、XSS 和 CSRF 攻击的实用方法&#x1f512; 使用 HTTPS 保证数据传输安全⚙️ 依赖更新与漏洞修复的安全管理策略 &#x1f6e1;️ 1. 防御 SQL 注入、XSS 和 CSRF 攻击的实用方法 在现代 Web 应…

从〇开始深度学习(番外)——混淆矩阵(Confusion Matrix)

从〇开始深度学习(番外)——混淆矩阵&#xff08;Confusion Matrix&#xff09; 文章目录 从〇开始深度学习(番外)——混淆矩阵&#xff08;Confusion Matrix&#xff09;写在前面1.混淆矩阵2.归一化混淆矩阵 写在前面 《从〇开始深度学习&#xff08;番外&#xff09;》系列主…

龙海家园地面停车场探寻2

在南山前海上班2年多了&#xff0c;到现在最喜欢的小区还是龙海家园小区。龙海家园小区是深圳目前最大的公共保障性租赁住房小区,目前居住有约2.6万人。而小区的停车位是远远不够的。之前一直很好奇车子可以停哪里。 后面加班之余经常去小区吃饭和转转。发现龙海家园小区与对面…

Dash for Mac 代码API文档管理软件安装

Mac分享吧 文章目录 Dash for Mac 代码API文档管理软件 效果图展示一、Dash 代码API文档管理软件 Mac电脑版——v7.3.31️⃣&#xff1a;下载软件2️⃣&#xff1a;安装软件2.1 左侧安装包拖入右侧文件夹中&#xff0c;等待安装完成&#xff0c;运行软件2.2 打开软件&#xff…

[数据分析] 探索性数据分析 EDA

数据分析 按数据分析的思维模式或者目的&#xff1a; 描述性分析&#xff1a;使用统计方法&#xff08;如均值、中位数、众数、方差等&#xff09;来描述数据的特征&#xff0c;总结和组织数据&#xff0c;以提供对数据集的清晰理解预测性分析&#xff1a;使用历史数据来建立…