//=========================================================
//Information section
//=========================================================
info_name=1200-0117_FRIDA_R13;
info_vendor=Foxconn;
info_major_ver=0;
info_minor_ver=5;
cam_i2c_address=60;
//=========================================================
//Revision history
//=========================================================
// 0.5 2009-02-27 Changed synch polarity
//						Changed property number 28 -> 26
// 0.4 2009-01-30 Powersequence changed.
// 0.3 2009-01-16 Synch polarity changed to active low for both V- & Hsynch.
// 0.2 2009-01-14 Power up sequence changed for Frida SP1
// 0.1 2008-11-26 Power up sequence adjusted for Frida DP1
// 0.0 2008-11-21 First draft based on Alona

//=========================================================

//=========================================================
// Frida Power on sequence  (GPIO --> Port*0x10 + Pin*0x01 + 0x80)
//=======================================================

//Power up VT cam & main cam and hold main cam in reset state forever...
cam_power_on_0 = 5, 2, A4, 0, 0;		//SET VT_RST							0ms
cam_power_on_1 = 5, 2, 96, 1, 0;		//SET QCIF_STANDBY	  				0ms
cam_power_on_2 = 5, 0, 0, 1, f;			//SET RESETn (el physical equ 0)				15ms		
cam_power_on_3 = 5, 2, A7, 1, 5;		//Turn On CAM_LDO_EN	GPIO_23			0ms				
cam_power_on_4 = 5, 2, 85, 1, 5;		//Turn On VCAMSD18_EN	GPIO_05			0ms			
cam_power_on_5 = 5, 2, A3, 1, 5;		//Turn On VCAMSD28_EN	GPIO_19			15ms	
cam_power_on_6 = 5, 3, 9, 6590, f;		//START CLK	
cam_power_on_7 = 5, 0, 0, 0, f;			//CLR RESETn (el physical equ 1)		
cam_power_on_8 = 5, 4, 0, 1, 0;			//Set main camera in triste
cam_power_on_9 = 5, 3, 9, 0, f;			//STOP CLK
cam_power_on_a = 5, 2, A4, 1, f;		//CLR VT_RST							15 ms
cam_power_on_b = 5, 3, 9, 32C8, f;		//ENABLE CLK							15ms		
//leave powerdown mode 
cam_power_on_c = 5, 2, 96, 0, f;		//CLR QCIF_STANDBY						15 ms
cam_power_on_d = 5, 4, 0, 0, 0;  		// Do dummy write to i2c to stabilize the i2c bus at first poweron.

cam_power_i2c_1 = $a1f 0A 04 50 00 00 11 00 01 04 $f;	//Set Main camera in tristate.
cam_power_i2c_0 = $a60 12 80 $f 12 00 $f;			// Dummy I2C write
//cam_power_i2c_1 = $a1f $d0020 06 02 00 01 01 5c $f $d0020 $a60; // reg 5C is main cam power save mode reg. 

//========================================================= 
// ALONA Power off sequence 
cam_power_off_0 = 5, 2, 96, 1, 00;	// GPIO_14 = 96 QCIF_STANDBY = 0 (Standby mode)
cam_power_off_1 = 5, 2, A4, 0, 05;	// RESET GPIO_20 QCIF = 0, (Port 1 Pin 7) wait 5 ms
cam_power_off_2 = 5, 3, 9,  0, 05;  // Turn off 13 MHz clock, delay 5ms
cam_power_off_3 = 5, 2, A3, 0, 05;	//Turn Off VCAM28_EN		GPIO_19
cam_power_off_4 = 5, 2, 85, 0, 05;	//Turn Off  VCAMSD18_EN		GPIO_05
cam_power_off_5 = 5, 2, A7, 0, 05;	//Turn Off  VCAM_LDO_EN		GPIO_23


//====================================================================	  
// Platform registers used 
//====================================================================	
//reg 0 = Return register for cam_init_result
//reg 1 = Return Register for cam_init_result
//reg 2 = Used in swapping frog view values in verticval mirror property 
//reg 3 = Used to store output format for zooming property. 00=QCIF, FF=SQCIF 
//reg 4 = Used in CLEAR_BIT_XX and SET_BIT_XX
//reg 5 = Used to store exposure mode, day for 00 and night for FF
//reg 7 = 
//reg 8 = 
//reg 9 = 
//reg a = Used in Register dump macro for iteration
//reg b = Used in Register dump macro for dump
//reg c = Used in Register dump macro
//reg d = Used in light meter output 
//reg e = Used in light meter output 
//reg f = Used as platform return register 
//===================================================================== 
//========================================================= 
// MACROS used in writing and reading to/from OV6680 sensor 
//========================================================= 

