//***************************************************************************** // Platform registers used: // // Register 0, Used for macros // Register 1, Used for macros // Register 2, Used for macros // Register 3, Used for macros // Register 5, Used in Property 6 // Register 6, Used for resolution ids // Register 7, Used ACM abort flag for synchronized viewfinder images. // Register 8, Used to remember ISO setting since one has to change to AE_MODE to "auto" for IS. // Register 9, Firmware version, checked in init_sequence // // Register b, Used for Flash // Register c, Used for sensor scenes // Register d, 0 => normal, burst 1 => read out pict 1 ... // Register e, Image stabilization 1 => ON, 0 => OFF // Register f, Image format 1 => JPEG, 0 => YCbCr //Information section //========================================================= info_name=MCB881; info_vendor=Kpk; info_major_ver=1; info_minor_ver=4; //Camera characteristics section //========================================================= cam_power_on_0 = 5, 1, 07, 1, 0; // Set GPIO 07 as output. BERGF cam_power_on_1 = 5, 2, 07, 0, 0; // Hold XE_STROBE low BERGF cam_power_on_2 = 5, 0, 0, 1, 5; // Pull RST pin cam_power_on_3 = 5, 1, 26, 1, 0; // Set GPIO 26 as output cam_power_on_4 = 5, 2, 26, 1, 5; // Enable main camera to bus cam_power_on_5 = 5, 1, 24, 1, 0; // Set GPIO 24 as output cam_power_on_6 = 5, 2, 24, 1, 5; // 1.2 V cam_power_on_7 = 5, 1, 35, 1, 0; // Set GPIO 35 as output cam_power_on_8 = 5, 2, 35, 1, 10; // 1.8V IO 2.7V AF cam_power_on_9 = 5, 3, 1, 32C8, 5; // Turn on 13 MHz clock and wait 5 ms cam_power_on_a = 5, 0, 0, 0, 12C; // Release RST pin and wait 300 ms cam_power_on_b = 5, 1, 37, 1, 0; // Set GPIO 37 (AF-LED) as output cam_power_on_c = 5, 1, 07, 0, 0; // Set GPIO 07 as input BERGF cam_power_off_0 = 5, 0, 0, 1, 5; // Pull RST pin cam_power_off_1 = 5, 3, 1, 1, 5; // Turn off 13 MHz clock cam_power_off_2 = 5, 1, 35, 1, 0; // Set GPIO 35 as output cam_power_off_3 = 5, 2, 35, 0, 10; // 1.8V IO 2.7V AF Off cam_power_off_4 = 5, 1, 24, 1, 0; // Set GPIO 24 as output cam_power_off_5 = 5, 2, 24, 0, 5; // 1,2V OFF cam_power_off_6 = 5, 1, 26, 1, 0; // Set GPIO 26 as output cam_power_off_7 = 5, 2, 26, 1, 0; // Disable main camera to bus cam_power_off_8 = 5, 1, 37, 1, 0; // Set GPIO 37 (AF-LED) as output cam_power_off_9 = 5, 2, 37, 0, 5; // Set GPIO 37 (AF-LED) low //================================================ // DATA //================================================ cam_i2c_address=1F; cam_vf_clock_freq=1,32C8; cam_ss_clock_freq=1,32C8; cam_vf_format=B100; cam_ss_format=0001; // JPEG default cam_ss_format_6=B100; // YCbCr cam_ss_format_7=B100; // YCbCr cam_ss_format_8=B100; // YCbCr cam_ss_format_9=B100; // YCbCr cam_data_offset=2; // JPEG default cam_data_offset_6=0; // YCbCr cam_data_offset_7=0; // YCbCr cam_data_offset_8=0; // YCbCr cam_data_offset_9=0; // YCbCr cam_vf_sync=5; cam_ss_sync=5; cam_ss_jpeg_buffer_size_1=E1000; // 920 KB buffer for 640x480 snap cam_ss_jpeg_buffer_size_2=F4240; // 1000 KB buffer for 1280x960 snap cam_ss_jpeg_buffer_size_3=124f80; // 1200 KB buffer for 1632x1244 snap cam_ss_jpeg_buffer_size_4=177000; // 1500 KB buffer for 2000x1500 snap cam_ss_jpeg_buffer_size_5=177000; // 1500 KB buffer for 2048x1536 snap //================================================ // SUPPORTED SIZES //================================================ // CAPTURE MODE (JPEG) // 1 = 640 x 480 2 = 1280x 960 3 = 1632x1224 // 4 = 2000 x 1500 5 = 2048 x 1536 // CAPTURE MODE (YCbCr) // 6 = 320 x 240 7 = 640 x 480 8 = 1280 x 960 // 9 = 1632 x 1224 // DRAFT MODE // 11 = 320 x 240 // 12 = 320 x 240 // VR MODE // 19 = 128 x 96 18 fps // 20 = 176 x 144 18 fps // 21 = 128 x 96 Normal mode 10 fps // 22 = 128 x 96 Night mode 7.5 fps // 23 = 176 x 144 Normal mode 10 fps // 24 = 176 x 144 Night mode 7.5 fps sup_sizes = 1[280,1E0,0], 2[500,3C0,0], 3[660,4C8,0], 4[7D0,5DC,0], 5[800,600,0], 6[140,F0,0], 7[280,1E0,0], 8[500,3C0,0], 9[660,4C8,0], 11[140,F0,BB8], // bb8 => 30 fps 12[140,F0,4B0], // 4B0 => 12 fps 19[60,80,5DC,140,F0], 20[90,B0,5DC,140,F0], 21[80,60,3E8], 22[80,60,2EE], 23[B0,90,3E8], 24[B0,90,2EE]; //================================================ // MACROS //================================================ // Sets register to value SET_REG(REG,VAL) SET_REG = 05 02 00 !0 !1 $f $r2 01 $d0005; // Reads register READ_REG(REG,$r2 01) READ_REG = 05 01 00 !0 01 $f !1 ; CLEAR_EVENT_FIFO = $s0 01 [ 0 20 05 01 00 03 03 $f $r4 0 012 $d0005 $"CLEARED_EVENT_%0_%1_%2" $c0 00 $cl #SET_REG(06,03) $cx ]; // Clears event register and start listen to TRIG // Note FIFO is not cleared CLEAR_EVENT = 05 01 00 03 03 $f $r4 0 023 $"CAPTURED_%0_%2_%3" #SET_REG(06,03); // Listen to TRIG WAIT_FOR_TRIG = $h0 25 5 1000 $c0 00 $"TIMEOUT" $cx; // Only send command, no reply is read out COMMAND = 06 02 00 01 !1 !0 $f $r3 012 $d0005; // Waits for signal on TRIG, and clear the event register when it has arrived CAPTURE_EVENT = #WAIT_FOR_TRIG #CLEAR_EVENT; // This sends a command and waits for reply // In most cases this is the command that should be used, isn't it? COM_EVENT = #CLEAR_EVENT_FIFO #CLEAR_EVENT #COMMAND(!0,!1) #WAIT_FOR_TRIG #CLEAR_EVENT; // Use poll instead of TRIG. It is difficult to use TRIG if reply // and mode transfer comes to close WAIT_FOR_MODE = $s0 01 [ 0 ff 05 01 00 03 03 $f $r4 1123 $c3 ea $s0 00 $cl $d0005 $cx ]; // Used to change mode, TRIG is not used, instead event register is polled. CHANGE_MODE = #CLEAR_EVENT_FIFO #SET_REG(06,03) #COMMAND(!0,!1) #WAIT_FOR_MODE #SET_REG(06,03); // Wait for that firmware is loaded WAIT_FOR_MUTE_OFF = $s4 01 [ 4 20 05 01 00 03 03 $r4 1 123 $c3 ec $s4 00 #CLEAR_EVENT #CLEAR_EVENT $cl $d0064 $cx ]; // Used where HALF_RELEASE should be done HALF_RELEASE = $"Half-release" #CHANGE_MODE(31,02) // AE locked, No AF, ACC not locked #CAPTURE_EVENT; UPDATE_WB = // Updates white balance if necessary $p5 01 $c5 00 // WB is auto? $d004b // Delay 75 milliseconds $cl $d004b // Delay 75 milliseconds $u01 // Update WB $cx; UPDATE_WB_IF_NECESSARY = $p5 01 $c5 00 // WB is auto? $cl $d010E // Delay 270 milliseconds $u01 // Update WB $cx; UPDATE_WB_IF_NECESSARY_NM = $p5 01 $c5 00 // WB is auto? $cl $d0190 // Delay 400 milliseconds $u01 // Update WB $cx; UPDATE_PHOTO = // Updates photo metering $p5 16 $c5 00 // Photo metering is not spot? $cl $u16 // Update photo metering => spot $cx; UPDATE_ISO = // Updates ISO $p5 11 $c5 00 // ISO is auto $cl $u11 // Update ISO $cx; WB_ISO100 = // Correct WB for ISO100 xenon #SET_REG(43,2A) // FLASH_CC_R = 0x25 (colour temperature of 7000 K for flash) #SET_REG(44,73); // FLASH_CC_B = 0x73 (colour temperature of 7000 K for flash) WB_ISO200 = // Correct WB for ISO200 xenon #SET_REG(43,2B) // FLASH_CC_R = 0x27 (colour temperature of 6000 K for flash) #SET_REG(44,6D); // FLASH_CC_B = 0x6D (colour temperature of 6000 K for flash) WB_ISO320 = #SET_REG(43,29) // CC_R_FLASH = 0x2A (colour temperature of 6800 K for flash) #SET_REG(44,6B); // CC_B_FLASH = 0x68 (colour temperature of 6800 K for flash) WB_ISO400 = // Correct WB for ISO400 xenon #SET_REG(43,28) // FLASH_CC_R = 0x28 (colour temperature of 5700 K for flash) #SET_REG(44,6A); // FLASH_CC_B = 0x6A (colour temperature of 5700 K for flash) // Normal mode settings NORM_MODE = #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,04) // Sharpeness 00 to 04 #SET_REG(40,07) // Set flash ISO to 400 #COM_EVENT(58,01) #WB_ISO400; // Document mode settings DOC_MODE = #COM_EVENT(55,01) // Increase contrast to 1 #COM_EVENT(56,07) // Increase sharpness to 7 #COM_EVENT(06,01) // Increase exposure to 1 #SET_REG(40,01) // Set flash ISO to 100 #COM_EVENT(58,10) #WB_ISO100; Landscape = #COM_EVENT(55,01) // Increase contrast to 1 #COM_EVENT(56,04) // Sharpeness 00 to 04 #COM_EVENT(06,00) // Reset exposure #COM_EVENT(58,04); Sport_scene = #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,03) // Sharpeness 00 to 03 #COM_EVENT(06,02) // Reset exposure #COM_EVENT(58,01); Portrait = #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,04) // Sharpeness 00 to 04 #COM_EVENT(06,00) // Reset exposure #SET_REG(40,05) // flash iso 250 #COM_EVENT(58,03) #WB_ISO200; Nightportrait = #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,04) // Sharpeness 00 to 04 #SET_REG(40,06) // Set flash ISO to 320 #COM_EVENT(58,03) #WB_ISO400; Twilight_landscape= #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,04) // Sharpeness 00 to 04 #COM_EVENT(06,00) // Reset exposure #COM_EVENT(58,04); Beach_snow = #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,04) // Sharpeness 00 to 04 #COM_EVENT(06,00) // Reset exposure #COM_EVENT(58,04); UPDATE_SCENE_A = #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,02) // Increase sharpness to 02 #COM_EVENT(06,00); // Reset exposure UPDATE_SCENE_B = #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,02) // Increase sharpness to 02 #COM_EVENT(06,FA); // Set exposure TO FA UPDATE_SCENE_C = #COM_EVENT(55,00) // Reset contrast #COM_EVENT(56,02) // Increase sharpness to 02 #COM_EVENT(06,FE); // Set exposure TO FD //================================================ // OTHER SEQ //================================================ seq_init= // $d0014 #WAIT_FOR_MUTE_OFF #CHANGE_MODE(34,01) // Draft mode #SET_REG(1c,01) // JPEG_CONTINUOUS_NUM = 1 #SET_REG(10,01) // YC_CONTINUOUS_NUM = 1 #SET_REG(32,00) // AF_SCAN_MODE => 0 Normal one focus window // JPEG settings #SET_REG(12,13) // JPEG_RETRY_LIMIT = 0x1770 = 5000d milliseconds #SET_REG(11,88) // #SET_REG(19,64) // JPEG_INIT_QUALITY = 0x64 = 100d #SET_REG(1A,64) // JPEG_FIRST_QUALITY = 0x60 = 100 #SET_REG(1B,5F) // JPEG_LAST_QUALITY = 0x5F = 95 #SET_REG(20,50) // JPEG_BURST_QUALITY = 0x64 = 80d // Xenon Flash initialization #SET_REG(36,16) // AE_MSHUT_SHORT = 1/40 #SET_REG(37,16) // AE_MSHUT_LONG = 1/40 #SET_REG(41,00) // AE_LEDFLASH_OFFSET = 0x0400 #SET_REG(42,04) // Low byte of AE_LEDFLASH_OFFSET #SET_REG(58,F0) // CC_FLASH_OFFSET_MAX_RATIO #SET_REG(59,A0) // CC_FLASH_OFFSET_MIN_RATIO #SET_REG(5A,0D) // CC_FLASH_OFFSET_DARK #SET_REG(5B,2B) // CC_FLASH_OFFSET_BRIGHT #NORM_MODE // Formula to calculate AE value from exposure time, t, and ISO value: AE = 12971-1479*ln(ISO*t) #SET_REG(38,47) // 23b4 AE_FLASHINFO_SHORT = ISO 400, 1/30 s (no use level) #SET_REG(39,47) // 23b4 AE_FLASHINFO_LONG = ISO 400, 1/30 s (use level) #COM_EVENT(5a,08) // OFF, start FLASH_MODE 0b00001000 (FLASH INFO) No mech shutter, flash off // Default values for platform registers #COM_EVENT(72,00) // Update registers, INFO_GET_DATA #READ_REG(4d,$r2 9 9) // ROM_BUILD_VERSION in reg 9 $s7 00 // Flag for ACM (BestPic) abort 0 => init, 1 => event received, 2 => stop request, ff => Abort $s8 00 // Used to remember ISO setting in IS mode $sa 00 // Default normal scene $sb 00 // Default flash off $sc 00 // Default normal scene $sd 00 // Default no burst mode in snapshot $se 00 // Default no image stabilization $sf 01; // Used in resolution ids: 1 => JPEG, 0 => YCbCr seq_ping=; //================================================ // PROPERTIES //================================================ // //Properties: // 0 = Exposure Implemented // 1 = White balance Implemented // 2 = Flicker Implemented // 3 = Vertical mirror Implemented // 4 = Horisontal mirror Implemented // 5 = JPEG Compression level Implemented // 6 = Zoom Implemented // 7 = Night mode Implemented // 8 = Effects Implemented // 9 = Focus mode Implemented // a 10 = Focus operation Implemented // b 11 = Get Exif information 1 Implemented // c 12 = Get Exif information 2 Implemented // d 13 = (LED support) NOT VALID FOR MCB 881 // e 14 = Flash support Implemented // f 15 = Power save mode NOT VALID FOR MCB 881 // 10 16 = Scenes Implemented // 11 17 = ISO Implemented // 12 18 = Auto exposure NOT VALID FOR MCB 881 // 13 19 = Brightness NOT VALID FOR MCB 881 // 14 20 = Contrast Implemented // 15 21 = Sharpening Implemented // 16 22 = Metering mode Implemented // 17 23 = Check flash needed Implemented // 18 24 = Image stab Implemented // 19 25 = Linear zoom Implemented // 1a 26 = Get zoom value Implemented // 1b 27 = Snapshot operation Implemented // 1c 28 = Half release Implemented // 1d 29 = ACM operation Implemented //================================================ sup_properties = 0[3,f,9], 1[0,8,0], 2[0,3,0], 3[0,3,0], 4[0,3,0], 5[0,9,0], 6[a,a0,a], 7[0,0,0], 8[0,4,0], 9[0,6,0], a[0,5,0], b[0,0,0], c[0,0,0], e[0,5,0],10[0,7,0], 11[0,7,0],12[0,ff,0],14[0,11,8],15[0,11,8], 16[0,1,0],17[0,0,0],18[0,1,0],19[0,3,0], 1a[0,0,0], 1b[0,9,0],1c[0,1,0], 1d[0,3,0],1e[0,1,0], 1f[0,0,0]; //************************************************ // Exposure property 0 ***** //************************************************ // 3 => -2 EV, 9 => -(0) EV .... f => 2 EV //--------------------------------------------------- // SUPER NIGHT MODE C seq_set_prop_0_3 = #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 #COM_EVENT(06,FA) #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,10) // 8,0 fps AE_SLOW_SHUTTER $cc 00 // Normal scene? #SET_REG(40,03) // AE_XENON_ISO = 160 #SET_REG(37,0E) // AE_MSHUT_LONG = 1/250 #WB_ISO100 $cl $cc 01 // Portrait scene? #SET_REG(40,02) // AE_XENON_ISO = 125 #SET_REG(37,0E) // AE_MSHUT_LONG = 1/250 #WB_ISO100 $cl $cc 03 // Document scene? #COM_EVENT(06,FB) #SET_REG(37,0b) // AE_MSHUT_LONG = 1/500 #WB_ISO100 $cl $cc 05 // Sport? #COM_EVENT(06,FB) $cl $cc 07 // Nightportrait scene? #SET_REG(40,05) // AE_XENON_ISO = 250 #SET_REG(37,0f) // AE_MSHUT_LONG = 1/200 #COM_EVENT(51,00) // Sensor scene AUTO #SET_REG(2a,06) #COM_EVENT(02,04) // ISO320 #COM_EVENT(56,03) // Increase sharpness to 03 #COM_EVENT(06,00) #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,08) // 4,0 fps slow shutter speed #WB_ISO200 $cl $cc 04 // Night scene? #COM_EVENT(51,00) // Sensor scene AUTO #SET_REG(2a,01) #COM_EVENT(02,04) // ISO100 #COM_EVENT(56,07) // Increase sharpness to 07 #COM_EVENT(06,06) #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,01) // 0,5 fps very slow shutter speed #UPDATE_WB_IF_NECESSARY_NM $cl $cx $cx $cx $cx $cx $cx; // SUPER NIGHT MODE B seq_set_prop_0_4 = #COM_EVENT(02,00) // Set back to default #COM_EVENT(06,FA) #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,10) // 8,0 fps AE_SLOW_SHUTTER $cc 03 // Document? #COM_EVENT(06,FC) #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 05 // Sport? #COM_EVENT(06,FC) $cl $cc 00 // Normal? #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 #COM_EVENT(06,FA) $cl $cc 01 // Portrait? #COM_EVENT(06,FA) $cl $cc 04 // Night scene? #COM_EVENT(51,00) // Sensor scene AUTO #SET_REG(2a,04) #COM_EVENT(02,04) // ISO200 #COM_EVENT(56,06) // Increase sharpness to 06 #COM_EVENT(06,03) #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,02) // 1,0 fps slow shutter speed #UPDATE_WB_IF_NECESSARY_NM $cl $cc 07 // Nightportrait scene? #COM_EVENT(51,03) // Nightportrait scene #UPDATE_SCENE_B #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,0a) // 5,0 FPS #WB_ISO400 #UPDATE_WB_IF_NECESSARY $cl $cx $cx $cx $cx $cx $cx; // SUPER NIGHT MODE A seq_set_prop_0_5 = #COM_EVENT(02,00) // Set back to default #COM_EVENT(06,FB) #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,10) // 8,0 fps AE_SLOW_SHUTTER $cc 03 // Document? #COM_EVENT(06,FD) #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 05 // Sport? #COM_EVENT(06,FD) $cl $cc 00 // Normal? #COM_EVENT(06,FB) #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cl $cc 01 // Portrait? #COM_EVENT(06,FB) $cl $cc 07 // Nightportrait? #COM_EVENT(06,FB) $cl $cc 04 // Night scene? #COM_EVENT(51,00) // Sensor scene AUTO #SET_REG(2a,04) #COM_EVENT(02,04) // ISO200 #COM_EVENT(56,05) // Increase sharpness to 05 #COM_EVENT(06,02) // Increase exposure #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,04) // 2 fps slow shutter speed #UPDATE_WB_IF_NECESSARY_NM $cl $cx $cx $cx $cx $cx $cx; seq_set_prop_0_6 = #COM_EVENT(02,00) // Set back to default #COM_EVENT(06,FC) #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,10) // 8,0 fps AE_SLOW_SHUTTER #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cc 00 // Normal scene? #SET_REG(40,05) // AE_XENON_ISO = 250 #SET_REG(37,15) // AE_MSHUT_LONG = 1/50 #WB_ISO200 $cl $cc 07 // Nightportrait scene? #SET_REG(40,06) // AE_XENON_ISO = 320 #WB_ISO320 $cl $cc 01 // Portrait scene? #SET_REG(40,04) // AE_XENON_ISO = 200 #SET_REG(37,15) // AE_MSHUT_LONG = 1/50 #WB_ISO200 $cl $cc 03 // Document scene? #COM_EVENT(06,FE) #SET_REG(37,0E) // AE_MSHUT_LONG = 1/250 #WB_ISO100 $cl $cc 04 // Night scene? #COM_EVENT(51,04) // Night scene #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,08) // 4,0 FPS #UPDATE_SCENE_C #UPDATE_WB_IF_NECESSARY $cl $cc 05 // Sport? #COM_EVENT(06,FE) $cl $cx $cx $cx $cx $cx $cx; seq_set_prop_0_7 = $cc 03 #COM_EVENT(06,FF) #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 04 #COM_EVENT(06,FF) $cl $cc 05 #COM_EVENT(06,FF) $cl #COM_EVENT(06,FD) #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cl $cx $cx $cx $cx; seq_set_prop_0_8 = $cc 03 #COM_EVENT(06,00) #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 04 #COM_EVENT(06,00) $cl $cc 05 #COM_EVENT(06,00) $cl #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 #COM_EVENT(06,FE) $cl $cx $cx $cx $cx; seq_set_prop_0_9 = $cc 03 #COM_EVENT(06,01) // increase exposure #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 04 #COM_EVENT(06,01) // increase exposure $cl $cc 05 #COM_EVENT(06,01) // increase exposure $cl #COM_EVENT(06,FF) // Reduce exposure #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cl $cx $cx $cx $cx; seq_set_prop_0_a = $cc 03 #COM_EVENT(06,02) #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 04 #COM_EVENT(06,02) $cl $cc 05 #COM_EVENT(06,02) $cl #COM_EVENT(06,00) #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cl $cx $cx $cx $cx; seq_set_prop_0_b = $cc 03 #COM_EVENT(06,03) #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 04 #COM_EVENT(06,03) $cl $cc 05 #COM_EVENT(06,03) $cl #COM_EVENT(06,01) #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cl $cx $cx $cx $cx; seq_set_prop_0_c = #COM_EVENT(06,02) // Increase exposure to 2 #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cc 00 // Normal scene? #SET_REG(40,07) // AE_XENON_ISO = 400 #WB_ISO400 $cl $cc 01 // Portrait scene? #SET_REG(40,06) // AE_XENON_ISO = 320 #WB_ISO320 $cl $cc 07 // Nightportrait scene? #SET_REG(40,07) // AE_XENON_ISO = 400 $"slow_sync" #SET_REG(37,1a) // AE_MSHUT_LONG = 1/15 #WB_ISO400 $cl $cc 03 // Document scene? #COM_EVENT(06,04) #SET_REG(40,03) // AE_XENON_ISO = 160 #WB_ISO100 $cl $cc 04 // Night? #COM_EVENT(06,04) $cl $cc 05 // Sport? #COM_EVENT(06,04) $cl $cx $cx $cx $cx $cx $cx; seq_set_prop_0_d = $cc 03 #COM_EVENT(06,05) #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 04 #COM_EVENT(06,05) $cl $cc 05 #COM_EVENT(06,05) $cl #COM_EVENT(06,03) #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cl $cx $cx $cx $cx; seq_set_prop_0_e = $cc 03 #COM_EVENT(06,06) #SET_REG(37,19) // AE_MSHUT_LONG = 1/20 $cl $cc 04 #COM_EVENT(06,06) $cl $cc 05 #COM_EVENT(06,06) $cl $cc 06 // Landscape Mode Default #COM_EVENT(06,00) #COM_EVENT(06,04) #COM_EVENT(56,04) #COM_EVENT(55,00) #COM_EVENT(58,04) $cl #COM_EVENT(06,04) #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cl $cx $cx $cx $cx $cx; seq_set_prop_0_f = #COM_EVENT(06,05) // Increase exposure to 5 #SET_REG(37,17) // AE_MSHUT_LONG = 1/30 $cc 01 // Portrait scene? #SET_REG(40,07) // AE_XENON_ISO = 400 #WB_ISO400 $cl $cc 00 // Normal scene? #SET_REG(40,07) // AE_XENON_ISO = 400 $"slow_sync" #SET_REG(37,1a) // AE_MSHUT_LONG = 1/15 #WB_ISO400 $cl $cc 07 // Nightportrait scene? #SET_REG(40,07) // AE_XENON_ISO = 400 $"slow_sync" #SET_REG(37,1c) // AE_MSHUT_LONG = 1/10 #WB_ISO400 $cl $cc 03 // Document scene? #COM_EVENT(06,06) #SET_REG(40,05) // AE_XENON_ISO = 250 $"slow_sync" #SET_REG(37,18) // AE_MSHUT_LONG = 1/25 #WB_ISO200 $cl $cc 04 #COM_EVENT(06,06) $cl $cc 05 #COM_EVENT(06,06) $cl $cc 06 // Super Landscape Mode #COM_EVENT(06,00) #COM_EVENT(06,FE) #COM_EVENT(56,06) #COM_EVENT(55,03) #COM_EVENT(58,1D) $cl $cx $cx $cx $cx $cx $cx $cx; // END OF SUPER NIGHT MODE BY GNUS //************************************************ // White balance, property 1 ******* //************************************************ // 0 => auto 1 => tungsten 2 => fluorescent // 3 => clear sky 4 => cloudy // 5 => one push 6 => hold // 7 => Xenon 8 => LED //--------------------------------------------------- seq_set_prop_1_0 = #COM_EVENT(11,00); seq_set_prop_1_1 = #COM_EVENT(11,03); seq_set_prop_1_2 = #COM_EVENT(11,04); seq_set_prop_1_3 = #COM_EVENT(11,05); seq_set_prop_1_4 = #COM_EVENT(11,06); seq_set_prop_1_5 = #COM_EVENT(11,09); seq_set_prop_1_6 = #COM_EVENT(11,01); seq_set_prop_1_7 = #COM_EVENT(11,07); seq_set_prop_1_8 = #COM_EVENT(11,08); //**************************************************** // Flicker correction, property 2 ******* //**************************************************** // 0 => auto, 1 => 50 Hz, 2 => 60 Hz, 3 => disable // //--------------------------------------------------- seq_set_prop_2_0=#COM_EVENT(21,01); //Auto detect seq_set_prop_2_1=#COM_EVENT(21,02); //50Hz detect seq_set_prop_2_2=#COM_EVENT(21,03); //60Hz detect seq_set_prop_2_3=#COM_EVENT(21,00); //Disable //*************************************************** // Vertical mirror, property 3 ********* //*************************************************** seq_set_prop_3_0 = #COM_EVENT(52,00); // OFF 0b00000000 Capt/draft seq_set_prop_3_1 = #COM_EVENT(52,0a); // ON 0b00001010 Capt/draft //*************************************************** // Horizontal mirror, property 4 ******* //*************************************************** seq_set_prop_4_0 = #COM_EVENT(52,00); // OFF 0b00000000 Capt/draft seq_set_prop_4_1 = #COM_EVENT(52,05); // ON 0b00000101 Capt/draft //*************************************************** // JPEG Compression level, property 5 //*************************************************** seq_set_prop_5_0 = #SET_REG(19,5F) // JPEG_INIT_QUALITY = 0x5F = 95d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,66) #SET_REG(18,03) #SET_REG(15,23) #SET_REG(16,03); seq_set_prop_5_1 = #SET_REG(19,64) // JPEG_INIT_QUALITY = 0x64 = 100d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,66) #SET_REG(18,03) #SET_REG(15,23) #SET_REG(16,03); seq_set_prop_5_2 = $"VGA_High_comp" #SET_REG(19,5F) // JPEG_INIT_QUALITY = 0x5F = 95d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,20) #SET_REG(18,03) #SET_REG(15,58) #SET_REG(16,03); seq_set_prop_5_3 = $"VGA_low_comp" #SET_REG(19,64) // JPEG_INIT_QUALITY = 0x64 = 100d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,64) #SET_REG(18,03) #SET_REG(15,23) #SET_REG(16,03); seq_set_prop_5_4 = $"1M_High_comp" #SET_REG(19,5F) // JPEG_INIT_QUALITY = 0x5F = 95d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,20) #SET_REG(18,03) #SET_REG(15,58) #SET_REG(16,03); seq_set_prop_5_5 = $"1M_low_comp" #SET_REG(19,64) // JPEG_INIT_QUALITY = 0x64 = 100d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,64) #SET_REG(18,03) #SET_REG(15,23) #SET_REG(16,03); seq_set_prop_5_6 = $"2M_High_comp" #SET_REG(19,5F) // JPEG_INIT_QUALITY = 0x5F = 95d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,20) #SET_REG(18,03) #SET_REG(15,58) #SET_REG(16,03); seq_set_prop_5_7 = $"2M_low_comp" #SET_REG(19,64) // JPEG_INIT_QUALITY = 0x64 = 100d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,64) #SET_REG(18,03) #SET_REG(15,23) #SET_REG(16,03); seq_set_prop_5_8 = $"3M_High_comp" #SET_REG(19,5F) // JPEG_INIT_QUALITY = 0x5F = 95d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,66) #SET_REG(18,03) #SET_REG(15,23) #SET_REG(16,03); seq_set_prop_5_9 = $"3M_low_comp" #SET_REG(19,64) // JPEG_INIT_QUALITY = 0x64 = 100d #SET_REG(13,84) #SET_REG(14,03) #SET_REG(17,66) #SET_REG(18,03) #SET_REG(15,23) #SET_REG(16,03); //*************************************************** // Zoom, property 6 ***** //*************************************************** // 10 => 1.0 x zoom, 11 => 1.1 x zoom, ... 160 => 16.0 x zoom // Hex values from 40 ... 04 seq_set_prop_6 = #SET_REG(3d,3C) // ZM_SMTH_SPEED = 60 #SET_REG(3e,01) // ZM_SMTH_INTERVAL = 1 $s4 %0 // Place value in reg 4 $s5 40 // Place value 64 in reg 5 $*5 0a // Multiply reg 5 by a $/5 r4 // Divide reg 5 with reg 4 $"Cam_mag_value_%5" #COM_EVENT(61,$w5); seq_get_prop_6 = #READ_REG(3c,$r2 3 3) // Read ZM_STEP $"MAG_%3" $c3 40 $s0 0A $cl $cx $c3 3F $s0 0A $cl $cx $c3 3E $s0 0A $cl $cx $c3 3D $s0 0A $cl $cx $c3 3C $s0 0B $cl $cx $c3 3B $s0 0B $cl $cx $c3 3A $s0 0B $cl $cx $c3 39 $s0 0B $cl $cx $c3 38 $s0 0B $cl $cx $c3 37 $s0 0C $cl $cx $c3 36 $s0 0C $cl $cx $c3 35 $s0 0C $cl $cx $c3 34 $s0 0C $cl $cx $c3 33 $s0 0D $cl $cx $c3 32 $s0 0D $cl $cx $c3 31 $s0 0D $cl $cx $c3 30 $s0 0D $cl $cx $c3 2F $s0 0E $cl $cx $c3 2E $s0 0E $cl $cx $c3 2D $s0 0E $cl $cx $c3 2C $s0 0F $cl $cx $c3 2B $s0 0F $cl $cx $c3 2A $s0 0F $cl $cx $c3 29 $s0 10 $cl $cx $c3 28 $s0 10 $cl $cx $c3 27 $s0 10 $cl $cx $c3 26 $s0 11 $cl $cx $c3 25 $s0 11 $cl $cx $c3 24 $s0 12 $cl $cx $c3 23 $s0 12 $cl $cx $c3 22 $s0 13 $cl $cx $c3 21 $s0 13 $cl $cx $c3 20 $s0 14 $cl $cx $c3 1F $s0 15 $cl $cx $c3 1E $s0 15 $cl $cx $c3 1D $s0 16 $cl $cx $c3 1C $s0 17 $cl $cx $c3 1B $s0 18 $cl $cx $c3 1A $s0 19 $cl $cx $c3 19 $s0 1A $cl $cx $c3 18 $s0 1B $cl $cx $c3 17 $s0 1C $cl $cx $c3 16 $s0 1D $cl $cx $c3 15 $s0 1E $cl $cx $c3 14 $s0 20 $cl $cx $c3 13 $s0 22 $cl $cx $c3 12 $s0 24 $cl $cx $c3 11 $s0 26 $cl $cx $c3 10 $s0 28 $cl $cx $c3 0F $s0 2A $cl $cx $c3 0E $s0 2E $cl $cx $c3 0D $s0 31 $cl $cx $c3 0C $s0 35 $cl $cx $c3 0B $s0 3A $cl $cx $c3 0A $s0 40 $cl $cx $c3 09 $s0 47 $cl $cx $c3 08 $s0 50 $cl $cx $c3 07 $s0 5B $cl $cx $c3 06 $s0 6B $cl $cx $c3 05 $s0 80 $cl $cx $c3 04 $s0 A0 $cl $cx $s1 00 $s2 00 $s3 00 $"ZOOM_%3_%2_%1_%0"; //*************************************************** // Night mode, property 7 ***** //*************************************************** // Only for video telephony!!! // 0 => 12 fps 1 => 10 fps //--------------------------------------------------- seq_set_prop_7_0 = #COM_EVENT(34,01) // Draft mode #SET_REG(09,16) // 11 fps #COM_EVENT(03,16); // 11 fps, AE_SLOW_SHUTTER seq_set_prop_7_1 = #COM_EVENT(34,01) // Draft mode #SET_REG(09,12) // 9 fps #COM_EVENT(03,12); // 9 fps, AE_SLOW_SHUTTER //*************************************************** // Effects, property 8 ***** //*************************************************** // // 0 => normal, 1 => negative, 2 => solarize // 3 => sepia, 4 => black&white, //inverted sepia and negative B&W //--------------------------------------------------- seq_set_prop_8 = #COM_EVENT(53,%0); //*************************************************** // Focus mode, property 9 ***** //*************************************************** seq_set_prop_9_0 = #SET_REG(32,00); // 0x32 = AF_SCAN_MODE => 0 Normal seq_set_prop_9_1 = #SET_REG(32,01); // 0x32 = AF_SCAN_MODE => 1 Full range seq_set_prop_9_2 = ; seq_set_prop_9_3 = ; seq_set_prop_9_4 = ; seq_set_prop_9_5 = #READ_REG(32,$r2 0 0) // Check what reg 32 contains $b0 00 1 7 // Mask out LSB bit $c0 00 // LSB was zero, i.e. scan mode was normal #SET_REG(32,00) // Use one AF window, normal $cl // scan mode was full range #SET_REG(32,01) // Use one AF window, full range $cx; seq_set_prop_9_6 = #READ_REG(32,$r2 0 0) // Check what reg 32 contains $b0 00 1 7 // Mask out LSB bit $c0 00 // LSB was zero, i.e. scan mode was normal #SET_REG(32,04) // Use multiple AF windows, normal $cl // scan mode was full range #SET_REG(32,05) // Use multiple AF windows, full range $cx; //*************************************************** // Focus operation, property 10, *** //*************************************************** // 0 => stop AF 1 => start AF 2 => Go to infinity //-------------------------------------------------- seq_set_prop_a_0 = $go 37 0; // Turn off AF-LED seq_set_prop_a_1 = $c9 08 // R5 #COM_EVENT(72,00) // Update the registers #READ_REG(28,$r2 5 5) // Read AE-value (MSB)in camera reg 28 $>5 5 $p4 10 // Put value of scene property in reg 4 $c4 06 // Sports mode? // AF-LED OFF in sports mode $cl $c5 00 // AF-LED ON? $go 37 1 // Set gpio 3:7 (AF-LED) to high (one) $cl $cx $cx $cl // else R6 $ce 01 // AF-LED for IS_MOVIE_MODE? #COM_EVENT(72,00) // Update the registers #READ_REG(28,$r2 5 5) // Read AE-value (MSB)in camera reg 28 $>5 5 $c5 00 // AF-LED ON? $go 37 1 // Set gpio 3:7 (AF-LED) to high (one) $cl $cx $cl // Not IS_MOVIE_MODE #COM_EVENT(72,00) // Update the registers #READ_REG(3a,$r2 5 5) // Read AE_FLASHINFO_STATUS $p4 10 // Put value of scene property in reg 4 $c4 06 // Sports mode? // AF-LED OFF in sports mode $cl $c5 03 // AF-LED ON? $go 37 1 // Set gpio 3:7 (AF-LED) to high (one) $cl $cx $cx $cx $cx #COM_EVENT(42,01); seq_set_prop_a_2 = $go 37 0 #COM_EVENT(43,00); // Go to infinity seq_get_prop_a = 05 01 00 03 03 $f $r4 0 012 // Read out reg. 345 from cam to platform reg 012 $c2 e6 // e6 = AF event $c1 00 $s0 04 $go 37 0 // AF success, turn off AF-LED $cl $s0 05 $go 37 0 // AF failed, turn off AF-LED $cx $cl $c2 e7 // e7 = MF event // If we are not using manual focus, then this event should just be ignored $p0 0a $c0 01 $s0 03 // in progress $cl $c1 00 $s0 04 $go 37 0 // MF succes, turn off AF-LED $cl $s0 05 $go 37 0 // MF failed, turn off AF-LED $cx $cx $cl $s0 03 // in progress $cx $cx $s1 00 // Set reg1 to zero $s2 00 // Set reg2 to zero $s3 00 // Set reg3 to zero $"FOCUSOPERATION_%0_%1_%2_%3"; //***************************************************** // Get EXIF information 1, property 11 ** //***************************************************** seq_get_prop_b = #COM_EVENT(72,00) // Update the registers, INFO_GET_DATA #READ_REG(48,$r2 3 3) // Put shutter(H, MSB) in reg 3 #READ_REG(47,$r2 2 2) // Put shutter(L, LSB) in reg 2 #READ_REG(46,$r2 1 1) // Put ISO(H, MSB) in reg 1 #READ_REG(45,$r2 0 0) // Put ISO(L, LSB) in reg 0 $"EXIF1_%3_%2_%1_%0"; //***************************************************** // Get EXIF information 2, property 12 *** //***************************************************** seq_get_prop_c = #COM_EVENT(72,00) // Update registers, INFO_GET_DATA #READ_REG(49,$r2 0 0) // Put WB in reg 0 $c0 00 // reg 0 = 00 ? // Do nothing $cl $-0 02 // Subtract 2 from reg 5 $cx #READ_REG(4a,$r2 1 1) // Put distance in reg 1 #READ_REG(4b,$r2 2 2) // Put flash (LED) in reg 2 #READ_REG(26,$r2 3 3) // Put q-factor (JPEG_HOST_QUALITY) in reg 3 $"EXIF2_%3_%2_%1_%0"; //******************************************************************** // Internal/External xenon flash support, property 14 *** //******************************************************************** // 0 => OFF 1 => not impl. 2 => Auto // 3 => Auto RER 4 => Forced ON //-------------------------------------------------------------------- seq_set_prop_e_0 = $sb 00 // OFF $c9 08 // R5 camera version? #COM_EVENT(5a,00) $cl // Else R6 version #COM_EVENT(5a,08) $cx; seq_set_prop_e_1 = ; // No external flash seq_set_prop_e_2 = $sb 02; // Auto seq_set_prop_e_3 = $sb 03; // Auto, red-eye seq_set_prop_e_4 = $sb 04 // Forced ON, for service menu and production tests $c9 08 // R5 camera version? #COM_EVENT(5a,83) // Forced xenon 0b10000011, slow sync at beginning $cl #COM_EVENT(51,00) // Sensor scene "Auto 00" #COM_EVENT(5a,9b) // FLASH_MODE 0b10001011: Flash on, RER off, sync on beginning. $cx; //******************************************************************** // Scenes, property 16, 0x10 //******************************************************************** // 0 => normal 1 => Portrait 2 => Landscape // 3 => Nightscene 4 => Nightportrait 5 => Beach/snow // 6 => sports 7 => Document //-------------------------------------------------------------------- seq_set_prop_10_0 = $"Normal_scene" // IS disabled $sc 00 // Sensor scene #COM_EVENT(03,10) // 8 fps AE_SLOW_SHUTTER #COM_EVENT(51,00) // Normal #UPDATE_WB // Update whitebalance #UPDATE_PHOTO // update photo property #UPDATE_ISO // updates iso #NORM_MODE; // normal mode seq_set_prop_10_1 = $"Portrait_scene" // IS disabled $sc 01 // Sensor scene "Portrait 01" #COM_EVENT(51,00) // Sensor scene #UPDATE_WB #UPDATE_ISO #Portrait; seq_set_prop_10_2 = $"Landscape_scene" // Flash disabled $sc 06 // Sensor scene #COM_EVENT(03,0f) // 8 fps AE_SLOW_SHUTTER $c9 08 // R5 camera version? #COM_EVENT(51,06) // Landscape $cl // Else R6 $ce 01 // IS ON? #COM_EVENT(51,08) // Sensor scene "Custom 08" #COM_EVENT(08,05) // AE_PHOTOMETRY = 05 $cl #COM_EVENT(51,06) // Sensor scene "Landscape 06" $cx $cx #UPDATE_WB // Update whitebalance #UPDATE_ISO #Landscape; seq_set_prop_10_3 = $"Twilight_landscape_scene" // Flash disabled $sc 04 // Sensor scene #COM_EVENT(51,04) // night $p5 01 $c5 00 // WB is auto? $d010E // Delay 270 milliseconds $cl $d010E // Delay 270 milliseconds $u01 // Update WB $cx #UPDATE_WB // Update whitebalance #UPDATE_ISO // update iso #Twilight_landscape; seq_set_prop_10_4 = $"Nightportrait" // IS disabled $sc 07 // Sensor scene #COM_EVENT(51,07) // night #UPDATE_WB // Update whitebalance #UPDATE_ISO // update iso #Nightportrait; seq_set_prop_10_5 = $"Beach_snow_scene" // Flash disabled $sc 02 // Sensor scene #COM_EVENT(03,0f) // 7,5 fps AE_SLOW_SHUTTER $c9 08 // R5 camera version #COM_EVENT(51,02) // Beach/snow $cl // Else R6 camera $ce 01 // IS ON? #COM_EVENT(51,08) // Sensor scene "Custom 08" #COM_EVENT(08,03) // AE_PHOTOMETRY = 03 $cl // Else R6 #COM_EVENT(51,02) // Sensor scene "Beach/snow 02" $cx $cx #UPDATE_WB // Update whitebalance #Beach_snow; seq_set_prop_10_6 = $"Sport_scene" // Flash and IS disabled $sc 05 // Sensor scene #COM_EVENT(51,05) // Sensor scene "Sports 05" #UPDATE_WB // Update whitebalance #Sport_scene; seq_set_prop_10_7 = $"Document_scene" // IS disabled $sc 00 // Sensor scene #COM_EVENT(03,10) // 8 fps AE_SLOW_SHUTTER #COM_EVENT(51,00) // Sensor scene "Auto 00" #UPDATE_WB // Update whitebalance #DOC_MODE; //************************************************** // ISO, property 17, 0x11 **** //************************************************** // 0 => Auto 1 => 100 2 => 200 3 => 400 4=> 800 //-------------------------------------------------- seq_set_prop_11_0 = // Auto $s8 00 #SET_REG(40,07) // Default ISO 400 #COM_EVENT(02,00) #WB_ISO400; seq_set_prop_11_1 = // ISO 100 $s8 01 #SET_REG(2a,01) #SET_REG(40,01) #COM_EVENT(02,04) #WB_ISO100; seq_set_prop_11_2 = // ISO 200 $s8 04 #SET_REG(2a,04) #SET_REG(40,04) #COM_EVENT(02,04) #WB_ISO200; seq_set_prop_11_3 = // ISO 400 $s8 07 #SET_REG(2a,07) #SET_REG(40,07) #COM_EVENT(02,04) #WB_ISO400; seq_set_prop_11_4 = //ISO 800 $s8 10 #SET_REG(2a,0a) #SET_REG(40,0a) #COM_EVENT(02,04) #WB_ISO800; seq_set_prop_11_5; //************************************************** // Contrast, property 20 **** //************************************************** // 0 => -8 ... 8 => 0 ... 17 => 8 //------------------------------------------------- seq_set_prop_14 = $s5 %0 $-5 0F #COM_EVENT(55,$w5); //************************************************** // Sharpening, property 21 **** //************************************************** // 0 => -8 ... 8 => 0 ... 17 => 8 //------------------------------------------------- seq_set_prop_15 = $s5 %0 $-5 09 #COM_EVENT(56,$w5); //************************************************** // Photo metering, property 22 //************************************************** seq_set_prop_16_0 = #COM_EVENT(08,00); // Multimode, centerweighted seq_set_prop_16_1 = #COM_EVENT(08,01); // Spot, centerspot //************************************************** // Check if flash needed, property 23 //************************************************** // seq_get_prop_17 = $c9 08 //R5 camera version #COM_EVENT(72,00) // Update the registers #READ_REG(28,$r2 5 5) // Read AE-value (MSB)in camera reg 28 $>5 5 // Shift reg 5 five bits to the right #SET_REG(37,16) // AE_MSHUT_LONG = 1/40 This is only changed in nightportrait $cb 02 // Auto flash? $c5 00 // Use flash #COM_EVENT(5a,94) // Automatic 0b10010100, mech shutter $s0 01 // Set reg 0 to 01 $"autoflash" $cl #COM_EVENT(5a,00) // OFF $s0 00 // Set reg 0 to 00 $"noautoflash" $cx $cx $cb 03 // Auto flash RER? $c5 00 // Use flash #SET_REG(37,16) // AE_MSHUT_LONG = 1/40 #COM_EVENT(5a,b4) // Automatic 0b10110100, red-eye, mech shutter $s0 01 // Set reg 0 to 01 $"autoflash_rer" $cl #COM_EVENT(5a,00) // OFF $s0 00 // Set reg 0 to 00 $"noautoflash_rer" $cx $cx $s1 00 $s2 00 $s3 00 $"FLASH_%0" $cl // R6 camera version $ce 00 // IS OFF? #COM_EVENT(72,00) // Update the registers #READ_REG(3a,$r2 5 5) // Read AE_FLASHINFO_STATUS $"FLASH_INFO_%5" #SET_REG(37,16) // AE_MSHUT_LONG = 1/40 This is only changed in nightportrait $cb 02 // Auto flash? $c5 03 // Use flash $cc 00 // Normal scene? #COM_EVENT(58,01) // reduce colour sat $cl $cc 01 // Portrait? #COM_EVENT(58,01) // reduce colour sat $cl $cc 07 // Night portrait? #COM_EVENT(58,01) // reduce colour sat $cx $cx $cx #COM_EVENT(5a,8b) // FLASH_MODE 0b10001011: Flash on, RER off, sync on beginning. $s0 01 // Set reg 0 to 01 $"autoflash" $cl #COM_EVENT(5a,08) // OFF, FLASH_MODE 0b00001000: Flash off, electronic shutter only. $s0 00 // Set reg 0 to 00 $"noautoflash" $cx $cx $cb 03 // Auto flash? $c5 03 // Use flash $cc 00 // Normal scene? #COM_EVENT(58,00) // reduce colour sat $cl $cc 01 // Portrait? #COM_EVENT(58,01) // reduce colour sat $cl $cc 07 // Night portrait? #COM_EVENT(58,01) // reduce colour sat $cx $cx $cx #COM_EVENT(5a,ab) // FLASH_MODE 0b10101011: flash on, RER on, sync on beginning. $s0 01 // Set reg 0 to 01 $"autoflash_rer" $cl #COM_EVENT(5a,08) // OFF, FLASH_MODE 0b00001000: flash off, electronic shutter only. $s0 00 // Set reg 0 to 00 $"noautoflash_rer" $cx $cx $cl // IS ON $"IS_ON_flash_disabled" $s0 0a $cx $s1 00 $s2 00 $s3 00 $"FLASH_%0" $cx; //************************************************** // Image stabilization, property 24 *** //************************************************** seq_set_prop_18_0 = $se 00 // Off, set reg e to 00 #SET_REG(2a,$w8) // Change back to old ISO $c8 00 // AE_MODE = auto? #COM_EVENT(02,00) // Auto $cl #COM_EVENT(02,04) // ISO priority $cx; seq_set_prop_18_1 = #COM_EVENT(02,00) // AE_MODE = Auto $se 01; // On, set reg e to 01 //*************************************************** // Linear zoom, property 25 ***** //*************************************************** // 0 => Stop 1 => zoom in 2 => zoom out //--------------------------------------------------- seq_set_prop_19_0 = #COM_EVENT(61,84); seq_set_prop_19_1 = #SET_REG(3d,01) // ZM_SMTH_SPEED = 60 #SET_REG(3e,01) // ZM_SMTH_INTERVAL = 1 #COM_EVENT(61,04); seq_set_prop_19_2 = #SET_REG(3d,01) // ZM_SMTH_SPEED = 60 #SET_REG(3e,01) // ZM_SMTH_INTERVAL = 1 #COM_EVENT(61,40); //*************************************************** // Get zoom value, property 26 ***** //*************************************************** seq_get_prop_1a = #READ_REG(3c,$r2 0 0) // Read ZM_STEP $s3 00 $s2 00 $s1 00 $"ZOOM_STEP_%3_%2_%1_%0"; //************************************************** // Snapshot operation, property 27 **** //************************************************** // 0 = Still Capture mode/IS Still Capture mode // 1 = Burst output. Read out picture 1 // . // . // 9 = Burst output. Read out picture 9 //-------------------------------------------------- seq_set_prop_1b = $sd %0; // Place value of input in reg d //************************************************** // Half release, property 28, ** //************************************************** seq_set_prop_1c_0 = #CHANGE_MODE(34,01) // Draft mode #COM_EVENT(43,00); // Go to infinity seq_set_prop_1c_1 = #HALF_RELEASE; // Half-release mode //************************************************** // ACM operation, property 29 *** //************************************************** seq_set_prop_1d_0 = $"[PV] P29 init" $s7 00; // Normal ACM operation seq_set_prop_1d_1 = $"[PV] P29 Abort" $s7 ff; // Abort ACM operation seq_set_prop_1d_2 = #CHANGE_MODE(3a,00); // Mode burst output (Picture is actually taken here) seq_set_prop_1d_3 = #SET_REG(0d,02) // Rapid YC size 320x240 #CHANGE_MODE(39,44); // Mode burst start, BURST_NUM = 9, BURST_REMAIN = 4 seq_get_prop_1d = $c7 00 // Init $s0 04 $cx $c7 01 // Ready $s0 05 $cx $c7 02 // Delay $s0 06 $cx $c7 03 // Done $s0 07 $cx $c7 ff // Finish $s0 08 $cx $s1 00 $s2 00 $s3 00; //************************************************** // Test pattern, property 30 **** //************************************************** // 0 => Reset 1 => test pattern //-------------------------------------------------- seq_set_prop_1e_0 = $gr 1 // Reset $d0014 $gr 0 $d0140 // Delay 320 ms #SET_REG(1c,01) // JPEG_CONTINUOUS_NUM = 1 #SET_REG(10,01); // YC_CONTINUOUS_NUM = 1 seq_set_prop_1e_1 = 03 55 AA $f $r2 01 $d0005 // Testpattern 08 04 44 0C 04 00 01 00 $f $r2 01 $d0005 08 04 45 0C 04 00 01 00 $f $r2 01 $d0005 08 04 46 0C 04 00 05 00 $f $r2 01 $d0005; //*************************************************** // Property 31, only for tests //*************************************************** seq_set_prop_1f_0 = #COM_EVENT(72,00) // Update the registers #READ_REG(28,$r2 5 5) // Read AE-value (MSB)in camera reg 28 $"AE_LEVEL_%5"; //================================================ // SIZE CONFIGS //================================================ seq_ss_config_1 = $s6 01 $ce 00 $sf 01 #SET_REG(0a,09) // JPEG $cl $sf 01 #SET_REG(0b,06) // JPEG Image stabilization $cx; seq_ss_config_2 = $s6 02 $ce 00 $sf 01 #SET_REG(0a,08) // JPEG $cl $sf 01 #SET_REG(0b,05) // JPEG Image stabilization $cx; seq_ss_config_3 = $s6 03 $ce 00 $sf 01 #SET_REG(0a,06) // JPEG $cl $sf 01 #SET_REG(0b,03) // JPEG Image stabilization $cx; seq_ss_config_4 = $s6 04 $ce 00 $sf 01 #SET_REG(0a,03) // JPEG $cl $sf 01 #SET_REG(0b,00) // JPEG Image stabilization $cx; seq_ss_config_5 = $s6 05 $sf 01 #SET_REG(0a,00); // JPEG seq_ss_config_6 = $s6 06 $ce 00 $sf 00 #SET_REG(0a,0b) // YCbCr $cl $sf 00 #SET_REG(0b,08) // YCbCr Image stabilization $cx; seq_ss_config_7 = $s6 07 $ce 00 $sf 00 #SET_REG(0a,09) // YCbCr $cl $sf 00 #SET_REG(0b,06) // YCbCr Image stabilization $cx; seq_ss_config_8 = $s6 08 $ce 00 $sf 00 #SET_REG(0a,08) // YCbCr $cl $sf 00 #SET_REG(0b,05) // YCbCr Image stabilization $cx; seq_ss_config_9 = $s6 09 $ce 00 $sf 00 #SET_REG(0a,06) // YCbCr $cl $sf 00 #SET_REG(0a,03) // YCbCr Image stabilization $cx; seq_vf_config_11 = $s6 11 #SET_REG(07,03) // Draft 320x240 #SET_REG(08,02) // IS Movie 320x240 $cc 04 #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,08) // AE_SLOW_SHUTTER = 4 fps $cl $cc 07 // Nightportrait scene? #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,0A) // 5 fps AE_SLOW_SHUTTER $cl #SET_REG(09,3C) // 30 fps DRAFT_RATE #COM_EVENT(03,10) // 8,0 fps AE_SLOW_SHUTTER $cx $cx; seq_vf_config_12 = $s6 12 #SET_REG(07,03) // Draft 320x240 #SET_REG(08,02) // IS Movie 320x240 #SET_REG(09,24) // 12 fps DRAFT_RATE #COM_EVENT(03,24); // 7,5 fps AE_SLOW_SHUTTER seq_vf_config_19 = $s6 19 #SET_REG(07,03) // Draft 128x96 #SET_REG(08,02) // IS Movie 128x96 #SET_REG(09,24) // 15 fps DRAFT_RATE #COM_EVENT(03,24); // 18 fps AE_SLOW_SHUTTER seq_vf_config_20 = $s6 20 #SET_REG(07,03) // Draft 176x144 #SET_REG(08,02) // IS Movie 176x144 #SET_REG(09,24) // 18 fps DRAFT_RATE #COM_EVENT(03,24); // 18 fps AE_SLOW_SHUTTER seq_vf_config_21 = $s6 21 #SET_REG(07,07) // Draft 128x96 #SET_REG(08,06) // IS Movie 128x96 #SET_REG(09,24) // 18 fps DRAFT_RATE #COM_EVENT(03,24); // 18 fps AE_SLOW_SHUTTER seq_vf_config_22 = $s6 22 #SET_REG(07,07) // Draft 128x96 #SET_REG(08,06) // IS Movie 128x96 #SET_REG(09,24) // 18 fps DRAFT_RATE #COM_EVENT(03,24); // 18 fps AE_SLOW_SHUTTER seq_vf_config_23 = $s6 23 #COM_EVENT(34,01) // Draft mode #SET_REG(07,05) // Draft 176x144 #SET_REG(08,04) // IS Movie 176x144 #SET_REG(09,24) // 18 fps DRAFT_RATE #COM_EVENT(03,24); // 18 fps AE_SLOW_SHUTTER seq_vf_config_24 = $s6 24 #COM_EVENT(34,01) // Draft mode #SET_REG(07,05) // Draft 176x144 #SET_REG(08,04) // IS Movie 176x144 #SET_REG(09,24) // 18 fps DRAFT_RATE #COM_EVENT(03,24); // 18 fps AE_SLOW_SHUTTER //=============================================== // Rotation of viewfinder and video images //=============================================== cam_post_processing_11 = 1; // viewfinder rotation cam_post_processing_19 = 1; // videotelephony cam_post_processing_20 = 1; // videotelephony //================================================ //============ STATE TRANSITIONS ================= //================================================ seq_vf_start = $"draft" #CHANGE_MODE(34,01) // Draft mode $d000a // Delay to remove blink $ce 01 // IS ON? $c6 23 #CHANGE_MODE(38,01) $cx $c6 24 #CHANGE_MODE(38,01) $cx $cx; seq_vf_stop = ; seq_ss_start = $cb 02 // Xenon "auto" $go 13 0 // Turn off xenon charge $cx $cd 00 // Still Capture mode? $cf 00 // YCbCr? $ce 01 // Image stabilization ON? $"IS_YCbCr_snapshot" #CHANGE_MODE(37,01) // IS YCbCr $cl $"YCbCr_snapshot" #CHANGE_MODE(36,01) // YCbCr $cx $cl $ce 01 // Image stabilization ON? $"IS_JPEG_snapshot" #CHANGE_MODE(37,81) // IS JPEG $c9 05 // 05=R3 firmware version? $cl $c9 07 // 07=R4 firmware, no 02 E4 event $cl #CAPTURE_EVENT // e4 02 $cx $cx $cl $"JPEG_snapshot" #CHANGE_MODE(36,81) // JPEG $c9 05 // 05=R3 firmware version? $cl $c9 07 // 07=R4 firmware, no 02 E4 event $cl #CAPTURE_EVENT // e4 02 $cx $cx $cx $cx $cl // Burst output mode $"Best_Pic_snapshot" #CHANGE_MODE(3a,$wd) // Read out picture # in reg. d $cx; // Take only waits for status = 0 seq_ss_take = #CAPTURE_EVENT; // e4 00 // Verify should be modified to something that actually verifies // the image. seq_ss_verify = #CAPTURE_EVENT // e4 01 $s0 01; // STATUS == 1 seq_ss_stop = ; // Functions for synchronized viewfinder images in burst mode. seq_pv_start = $"[PV] START_PREVIEW" $s7 00 // [Init] #SET_REG(0d,02) // Rapid YC size 320x240 #CHANGE_MODE(39,45); // Mode burst start, BURST_NUM = 9, BURST_REMAIN = 4 seq_pv_stop = $c7 01 $"[PV] STOP_PREVIEW" $s7 03 // [Done] #COMMAND(3a,00) // Stop $cl $"[PV] STOP_PREVIEW (wait)" $s7 02 // [Delay] $cx; seq_pv_verify = $h0 25 5 0000 05 01 00 03 03 $f $r4 0 012 // [source, info, id] 05 02 00 06 03 $f $c7 ff // $s0 ff // [Finish!] $"[PV] Abort" $cl // $s0 00 $c2 e3 // ev_jpeg_end $b1 00 4 4 $c1 00 $s0 01 // Rotate...i.e synch jpeg with viewfinder image $"[PV] rotate" $cl $"[PV] Failed_%0_%1_%2" $cx $cl $cx $c2 ea // ev_mode_changed $c1 0a $"[PV] ev_mode_changed(burst_output)" $s0 ff // [Finish!] $cl $"[PV] ev_mode_changed(%0_%1_%2)" $cx $cl $cx $c2 ee // ev_burst_status $c7 02 $"[PV] STOP_PREVIEW (delay)" $s7 03 // [Done] #COMMAND(3a,00) // Stop $cl $"[PV] ev_burst_status" $s7 01 // [Ready] $cx $cl $cx $cx; //================================================ //============ JPEG HEADER CREATION ============== //================================================ // // Same header as in clara with the difference that // restart is added. // jpeg_qtable_selector_0=$s2 00 #READ_REG(26, $r2 0 0); jpeg_qtable_selector_1=$s2 01 #READ_REG(26, $r2 0 0); //changed from 1a jpeg_qtable_0=10 0B 0C 0E 0C 0A 10 0E 0D 0E 12 11 10 13 18 28 1A 18 16 16 18 31 23 25 1D 28 3A 33 3D 3C 39 33 38 37 40 48 5C 4E 40 44 57 45 37 38 50 6D 51 57 5F 62 67 68 67 3E 4D 71 79 70 64 78 5C 65 67 63; jpeg_qtable_1=11 12 12 18 15 18 2F 1A 1A 2F 63 42 38 42 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63; jpeg_qtable_factors=0,320100,190000,10AB00,C8000,A0000,85500,72500,64000,58E00,50000 ,48C00,42B00,3D900,39200,35500,32000,2F100,2C700,2A200,28000 ,26200,24600,22D00,21500,20000,1EC00,1DA00,1C900,1B900,1AB00 ,19D00,19000,18400,17800,16E00,16400,15A00,15100,14800,14000 ,13800,13100,12A00,12300,11C00,11600,11000,10B00,10500,10000 ,FB00,F600,F100,EC00,E600,E100,DC00,D700,D200,CD00 ,C800,C300,BD00,B800,B300,AE00,A900,A400,9F00,9A00 ,9400,8F00,8A00,8500,8000,7B00,7600,7100,6C00,6600 ,6100,5C00,5700,5200,4D00,4800,4300,3D00,3800,3300 ,2E00,2900,2400,1F00,1A00,1400,F00,A00,500,100; jpeg_header= FF D8 FF E0 00 10 4A 46 49 46 00 01 01 00 00 01 00 01 00 00 FF DB 00 84 00 $qt0 01 $qt1 FF C4 01 A2 00 00 01 05 01 01 01 01 01 01 00 00 00 00 00 00 00 00 01 02 03 04 05 06 07 08 09 0A 0B 01 00 03 01 01 01 01 01 01 01 01 01 00 00 00 00 00 00 01 02 03 04 05 06 07 08 09 0A 0B 10 00 02 01 03 03 02 04 03 05 05 04 04 00 00 01 7D 01 02 03 00 04 11 05 12 21 31 41 06 13 51 61 07 22 71 14 32 81 91 a1 08 23 42 b1 c1 15 52 d1 f0 24 33 62 72 82 09 0a 16 17 18 19 1a 25 26 27 28 29 2a 34 35 36 37 38 39 3a 43 44 45 46 47 48 49 4a 53 54 55 56 57 58 59 5a 63 64 65 66 67 68 69 6a 73 74 75 76 77 78 79 7a 83 84 85 86 87 88 89 8a 92 93 94 95 96 97 98 99 9a a2 a3 a4 a5 a6 a7 a8 a9 aa b2 b3 b4 b5 b6 b7 b8 b9 ba c2 c3 c4 c5 c6 c7 c8 c9 ca d2 d3 d4 d5 d6 d7 d8 d9 da e1 e2 e3 e4 e5 e6 e7 e8 e9 ea f1 f2 f3 f4 f5 f6 f7 f8 f9 fa 11 00 02 01 02 04 04 03 04 07 05 04 04 00 01 02 77 00 01 02 03 11 04 05 21 31 06 12 41 51 07 61 71 13 22 32 81 08 14 42 91 a1 b1 c1 09 23 33 52 f0 15 62 72 d1 0a 16 24 34 e1 25 f1 17 18 19 1a 26 27 28 29 2a 35 36 37 38 39 3a 43 44 45 46 47 48 49 4a 53 54 55 56 57 58 59 5a 63 64 65 66 67 68 69 6a 73 74 75 76 77 78 79 7a 82 83 84 85 86 87 88 89 8a 92 93 94 95 96 97 98 99 9a a2 a3 a4 a5 a6 a7 a8 a9 aa b2 b3 b4 b5 b6 b7 b8 b9 ba c2 c3 c4 c5 c6 c7 c8 c9 ca d2 d3 d4 d5 d6 d7 d8 d9 da e2 e3 e4 e5 e6 e7 e8 e9 ea f2 f3 f4 f5 f6 f7 f8 f9 fa FF DD 00 04 00 00 FF C0 00 11 08 $h $w 03 01 21 00 02 11 01 03 11 01 FF DA 00 0C 03 01 00 02 11 03 11 00 3F 00;