1. Sensor Development Block Diagram
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/87/12/wKiom1fSl5mwA2ESAABzoRmaSVU881.jpg "title=" Sens001.jpg "width=" "height=" 321 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:500px;height:321px; "alt=" Wkiom1fsl5mwa2esaabzormasvu881.jpg "/>
2. Device driver loading and hardware system configuration
CD mpp/ko# default online./load3518e-a-sensor sc2135-osmem 32-total 64# vi_vpss offline./load3518e-a-sensor sc2135- Osmem 32-total 64-offline
The load3518e script is primarily used to configure the hardware system's parameters (pin multiplexing, sensor clock, vi clock) to load the drive (. ko), including the I²c interface driver that accesses the sensor.
Offline mode when the image is stored in DDR, the image is not stored in the DDR in online mode.
Add sensor-related configuration to the load3518e script, which uses the Smartsens's SC2135 2 million-megapixel image sensor.
Insert_sns () {case $SNS _type insc2135) himm 0x200f0040 0x2; # i2c0_sclhimm 0x200f0044 0x2; # i2c0_sda#cmos pinmuxhimm 0x200f007c 0x1; # vi_data13himm 0x200f0080 0x1; # VI_DATA10himm 0x200f0084 0x1; # VI_DATA12himm 0x200f0088 0x1; # vi_data11himm 0x200f008c 0x2; # VI_VShimm 0x200f0090 0x2; # VI_HShimm 0x200f0094 0x1; # vi_data9himm 0x2003002c 0xb4001;# sensor unreset, clk 27mhz, vi 148.5mhz#himm 0x20030104 0x1;# vpss 148.5mhz;; *) echo "xxxx invalid sensor type $SNS _type xxxx" report_error;; Esac}insert_ko () {# sys configsys_config;# driver loadinsmod mmz.ko mmz=anonymous,0, $mmz _start, $mmz _size anony=1 | | report_errorinsmod hi_media.koinsmod hi3518e_base.koinsmod hi3518e_sys.ko vi_vpss_ online= $b _arg_online sensor= $SNS _typeinsmod hi3518e_tde.koinsmod hi3518e_region.koinsmod hi3518e_vgs.koinsmod hi3518e_isp.koinsmod hi3518e_viu.ko detect_err_frame=10;insmod hi3518e_vpss.ko rfr_frame_comp=1;insmod hi3518e_vou.ko#insmod hi3518e_vou.ko transparenttransmit=1 #enable transparenttransmitinsmod hifb.ko video= "hifb:vram0_size : 1620 " # default palinsmod hi3518e_rc.koinsmod hi3518e_ Venc.ko insmod hi3518e_chnl.ko chnllowpower=1insmod hi3518e_h264e.koinsmod hi3518e_ jpege.koinsmod hi3518e_ive.ko save_power=0; #insmod hi3518e_ive.koinsmod extdrv/sensor_ i2c.koecho "==== your input sensor type is $SNS _type ==== "insmod extdrv/pwm.koinsmod extdrv/piris.ko#insert_sns > /dev/nullinsert_snsinsert_audioinsmod hi_mipi.koecho "==== your input sensor type is $SNS _type ==== "}
3. Sensor's library file generation (. So)
The sensor library file needs to be compiled in the SDK package in the Linux server, and the resulting. So file is placed in the Hi3518e_stream_xxx/libs directory in the Stream package in the SDK bundle.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/87/13/wKiom1fSrKWSwkQLAAB-bfCJ3DQ706.jpg "title=" Sensor--2.jpg "width=" "height=" 159 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:700PX;HEIGHT:159PX; "alt=" Wkiom1fsrkwswkqlaab-bfcj3dq706.jpg "/>
The SENSOR_CTL.C implements the read and write initialization of the sensor.
SENSOR_CMOS.C mainly implements the callback function that ISP needs, including ISP, AE, AWB and so on.
Isp functionhi_s32 cmos_init_sensor_exp_function (Isp_sensor_exp_func_s *pstsensorexpfunc) { memset (pstsensorexpfunc, 0, sizeof (isp_sensor_exp_func_s)); pstSensorExpFunc->pfn_cmos_sensor_init = sensor_init; pstsensorexpfunc->pfn_cmos_sensor_exit = sensor_exit; pstsensorexpfunc- >pfn_cmos_sensor_global_init = sensor_global_init; pstSensorExpFunc-> Pfn_cmos_set_image_mode = cmos_set_image_mode; pstsensorexpfunc->pfn_cmos_ set_wdr_mode = cmos_set_wdr_mode; pstsensorexpfunc- >pfn_cmos_get_isp_default = cmos_get_isp_default; pstsensorexpfunc->pfn _cmos_get_isp_black_level = cmos_get_isp_black_level; pstsensorexpfunc-> Pfn_cmos_set_pixel_detect = cmos_set_pixel_detect; pstsensorexpfunc->pfn_cmos_get_sns_reg_info = cmos_get_sns_regs_info; return 0;} Ae functionhi_s32 cmos_init_ae_exp_function (Ae_sensor_exp_func_s *pstexpfuncs) { memset (pstexpfuncs, 0, sizeof (ae_sensor_exp_func_s)); pstexpfuncs->pfn_cmos_get_ae_default = cmos_get_ae_default; pstexpfuncs->pfn_cmos_fps_set = cmos_fps_set; pstexpfuncs->pfn_cmos_slow_framerate_set= cmos_slow_ framerate_set; pstexpfuncs->pfn_cmos_inttime_update = cmos_inttime_update; pstexpfuncs->pfn_cmos_gains_update = cmos_gains_update; pstexpfuncs->pfn_cmos_again_calc_table = cmos_again_calc_table; pstexpfuncs- >pfn_cmos_get_inttime_max = cmos_get_inttime_max; return 0;} Awb functionhi_s32 cmos_init_awb_exp_function (Awb_sensor_exp_func_s *pstexpfuncs) { memset (pstexpfuncs, 0, sizeof (awb_sensor_exp_func_s)); pstexpfuncs->pfn_cmos_get_awb_default = cmos_get_awb_default; return 0;}
4. Modify the. ini file for stream packages
Sc2135_1080p_line.ini file in the Hi3518e_stream_xxx/configs directory, the file is changed to specify the location of the. So file, the interface (LVDS/MIPI/DVP) of the input video, the video format (resolution, Sync mode, Target frame rate, etc.) system configuration.
5. Run the Stream software
Run the hiisptool.sh script in the stream package to establish communication with the pqtools of the host computer via the Ethernet card.
Cd/hi3518e_stream_v1.0.2.0./hiisptool.sh-a-P Sc2135_1080p_line.ini
The Ittb_control process is a TCP-based server that is responsible for controlling the transmission of signals.
The Ittb_stream process is also based on the TCP service side, which is responsible for playing the H/YUV video stream.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/87/11/wKioL1fSsq-wXKC9AADRHXJoipc306.jpg "title=" Sensor004.jpg "alt=" Wkiol1fssq-wxkc9aadrhxjoipc306.jpg "/>
6. Run PQ Tools
Double-click the PQ Tools picture and the following dialog box appears, setting the IP address.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/13/wKiom1fStgiBOLd5AABV6TYUyy8974.jpg "title=" Sensor005.jpg "alt=" Wkiom1fstgibold5aabv6tyuyy8974.jpg "/>
Select the Ttp_stream.exe option from the drop-down menu
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/87/13/wKiom1fStkDxwy9rAADdoeFseIU165.jpg "title=" Sensor006.jpg "alt=" Wkiom1fstkdxwy9raaddoefseiu165.jpg "/>
7. Final results
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/11/wKioL1fStqGzj4q-AAFyb_DMrWc691.jpg "title=" Sensor007.jpg "width=" "height=" 481 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:750px;height:481px; "alt=" Wkiol1fstqgzj4q-aafyb_dmrwc691.jpg "/>
This article is from the "Shugenyin blog" blog, make sure to keep this source http://shugenyin.blog.51cto.com/4259554/1851241
HiSilicon hi3518ev200 (5) Image sensor driver development