CLEAR_BIT_0=$b4 00 0 1;
  SET_BIT_0=$b4 01 0 1;
CLEAR_BIT_1=$b4 00 1 1;
  SET_BIT_1=$b4 01 1 1;
CLEAR_BIT_2=$b4 00 2 1;
  SET_BIT_2=$b4 01 2 1;
CLEAR_BIT_3=$b4 00 3 1;
  SET_BIT_3=$b4 01 3 1;
CLEAR_BIT_4=$b4 00 4 1;
  SET_BIT_4=$b4 01 4 1;
CLEAR_BIT_5=$b4 00 5 1;
  SET_BIT_5=$b4 01 5 1;
CLEAR_BIT_6=$b4 00 6 1;
  SET_BIT_6=$b4 01 6 1;
CLEAR_BIT_7=$b4 00 7 1;
  SET_BIT_7=$b4 01 7 1;
REGISTER_READ= !0 $f $r1 4;  // read 1 byte from cam reg !0 into internal 4
REGISTER_WRITE=!0 $w4 $f;     // write internal register 4 to selected register
// Reads out register !0, performs operation !1, then writes back
// register !0.  
REGISTER_MODIFY= 
  #REGISTER_READ(!0)  // read one byte from cam reg !0 into internal 4
  !1                  // perform !1
  #REGISTER_WRITE(!0) // write back to selected register
  ;
// Macros for different size and zoom settings
FROG_VIEW_AND_SCALE =   12 40 $f 2f 07 $f 18 c8 $f 60 7f $f 73 16 $f 74 01 $f 77 01 $f 78 18 $f;
QCIF_WITH_FROG_1x_ZOOM = 06 44 $f 12 40 $f 2f 07 $f 04 02 $f 17 40 $f 19 39 $f 18 cc $f
												 1a 90 $f 5a 58 $f 5b 48 $f 60 ff $f 73 16	$f 74 01 $f
												 77 0c $f 78 18 $f;
QCIF_NO_FROG_2x_ZOOM =  06 40 $f 12 00 $f 2f 0f $f 04 00 $f 17 5c $f 19 43 $f
												18 5a $f 1a 48 $f	5a 58 $f 5b 48 $f 77 20 $f 60 e7 $f
												73 06 $f 74 20 $f;
SQCIF_WITH_FROG_1x_ZOOM = 06 44 $f 12 00 $f 2f 0f $f 04 00 $f 17 52 $f 19 37 $f 18 82 $f 1a 60 $f
												  5a 40 $f 5b 30 $f 60 f7 $f 77 20 $f 73 06 $f 74 20 $f;
SQCIF_WITH_FROG_2x_ZOOM = 06 40 $f 12 00 $f 2f 0f $f 17 62 $f 19 4f $f 18 42 $f 1a 30 $f
												  5a 40 $f 5b 30 $f 77 20 $f 60 e7 $f 73 06 $f 74 20 $f;

// Macros for shifting between different fps settings while maintaining correct banding filter
MACRO_30_FPS_SETTINGS = 57 2e $f 59 07 $f 5f a3 $f 59 08 $f 5f 54 $f 0e 40 $f 11 00 $f
								        2a 00 $f 2b 3a $f 2c 3a $f 2d 00 $f 2e 00 $f 4f 82 $f 50 6c $f
								        21 23 $f 14 30 $f 0f 29 $f
								        ;
MACRO_15_FPS_SETTINGS = 57 0e $f 59 07 $f 5f a3 $f 59 08 $f 5f 54 $f 0e 40 $f 11 01 $f
								        2a 00 $f 2b 3a $f 2c 00 $f 2d 00 $f 2e 00 $f 4f 41 $f 50 36 $f
								        21 57 $f 14 30 $f 0f 29 $f
								        ;
MACRO_12_FPS_SETTINGS = 57 0e $f 59 07 $f 5f a3 $f 59 08 $f 5f 54 $f 0e 40 $f 11 01 $f
								        2a 00 $f 2b 3a $f 2c 6d $f 2d 00 $f 2e 00 $f 4f 41 $f 50 36 $f
								        21 79 $f 14 30 $f 0f 29 $f
								        ;
MACRO_10_FPS_SETTINGS = 57 0e $f 59 07 $f 5f 93 $f 59 08 $f 5f 54 $f 0e 40 $f 11 01 $f
								        2a 00 $f 2b 3a $f 2c da $f 2d 00 $f 2e 00 $f 4f 41 $f 50 36 $f
								        21 9b $f 14 30 $f 0f 29 $f
								        ;                        
MACRO_8_FPS_SETTINGS = 57 0e $f 59 07 $f 5f a3 $f 59 08 $f 5f 54 $f 0e 40 $f 11 01 $f
								       2a 01 $f 2b 3a $f 2c 7d $f 2d 00 $f 2e 00 $f 4f 41 $f 50 36 $f
								       21 9b $f 14 30 $f 0f 29 $f
								       ;
MACRO_7_5_FPS_SETTINGS = 57 0e $f 59 07 $f 5f 93 $f 59 08 $f 5f 54 $f 0e 40 $f 11 03 $f
								       2a 00 $f 2b 3a $f 2c 00 $f 2d 00 $f 2e 00 $f 4f 20 $f 50 1b $f
								       21 cf $f 14 30 $f 0f 29 $f
								       ;
MACRO_6_FPS_SETTINGS = 57 0e $f 59 07 $f 5f a3 $f 59 08 $f 5f 54 $f 0e 40 $f 11 03 $f
								       2a 00 $f 2b 44 $f 2c 6d $f 2d 00 $f 2e 00 $f 4f 20 $f 50 1b $f
								       21 03 $f 14 33 $f 0f 29 $f
								       ;
MACRO_VARIABLE_FRAMERATE_6_TO_12_FPS = 57 0e $f 59 07 $f 5f a3 $f 59 08 $f 5f 54 $f
                                       0e 98 $f 11 01 $f 2a 00 $f 2b 3a $f 2c 6d $f 
                                       2d 00 $f 2e 00 $f 4f 41 $f 50 36 $f 21 79 $f 
                                       14 30 $f 0f 29 $f;                   
STREAM_OFF =  #REGISTER_MODIFY(38,#SET_BIT_6)	
 							#REGISTER_MODIFY(38,#SET_BIT_5)
 							#REGISTER_MODIFY(38,#SET_BIT_4);
STREAM_ON =  	#REGISTER_MODIFY(38,#CLEAR_BIT_6)
 							#REGISTER_MODIFY(38,#CLEAR_BIT_5)
 							#REGISTER_MODIFY(38,#CLEAR_BIT_4);


FIRMWARE_2 = //Directly from OVT settings
0c c6 $f 3f 16 $f 0d 30 $f 06 40 $f 28 d0 $f 09 01 $f 17 40 $f
19 03 $f 18 ca $f 1a c8 $f 5a c8 $f 5b c8 $f 13 f7 $f 24 45 $f
25 3D $f 26 92 $f 27 34 $f 29 2C $f 5d A4 $f 60 67 $f 73 06 $f
74 20 $f 75 3c $f 76 40 $f 48 c4 $f 22 81 $f 3c 45 $f 20 b4 $f 
2f 07 $f 30 80 $f 31 49 $f 32 00 $f 33 00 $f 35 00 $f 34 1a $f  
36 1d $f 37 2d $f 40 00 $f 41 09 $f 42 01 $f 43 00 $f 44 00 $f  
45 00 $f 46 00 $f 47 00 $f 63 df $f 64 01 $f 65 02 $f 4a 08 $f  
4b 01 $f 4c c0 $f 5e 20 $f 66 f2 $f 81 12 $f 82 08 $f 83 16 $f  
79 80 $f 7a 6c $f 7b 14 $f 7c 0a $f 7d 7e $f 7e 88 $f 7f 1e $f
84 30 $f 85 5e $f 86 72 $f 87 82 $f 88 8e $f 89 9a $f 8a a4 $f  
8b ac $f 8c b8 $f 8d c3 $f 8e d6 $f 8f e6 $f 90 f2 $f 91 04 $f  
38 04 $f 58 83 $f 59 0e $f 5f 60 $f 56 40 $f 51 e0 $f 57 02 $f  
59 07 $f 5f a3 $f 59 08 $f 5f 54 $f 52 30 $f 56 29 $f 53 20 $f  
54 30 $f 59 00 $f 5f f0 $f 59 01 $f 5f F0 $f 59 0F $f 5f 00 $f  
59 10 $f 5f 7E $f 59 0A $f 5f 80 $f 59 0B $f 5f 01 $f 59 0C $f  
5f 0F $f 59 0D $f 5f 20 $f 59 09 $f 5f 20 $f 59 02 $f 5f 80 $f  
59 03 $f 5f 60 $f 59 04 $f 5f F0 $f 59 05 $f 5f 80 $f 59 06 $f  
5f 04 $f 59 0B $f 5f 31 $f 55 A6 $f 0F 29 $f 21 67 $f 14 30 $f  
4f 41 $f 50 36 $f 11 01 $f 2a 00 $f 2b 3a $f 2c 00 $f 2d 00 $f  
2e 00 $f 4d d1 $f 4e 09 $f 3e 69 $f 04 10 $f 77 20 $f $s3 00
$"CAM_FIRMWARE_DOWNLOADED";

DUMP_REG = $wa  $f  $r1 b $"CAM_C0_%a_%b" $+a 01;

REGISTER_DUMP_TO_LOG = $"CAM_Register_dump_to_log_started" 
		$sb 00 $sa 00 $sc FF // set internal regs
		$"CAM_Register_dump_loop_starting" 
		[c 94 #DUMP_REG];     // loop through registers 0 to 94 (all above 94=A0) and dump to log	 
//===================================================================== 
// I2C sequences 
//===================================================================== 
seq_init= $"CAM_SEQ_INIT" 12 80 $f 5c 40 $f 3d 5a $f 12 00 $f 
	//15 2C $f//I2C reset and power settings	OK
	//15 28 $f//I2C reset and power settings
	//15 08 $f//I2C reset and power settings
	15 08 $f//I2C reset and power settings
	0a $f $r1 0 $"CAM_ID_NUMBER_MSB_%0" 
	0b $f $r1 1 $"CAM_ID_NUMBER_LSB_%1"
	#FIRMWARE_2
	#MACRO_VARIABLE_FRAMERATE_6_TO_12_FPS
	; 
seq_ping=;

// ================= Viewfinder ==========================================
//SQCIF (Platform scales down to SQCIF from QCIF to maintain QCIF FOV)
seq_vf_config_27=
  #QCIF_WITH_FROG_1x_ZOOM
  #MACRO_12_FPS_SETTINGS
 	$s3 FF // Set internal register 3 to FF for SQCIF zooming 
	;
//QCIF 12fps
seq_vf_config_26=
  #QCIF_WITH_FROG_1x_ZOOM
  #MACRO_12_FPS_SETTINGS
	$s3 00 // Set internal register 3 to 00 for QCIF zooming 
	;

//QCIF 10fps
seq_vf_config_2d=
  #QCIF_WITH_FROG_1x_ZOOM
  #MACRO_10_FPS_SETTINGS
	$s3 00 // Set internal register 3 to 00 for QCIF zooming 
	;

//QCIF (COPY OF size_id 12!!!!! for ITP only)
seq_vf_config_4c=
  #QCIF_WITH_FROG_1x_ZOOM
  #MACRO_12_FPS_SETTINGS
  $s3 00 // Set internal register 3 to 00 for QCIF zooming 
	;
//QVGA for ITP only
seq_vf_config_4d=	17 4c $f 18 c8 $f 19 03 $f 1a c8 $f 5a 78 $f 5b A0 $f // Set data output to 240x320 
  								#REGISTER_MODIFY(0c,#CLEAR_BIT_6) #REGISTER_MODIFY(31,#CLEAR_BIT_6)
  								;
seq_vf_start= ;
seq_vf_stop=	#STREAM_OFF
							5a c8 $f 5b c8 $f
							#REGISTER_MODIFY(60,#CLEAR_BIT_4)      // Disable scale function
							#REGISTER_MODIFY(60,#CLEAR_BIT_3)      // Disable Frog view
							#REGISTER_MODIFY(06,#CLEAR_BIT_2)      // PCLK not divided by two for scale function
							#REGISTER_MODIFY(12,#CLEAR_BIT_6)      // AEC/AGC option not QCIF
							#STREAM_ON
							$"CAM_seq_vf_stop_done"
							;
	
// ================== Snapshot for ITP only ===========================================
// 400x400 snapshot for ITP testing purposes
seq_ss_config_41= 06 40 $f 12 00 $f 2f 07 $f 04 00 $f 17 40 $f 19 03 $f 18 ca $f 
									1a c8 $f 5a c8 $f 5b c8 $f 77 20 $f 60 e7 $f 73 06 $f 74 20 $f
									#REGISTER_MODIFY(0c,#SET_BIT_6) #REGISTER_MODIFY(31,#SET_BIT_6)
									; 
seq_ss_start= $d044C; //Delay 1,1s to allow AGC/AEC registers to settle
seq_ss_take=;
seq_ss_stop=;
seq_ss_verify=;
//====================================================================	
// DATA 
//====================================================================	
cam_vf_clock_freq=1,32c8;		// Viewfinder 13MHz 
cam_ss_clock_freq=1,32C8;   // Snapshot 13MHz	 	 		
cam_vf_format=B100;			    // YUV422 U Y1 V Y2...
cam_ss_format=B100;    			// YUV422 U Y1 V Y2...
cam_ping_result=; 
cam_init_result=66;         // For OMNIVISION 6680 sensor 
cam_vf_sync=0;              // VSYNC active low, HSYNC active high. Last data sample before VSYNC and HSYNC inactive
cam_ss_sync=0;              // See above 
cam_isp_config = 0;
cam_ccp2_enabled = 0;		//Disable ccp2 interface and set parallel width to 8bit, align to 7-0.
//=========================================================
//Supported sizes 
//========================================================= 
sup_sizes=
27[80,60,04B0, b0, 90],	// 128x96  - VF 12fps SQCIF (scaled down from QCIF by platform)
26[b0,90,04B0],		      // 176x144 - VF 12fps QCIF 
2d[b0,90,03E8],         // 176x144 - VF 10fps QCIF
4c[b0,90,04B0],	        // 176x144 - VF 12fps QCIF (copy of 12 for ITP use) 
4d[f0,140,04b0],        // 240x320 - VF 12fps QVGA for ITP use 
41[190,190,0]; 		      // 400x400 - SS YUV for ITP use 
//========================================================= 
// Support Properties: 
//========================================================= 
sup_properties = 
0[0, F,9],   // Exposure (EV-3.0 to EV+2.0 in steps of 0.3) 
1[0, 0,0],   // White balance (auto) 
2[0, 0,0],   // Flicker (auto) 
3[0, 1,1],   // Vertical mirror (0 = off, 1 = on) 
4[0, 1,0],   // Horizontal mirror (0 = off, 1 = on) 
6[a,14,a],    // Zoom (1.0x and 2.0x) 
7[0, 1,0],   // Night mode (0 = off, 1 = on) 
15[0,1,0],   // Frog view mode (0 = off, 1 = on) 
17[0,0,0],   // ISO (auto) 
// Testing and ITP properties: 
16[0,e,0],    // Optics testing property
19[0,5,1],   // Light meter control 
18[0,6,0],   // Window positioning 
1e[0,3,0];   // Color bar pattern enable, reset and main camera power save mode 
//========================================================= 
// Properties: 
//========================================================= 
// --- Brightness property 0 --------------------- 
// 
//  0 => -3 EV  1=> -(2 2/3) EV .... 
//  9 =>  0 EV  .... 
// 15 =>  2 EV 
//------------------------------------------------
seq_set_prop_0_0 = 24 0b $f 25 03 $f 26 10 $f; // -3.0EV
seq_set_prop_0_1 = 24 0c $f 25 04 $f 26 20 $f; // -2.7EV 
seq_set_prop_0_2 = 24 0f $f 25 07 $f 26 20 $f; // -2.3EV 
seq_set_prop_0_3 = 24 11 $f 25 09 $f 26 20 $f; // -2.0EV 
seq_set_prop_0_4 = 24 15 $f 25 0d $f 26 30 $f; // -1.7EV 
seq_set_prop_0_5 = 24 1a $f 25 12 $f 26 30 $f; // -1.3EV 
seq_set_prop_0_6 = 24 20 $f 25 18 $f 26 40 $f; // -1.0EV 
seq_set_prop_0_7 = 24 26 $f 25 1e $f 26 51 $f; // -0.7EV 
seq_set_prop_0_8 = 24 31 $f 25 29 $f 26 61 $f; // -0.3EV 
seq_set_prop_0_9 = 24 3b $f 25 33 $f 26 71 $f; //  0 EV (default)
seq_set_prop_0_a = 24 48 $f 25 40 $f 26 92 $f; //  0.3EV 
seq_set_prop_0_b = 24 5d $f 25 55 $f 26 c2 $f; //  0.7EV 
seq_set_prop_0_c = 24 72 $f 25 6a $f 26 e3 $f; //  1.0EV 
seq_set_prop_0_d = 24 8b $f 25 83 $f 26 f4 $f; //  1.3EV 
seq_set_prop_0_e = 24 b7 $f 25 af $f 26 f5 $f; //  1.7EV 
seq_set_prop_0_f = 24 e0 $f 25 d8 $f 26 f6 $f; //  2.0EV 

// --- White balance property 1 ------------------ 
//
//  (Sania uses auto only) 
//------------------------------------------------ 
seq_set_prop_1_0 = ;  // auto 

// --- Flicker correction property 2 ------------- 
// 
//  (Sania uses only auto) 
//------------------------------------------------ 
seq_set_prop_2_0 = ;	// auto 

// --- Vertical mirror property 3 ---------------- 
// 
//  0 => off, 1 => on 
//------------------------------------------------ 

seq_set_prop_3_0 = $"CAM_Vertical_mirror_off" #REGISTER_MODIFY(0c,#CLEAR_BIT_6)
									 #REGISTER_MODIFY(31,#CLEAR_BIT_6)   // Lens correction not mirrored
									 ;
seq_set_prop_3_1 = $"CAM_Vertical_mirror_on"  #REGISTER_MODIFY(0c,#SET_BIT_6)
									 #REGISTER_MODIFY(31,#SET_BIT_6)   // Lens correction mirrored
									 ;
// --- Horizontal mirror property 4 -------------- 
// 
//  0 => off, 1 => on 
//------------------------------------------------ 
seq_set_prop_4_0 = $"CAM_Horizontal_mirror_off" #REGISTER_MODIFY(0c,#CLEAR_BIT_7)
									 // Following three rows for swapping frog view values when flipping
									 #REGISTER_READ(77) $m2 4// Read reg 77 and move to int reg 2
									 #REGISTER_READ(78) #REGISTER_WRITE(77)// Copy reg 78 to reg 77
									 $m4 2 #REGISTER_WRITE(78)// move int reg 2 to int reg 4 and Write to reg 78
									 77 $f $r1 f $"CAM_Reg_77_content_%f"
									 78 $f $r1 f $"CAM_Reg_78_content_%f"
									 ; 
seq_set_prop_4_1 = $"CAM_Horizontal_mirror_on"  #REGISTER_MODIFY(0c,#SET_BIT_7)
									 // Following three rows for swapping frog view values when flipping
									 #REGISTER_READ(77) $m2 4// Read reg 77 and move to int reg 2
									 #REGISTER_READ(78) #REGISTER_WRITE(77)// Copy reg 78 to reg 77
									 $m4 2 #REGISTER_WRITE(78)// move int reg 2 to int reg 4 and Write to reg 78
									 77 $f $r1 f $"CAM_Reg_77_content_%f"
									 78 $f $r1 f $"CAM_Reg_78_content_%f"
									 ;
// --- Zoom property 6 --------------------------- 
// 
// 10 (0xa) => 1.0 x zoom 
// 20 (0x14) => 2.0 x zoom 
//------------------------------------------------ 
 							
seq_set_prop_6_a=
$"CAM_1x_zoom_reg_5_content_%5"
$"CAM_2x_zoom_reg_3_content_%3"
 $h0 V 01a0  // wait for end of frame or 416ms (> 4/10fps)
 #STREAM_OFF
$c5 00    // No night mode
 $d0060     // 96ms >= 1/12fps = 83.3ms
 #QCIF_WITH_FROG_1x_ZOOM
 $"CAM_1x_zoom_no_night_mode"
$cl         // Night mode active, change zoom in day mode and then switch back to night mode
 $d0080     // 128ms >= 1/8fps = 125ms
 #MACRO_12_FPS_SETTINGS
 #QCIF_WITH_FROG_1x_ZOOM
 #MACRO_8_FPS_SETTINGS
 $"CAM_1x_zoom_yes_night_mode"
$cx
 #STREAM_ON
 $h0 V 01a0  // wait for end of frame or 416ms (> 4/10fps)
; 

seq_set_prop_6_14=
$"CAM_2x_zoom_reg_5_content_%5"
$"CAM_2x_zoom_reg_3_content_%3"
 $h0 V 01a0  // wait for end of frame or 416ms (> 4/10fps)
 #STREAM_OFF
$c3 FF // IF internal reg 3 = 0, QCIF format is used in VF 
 #QCIF_NO_FROG_2x_ZOOM
 $"CAM_2x_zoom_QCIF"
$cl // ELSE, internal reg 3 = FF ; means SQCIF is used in VF
 #QCIF_NO_FROG_2x_ZOOM
 $"CAM_2x_zoom_SQCIF"
$cx

 #STREAM_ON
 $h0 V 01a0  // wait for end of frame or 416ms (> 4/10fps)
;
// ---------- Exposure property 7 ----------------
//
//  0 => Normal mode, 1 => Night mode
//------------------------------------------------
seq_set_prop_7_0= #MACRO_12_FPS_SETTINGS $s5 00;
seq_set_prop_7_1= #MACRO_8_FPS_SETTINGS $s5 FF;
								 
// ---------- Frog view property 15 ----------------
//
//	Frog view is enables by default for QCIF and SQCIF
//  This property is thus obsolete for SW.
//  QCIF or SQCIF format is prerequisite
//
//  0 => off, 1 => on
//------------------------------------------------
seq_set_prop_15_0= $"CAM_Disable_frogview" 
 									 #REGISTER_MODIFY(60,#CLEAR_BIT_3)  // Disable frog view
									 $"CAM_Frogview_disabled"
									 ;
seq_set_prop_15_1= $"CAM_Enable_frogview" 
									 #FROG_VIEW_AND_SCALE
									 $"CAM_Frogview_enabled"
									 ;

// ---------- ISO property 17 ----------------
//
//  (Sania uses auto only)
//------------------------------------------------
seq_set_prop_17_0=; //auto
									
// ---------- Optics testing property 16 ----------
//
//               TESTING ONLY!!!
//
// 0 => Normal colors
// 1 => Warm colors
// 2 => Skin tones 1
// 3 => Register dump
// 4 => PSA Color settings
// 5 => Skin tones 2
// 6 => LCC Compromise
// 7 => Skin tones 3
// 8 => LCC Flextronics
// 9 => Elena Colour settings
// a => Decreased contrast
// b => Default contrast
// c => LCC Foxconn
// d => Double color matrix values enable
// e => Double color matrix values disable
//------------------------------------------------
seq_set_prop_16_0=
79 74 $f 7a 5f $f 7b 15 $f 7c 14 $f 7d 68 $f 7e 7c $f 7f 1e $f;
seq_set_prop_16_1=
79 9a $f 7a 83 $f 7b 17 $f 7c 0c $f 7d 8e $f 7e 9a $f 7f 1e $f;
seq_set_prop_16_2=
79 d7 $f 7a c3 $f 7b 14 $f 7c 36 $f 7d ba $f 7e f0 $f 7f 1e $f;
seq_set_prop_16_3=
$"CAM_Prop_26_3" #REGISTER_DUMP_TO_LOG;
seq_set_prop_16_4=
79 7c $f 7a 68 $f 7b 14 $f 7c 0a $f 7d 76 $f 7e 80 $f 7f 1e $f;
seq_set_prop_16_5=
79 81 $f 7a 6d $f 7b 14 $f 7c 0a $f 7d 7e $f 7e 88 $f 7f 1e $f;
seq_set_prop_16_6=
30 80 $f 31 09 $f 32 00 $f 33 00 $f 35 00 $f 34 1a $f 36 1d $f 37 2d $f;
seq_set_prop_16_7=
79 80 $f 7a 6c $f 7b 14 $f 7c 0a $f 7d 7e $f 7e 88 $f 7f 1e $f;
seq_set_prop_16_8=
30 80 $f 31 09 $f 32 10 $f 33 18 $f 35 00 $f 34 20 $f 36 22 $f 37 38 $f;
seq_set_prop_16_9=
79 7c $f 7a 68 $f 7b 14 $f 7c 0a $f 7d 76 $f 7e 80 $f 7f 1e $f;
seq_set_prop_16_a=
70 60 $f 71 10 $f;
seq_set_prop_16_b=
70 00 $f 71 20 $f;
seq_set_prop_16_c=
30 80 $f 31 09 $f 32 85 $f 33 18 $f 35 00 $f 34 15 $f 36 18 $f 37 22 $f;
seq_set_prop_16_d=
#REGISTER_MODIFY(7f,#SET_BIT_6);
seq_set_prop_16_e=
#REGISTER_MODIFY(7f,#CLEAR_BIT_6);
									 
// ---------- Light Meter property 19 ------------
//
//		       		TESTING ONLY!!!!
//
//  0 => off, 1 => on, 2 => get value via debug print
//  3 => sleep mode off, 4 => sleep mode on
//  5 => get value via I2C
//------------------------------------------------
seq_set_prop_19_0= #REGISTER_MODIFY(30,#CLEAR_BIT_6); 												 //Disable light meter
seq_set_prop_19_1= #REGISTER_MODIFY(30,#SET_BIT_6) 4d 01 $f 4e 09 $f 3e 69 $f; //Enable light meter with complete register settings
seq_set_prop_19_2= 3a $f $r1 d 39 $f $r1 e 
									 $"CAM_Light_meter_value__MSB_q%dq__LSB_z%ez"; 							 //Output value if ENDE=1 in ITP
seq_set_prop_19_3= #REGISTER_MODIFY(09,#CLEAR_BIT_4); 												 //Disable sleep mode
seq_set_prop_19_4= #REGISTER_MODIFY(09,#SET_BIT_4);			 											 //Enable sleep mode
seq_set_prop_19_5= 3a $f 39 $f $"CAM_Light_meter_output_on_I2C_bus"; 					 // Light meter output to I2C instead of by using ENDE=1, for Illumination driver app.
seq_get_prop_19  = 3a $f $r1 0 39 $f $r1 1 $d0002 $"CAM_light_meter_output_%0_%1"; // Light meter output to SW app.

// ---------- WINDOW MOVING property 18 ----------
//
//                  TESTING ONLY!!!
//
// 0 => Reset to original positions 17=0x41, 19=0x20
// 1 => Increase H- startpos with 4 pixels (reg 0x17)
// 2 => Decrease H-startpos with 4 pixels (reg 0x17)
// 3 => Increase V-startpos with 4 pixels (reg 0x19)
// 4 => Decrease V-startpos with 4 pixels (reg 0x19)
// 5 => Set V-startpos to lowest window on sensor
//------------------------------------------------
seq_set_prop_18_0=17 41 $f 19 02 $f;
seq_set_prop_18_1=17 $f $r1 f $+f 01 $f 17 $wf $f $"CAM_Reg_17_content_%f";
seq_set_prop_18_2=17 $f $r1 f $-f 01 $f 17 $wf $f $"CAM_Reg_17_content_%f";
seq_set_prop_18_3=19 $f $r1 f $+f 02 $f 19 $wf $f $"CAM_Reg_19_content_%f";
seq_set_prop_18_4=19 $f $r1 f $-f 02 $f 19 $wf $f $"CAM_Reg_19_content_%f";
seq_set_prop_18_5=19 38 $f;
seq_set_prop_18_6=73 $f $r1 f $f 73 $wf $f $"CAM_Reg_73_content_%f"
		  74 $f $r1 f $f 74 $wf $f $"CAM_Reg_74_content_%f";

// ---------- COLOR BAR PATTERN property 1e ----------
//
//               ITP TESTING ONLY!!!
//
// 0 => Disable color bar
// 1 => Enable color bar with fading bars
// 2 => Set Main camera in Power Save mode (once)
// 3 => Loop to set Main camera in Power Save mode
//------------------------------------------------
seq_set_prop_1e_0= #REGISTER_MODIFY(61,#CLEAR_BIT_1);  	// Disable color bar output image
seq_set_prop_1e_1= #REGISTER_MODIFY(61,#SET_BIT_1)     	// Enable color bar output image
		   #REGISTER_MODIFY(68,#SET_BIT_6);    	// Set color bar to fade-to-gray

seq_set_prop_1e_2= $a1f $d0020				// set I2C adress to 1F
		   $go 63 1 $f           		// Reset high (de-activate)
	 	   06 02 00 01 01 5c $f			// Set main camera in power save mode
	 	   $d0020 $a60				// Set I2c Adress to 60
	 	   ;

seq_set_prop_1e_3= $a1f $d0020				// set I2C adress to 1F
		   $s0 01
		   [0 ff
		   $h7 63 4 1000      			// Listen to trig on Application GPIO_63 = Reset 
  		   $c7 01                
    			$"CAMDRIVER0: Reset active"   	
    			$go 63 1 $f           		// Reset high (de-activate)
	 	   	06 02 00 01 01 5c $f		// Set main camera in power save mode
	 	   	$s0 00 $f
                    $cl
    			$"CAMDRIVER0: Reset not active"
    			$d0064
  		    $cx]
  		    $d0020 $a60				// Set I2c Adress to 60
  		    ;
