From d9fbb9af0102a36ddf49c63e8360226e919fb9c8 Mon Sep 17 00:00:00 2001 From: yutaka Date: Thu, 19 Jul 2007 03:49:48 +0000 Subject: [PATCH] add sharp/micron code and remove samsung at all git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@194 4ee2a332-4b2b-5046-8439-1ba90f034370 --- .../camera/ARM7/320x240_PLL_30fps_070306.set | 31 - .../ARM7/320x240_noPLL_20fps_070306.set | 28 - ...15fpsFIX_x8_CC_FilterKIM_MatrixOn3_PLL.dat | 224 +++ ...ilterKIM_MatrixOn3_PLL_1676MHz-1676MHz.dat | 234 +++ .../ARM7/A3AFX_EVT2_20fps_16M_070206.set | 708 --------- ...3AFX_EVT2_20fps_16M_PLLoff_hVGA_070209.set | 512 ------- .../ARM7/A3AFX_EVT2_30fps_16M_QVGA_070206.set | 715 --------- .../A3AFX_EVT3_30fps_Scaledown_16.7M_50Hz.set | 649 --------- ...3AFX_EVT3_30fps_Subsampling_16.7M_50Hz.set | 655 --------- build/libraries/camera/ARM7/MT9V113-MTM10.ini | 1031 +++++++++++++ build/libraries/camera/ARM7/MT9V113-REV1.sdat | 1287 +++++++++++++++++ build/libraries/camera/ARM7/Makefile | 39 +- build/libraries/camera/ARM7/camera_control.c | 135 +- .../{camera_i2c_common.c => camera_i2c.c} | 85 +- .../libraries/camera/ARM7/camera_i2c_micron.c | 219 ++- .../camera/ARM7/camera_i2c_samsung.c | 264 ---- .../libraries/camera/ARM7/camera_i2c_sharp.c | 106 +- build/libraries/camera/ARM7/convert_micron.pl | 323 ++++- .../libraries/camera/ARM7/convert_samsung.pl | 145 -- build/libraries/camera/ARM7/convert_sharp.pl | 168 +++ build/libraries/camera/ARM9/camera.c | 170 +-- build/libraries/camera/ARM9/camera_api.c | 965 +++--------- .../libraries/i2c/ARM7/src/i2c_instruction.c | 107 +- build/tests/camera/Makefile | 4 +- build/tests/camera/camera-1/ARM7/src/main.c | 10 +- build/tests/camera/camera-1/ARM9/src/main.c | 211 ++- build/tests/camera/camera-2/ARM7/Makefile | 44 + build/tests/camera/camera-2/ARM7/src/main.c | 167 +++ build/tests/camera/camera-2/ARM9/Makefile | 41 + build/tests/camera/camera-2/ARM9/src/main.c | 232 +++ build/tests/camera/camera-2/Makefile | 32 + include/twl/camera.h | 2 +- include/twl/camera/ARM7/control.h | 2 +- include/twl/camera/ARM7/i2c.h | 108 ++ include/twl/camera/ARM7/i2c_common.h | 262 ---- include/twl/camera/ARM7/i2c_micron.h | 203 +-- include/twl/camera/ARM7/i2c_samsung.h | 546 ------- include/twl/camera/ARM7/i2c_sharp.h | 218 +-- include/twl/camera/ARM9/camera.h | 72 +- include/twl/camera/ARM9/camera_api.h | 357 ++--- include/twl/camera/ARM9/transfer.h | 12 +- include/twl/camera/common/fifo.h | 44 +- include/twl/camera/common/types.h | 35 +- include/twl/i2c/ARM7/i2c.h | 31 +- 44 files changed, 4926 insertions(+), 6507 deletions(-) delete mode 100644 build/libraries/camera/ARM7/320x240_PLL_30fps_070306.set delete mode 100644 build/libraries/camera/ARM7/320x240_noPLL_20fps_070306.set create mode 100644 build/libraries/camera/ARM7/5030_15fpsFIX_x8_CC_FilterKIM_MatrixOn3_PLL.dat create mode 100644 build/libraries/camera/ARM7/5030_15fps_5fps_adjust2_x8_CC_FilterKIM_MatrixOn3_PLL_1676MHz-1676MHz.dat delete mode 100644 build/libraries/camera/ARM7/A3AFX_EVT2_20fps_16M_070206.set delete mode 100644 build/libraries/camera/ARM7/A3AFX_EVT2_20fps_16M_PLLoff_hVGA_070209.set delete mode 100644 build/libraries/camera/ARM7/A3AFX_EVT2_30fps_16M_QVGA_070206.set delete mode 100644 build/libraries/camera/ARM7/A3AFX_EVT3_30fps_Scaledown_16.7M_50Hz.set delete mode 100644 build/libraries/camera/ARM7/A3AFX_EVT3_30fps_Subsampling_16.7M_50Hz.set create mode 100644 build/libraries/camera/ARM7/MT9V113-MTM10.ini create mode 100644 build/libraries/camera/ARM7/MT9V113-REV1.sdat rename build/libraries/camera/ARM7/{camera_i2c_common.c => camera_i2c.c} (61%) delete mode 100644 build/libraries/camera/ARM7/camera_i2c_samsung.c delete mode 100644 build/libraries/camera/ARM7/convert_samsung.pl create mode 100644 build/libraries/camera/ARM7/convert_sharp.pl create mode 100644 build/tests/camera/camera-2/ARM7/Makefile create mode 100644 build/tests/camera/camera-2/ARM7/src/main.c create mode 100644 build/tests/camera/camera-2/ARM9/Makefile create mode 100644 build/tests/camera/camera-2/ARM9/src/main.c create mode 100644 build/tests/camera/camera-2/Makefile create mode 100644 include/twl/camera/ARM7/i2c.h delete mode 100644 include/twl/camera/ARM7/i2c_common.h delete mode 100644 include/twl/camera/ARM7/i2c_samsung.h diff --git a/build/libraries/camera/ARM7/320x240_PLL_30fps_070306.set b/build/libraries/camera/ARM7/320x240_PLL_30fps_070306.set deleted file mode 100644 index ddfd57c..0000000 --- a/build/libraries/camera/ARM7/320x240_PLL_30fps_070306.set +++ /dev/null @@ -1,31 +0,0 @@ -sef00 -s8000 // for 320x240 -s8101 -sc400 -sc5f0 -sc601 -sc740 - - - -sef02 -s5821 // PLL 33Mhz 30fps -s590c -s5a24 // for 33MHz - -//s5821 // PLL on -//s591A // pll_s=0, pll_p=26, -//s5A1A // pll_m=26 - -//s289B // CFPN on **** Revised at EVT1 - -sef01 -sd189 // 0209 16.7Mhz //d2:24MHz 64:13MHz dc:25MHz 13MHz //d2 //d2(24MHz) Mclk Value (Mclk - 30d)/100,000 - - - -sef01 -s7167 // AE Target similar to 20fps noPLL setting -sd915 //AE saturation CHIP_DEBUG - - diff --git a/build/libraries/camera/ARM7/320x240_noPLL_20fps_070306.set b/build/libraries/camera/ARM7/320x240_noPLL_20fps_070306.set deleted file mode 100644 index 33147f1..0000000 --- a/build/libraries/camera/ARM7/320x240_noPLL_20fps_070306.set +++ /dev/null @@ -1,28 +0,0 @@ -sef00 -s8000 // for 320x240 -s8101 -sc400 -sc5f0 -sc601 -sc740 - - -sef01 -se400 // 0209 for PLL off 20fps // 24MHz VblankH (H.L) //FPS (24MHz, 28~5fps) -se525 // 0209 //ea // 24MHz NT VblankL (H.L) - - -// -//s5861 // PLL off -//s594c -//s5a30 // for 48MHz -// -//s289B // CFPN on **** Revised at EVT1 -// -////061011 -//sef01 -//sd189 // 0209 16.7Mhz //d2:24MHz 64:13MHz dc:25MHz 13MHz //d2 //d2(24MHz) Mclk Value (Mclk - 30d)/100,000 - - -sef01 -s7173 // AE Target Default (73h) \ No newline at end of file diff --git a/build/libraries/camera/ARM7/5030_15fpsFIX_x8_CC_FilterKIM_MatrixOn3_PLL.dat b/build/libraries/camera/ARM7/5030_15fpsFIX_x8_CC_FilterKIM_MatrixOn3_PLL.dat new file mode 100644 index 0000000..ef6bb01 --- /dev/null +++ b/build/libraries/camera/ARM7/5030_15fpsFIX_x8_CC_FilterKIM_MatrixOn3_PLL.dat @@ -0,0 +1,224 @@ +#VGA +#I2C +# E0 +#I2CS +# 7F +#ImageSize +# 640 +# 480 +# 0 + + +03 01 +#04 A0 +09 D2 #PLL +0A 03 #PLL1 +0B 00 #PLL2 +04 10 +04 90 + +C9 B0 #frame height 15fps +C8 04 #1200 +E0 07 #frame width +E1 D0 #1600 + + +03 02 +11 04 #mid fh +12 B0 +13 04 # 0E #max fh +14 B0 # 10 +16 70 #mid ex +17 80 +19 70 #max ex +1A 80 +1E 04 #exp fh +1F B0 + +#flicker setting +03 01 + +B9 3E +BA 7F +BB 0E +BC 56 +C1 3E +C2 7F +C3 25 +C4 80 + + +#black +FF 0B + + +4A 42 +4B 00 #11Jul07 .Kim +51 24 +52 24 +53 00 +54 20 + + +55 00 +56 06 +57 0C +58 16 +59 20 +5A 36 +5B 48 +5C 68 +5D 84 +5E A6 +5F C2 +60 D6 +61 E8 +62 F4 +63 FF +#6E 0D #Lengs_Gain_G1(R) +#6F 02 #Lengs_Gain_G2(B) +#7E 51 #Lengs_G1_E(R) + +#6D 0D #3200 DNP R:43 B:5A +#6E 06 #Lengs_Gain_G1(R) +#6F 06 #Lengs_Gain_G2(B) +#70 03 + + +6D 0D #5200 DNP R:55, B:49 +6E 08 #Lengs_Gain_G1(R) +6F 08 #Lengs_Gain_G2(B) +70 03 + + +7A 4A #Red_E +7B 38 #Red_W +7C 40 #Red_N +7D 50 #Red_S +7E 10 #G1_E +7F 28 #G1_W +80 20 #G1_N +81 40 #G1_S +82 10 #G2_E +83 28 #G2_W +84 20 #G2_N +85 40 #G2_S +86 10 #B_E +87 60 #B_W +88 20 #B_N +89 50 #B_S + +#7A 48 +#7B 30 +#7E 41 #Lengs_G1_E(R) +#87 50 +#88 50 + +#03 02 + +#C1 0D +#C2 06 +#C3 06 +#C4 03 + +#C5 0D #R:55 +#C6 08 +#C7 08 +#C8 03 + +#C9 43 +#CA 55 +#05 4D #enable R/B + +#03 01 + +B2 44 #Rgain min 11Jul07 .KIM +B3 80 #Rgain max +B4 44 #Bgain min 11Jul07 .KIM +B5 80 #Bgain max +0F 98 + + +03 02 +94 82 # 11Jul07 .KIM +95 80 # 11Jul07 .KIM +AA 4E # Matrix1 of Color +AB A9 # Matrix2 of Color +AC 84 # Matrix3 of Color +AD 87 # Matrix4 of Color +AE 3A # Matrix5 of Color +AF 92 # Matrix6 of Color +B0 8B # Matrix7 of Color +B1 A0 # Matrix8 of Color +B2 4C # Matrix9 of Color +B3 24 # MatrixNo2 of Color +B4 00 # MatrixNo2 of Color +B5 00 # MatrixNo2 of Color +B6 24 # MatrixNo2 of Color + +#AA 40 # Matrix1 of Color +#AB 00 # Matrix2 of Color +#AC 00 # Matrix3 of Color +#AD 00 # Matrix4 of Color +#AE 40 # Matrix5 of Color +#AF 00 # Matrix6 of Color +#B0 00 # Matrix7 of Color +#B1 00 # Matrix8 of Color +#B2 40 # Matrix9 of Color +#B3 40 # MatrixNo2 of Color 11Jul07 .KIM +#B4 08 # MatrixNo2 of Color +#B5 00 # MatrixNo2 of Color +#B6 40 # MatrixNo2 of Color 11Jul07 .KIM + + + +69 04 #LPF +6A 04 +6B 04 +6C 10 +6D 10 +6E 0A +6F 00 #Gamma +70 00 +71 00 +72 10 +73 10 +74 1F +75 00 #DPC +76 00 +77 10 +78 1F +79 1F +7A 1F +7B 00 #color +7C 00 +7D 00 +7E 08 +7F 08 +80 08 +81 00 #Lens +82 04 +83 08 +84 10 +85 1F +86 1F +87 00 #Edge +88 00 +89 00 +8A 28 +8B 28 +8C 3F + +#Bank C +03 02 + +2E 88 #max_yt1 +30 78 #min_yt1 +34 80 #Ytarget +36 80 #UsrYtarget +37 80 #FstYtarget + +#Bank A +03 00 +95 40 +03 01 diff --git a/build/libraries/camera/ARM7/5030_15fps_5fps_adjust2_x8_CC_FilterKIM_MatrixOn3_PLL_1676MHz-1676MHz.dat b/build/libraries/camera/ARM7/5030_15fps_5fps_adjust2_x8_CC_FilterKIM_MatrixOn3_PLL_1676MHz-1676MHz.dat new file mode 100644 index 0000000..dd6afd4 --- /dev/null +++ b/build/libraries/camera/ARM7/5030_15fps_5fps_adjust2_x8_CC_FilterKIM_MatrixOn3_PLL_1676MHz-1676MHz.dat @@ -0,0 +1,234 @@ +#VGA +#I2C +# E0 +#I2CS +# 7F +#ImageSize +# 640 +# 480 +# 0 + + +03 01 +#04 A0 +09 D2 #PLL +0A 03 #PLL1 +0B 00 #PLL2 +04 10 +04 90 + +C9 B0 #frame height 15fps +C8 04 #1200 +E0 07 #frame width +E1 D0 #1600 + + +03 02 +11 04 #mid fh +12 B0 +13 0E #max fh +14 10 +16 70 #mid ex +17 80 +19 70 #max ex +1A 80 +1E 04 #exp fh +1F B0 + +#flicker setting +03 01 + +B9 3E +BA 7F +BB 0E +BC 56 +C1 3E +C2 7F +C3 25 +C4 80 + + +#black +FF 0B + + +4A 42 +4B 00 #11Jul07 .Kim +51 24 +52 24 +53 00 +54 20 + + +55 00 +56 06 +57 0C +58 16 +59 20 +5A 36 +5B 48 +5C 68 +5D 84 +5E A6 +5F C2 +60 D6 +61 E8 +62 F4 +63 FF +#6E 0D #Lengs_Gain_G1(R) +#6F 02 #Lengs_Gain_G2(B) +#7E 51 #Lengs_G1_E(R) + +#6D 0D #3200 DNP R:43 B:5A +#6E 06 #Lengs_Gain_G1(R) +#6F 06 #Lengs_Gain_G2(B) +#70 03 + + +6D 0D #5200 DNP R:55, B:49 +6E 08 #Lengs_Gain_G1(R) +6F 08 #Lengs_Gain_G2(B) +70 03 + + +7A 4A #Red_E +7B 38 #Red_W +7C 40 #Red_N +7D 50 #Red_S +7E 10 #G1_E +7F 28 #G1_W +80 20 #G1_N +81 40 #G1_S +82 10 #G2_E +83 28 #G2_W +84 20 #G2_N +85 40 #G2_S +86 10 #B_E +87 60 #B_W +88 20 #B_N +89 50 #B_S + +#7A 48 +#7B 30 +#7E 41 #Lengs_G1_E(R) +#87 50 +#88 50 + +#03 02 + +#C1 0D +#C2 06 +#C3 06 +#C4 03 + +#C5 0D #R:55 +#C6 08 +#C7 08 +#C8 03 + +#C9 43 +#CA 55 +#05 4D #enable R/B + +#03 01 + +B2 44 #Rgain min 11Jul07 .KIM +B3 80 #Rgain max +B4 44 #Bgain min 11Jul07 .KIM +B5 80 #Bgain max +0F 98 + + +03 02 +94 82 # 11Jul07 .KIM +95 80 # 11Jul07 .KIM +AA 4E # Matrix1 of Color +AB A9 # Matrix2 of Color +AC 84 # Matrix3 of Color +AD 87 # Matrix4 of Color +AE 3A # Matrix5 of Color +AF 92 # Matrix6 of Color +B0 8B # Matrix7 of Color +B1 A0 # Matrix8 of Color +B2 4C # Matrix9 of Color +B3 24 # MatrixNo2 of Color +B4 00 # MatrixNo2 of Color +B5 00 # MatrixNo2 of Color +B6 24 # MatrixNo2 of Color + +#AA 40 # Matrix1 of Color +#AB 00 # Matrix2 of Color +#AC 00 # Matrix3 of Color +#AD 00 # Matrix4 of Color +#AE 40 # Matrix5 of Color +#AF 00 # Matrix6 of Color +#B0 00 # Matrix7 of Color +#B1 00 # Matrix8 of Color +#B2 40 # Matrix9 of Color +#B3 40 # MatrixNo2 of Color 11Jul07 .KIM +#B4 08 # MatrixNo2 of Color +#B5 00 # MatrixNo2 of Color +#B6 40 # MatrixNo2 of Color 11Jul07 .KIM + + + +69 04 #LPF +6A 04 +6B 04 +6C 10 +6D 10 +6E 0A +6F 00 #Gamma +70 00 +71 00 +72 10 +73 10 +74 1F +75 00 #DPC +76 00 +77 10 +78 1F +79 1F +7A 1F +7B 00 #color +7C 00 +7D 00 +7E 08 +7F 08 +80 08 +81 00 #Lens +82 04 +83 08 +84 10 +85 1F +86 1F +87 00 #Edge +88 00 +89 00 +8A 28 +8B 28 +8C 3F + +#Bank C +03 02 + +2E 88 #max_yt1 +30 78 #min_yt1 +34 80 #Ytarget +36 80 #UsrYtarget +37 80 #FstYtarget + +#Bank A +03 00 +95 40 +03 01 + +#Bank B +03 01 +D4 08 # 01D4 referense gain1 +09 D2 #PLL +0A 02 #03 #pre PLL1 +0B 03 #00 #post PLL2 + + + diff --git a/build/libraries/camera/ARM7/A3AFX_EVT2_20fps_16M_070206.set b/build/libraries/camera/ARM7/A3AFX_EVT2_20fps_16M_070206.set deleted file mode 100644 index d9fb6d0..0000000 --- a/build/libraries/camera/ARM7/A3AFX_EVT2_20fps_16M_070206.set +++ /dev/null @@ -1,708 +0,0 @@ -// 10.18 X shading, Color correction, RGB shading -// <0. D9> 50->C0 -// <1. E0> 04 -> 07, <0. D1> B2̸ 귯 . -// 07 63Ͽ 귯 ߻. 13M̻ . -// <1. B7> 68 -> 58, NL color saturation level -// <2. 23> DB -> D8, Tx width Sel -// <2. 3A> 60 -> 20, double shutter OFF -// <2. 0B> 81 -> 85 Negative (subsampling) - -//------------------------------------------------------------------ -// Set File -// - S5KA3AFX_xshade_060913.xls generates -// - date : 2007-01-08 2:45:52 -//------------------------------------------------------------------ - -// Page : 00 -sef00 -s0b39 // B gain -s0d03 -s0e00 -s0f1F -s1000 -s1137 -s1208 -s1342 -s1400 -s1512 -s169E -s1900 -s1707 -s18F2 -s1901 -s1707 -s18F5 -s1902 -s1707 -s18E8 -s1903 -s1707 -s18E6 -s1904 -s1707 -s18E2 -s1905 -s1707 -s18D9 -s1906 -s1707 -s18DB -s1907 -s1700 -s1806 -s1908 -s1707 -s18FF -s1909 -s1707 -s18FF -s190A -s1707 -s18FC -s190B -s1707 -s18F4 -s190C -s1707 -s18F5 -s190D -s1707 -s18ED -s190E -s1700 -s181C -s190F -s1700 -s1811 -s1910 -s1700 -s1812 -s1911 -s1700 -s1813 -s1912 -s1700 -s1808 -s1913 -s1700 -s180A -s1914 -s1700 -s1806 -s1915 -s1700 -s1827 -s1916 -s1700 -s182F -s1917 -s1700 -s1828 -s1918 -s1700 -s181E -s1919 -s1700 -s181A -s191A -s1700 -s1817 -s191B -s1700 -s181B -s191C -s1700 -s1843 -s191D -s1700 -s1838 -s191E -s1700 -s183B -s191F -s1700 -s1835 -s1920 -s1700 -s1835 -s1921 -s1700 -s1830 -s1922 -s1700 -s182E -s1940 - - -////////////////////////////////////////////////////////// -//sef00 -//sca02 //Raw data out - -//sef00 -//scb00 // Normal mode -// -//sef01 -//s7000 // AE/AWB off //Jee hwan: 06.10.27 -// -//sef02 //shutter off //Jee hwan: 06.10.27 -//s0122 - -sef02 // CIS page -//s4b5E // PCLK driving current max -s23d8 // Tx width -s3a20 // double shutter off -s6508 // CIS mode -s0a90 // Display WCW -s0126 // E-shutter enable - -s0378 // S1R END **** Revised at EVT1 -s0500 // S1S end value control -s07E5 // S2 END -s090E // S4 END -s0b81 //85 //81 // Analog offset -s1320 //a0 // R_REF -//s1580 // EC COMP 100'b -s1c57 // global gain **** Revised at EVT1 -s243d // i_cds **** Revised at EVT1 -s2625 // clamp level control **** Revised at EVT1 -s298f // CFPN start frame (16) -s4b5b // IO driving current -s5605 // Line ADLC -s5861 // amp bias current source select (71h : self bias) -s5f06 // aps bias current -s673c // EC_COMP & SAVG_END -s6810 // i_rmp control -s6913 // i_mid - -s5821 // PLL for 30MHz 20fps -s5950 -s5a3c - -//s5821 // PLL on -//s591A // pll_s=0, pll_p=26, -//s5A1A // pll_m=26 - -s289B // CFPN on **** Revised at EVT1 - -//061011 -sef01 -sd18a // for 16.8MHz //d2:24MHz 64:13MHz dc:25MHz 13MHz //d2 //d2(24MHz) Mclk Value (Mclk - 30d)/100,000 -//sd164 //64(13MHz) Mclk Value (Mclk - 30d)/100,000 -//sd915 //AE saturation CHIP_DEBUG - -////////// -//page 0 -////////// -sef00 -//s093e //gr gain - -sef00 -s2960 //GrGb - -// AE Window -sef00 -s5500 // AE window -s5800 -s5931 -s5a02 -s5b47 -s5c00 -s5d64 -s5e01 -s5fac -s6000 -s6173 -s6202 -s630c -s6400 -s65ab -s6601 -s677e - -sef01 // AE weight -s7701 -s7801 -//s7903 -//s7a03 -//s7b04 -//s7c04 - -sef00 -s5718 // AE Lux min threshold - -sd9c0 // color edge threshold - -///////////////////////////////////////////////////// -//page 1///////////////////////////////////////////// -///////////////////////////////////////////////////// -sef01 -s837d // R gain max -s8430 // B gain max - -saf00 //L.L Brightness -sb4b0 //a0 // N.L contrast -sb5b0 //a0 // L.L contrast - -sb746 //58 //68 // N.L color saturation -sb830 //52 // L.L color saturation - -s7097 //17 // fix PAL(50Hz) -s715a //68 //70 //6f //4d //60 //78 //AE target -s720c //12 //0a //05 //12 // AE threshold -s7463 //60 //70 //74 //70 // low agc max -s7540 // normal agc max - -sa640 //80 //N.L sharpness H/V Gain -sab24 //18 //60 //N.L NR Edge -sad40 //20 //L.L NR Edge -//sa330 //AWB speed //EVT0 Ǿ .(0x03) //EVT1 . - -scc09 //08 //Flicker threshold 12 -sd522 //32 //Chip_Debug2 - -se008 // NT Max -se208 //07 //18 // Low NT max -se106 // PAL Max -se306 //07 //18 // Low PAL max - -se401 // 24MHz VblankH (H.L) //FPS (24MHz, 28~5fps) -se5a9 //ea // 24MHz NT VblankL (H.L) -//se400 // 13MHz VblankH (H.L) //FPS (24MHz, 28~5fps) -//se52a // 13MHz VblankL (H.L) - -se843 //44 //84 //97 // ae speed - -sef00 -//s8c0e //skin color detection -sc80a //YC delay - - -//////////////////////////////////////// -// Color Correction -> Shading -> Gamma -> AWB -> Hue -//////////////////////////////////////// - -// Color Correction - -sef00 // //D65-1 //D65 //CW //U30-6 //U30 //Old -s4c40 //95 //95 //81 //8a //50 //62 //56 -s4d92 //c2 //c2 //ba //d2 //af //a9 //8d -s4e0f //92 //92 //87 //07 //1f //07 //89 -s4f9a //9b //9b //98 //9e //9e //a2 //94 -s503b //73 //73 //64 //4c //2e //47 //5c -s511e //98 //98 //8c //12 //30 //1b //8b -s5282 //80 //80 //80 //80 //86 //85 //80 -s53bf //b3 //b3 //ad //cd //eb //f2 //91 -s547f //73 //73 //6d //8e //b2 //b8 //51 - -//////CW -//sef00 -//s4c92 -//s4dcf -//s4e82 -//s4fad -//s506e -//s5180 -//s5287 -//s53eb -//s54b2 -// -////D65 -//sef00 -//s4c8a -//s4dc2 -//s4e88 -//s4f9f -//s5072 -//s5193 -//s5281 -//s53ca -//s548c - -//Default -//sef00 -//s4c56 -//s4d8d -//s4e89 -//s4f96 -//s505d -//s5188 -//s5294 -//s5389 -//s545d - -// Shading2 //// RGB Shading// RGB Shading// RGB Shading - // // //linear//old -sef00 //sef00 //sef00 //00 //00 //00 //00 -s3001 //s3001 //s3001 //01 //01 //01 //01 -s322a //0a //s3200 //s3200 //00 //00 //00 //00 -s360a //s3600 //s3600 //00 //00 //00 //00 -s3a0a //s3a00 //s3a00 //00 //00 //00 //00 -s3300 //s3301 //s3300 //00 //01 //00 //01 -s3400 //s3450 //s3400 //32 //50 //00 //50 -s3700 //s3701 //s3700 //00 //01 //00 //01 -s3800 //s3850 //s3800 //50 //50 //00 //50 -s3b00 //s3b01 //s3b00 //00 //01 //00 //01 -s3c00 //s3c50 //s3c00 //00 //50 //00 //50 -s31b6 //fd //s31df //s3187 //ff //ff //5e //ff -s35df //da //s35b8 //s3569 //d7 //da //54 //da -s39bf //c1 //s39a9 //s395a //be //e6 //4d //e6 -s3f01 //s3f01 //s3f01 //01 //01 //01 //01 -s4036 //4a //s4040 //s4040 //4a //40 //40 //40 -s3d01 //s3d00 //s3d01 //00 //00 //01 //00 -s3e04 //s3ef0 //s3e18 //fa //f0 //18 //f0 - -//sef00 -////Gamma(Red) -//s4800 -//s4900 -//s4A08 -//s4BF0 -//s4801 -//s4900 -//s4A10 -//s4BB6 -//s4802 -//s4900 -//s4A20 -//s4B5F -//s4803 -//s4900 -//s4A40 -//s4B4F -//s4804 -//s4900 -//s4A80 -//s4B37 -//s4805 -//s4901 -//s4A00 -//s4B27 -//s4806 -//s4901 -//s4AC0 -//s4B1C -//s4807 -//s4902 -//s4A80 -//s4B14 -//s4808 -//s4903 -//s4A00 -//s4B14 -//s4809 -//s4903 -//s4A80 -//s4B12 -//s480A -//s4903 -//s4AC0 -//s4B10 -//s480D -//s4B14 -////Gamma(Green) -//s4810 -//s4900 -//s4A08 -//s4BF0 -//s4811 -//s4900 -//s4A10 -//s4BB6 -//s4812 -//s4900 -//s4A20 -//s4B5F -//s4813 -//s4900 -//s4A40 -//s4B4F -//s4814 -//s4900 -//s4A80 -//s4B37 -//s4815 -//s4901 -//s4A00 -//s4B27 -//s4816 -//s4901 -//s4AC0 -//s4B1C -//s4817 -//s4902 -//s4A80 -//s4B14 -//s4818 -//s4903 -//s4A00 -//s4B14 -//s4819 -//s4903 -//s4A80 -//s4B12 -//s481A -//s4903 -//s4AC0 -//s4B10 -//s481D -//s4B14 -////Gamma(Blue) -//s4820 -//s4900 -//s4A08 -//s4BF0 -//s4821 -//s4900 -//s4A10 -//s4BB6 -//s4822 -//s4900 -//s4A20 -//s4B5F -//s4823 -//s4900 -//s4A40 -//s4B4F -//s4824 -//s4900 -//s4A80 -//s4B37 -//s4825 -//s4901 -//s4A00 -//s4B27 -//s4826 -//s4901 -//s4AC0 -//s4B1C -//s4827 -//s4902 -//s4A80 -//s4B14 -//s4828 -//s4903 -//s4A00 -//s4B14 -//s4829 -//s4903 -//s4A80 -//s4B12 -//s482A -//s4903 -//s4AC0 -//s4B10 -//s482D -//s4B14 -//s4880 - -//gamma5 -sef00 -//Gamma(Red) -s4800 -s4900 -s4A08 -s4B1B -s4801 -s4900 -s4A10 -s4B4E -s4802 -s4900 -s4A20 -s4B6F -s4803 -s4900 -s4A40 -s4B59 -s4804 -s4900 -s4A80 -s4B33 -s4805 -s4901 -s4A00 -s4B2B -s4806 -s4901 -s4AC0 -s4B20 -s4807 -s4902 -s4A80 -s4B19 -s4808 -s4903 -s4A00 -s4B16 -s4809 -s4903 -s4A80 -s4B13 -s480A -s4903 -s4AC0 -s4B12 -s480B -s4B14 -//Gamma(Green) -s4810 -s4900 -s4A08 -s4B1B -s4811 -s4900 -s4A10 -s4B4E -s4812 -s4900 -s4A20 -s4B6F -s4813 -s4900 -s4A40 -s4B59 -s4814 -s4900 -s4A80 -s4B33 -s4815 -s4901 -s4A00 -s4B2B -s4816 -s4901 -s4AC0 -s4B20 -s4817 -s4902 -s4A80 -s4B19 -s4818 -s4903 -s4A00 -s4B16 -s4819 -s4903 -s4A80 -s4B13 -s481A -s4903 -s4AC0 -s4B12 -s481B -s4B14 -//Gamma(Blue) -s4820 -s4900 -s4A08 -s4B1B -s4821 -s4900 -s4A10 -s4B4E -s4822 -s4900 -s4A20 -s4B6F -s4823 -s4900 -s4A40 -s4B59 -s4824 -s4900 -s4A80 -s4B33 -s4825 -s4901 -s4A00 -s4B2B -s4826 -s4901 -s4AC0 -s4B20 -s4827 -s4902 -s4A80 -s4B19 -s4828 -s4903 -s4A00 -s4B16 -s4829 -s4903 -s4A80 -s4B13 -s482A -s4903 -s4AC0 -s4B12 -s482B -s4B14 -s4880 - -//AWB -//sef00 -//s9301 // AWB map -//sa00f -//s9f0f -//s9300 - -//AWB mode : auto(??) -//sef01 -//s8000 - -// Hue - -sef00 -s8c0c //Skin Color Detection On/Off -s7400 //00 //Hue & Saturation Off=00, On=01 -s7958 //Saturation Gain -s7501 //Hue & Saturation Cosine 1 -s7660 //ff //Hue & Saturation Cosine 2 -s7702 //Hue & Saturation Sine 1 -s7811 //Hue & Saturation Sine 2 -s7295 //b0 //90 //Contrast Gain -//s7389 //Brightness Gain -sd800 //Edge color suppress - -//sef02 -//s0f40 - -//AWB white's count low 0f00 --> 0708 -sef01 -s8507 //0f //07 -s8608 //00 //08 - -//AWB boundary -//sef00 -//sb100 -//sb221 -//sb300 -//sb42c -//sb501 -//sb6e0 -//sb702 -//sb870 - -// Bad Pixel Replacement - -//sef00 -//s1a01 -//s1b00 -//s1e00 -//s1c00 -//s1f00 -//s1d00 -//s2000 - -sef01 -sb930 -sba00 - -seb40 //6f //Low Light Indication AGC -// -//sef02 //shutter on //Jee hwan: 06.10.27 -//s0126 -// -//sef01 // AE/AWB on //Jee hwan: 06.10.27 -//s7017 diff --git a/build/libraries/camera/ARM7/A3AFX_EVT2_20fps_16M_PLLoff_hVGA_070209.set b/build/libraries/camera/ARM7/A3AFX_EVT2_20fps_16M_PLLoff_hVGA_070209.set deleted file mode 100644 index 1c394c9..0000000 --- a/build/libraries/camera/ARM7/A3AFX_EVT2_20fps_16M_PLLoff_hVGA_070209.set +++ /dev/null @@ -1,512 +0,0 @@ -// 10.18 X shading, Color correction, RGB shading -// <0. D9> 50->C0 -// <1. E0> 04 -> 07, <0. D1> B2̸ 귯 . -// 07 63Ͽ 귯 ߻. 13M̻ . -// <1. B7> 68 -> 58, NL color saturation level -// <2. 23> DB -> D8, Tx width Sel -// <2. 3A> 60 -> 20, double shutter OFF -// <2. 0B> 81 -> 85 Negative (subsampling) - -//------------------------------------------------------------------ -// Set File -// - S5KA3AFX_xshade_060913.xls generates -// - date : 2007-01-08 2:45:52 -//------------------------------------------------------------------ - -// Page : 00 -sef00 - -sc3a0 // 320x480 -sc601 -sc740 - -s0d03 -s0e00 -s0f1F -s1000 -s1137 -s1208 -s1342 -s1400 -s1512 -s169E -s1900 -s1707 -s18F2 -s1901 -s1707 -s18F5 -s1902 -s1707 -s18E8 -s1903 -s1707 -s18E6 -s1904 -s1707 -s18E2 -s1905 -s1707 -s18D9 -s1906 -s1707 -s18DB -s1907 -s1700 -s1806 -s1908 -s1707 -s18FF -s1909 -s1707 -s18FF -s190A -s1707 -s18FC -s190B -s1707 -s18F4 -s190C -s1707 -s18F5 -s190D -s1707 -s18ED -s190E -s1700 -s181C -s190F -s1700 -s1811 -s1910 -s1700 -s1812 -s1911 -s1700 -s1813 -s1912 -s1700 -s1808 -s1913 -s1700 -s180A -s1914 -s1700 -s1806 -s1915 -s1700 -s1827 -s1916 -s1700 -s182F -s1917 -s1700 -s1828 -s1918 -s1700 -s181E -s1919 -s1700 -s181A -s191A -s1700 -s1817 -s191B -s1700 -s181B -s191C -s1700 -s1843 -s191D -s1700 -s1838 -s191E -s1700 -s183B -s191F -s1700 -s1835 -s1920 -s1700 -s1835 -s1921 -s1700 -s1830 -s1922 -s1700 -s182E -s1940 - - -////////////////////////////////////////////////////////// -//sef00 -//sca02 //Raw data out - -//sef00 -//scb00 // Normal mode -// -//sef01 -//s7000 // AE/AWB off //Jee hwan: 06.10.27 -// -//sef02 //shutter off //Jee hwan: 06.10.27 -//s0122 - -sef02 // CIS page -//s4b5E // PCLK driving current max -s23d8 // Tx width -s3a20 // double shutter off -s6508 // CIS mode -s0a90 // Display WCW -s0126 // E-shutter enable - -s0378 // S1R END **** Revised at EVT1 -s0500 // S1S end value control -s07E5 // S2 END -s090E // S4 END -s0b81 //85 //81 // Analog offset -s1320 //a0 // R_REF -//s1580 // EC COMP 100'b -s1c57 // global gain **** Revised at EVT1 -s243d // i_cds **** Revised at EVT1 -s2625 // clamp level control **** Revised at EVT1 -s298f // CFPN start frame (16) -s4b5b // IO driving current -s5605 // Line ADLC -s5861 // amp bias current source select (71h : self bias) -s5f06 // aps bias current -s673c // EC_COMP & SAVG_END -s6810 // i_rmp control -s6913 // i_mid - -s5861 // PLL off -s594c -s5a30 // for 48MHz - -s289B // CFPN on **** Revised at EVT1 - -//061011 -sef01 -sd189 // 0209 16.7Mhz //d2:24MHz 64:13MHz dc:25MHz 13MHz //d2 //d2(24MHz) Mclk Value (Mclk - 30d)/100,000 - -////////// -//page 0 -////////// -sef00 -//s093e //gr gain -s093d // 0208 -s0a3d // 0208 - -sef00 -s2960 //GrGb - -// AE Window -sef00 -s5500 // AE window -s5800 -s5931 -s5a02 -s5b47 -s5c00 -s5d64 -s5e01 -s5fac -s6000 -s6173 -s6202 -s630c -s6400 -s65ab -s6601 -s677e - -sef01 // AE weight -s7701 -s7801 -//s7903 -//s7a03 -//s7b04 -//s7c04 - -sef00 -s5718 // AE Lux min threshold - -sd9c0 // color edge threshold - -///////////////////////////////////////////////////// -//page 1///////////////////////////////////////////// -///////////////////////////////////////////////////// -sef01 -s837d // R gain max -s8430 // B gain max - -saf00 //L.L Brightness -sb4b0 //a0 // N.L contrast -sb5b0 //a0 // L.L contrast - -sb746 //58 //68 // N.L color saturation -sb830 //52 // L.L color saturation - -s7097 //17 // fix PAL(50Hz) -s715a //68 //70 //6f //4d //60 //78 //AE target -s720c //12 //0a //05 //12 // AE threshold -s746a //60 //70 //74 //70 // low agc max -s7540 // normal agc max - -sa640 //80 //N.L sharpness H/V Gain -sab24 //18 //60 //N.L NR Edge -sad40 //20 //L.L NR Edge -//sa330 //AWB speed //EVT0 Ǿ .(0x03) //EVT1 . - -scc09 //08 //Flicker threshold 12 -sd522 //32 //Chip_Debug2 - -se008 // NT Max -se208 //07 //18 // Low NT max -se106 // PAL Max -se306 //07 //18 // Low PAL max - -se400 // 0209 for PLL off 20fps // 24MHz VblankH (H.L) //FPS (24MHz, 28~5fps) -se525 // 0209 //ea // 24MHz NT VblankL (H.L) - -se843 //44 //84 //97 // ae speed - -sef00 -//s8c0e //skin color detection -sc80a //YC delay - - -//////////////////////////////////////// -// Color Correction -> Shading -> Gamma -> AWB -> Hue -//////////////////////////////////////// - -// Color Correction - -sef00 // //D65-1 //D65 //CW //U30-6 //U30 //Old -s4c40 //95 //95 //81 //8a //50 //62 //56 -s4d92 //c2 //c2 //ba //d2 //af //a9 //8d -s4e0f //92 //92 //87 //07 //1f //07 //89 -s4f9a //9b //9b //98 //9e //9e //a2 //94 -s503b //73 //73 //64 //4c //2e //47 //5c -s511e //98 //98 //8c //12 //30 //1b //8b -s5282 //80 //80 //80 //80 //86 //85 //80 -s53bf //b3 //b3 //ad //cd //eb //f2 //91 -s547f //73 //73 //6d //8e //b2 //b8 //51 - -// Shading2 //// RGB Shading// RGB Shading// RGB Shading - // // //linear//old -sef00 //sef00 //sef00 //00 //00 //00 //00 -s3001 //s3001 //s3001 //01 //01 //01 //01 -s322a //0a //s3200 //s3200 //00 //00 //00 //00 -s360a //s3600 //s3600 //00 //00 //00 //00 -s3a0a //s3a00 //s3a00 //00 //00 //00 //00 -s3300 //s3301 //s3300 //00 //01 //00 //01 -s3400 //s3450 //s3400 //32 //50 //00 //50 -s3700 //s3701 //s3700 //00 //01 //00 //01 -s3800 //s3850 //s3800 //50 //50 //00 //50 -s3b00 //s3b01 //s3b00 //00 //01 //00 //01 -s3c00 //s3c50 //s3c00 //00 //50 //00 //50 -s31b6 //fd //s31df //s3187 //ff //ff //5e //ff -s35df //da //s35b8 //s3569 //d7 //da //54 //da -s39bf //c1 //s39a9 //s395a //be //e6 //4d //e6 -s3f01 //s3f01 //s3f01 //01 //01 //01 //01 -s4036 //4a //s4040 //s4040 //4a //40 //40 //40 -s3d01 //s3d00 //s3d01 //00 //00 //01 //00 -s3e04 //s3ef0 //s3e18 //fa //f0 //18 //f0 - -//gamma5 -sef00 -//Gamma(Red) -s4800 -s4900 -s4A08 -s4B1B -s4801 -s4900 -s4A10 -s4B4E -s4802 -s4900 -s4A20 -s4B6F -s4803 -s4900 -s4A40 -s4B59 -s4804 -s4900 -s4A80 -s4B33 -s4805 -s4901 -s4A00 -s4B2B -s4806 -s4901 -s4AC0 -s4B20 -s4807 -s4902 -s4A80 -s4B19 -s4808 -s4903 -s4A00 -s4B16 -s4809 -s4903 -s4A80 -s4B13 -s480A -s4903 -s4AC0 -s4B12 -s480B -s4B14 -//Gamma(Green) -s4810 -s4900 -s4A08 -s4B1B -s4811 -s4900 -s4A10 -s4B4E -s4812 -s4900 -s4A20 -s4B6F -s4813 -s4900 -s4A40 -s4B59 -s4814 -s4900 -s4A80 -s4B33 -s4815 -s4901 -s4A00 -s4B2B -s4816 -s4901 -s4AC0 -s4B20 -s4817 -s4902 -s4A80 -s4B19 -s4818 -s4903 -s4A00 -s4B16 -s4819 -s4903 -s4A80 -s4B13 -s481A -s4903 -s4AC0 -s4B12 -s481B -s4B14 -//Gamma(Blue) -s4820 -s4900 -s4A08 -s4B1B -s4821 -s4900 -s4A10 -s4B4E -s4822 -s4900 -s4A20 -s4B6F -s4823 -s4900 -s4A40 -s4B59 -s4824 -s4900 -s4A80 -s4B33 -s4825 -s4901 -s4A00 -s4B2B -s4826 -s4901 -s4AC0 -s4B20 -s4827 -s4902 -s4A80 -s4B19 -s4828 -s4903 -s4A00 -s4B16 -s4829 -s4903 -s4A80 -s4B13 -s482A -s4903 -s4AC0 -s4B12 -s482B -s4B14 -s4880 - -// Hue - -sef00 -s8c0c //Skin Color Detection On/Off -s7400 //00 //Hue & Saturation Off=00, On=01 -s7958 //Saturation Gain -s7501 //Hue & Saturation Cosine 1 -s7660 //ff //Hue & Saturation Cosine 2 -s7702 //Hue & Saturation Sine 1 -s7811 //Hue & Saturation Sine 2 -s72a5 //95 //b0 //90 //Contrast Gain 0208 -//s7389 //Brightness Gain -sd800 //Edge color suppress - -//sef02 -//s0f40 - -//AWB white's count low 0f00 --> 0708 -sef01 -s8507 //0f //07 -s8608 //00 //08 - -// Bad Pixel Replacement - -sef00 // 0208 -s1a01 -s1b20 -s1e20 -s1c20 -s1f20 -s1d20 -s2020 - -s2b01 // 0208 NR -s2d15 - -sef01 -sb930 -sba00 - -seb40 //6f //Low Light Indication AGC - -sef00 // 0209 sharpness -sb902 -sbe80 -sbf30 -sc080 -sc130 - -sef01 -sa680 - diff --git a/build/libraries/camera/ARM7/A3AFX_EVT2_30fps_16M_QVGA_070206.set b/build/libraries/camera/ARM7/A3AFX_EVT2_30fps_16M_QVGA_070206.set deleted file mode 100644 index e3234f6..0000000 --- a/build/libraries/camera/ARM7/A3AFX_EVT2_30fps_16M_QVGA_070206.set +++ /dev/null @@ -1,715 +0,0 @@ -// 10.18 X shading, Color correction, RGB shading -// <0. D9> 50->C0 -// <1. E0> 04 -> 07, <0. D1> B2̸ 귯 . -// 07 63Ͽ 귯 ߻. 13M̻ . -// <1. B7> 68 -> 58, NL color saturation level -// <2. 23> DB -> D8, Tx width Sel -// <2. 3A> 60 -> 20, double shutter OFF -// <2. 0B> 81 -> 85 Negative (subsampling) - -//------------------------------------------------------------------ -// Set File -// - S5KA3AFX_xshade_060913.xls generates -// - date : 2007-01-08 2:45:52 -//------------------------------------------------------------------ - -// Page : 00 -sef00 - -s8000 // for 256x192 -s8101 -sc400 -sc5c0 -sc601 -sc700 - -s0d03 -s0e00 -s0f1F -s1000 -s1137 -s1208 -s1342 -s1400 -s1512 -s169E -s1900 -s1707 -s18F2 -s1901 -s1707 -s18F5 -s1902 -s1707 -s18E8 -s1903 -s1707 -s18E6 -s1904 -s1707 -s18E2 -s1905 -s1707 -s18D9 -s1906 -s1707 -s18DB -s1907 -s1700 -s1806 -s1908 -s1707 -s18FF -s1909 -s1707 -s18FF -s190A -s1707 -s18FC -s190B -s1707 -s18F4 -s190C -s1707 -s18F5 -s190D -s1707 -s18ED -s190E -s1700 -s181C -s190F -s1700 -s1811 -s1910 -s1700 -s1812 -s1911 -s1700 -s1813 -s1912 -s1700 -s1808 -s1913 -s1700 -s180A -s1914 -s1700 -s1806 -s1915 -s1700 -s1827 -s1916 -s1700 -s182F -s1917 -s1700 -s1828 -s1918 -s1700 -s181E -s1919 -s1700 -s181A -s191A -s1700 -s1817 -s191B -s1700 -s181B -s191C -s1700 -s1843 -s191D -s1700 -s1838 -s191E -s1700 -s183B -s191F -s1700 -s1835 -s1920 -s1700 -s1835 -s1921 -s1700 -s1830 -s1922 -s1700 -s182E -s1940 - - -////////////////////////////////////////////////////////// -//sef00 -//sca02 //Raw data out - -//sef00 -//scb00 // Normal mode -// -//sef01 -//s7000 // AE/AWB off //Jee hwan: 06.10.27 -// -//sef02 //shutter off //Jee hwan: 06.10.27 -//s0122 - -sef02 // CIS page -//s4b5E // PCLK driving current max -s23d8 // Tx width -s3a20 // double shutter off -s6508 // CIS mode -s0a90 // Display WCW -s0126 // E-shutter enable - -s0378 // S1R END **** Revised at EVT1 -s0500 // S1S end value control -s07E5 // S2 END -s090E // S4 END -s0b81 //85 //81 // Analog offset -s1320 //a0 // R_REF -//s1580 // EC COMP 100'b -s1c57 // global gain **** Revised at EVT1 -s243d // i_cds **** Revised at EVT1 -s2625 // clamp level control **** Revised at EVT1 -s298f // CFPN start frame (16) -s4b5b // IO driving current -s5605 // Line ADLC -s5861 // amp bias current source select (71h : self bias) -s5f06 // aps bias current -s673c // EC_COMP & SAVG_END -s6810 // i_rmp control -s6913 // i_mid - -s5821 // PLL for 45MHz 20fps -s5910 -s5a2d - -//s5821 // PLL on -//s591A // pll_s=0, pll_p=26, -//s5A1A // pll_m=26 - -s289B // CFPN on **** Revised at EVT1 - -//061011 -sef01 -sd18a // for 16.8MHz //d2:24MHz 64:13MHz dc:25MHz 13MHz //d2 //d2(24MHz) Mclk Value (Mclk - 30d)/100,000 -//sd164 //64(13MHz) Mclk Value (Mclk - 30d)/100,000 -//sd915 //AE saturation CHIP_DEBUG - -////////// -//page 0 -////////// -sef00 -//s093e //gr gain - -sef00 -s2960 //GrGb - -// AE Window -sef00 -s5500 // AE window -s5800 -s5931 -s5a02 -s5b47 -s5c00 -s5d64 -s5e01 -s5fac -s6000 -s6173 -s6202 -s630c -s6400 -s65ab -s6601 -s677e - -sef01 // AE weight -s7701 -s7801 -//s7903 -//s7a03 -//s7b04 -//s7c04 - -sef00 -s5718 // AE Lux min threshold - -sd9c0 // color edge threshold - -///////////////////////////////////////////////////// -//page 1///////////////////////////////////////////// -///////////////////////////////////////////////////// -sef01 -s837d // R gain max -s8430 // B gain max - -saf00 //L.L Brightness -sb4b0 //a0 // N.L contrast -sb5b0 //a0 // L.L contrast - -sb746 //58 //68 // N.L color saturation -sb830 //52 // L.L color saturation - -s7097 //17 // fix PAL(50Hz) -s715a //68 //70 //6f //4d //60 //78 //AE target -s720c //12 //0a //05 //12 // AE threshold -s7460 //70 //74 //70 // low agc max -s7540 // normal agc max - -sa640 //80 //N.L sharpness H/V Gain -sab24 //18 //60 //N.L NR Edge -sad40 //20 //L.L NR Edge -//sa330 //AWB speed //EVT0 Ǿ .(0x03) //EVT1 . - -scc09 //08 //Flicker threshold 12 -sd522 //32 //Chip_Debug2 - -se008 // NT Max -se208 //07 //18 // Low NT max -se106 // PAL Max -se306 //07 //18 // Low PAL max - -se401 // 24MHz VblankH (H.L) //FPS (24MHz, 28~5fps) -se5a9 //ea // 24MHz NT VblankL (H.L) -//se400 // 13MHz VblankH (H.L) //FPS (24MHz, 28~5fps) -//se52a // 13MHz VblankL (H.L) - -se843 //44 //84 //97 // ae speed - -sef00 -//s8c0e //skin color detection -sc80a //YC delay - - -//////////////////////////////////////// -// Color Correction -> Shading -> Gamma -> AWB -> Hue -//////////////////////////////////////// - -// Color Correction - -sef00 // //D65-1 //D65 //CW //U30-6 //U30 //Old -s4c40 //95 //95 //81 //8a //50 //62 //56 -s4d92 //c2 //c2 //ba //d2 //af //a9 //8d -s4e0f //92 //92 //87 //07 //1f //07 //89 -s4f9a //9b //9b //98 //9e //9e //a2 //94 -s503b //73 //73 //64 //4c //2e //47 //5c -s511e //98 //98 //8c //12 //30 //1b //8b -s5282 //80 //80 //80 //80 //86 //85 //80 -s53bf //b3 //b3 //ad //cd //eb //f2 //91 -s547f //73 //73 //6d //8e //b2 //b8 //51 - -//////CW -//sef00 -//s4c92 -//s4dcf -//s4e82 -//s4fad -//s506e -//s5180 -//s5287 -//s53eb -//s54b2 -// -////D65 -//sef00 -//s4c8a -//s4dc2 -//s4e88 -//s4f9f -//s5072 -//s5193 -//s5281 -//s53ca -//s548c - -//Default -//sef00 -//s4c56 -//s4d8d -//s4e89 -//s4f96 -//s505d -//s5188 -//s5294 -//s5389 -//s545d - -// Shading2 //// RGB Shading// RGB Shading// RGB Shading - // // //linear//old -sef00 //sef00 //sef00 //00 //00 //00 //00 -s3001 //s3001 //s3001 //01 //01 //01 //01 -s322a //0a //s3200 //s3200 //00 //00 //00 //00 -s360a //s3600 //s3600 //00 //00 //00 //00 -s3a0a //s3a00 //s3a00 //00 //00 //00 //00 -s3300 //s3301 //s3300 //00 //01 //00 //01 -s3400 //s3450 //s3400 //32 //50 //00 //50 -s3700 //s3701 //s3700 //00 //01 //00 //01 -s3800 //s3850 //s3800 //50 //50 //00 //50 -s3b00 //s3b01 //s3b00 //00 //01 //00 //01 -s3c00 //s3c50 //s3c00 //00 //50 //00 //50 -s31b6 //fd //s31df //s3187 //ff //ff //5e //ff -s35df //da //s35b8 //s3569 //d7 //da //54 //da -s39bf //c1 //s39a9 //s395a //be //e6 //4d //e6 -s3f01 //s3f01 //s3f01 //01 //01 //01 //01 -s4036 //4a //s4040 //s4040 //4a //40 //40 //40 -s3d01 //s3d00 //s3d01 //00 //00 //01 //00 -s3e04 //s3ef0 //s3e18 //fa //f0 //18 //f0 - -//sef00 -////Gamma(Red) -//s4800 -//s4900 -//s4A08 -//s4BF0 -//s4801 -//s4900 -//s4A10 -//s4BB6 -//s4802 -//s4900 -//s4A20 -//s4B5F -//s4803 -//s4900 -//s4A40 -//s4B4F -//s4804 -//s4900 -//s4A80 -//s4B37 -//s4805 -//s4901 -//s4A00 -//s4B27 -//s4806 -//s4901 -//s4AC0 -//s4B1C -//s4807 -//s4902 -//s4A80 -//s4B14 -//s4808 -//s4903 -//s4A00 -//s4B14 -//s4809 -//s4903 -//s4A80 -//s4B12 -//s480A -//s4903 -//s4AC0 -//s4B10 -//s480D -//s4B14 -////Gamma(Green) -//s4810 -//s4900 -//s4A08 -//s4BF0 -//s4811 -//s4900 -//s4A10 -//s4BB6 -//s4812 -//s4900 -//s4A20 -//s4B5F -//s4813 -//s4900 -//s4A40 -//s4B4F -//s4814 -//s4900 -//s4A80 -//s4B37 -//s4815 -//s4901 -//s4A00 -//s4B27 -//s4816 -//s4901 -//s4AC0 -//s4B1C -//s4817 -//s4902 -//s4A80 -//s4B14 -//s4818 -//s4903 -//s4A00 -//s4B14 -//s4819 -//s4903 -//s4A80 -//s4B12 -//s481A -//s4903 -//s4AC0 -//s4B10 -//s481D -//s4B14 -////Gamma(Blue) -//s4820 -//s4900 -//s4A08 -//s4BF0 -//s4821 -//s4900 -//s4A10 -//s4BB6 -//s4822 -//s4900 -//s4A20 -//s4B5F -//s4823 -//s4900 -//s4A40 -//s4B4F -//s4824 -//s4900 -//s4A80 -//s4B37 -//s4825 -//s4901 -//s4A00 -//s4B27 -//s4826 -//s4901 -//s4AC0 -//s4B1C -//s4827 -//s4902 -//s4A80 -//s4B14 -//s4828 -//s4903 -//s4A00 -//s4B14 -//s4829 -//s4903 -//s4A80 -//s4B12 -//s482A -//s4903 -//s4AC0 -//s4B10 -//s482D -//s4B14 -//s4880 - -//gamma5 -sef00 -//Gamma(Red) -s4800 -s4900 -s4A08 -s4B1B -s4801 -s4900 -s4A10 -s4B4E -s4802 -s4900 -s4A20 -s4B6F -s4803 -s4900 -s4A40 -s4B59 -s4804 -s4900 -s4A80 -s4B33 -s4805 -s4901 -s4A00 -s4B2B -s4806 -s4901 -s4AC0 -s4B20 -s4807 -s4902 -s4A80 -s4B19 -s4808 -s4903 -s4A00 -s4B16 -s4809 -s4903 -s4A80 -s4B13 -s480A -s4903 -s4AC0 -s4B12 -s480B -s4B14 -//Gamma(Green) -s4810 -s4900 -s4A08 -s4B1B -s4811 -s4900 -s4A10 -s4B4E -s4812 -s4900 -s4A20 -s4B6F -s4813 -s4900 -s4A40 -s4B59 -s4814 -s4900 -s4A80 -s4B33 -s4815 -s4901 -s4A00 -s4B2B -s4816 -s4901 -s4AC0 -s4B20 -s4817 -s4902 -s4A80 -s4B19 -s4818 -s4903 -s4A00 -s4B16 -s4819 -s4903 -s4A80 -s4B13 -s481A -s4903 -s4AC0 -s4B12 -s481B -s4B14 -//Gamma(Blue) -s4820 -s4900 -s4A08 -s4B1B -s4821 -s4900 -s4A10 -s4B4E -s4822 -s4900 -s4A20 -s4B6F -s4823 -s4900 -s4A40 -s4B59 -s4824 -s4900 -s4A80 -s4B33 -s4825 -s4901 -s4A00 -s4B2B -s4826 -s4901 -s4AC0 -s4B20 -s4827 -s4902 -s4A80 -s4B19 -s4828 -s4903 -s4A00 -s4B16 -s4829 -s4903 -s4A80 -s4B13 -s482A -s4903 -s4AC0 -s4B12 -s482B -s4B14 -s4880 - -//AWB -//sef00 -//s9301 // AWB map -//sa00f -//s9f0f -//s9300 - -//AWB mode : auto(??) -//sef01 -//s8000 - -// Hue - -sef00 -s8c0c //Skin Color Detection On/Off -s7400 //00 //Hue & Saturation Off=00, On=01 -s7958 //Saturation Gain -s7501 //Hue & Saturation Cosine 1 -s7660 //ff //Hue & Saturation Cosine 2 -s7702 //Hue & Saturation Sine 1 -s7811 //Hue & Saturation Sine 2 -s72b0 //90 //Contrast Gain -//s7389 //Brightness Gain -sd800 //Edge color suppress - -//sef02 -//s0f40 - -//AWB white's count low 0f00 --> 0708 -sef01 -s8507 //0f //07 -s8608 //00 //08 - -//AWB boundary -//sef00 -//sb100 -//sb221 -//sb300 -//sb42c -//sb501 -//sb6e0 -//sb702 -//sb870 - -// Bad Pixel Replacement - -//sef00 -//s1a01 -//s1b00 -//s1e00 -//s1c00 -//s1f00 -//s1d00 -//s2000 - -sef01 -sb930 -sba00 - -seb40 //6f //Low Light Indication AGC -// -//sef02 //shutter on //Jee hwan: 06.10.27 -//s0126 -// -//sef01 // AE/AWB on //Jee hwan: 06.10.27 -//s7017 diff --git a/build/libraries/camera/ARM7/A3AFX_EVT3_30fps_Scaledown_16.7M_50Hz.set b/build/libraries/camera/ARM7/A3AFX_EVT3_30fps_Scaledown_16.7M_50Hz.set deleted file mode 100644 index 2b021cd..0000000 --- a/build/libraries/camera/ARM7/A3AFX_EVT3_30fps_Scaledown_16.7M_50Hz.set +++ /dev/null @@ -1,649 +0,0 @@ -//3.13 Pearl setting . - -//------------------------------------------------------------------ -// Set File -// - S5KA3AFX_xshade_061018.xls generates -// - date : 2007-03-12 3:20:55 -//------------------------------------------------------------------ - -sef01 -s7000 //AE,AWB OFF - -//QVGA -sef00 -s7ce0 -s8101 -s8250 -s7f00 -s80f0 -sc209 -sc601 -sc740 -sc400 -sc5F0 - - -//// Page : 00 -//sef00 -//s0d03 -//s0e00 -//s0f1F -//s1000 -//s1137 -//s1208 -//s1342 -//s1400 -//s1512 -//s169E -//s1900 -//s1707 -//s18E0 -//s1901 -//s1707 -//s18E3 -//s1902 -//s1707 -//s18ED -//s1903 -//s1707 -//s18CA -//s1904 -//s1707 -//s18D2 -//s1905 -//s1707 -//s18EC -//s1906 -//s1707 -//s18E5 -//s1907 -//s1700 -//s1812 -//s1908 -//s1707 -//s18E6 -//s1909 -//s1700 -//s1808 -//s190A -//s1707 -//s18EA -//s190B -//s1707 -//s18DA -//s190C -//s1707 -//s18E3 -//s190D -//s1707 -//s18F9 -//s190E -//s1700 -//s181C -//s190F -//s1700 -//s1812 -//s1910 -//s1700 -//s1818 -//s1911 -//s1700 -//s1808 -//s1912 -//s1707 -//s18EB -//s1913 -//s1707 -//s18F9 -//s1914 -//s1707 -//s18F4 -//s1915 -//s1700 -//s181F -//s1916 -//s1700 -//s1815 -//s1917 -//s1700 -//s1811 -//s1918 -//s1700 -//s180E -//s1919 -//s1700 -//s1808 -//s191A -//s1707 -//s18FE -//s191B -//s1707 -//s18F4 -//s191C -//s1700 -//s1824 -//s191D -//s1700 -//s1803 -//s191E -//s1700 -//s1802 -//s191F -//s1707 -//s18FF -//s1920 -//s1700 -//s1812 -//s1921 -//s1707 -//s18E5 -//s1922 -//s1707 -//s18D1 -//s1940 -// - -sef02 -s5950 //P, S -s5a32 //M -s5821 //PLL - -////////////////////////////////////////////////////////// - -sef02 // CIS page -//s4b5E // PCLK driving current max -//s23d8 // Tx width -s3a20 // double shutter off -s6508 // CIS mode -s0a90 // Display WCW -s0126 // E-shutter enable - -s0378 // S1R END **** Revised at EVT1 -s0500 // S1S end value control -s07E5 // S2 END -s090E // S4 END -s0b84 //85 //81 // Analog offset -s13a0 //20 // R_REF -//s1580 // EC COMP 100'b -s1c58 //20070304AM //57 // global gain **** Revised at EVT1 -s243d // i_cds **** Revised at EVT1 -s2625 // clamp level control **** Revised at EVT1 -s298f // CFPN start frame (16) -s4b5b // IO driving current -s5605 // Line ADLC -//s5861 // amp bias current source select (71h : self bias) -s5f06 // aps bias current -s673c // EC_COMP & SAVG_END -s6810 // i_rmp control -s6913 // i_mid - -//s5821 // PLL on -//s591A // pll_s=0, pll_p=26, -//s5A1A // pll_m=26 - -s289B // CFPN on **** Revised at EVT1 - -//061011 -sef01 -sd1e6 //89:16.7MHz, d2:24MHz 64:13MHz dc:25MHz 13MHz //d2 //d2(24MHz) Mclk Value (Mclk - 30d)/100,000 -//sd164 //64(13MHz) Mclk Value (Mclk - 30d)/100,000 -//sd915 //AE saturation CHIP_DEBUG - -////////// -//page 0 -////////// -sef00 -//s093e //gr gain - -sef00 -s2740 //08 //GR/GB Correction Limitation Value -s2960 //GrGb Edge Threshold Value - -// AE Window -sef00 -s5500 //Window diplay off -s5800 -s5900 -s5a02 -s5b80 -s5c00 -s5d00 -s5e01 -s5fe0 -s6000 -s6100 -s6202 -s6380 -s6400 -s6500 -s6601 -s67e0 - -sef01 // AE weight -s7701 -s7801 -//s7903 -//s7a03 -//s7b04 -//s7c04 - -sef00 -//s5718 // AE Lux min threshold - -sd9c0 // color edge threshold - -////AWB Luminance check -////20070212 Added for low light starting env. -sef00 -sad03 //Luminance upper_level[9:8] -sae20 //Luminance upper_level[7:0] -saf00 //Luminance lower_level[9:8] -sb090 //Luminance lower_level[7:0] - -///////////////////////////////////////////////////// -//page 1///////////////////////////////////////////// -///////////////////////////////////////////////////// -sef01 -////20070212 Modified for low light starting env. -s8372 //7d //AWB R/B Max Gain : <0.44>'s max -s8438 //30 //AWB R/B Min Gain : <0.42>'s max - -sa841 //20070222 //shutter Control -sa9d4 //20070222 //Shutter Threshold - -saf04 //20070213PM //00 //L.L Brightness -sb488 //20070213 //b0 //a0 // N.L contrast -sb588 //20070213 //b0 //a0 // L.L contrast -sbc56 //20070305PM //26 //20070213 //AWB skip point (default:16) - -sb746 //58 //68 // N.L color saturation -sb846 //20070305PM //30 //52 // L.L color saturation - -//s7097 //17 // fix PAL(50Hz) -s716a //20070213PM //55 //5a //68 //70 //6f //4d //60 //78 //AE target -s7209 //20070214PM //07 //0c //12 //0a //05 //12 // AE threshold -//s7334 //20070214PM //AE Step Guard Value -s7466 //6b //60 //70 //74 //70 // low agc max -s7540 // normal agc max - -sa640 //80 //N.L sharpness H/V Gain -sab40 //38 //18 //60 //N.L NR Edge -sad80 //40 //20 //L.L NR Edge -//sa330 //AWB speed //EVT0 Ǿ .(0x03) //EVT1 . - -scc09 //08 //Flicker threshold 12 -sd522 //23 //32 //Chip_Debug2 - -se004 // NT Max -se204 //07 //18 // Low NT max -se103 // PAL Max -se303 //07 //18 // Low PAL max - -se400 // 24MHz VblankH (H.L) //FPS (24MHz, 15fps) -se527 //ea // 24MHz NT VblankL (H.L) -//se400 // 13MHz VblankH (H.L) //FPS (24MHz, 15fps) -//se52a // 13MHz VblankL (H.L) - -se600 //20070215AM // 24MHz VblankH (H.L) //FPS (24MHz, 15fps) -se727 //20070215AM //ea // 24MHz NT VblankL (H.L) - -se868 //44 //84 //97 // ae speed -se984 //Double shutter ON -//se987 -sef00 -//s8c0e //skin color detection -sc80a //YC delay - - -//////////////////////////////////////// -// Color Correction -> Shading -> Gamma -> AWB -> Hue -//////////////////////////////////////// - -// Color Correction - -//sef00 // //D65-1 //D65 //CW //U30-6 //U30 //Old -//s4c40 //95 //95 //81 //8a //50 //62 //56 -//s4d92 //c2 //c2 //ba //d2 //af //a9 //8d -//s4e0f //92 //92 //87 //07 //1f //07 //89 -//s4f9a //9b //9b //98 //9e //9e //a2 //94 -//s503b //73 //73 //64 //4c //2e //47 //5c -//s511e //98 //98 //8c //12 //30 //1b //8b -//s5282 //80 //80 //80 //80 //86 //85 //80 -//s53bf //b3 //b3 //ad //cd //eb //f2 //91 -//s547f //73 //73 //6d //8e //b2 //b8 //51 - -////CW -sef00 -s4c92 -s4dcf -s4e82 -s4fad -s506e -s5180 -s5287 -s53eb -s54b2 -// -////D65 -//sef00 -//s4c8a -//s4dc2 -//s4e88 -//s4f9f -//s5072 -//s5193 -//s5281 -//s53ca -//s548c - -//Default -//sef00 -//s4c56 -//s4d8d -//s4e89 -//s4f96 -//s505d -//s5188 -//s5294 -//s5389 -//s545d - -//// Shading2 //// RGB Shading// RGB Shading// RGB Shading -// // // //linear//old -sef00 //sef00 //sef00 //00 //00 //00 //00 -s3001 //s3001 //s3001 //01 //01 //01 //01 -s32b8 //s3200 //s3200 //00 //00 //00 //00 -s3690 //s3600 //s3600 //00 //00 //00 //00 -s3a90 //s3a00 //s3a00 //00 //00 //00 //00 -s3301 //s3301 //s3300 //00 //01 //00 //01 -s3422 //s3450 //s3400 //32 //50 //00 //50 -s3701 //s3701 //s3700 //00 //01 //00 //01 -s3822 //s3850 //s3800 //50 //50 //00 //50 -s3b01 //s3b01 //s3b00 //00 //01 //00 //01 -s3c22 //s3c50 //s3c00 //00 //50 //00 //50 -s31f8 //s31df //s3187 //ff //ff //5e //ff -s35ce //s35b8 //s3569 //d7 //da //54 //da -s39ca //s39a9 //s395a //be //e6 //4d //e6 -s3f01 //s3f01 //s3f01 //01 //01 //01 //01 -s4054 //s4040 //s4040 //4a //40 //40 //40 -s3d01 //s3d00 //s3d01 //00 //00 //01 //00 -s3e04 //s3ef0 //s3e18 //fa //f0 //18 //f0 - -//gamma5 -sef00 -//Gamma(Red) -s4800 -s4900 -s4A08 -s4B1B -s4801 -s4900 -s4A10 -s4B4E -s4802 -s4900 -s4A20 -s4B6F -s4803 -s4900 -s4A40 -s4B59 -s4804 -s4900 -s4A80 -s4B33 -s4805 -s4901 -s4A00 -s4B2B -s4806 -s4901 -s4AC0 -s4B20 -s4807 -s4902 -s4A80 -s4B19 -s4808 -s4903 -s4A00 -s4B16 -s4809 -s4903 -s4A80 -s4B13 -s480A -s4903 -s4AC0 -s4B12 -s480B -s4B14 -//Gamma(Green) -s4810 -s4900 -s4A08 -s4B1B -s4811 -s4900 -s4A10 -s4B4E -s4812 -s4900 -s4A20 -s4B6F -s4813 -s4900 -s4A40 -s4B59 -s4814 -s4900 -s4A80 -s4B33 -s4815 -s4901 -s4A00 -s4B2B -s4816 -s4901 -s4AC0 -s4B20 -s4817 -s4902 -s4A80 -s4B19 -s4818 -s4903 -s4A00 -s4B16 -s4819 -s4903 -s4A80 -s4B13 -s481A -s4903 -s4AC0 -s4B12 -s481B -s4B14 -//Gamma(Blue) -s4820 -s4900 -s4A08 -s4B1B -s4821 -s4900 -s4A10 -s4B4E -s4822 -s4900 -s4A20 -s4B6F -s4823 -s4900 -s4A40 -s4B59 -s4824 -s4900 -s4A80 -s4B33 -s4825 -s4901 -s4A00 -s4B2B -s4826 -s4901 -s4AC0 -s4B20 -s4827 -s4902 -s4A80 -s4B19 -s4828 -s4903 -s4A00 -s4B16 -s4829 -s4903 -s4A80 -s4B13 -s482A -s4903 -s4AC0 -s4B12 -s482B -s4B14 -s4880 - -//AWB -//sef00 -//s9301 // AWB map -//sa00f -//s9f0f -//s9300 - -//AWB mode : auto(??) -//sef01 -//s8000 - -// Hue - -sef00 -s8c0c //Skin Color Detection On/Off -s7401 //20070214 //00 //Hue & Saturation Off=00, On=01 -s7946 //20070214 //58 //Saturation Gain -s7501 //Hue & Saturation Cosine 1 -s7600 //a0 //20070214 //ff //Hue & Saturation Cosine 2 -s7702 //Hue & Saturation Sine 1 -s7800 //20070214 //11 //Hue & Saturation Sine 2 -s7288 //20070213 //b0 //90 //Contrast Gain -//s7389 //Brightness Gain -sd800 //Edge color suppress - -//sef02 -//s0f40 - -//AWB white's count low 0f00 --> 0708 -sef01 -s8500 //07 //0f //07 -s86f0 //08 //00 //08 - -//AWB boundary -//sef00 -//sb100 -//sb221 -//sb300 -//sb42c -//sb501 -//sb6e0 -//sb702 -//sb870 - -// Bad Pixel Replacement - -//sef00 -//s1a01 -//s1b00 -//s1e00 -//s1c00 -//s1f00 -//s1d00 -//s2000 - -sef01 -sb908 //10 //30 //BPR Gain Setting -sba00 -sbd00 - -seb50 //40 //6f //Low Light Indication AGC - -//20070213 -//AWB Map 1 -sef01 -s9480 //00 -s95c0 //c0 -s96c0 //f0 -s97f0 //c0 -s9878 //78 -s9978 //78 -s9a7c //7c -s9b3c //3f -s9c1e //1f -s9d0f //0f -s9e07 //07 -s9f03 //03 -sa000 //01 -sa1c8 -sa202 -s9302 - -//20070213 -//AWB Map Direct Write -sef00 -s9480 //00 -s95c0 //c0 -s96c0 //f0 -s97f0 //c0 -s9878 //78 -s9978 //78 -sa07c //7c -sa13c //3f -sa21e //1f -sa30f //0f -sa407 //07 -sa503 //03 -sa600 //01 - -//Auto Flicker Correction -sef01 -sdd31 -scd21 -sde31 - -//Frame AE Control - L.L 5fps -//*** Frame ô Ʒ κ ּó .*** -sef00 -s5700 -//sef01 -//se218 -//se316 -//se888 -//****************************************************** - -//sef00 -//s4340 //20070222 //fixed value -//s423d //AWB R start point -//s446b //AWB B start point - -sef01 //shadow line -sa500 - -s7097 //17 // fix PAL(50Hz) - -sef00 -sb902 -sba80 -sbb80 -sbc98 -sbd30 - - diff --git a/build/libraries/camera/ARM7/A3AFX_EVT3_30fps_Subsampling_16.7M_50Hz.set b/build/libraries/camera/ARM7/A3AFX_EVT3_30fps_Subsampling_16.7M_50Hz.set deleted file mode 100644 index faa296f..0000000 --- a/build/libraries/camera/ARM7/A3AFX_EVT3_30fps_Subsampling_16.7M_50Hz.set +++ /dev/null @@ -1,655 +0,0 @@ -// 3.13 Pearl setting . -// AWB_Low/High_CNT (subsampling µ) -//------------------------------------------------------------------ -// Set File -// - S5KA3AFX_xshade_061018.xls generates -// - date : 2007-03-12 3:20:55 -//------------------------------------------------------------------ - -sef01 -s7000 //AE,AWB OFF - -//// Page : 00 -//sef00 -//s0d03 -//s0e00 -//s0f1F -//s1000 -//s1137 -//s1208 -//s1342 -//s1400 -//s1512 -//s169E -//s1900 -//s1707 -//s18E0 -//s1901 -//s1707 -//s18E3 -//s1902 -//s1707 -//s18ED -//s1903 -//s1707 -//s18CA -//s1904 -//s1707 -//s18D2 -//s1905 -//s1707 -//s18EC -//s1906 -//s1707 -//s18E5 -//s1907 -//s1700 -//s1812 -//s1908 -//s1707 -//s18E6 -//s1909 -//s1700 -//s1808 -//s190A -//s1707 -//s18EA -//s190B -//s1707 -//s18DA -//s190C -//s1707 -//s18E3 -//s190D -//s1707 -//s18F9 -//s190E -//s1700 -//s181C -//s190F -//s1700 -//s1812 -//s1910 -//s1700 -//s1818 -//s1911 -//s1700 -//s1808 -//s1912 -//s1707 -//s18EB -//s1913 -//s1707 -//s18F9 -//s1914 -//s1707 -//s18F4 -//s1915 -//s1700 -//s181F -//s1916 -//s1700 -//s1815 -//s1917 -//s1700 -//s1811 -//s1918 -//s1700 -//s180E -//s1919 -//s1700 -//s1808 -//s191A -//s1707 -//s18FE -//s191B -//s1707 -//s18F4 -//s191C -//s1700 -//s1824 -//s191D -//s1700 -//s1803 -//s191E -//s1700 -//s1802 -//s191F -//s1707 -//s18FF -//s1920 -//s1700 -//s1812 -//s1921 -//s1707 -//s18E5 -//s1922 -//s1707 -//s18D1 -//s1940 -// - - -////////////////////////////////////////////////////////// - -sef02 // CIS page -s0205 //sub -//s4b5E // PCLK driving current max -//s23d8 // Tx width -s3a20 // double shutter off -s6508 // CIS mode -s0a90 // Display WCW -s0126 // E-shutter enable - -s0378 // S1R END **** Revised at EVT1 -s0580 //00 // S1S end value control -s07E5 // S2 END -s090E // S4 END -s0b87 //85 //81 // Analog offset -s13a0 //20 // R_REF -//s1580 // EC COMP 100'b -s1c52 //58 //20070304AM //57 // global gain **** Revised at EVT1 -s243d // i_cds **** Revised at EVT1 -s2625 // clamp level control **** Revised at EVT1 -s298f // CFPN start frame (16) -s4b5b // IO driving current -s5605 // Line ADLC -s5861 // amp bias current source select (71h : self bias) -s5f06 // aps bias current -s673c // EC_COMP & SAVG_END -s6810 // i_rmp control -s6913 // i_mid - -//s5821 // PLL on -//s591A // pll_s=0, pll_p=26, -//s5A1A // pll_m=26 - -s288b //9B // CFPN on - **** Revised at EVT1 - -//061011 -sef01 -sd189 //89:16.7MHz, d2:24MHz 64:13MHz dc:25MHz 13MHz //d2 //d2(24MHz) Mclk Value (Mclk - 30d)/100,000 -//sd164 //64(13MHz) Mclk Value (Mclk - 30d)/100,000 -//sd915 //AE saturation CHIP_DEBUG - -////////// -//page 0 -////////// -sef00 -//s093e //gr gain - -sef00 -s2740 //08 //GR/GB Correction Limitation Value -s2960 //GrGb Edge Threshold Value - -// AE Window //// AE Window -sef00 //sef00 -s5500 //s5500 //Window diplay off -s5800 //s5800 -s591f //s5900 -s5a01 //s5a02 -s5b44 //s5b80 -s5c00 //s5c00 -s5d1d //s5d00 -s5e00 //s5e01 -s5fec //s5fe0 -s6000 //s6000 -s6128 //s6100 -s6201 //s6202 -s633b //s6380 -s6400 //s6400 -s6523 //s6500 -s6600 //s6601 -s67e6 //s67e0 - // -sef01 //sef01 // AE weight -s7701 //s7701 -s7801 //s7801 -s7900 ////s7903 -s7a00 ////s7a03 -s7b00 ////s7b04 -s7c00 ////s7c04 - -sef00 -//s5718 // AE Lux min threshold - -sd9c0 // color edge threshold - -////AWB Luminance check -////20070212 Added for low light starting env. -sef00 -sad03 //Luminance upper_level[9:8] -sae20 //Luminance upper_level[7:0] -saf00 //Luminance lower_level[9:8] -sb090 //Luminance lower_level[7:0] - -///////////////////////////////////////////////////// -//page 1///////////////////////////////////////////// -///////////////////////////////////////////////////// -sef01 -////20070212 Modified for low light starting env. -s8372 //7d //AWB R/B Max Gain : <0.44>'s max -s8438 //30 //AWB R/B Min Gain : <0.42>'s max - -sa841 //20070222 //shutter Control -sa9d4 //20070222 //Shutter Threshold - -saf04 //0f //20070213PM //00 //L.L Brightness -sb488 //20070213 //b0 //a0 // N.L contrast -sb588 //20070213 //b0 //a0 // L.L contrast -sbc56 //20070305PM //26 //20070213 //AWB skip point (default:16) - -sb746 //58 //68 // N.L color saturation -sb846 //20070305PM //30 //52 // L.L color saturation - -//s7097 //17 // fix PAL(50Hz) -s716a //20070213PM //55 //5a //68 //70 //6f //4d //60 //78 //AE target -s7209 //20070214PM //07 //0c //12 //0a //05 //12 // AE threshold -//s7334 //20070214PM //AE Step Guard Value -s7466 //6b //60 //70 //74 //70 // low agc max -s7540 // normal agc max - -sa640 //80 //N.L sharpness H/V Gain -sab40 //38 //18 //60 //N.L NR Edge -sad80 //40 //20 //L.L NR Edge -//sa330 //AWB speed //EVT0 Ǿ .(0x03) //EVT1 . - -scc09 //08 //Flicker threshold 12 -sd522 //23 //32 //Chip_Debug2 - -se004 // NT Max -se204 //07 //18 // Low NT max -se103 // PAL Max -se303 //07 //18 // Low PAL max - -se400 // 24MHz VblankH (H.L) //FPS (24MHz, 15fps) -se55e //ea // 24MHz NT VblankL (H.L) -//se400 // 13MHz VblankH (H.L) //FPS (24MHz, 15fps) -//se52a // 13MHz VblankL (H.L) - -se600 //20070215AM // 24MHz VblankH (H.L) //FPS (24MHz, 15fps) -se75e //20070215AM //ea // 24MHz NT VblankL (H.L) - -se868 //44 //84 //97 // ae speed - -se984 //87 -sef00 -//s8c0e //skin color detection -sc80a //YC delay - - -//////////////////////////////////////// -// Color Correction -> Shading -> Gamma -> AWB -> Hue -//////////////////////////////////////// - -// Color Correction - -//sef00 // //D65-1 //D65 //CW //U30-6 //U30 //Old -//s4c40 //95 //95 //81 //8a //50 //62 //56 -//s4d92 //c2 //c2 //ba //d2 //af //a9 //8d -//s4e0f //92 //92 //87 //07 //1f //07 //89 -//s4f9a //9b //9b //98 //9e //9e //a2 //94 -//s503b //73 //73 //64 //4c //2e //47 //5c -//s511e //98 //98 //8c //12 //30 //1b //8b -//s5282 //80 //80 //80 //80 //86 //85 //80 -//s53bf //b3 //b3 //ad //cd //eb //f2 //91 -//s547f //73 //73 //6d //8e //b2 //b8 //51 - -////CW -sef00 -s4c92 -s4dcf -s4e82 -s4fad -s506e -s5180 -s5287 -s53eb -s54b2 -// -////D65 -//sef00 -//s4c8a -//s4dc2 -//s4e88 -//s4f9f -//s5072 -//s5193 -//s5281 -//s53ca -//s548c - -//Default -//sef00 -//s4c56 -//s4d8d -//s4e89 -//s4f96 -//s505d -//s5188 -//s5294 -//s5389 -//s545d - -// RGB Shading //// RGB Shading ////// Shading2 //// RGB Shading// RGB Shading// RGB Shading - // //// // // //linear//old -sef00 //sef00 //sef00 //sef00 //sef00 //00 //00 //00 //00 -s3001 //s3001 //s3001 //s3001 //s3001 //01 //01 //01 //01 -s3264 //s323c //s32b8 //s3200 //s3200 //00 //00 //00 //00 -s363c //s363c //s3690 //s3600 //s3600 //00 //00 //00 //00 -s3a3c //s3a3c //s3a90 //s3a00 //s3a00 //00 //00 //00 //00 -s3300 //s3300 //s3301 //s3301 //s3300 //00 //01 //00 //01 -s3400 //s3400 //s3422 //s3450 //s3400 //32 //50 //00 //50 -s3700 //s3700 //s3701 //s3701 //s3700 //00 //01 //00 //01 -s3800 //s3800 //s3822 //s3850 //s3800 //50 //50 //00 //50 -s3b00 //s3b00 //s3b01 //s3b01 //s3b00 //00 //01 //00 //01 -s3c00 //s3c00 //s3c22 //s3c50 //s3c00 //00 //50 //00 //50 -s31f8 //s31f8 //s31f8 //s31df //s3187 //ff //ff //5e //ff -s35ce //s35ce //s35ce //s35b8 //s3569 //d7 //da //54 //da -s39c8 //s39ca //s39ca //s39a9 //s395a //be //e6 //4d //e6 -s3f00 //s3f00 //s3f01 //s3f01 //s3f01 //01 //01 //01 //01 -s40a0 //s40a0 //s4054 //s4040 //s4040 //4a //40 //40 //40 -s3d00 //s3d00 //s3d01 //s3d00 //s3d01 //00 //00 //01 //00 -s3e78 //s3e78 //s3e04 //s3ef0 //s3e18 //fa //f0 //18 //f0 - // -//gamma5 -sef00 -//Gamma(Red) -s4800 -s4900 -s4A08 -s4B1B -s4801 -s4900 -s4A10 -s4B4E -s4802 -s4900 -s4A20 -s4B6F -s4803 -s4900 -s4A40 -s4B59 -s4804 -s4900 -s4A80 -s4B33 -s4805 -s4901 -s4A00 -s4B2B -s4806 -s4901 -s4AC0 -s4B20 -s4807 -s4902 -s4A80 -s4B19 -s4808 -s4903 -s4A00 -s4B16 -s4809 -s4903 -s4A80 -s4B13 -s480A -s4903 -s4AC0 -s4B12 -s480B -s4B14 -//Gamma(Green) -s4810 -s4900 -s4A08 -s4B1B -s4811 -s4900 -s4A10 -s4B4E -s4812 -s4900 -s4A20 -s4B6F -s4813 -s4900 -s4A40 -s4B59 -s4814 -s4900 -s4A80 -s4B33 -s4815 -s4901 -s4A00 -s4B2B -s4816 -s4901 -s4AC0 -s4B20 -s4817 -s4902 -s4A80 -s4B19 -s4818 -s4903 -s4A00 -s4B16 -s4819 -s4903 -s4A80 -s4B13 -s481A -s4903 -s4AC0 -s4B12 -s481B -s4B14 -//Gamma(Blue) -s4820 -s4900 -s4A08 -s4B1B -s4821 -s4900 -s4A10 -s4B4E -s4822 -s4900 -s4A20 -s4B6F -s4823 -s4900 -s4A40 -s4B59 -s4824 -s4900 -s4A80 -s4B33 -s4825 -s4901 -s4A00 -s4B2B -s4826 -s4901 -s4AC0 -s4B20 -s4827 -s4902 -s4A80 -s4B19 -s4828 -s4903 -s4A00 -s4B16 -s4829 -s4903 -s4A80 -s4B13 -s482A -s4903 -s4AC0 -s4B12 -s482B -s4B14 -s4880 - -//AWB -//sef00 -//s9301 // AWB map -//sa00f -//s9f0f -//s9300 - -//AWB mode : auto(??) -//sef01 -//s8000 - -// Hue - -sef00 -s8c0c //Skin Color Detection On/Off -s7401 //20070214 //00 //Hue & Saturation Off=00, On=01 -s7946 //20070214 //58 //Saturation Gain -s7501 //Hue & Saturation Cosine 1 -s7600 //a0 //20070214 //ff //Hue & Saturation Cosine 2 -s7702 //Hue & Saturation Sine 1 -s7800 //20070214 //11 //Hue & Saturation Sine 2 -s7288 //20070213 //b0 //90 //Contrast Gain -//s7389 //Brightness Gain -sd800 //Edge color suppress - -//sef02 -//s0f40 - -//AWB white's count low 0f00 --> 0708 -sef01 -s8500 //07 //0f //07 -s863c //2d //08 //00 //08 -s8713 //0e -s88c0 //d0 - -//AWB boundary -sef00 -sb100 -sb200 -sb300 -sb400 -sb500 -sb6f0 -sb701 -sb840 - -// Bad Pixel Replacement - -//sef00 -//s1a01 -//s1b00 -//s1e00 -//s1c00 -//s1f00 -//s1d00 -//s2000 - -sef01 -sb908 //10 //30 //BPR Gain Setting -sba00 -sbd00 - -seb60 //40 //6f //Low Light Indication AGC - -//20070213 -//AWB Map 1 -sef01 -s9480 //00 -s95c0 //c0 -s96c0 //f0 -s97f0 //c0 -s9878 //78 -s9978 //78 -s9a7c //7c -s9b3c //3f -s9c1e //1f -s9d0f //0f -s9e07 //07 -s9f03 //03 -sa000 //01 -sa1c8 -sa202 -s9382 //AWB window //02 - -//20070213 -//AWB Map Direct Write -sef00 -s9480 //00 -s95c0 //c0 -s96c0 //f0 -s97f0 //c0 -s9878 //78 -s9978 //78 -sa07c //7c -sa13c //3f -sa21e //1f -sa30f //0f -sa407 //07 -sa503 //03 -sa600 //01 - -//Auto Flicker Correction -sef01 -sdd31 -scd21 -sde31 - -//Frame AE Control - L.L 5fps -//*** Frame ô Ʒ κ ּó .*** -sef00 -s5700 -//sef01 -//se218 -//se316 -//se888 -//****************************************************** - -//sef00 -//s4340 //20070222 //fixed value -//s423d //AWB R start point -//s446b //AWB B start point - -sef01 //shadow line -sa500 - -sef00 -sb902 -sba80 -sbb80 -sbc98 -sbd30 - -// -sef00 -s0400 -s05f8 -sc208 -sc308 -sc400 -sc5f0 -sc601 -sc740 - -sef02 -s0a9a -s08f7 - -s1a01 -s1be6 - -sef01 -sca01 -scbe6 - -s7097 //17 // fix PAL(50Hz) diff --git a/build/libraries/camera/ARM7/MT9V113-MTM10.ini b/build/libraries/camera/ARM7/MT9V113-MTM10.ini new file mode 100644 index 0000000..f37fe85 --- /dev/null +++ b/build/libraries/camera/ARM7/MT9V113-MTM10.ini @@ -0,0 +1,1031 @@ +;************************************************************************************** +; Copyright 2006 Micron Technology, Inc. All rights reserved. +; +; +; No permission to use, copy, modify, or distribute this software and/or +; its documentation for any purpose has been granted by Micron Technology, Inc. +; If any such permission has been granted ( by separate agreement ), it +; is required that the above copyright notice appear in all copies and +; that both that copyright notice and this permission notice appear in +; supporting documentation, and that the name of Micron Technology, Inc. or any +; of its trademarks may not be used in advertising or publicity pertaining +; to distribution of the software without specific, written prior permission. +; +; +; This software and any associated documentation are provided "AS IS" and +; without warranty of any kind. MICRON TECHNOLOGY, INC. EXPRESSLY DISCLAIMS +; ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, NONINFRINGEMENT +; OF THIRD PARTY RIGHTS, AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS +; FOR A PARTICULAR PURPOSE. MICRON DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED +; IN THIS SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF THIS SOFTWARE +; WILL BE UNINTERRUPTED OR ERROR-FREE. FURTHERMORE, MICRON DOES NOT WARRANT OR +; MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF ANY +; ACCOMPANYING DOCUMENTATION IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, +; OR OTHERWISE. +;**************************************************************************************/ +; +; Default INI file for the MI-0380-REV1 +; <<< MT9V113-MTM10.ini >>> +; $Revision: 1.3 $ +; $Date: 2007/04/22 07:13:21 $ +; +; This file holds groups of register presets (sections) specific for this sensor. The +; presets allow you to overwrite the power-on default settings with optimized register +; settings. +; The [Default Registers] section contains all optimized register settings for running +; the sensor in the demo environment. Other sections include settings optimized for a +; variety of situations like: Running at different master clock speeds, running under +; different lighting situations, running with different lenses, etc. +; Most of the demonstration software (DevWare, SensorDemo, ...) make use of this file +; to load and store the user presets. +; +; Keyname description: +; REG = assign a new register value +; BITFIELD = do a READ-MODIFY-WRITE to part of a register. The part is defined as a mask. +; LOAD = load an alternate section from this section +; STATE = set non-register state +; DELAY = delay a certain amount of milliseconds before continuing +; +; Keyname format: +; REG = [,]
, // +; BITFIELD = [,]
, , +; Some examples: +; BITFIELD=2, 0x05, 0x0020, 1 //for register 5 on page 2, set the 6th bit to 1 +; BITFIELD=0x06, 0x000F, 0 //for register 6, clear the first 4 bits +; LOAD =
+; STATE = , +; DELAY = +; +; Optional address space for this register. Some sensors (mostly SOC's) +; have multiple register pages (see the sensor spec or developer's guide) +;
the register address +; the new value to assign to the register +; is the part of a register value that needs to be updated with a new value +;
the name of another section to load +; non-register program state names [do not modify] +; wait for this ammount of milliseconds before continuing +; Some form of C-style comments are supported in this .ini file +; +;*************************************************************************************/ + +[Default Registers] +LOAD=Initialize Camera + +//LOAD=Image Setting ExtClk=6.75MHz Op_Pix=27.5MHz 15fps +//LOAD=Image Setting ExtClk=16.76MHz Op_Pix=27.5MHz 15fps +LOAD=Image Setting ExtClk=16.76MHz Op_Pix=8.38MHz + +LOAD=Lens Correction +LOAD=Auto Exposure +LOAD=Auto White Balance +LOAD=Gamma Correction +LOAD=Sharpness : 0 +LOAD=Refresh + + +[Initialize Camera] +REG = 0x001A, 0x0003// Activate Soft Reset & MIPI Reset +DELAY = 1 // Wait 1ms for internal reset cycle (6000 EXTCLK cycles) using a 6.75Mhz clock this will be approx 0.88ms +REG = 0x001A, 0x0000 // Deactivate both soft reset, MIPI reset +DELAY = 1 +REG = 0x0018, 0x4028 // Enable STANDBY mode, Bit(3) +REG = 0x001A, 0x0200 // Enable parallel port:bit(9) & Output enable: Bit(8) +REG = 0x001E, 0x0777 // Program to slowest SLEW rate +REG = 0x0016, 0x42DF // Invert PIXCLK output to interface with Micron DEMO2 board +// Enable EXTCLK bit9 + + +//////////////////////////////////////////////////////////////////////////////// +; This file was generated by: MT9V113 (SOC0380) Register Wizard +; Version: 2.8.0.53 Build Date: 06/06/2007 +; +; [PLL PARAMETERS] +; +; Bypass PLL: Unchecked +; Input Frequency: 6.750 +; Use Min Freq.: Unchecked +; Target System Frequency: 27.844 +; Target VCO Frequency: Unspecified +; "M" Value: Unspecified +; "N" Value: Unspecified +; +; Target PLL Frequency: 27.500 MHz +; MT9V113 Input Clock Frequency: 6.750 MHz +; MT9V113 Internal Clock Frequency: 27.844 MHz +; MT9V113 SOC Clock Frequency: 27.844 MHz +; M = 33 +; N = 0 +; Fpdf = 6.750 MHz +; Fvco = 445.500 MHz +; +; [CONTEXT A PARAMETERS] +; +; Requested Frames Per Second: 14.645 +; Output Columns: 640 +; Output Rows: 480 +; Allow Skipping: Unchecked +; Use Context B Line Time: Unchecked +; Low Power: Unchecked +; Blanking Computation: HB Min then VB +; +; Max Frame Time: 68.2827 msec +; Max Frame Clocks: 950623.0 clocks (13.922 MHz) +; Pixel Clock: divided by 1 +; Skip Mode: 1x cols, 1x rows, Bin Mode: No +; Horiz clks: 648 active + 194 blank = 842 total +; Vert rows: 488 active + 641 blank = 1129 total +; Extra Delay: 5 clocks +; +; Actual Frame Clocks: 950623 clocks +; Row Time: 60.480 usec / 842 clocks +; Frame time: 68.282685 msec +; Frames per Sec: 14.645 fps +; +; 50Hz Flicker Period: 165.34 lines +; 60Hz Flicker Period: 137.79 lines +; +; [CONTEXT B PARAMETERS] +; +; Requested Frames Per Second: 14.645 +; Output Columns: 640 +; Output Rows: 480 +; Allow Skipping: Unchecked +; Use Context A Line Time: Unchecked +; Low Power: Unchecked +; Blanking Computation: HB Min then VB +; +; Max Frame Time: 68.2827 msec +; Max Frame Clocks: 950623.0 clocks (13.922 MHz) +; Pixel Clock: divided by 1 +; Skip Mode: 1x cols, 1x rows, Bin Mode: No +; Horiz clks: 648 active + 194 blank = 842 total +; Vert rows: 488 active + 641 blank = 1129 total +; Extra Delay: 5 clocks +; +; Actual Frame Clocks: 950623 clocks +; Row Time: 60.480 usec / 842 clocks +; Frame time: 68.282685 msec +; Frames per Sec: 14.645 fps +; +; 50Hz Flicker Period: 165.34 lines +; 60Hz Flicker Period: 137.79 lines +; +; + +[Image Setting ExtClk=6.75MHz Op_Pix=27.5MHz 15fps] +BITFIELD= 0x14, 1, 1 // Bypass PLL +BITFIELD= 0X14, 2, 0 // Power-down PLL +REG = 0x0010, 0x0021 //PLL Dividers = 0x21 +REG = 0x0012, 0x0000 //PLL P Dividers = 0x0 +REG = 0x0014, 0x244B //PLL control: TEST_BYPASS on = 0x244B +DELAY = 1 // Allow PLL to lock +REG = 0x0014, 0x304B //PLL control: PLL_ENABLE on = 0x304B +POLL_REG=0x0014, 0x8000, ==0, DELAY=50, TIMEOUT=20 // Verify PLL lock +BITFIELD= 0x14, 1, 0 //PLL_BYPASS_OFF +REG = 0x98C, 0x2703 //Output Width (A) +REG = 0x990, 0x0280 // = 640 +REG = 0x98C, 0x2705 //Output Height (A) +REG = 0x990, 0x01E0 // = 480 +REG = 0x98C, 0x2707 //Output Width (B) +REG = 0x990, 0x0280 // = 640 +REG = 0x98C, 0x2709 //Output Height (B) +REG = 0x990, 0x01E0 // = 480 +REG = 0x98C, 0x270D //Row Start (A) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x270F //Column Start (A) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2711 //Row End (A) +REG = 0x990, 0x1EB // = 491 +REG = 0x98C, 0x2713 //Column End (A) +REG = 0x990, 0x28B // = 651 +REG = 0x98C, 0x2715 //Row Speed (A) +REG = 0x990, 0x0001 // = 1 +REG = 0x98C, 0x2717 //Read Mode (A) +REG = 0x990, 0x0026 // = 38 +REG = 0x98C, 0x2719 //sensor_fine_correction (A) +REG = 0x990, 0x001A // = 26 +REG = 0x98C, 0x271B //sensor_fine_IT_min (A) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x271D //sensor_fine_IT_max_margin (A) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x271F //Frame Lines (A) +REG = 0x990, 0x0469 // = 1129 +REG = 0x98C, 0x2721 //Line Length (A) +REG = 0x990, 0x034A // = 842 +REG = 0x98C, 0x2723 //Row Start (B) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2725 //Column Start (B) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2727 //Row End (B) +REG = 0x990, 0x1EB // = 491 +REG = 0x98C, 0x2729 //Column End (B) +REG = 0x990, 0x28B // = 651 +REG = 0x98C, 0x272B //Row Speed (B) +REG = 0x990, 0x0001 // = 1 +REG = 0x98C, 0x272D //Read Mode (B) +REG = 0x990, 0x0026 // = 38 +REG = 0x98C, 0x272F //sensor_fine_correction (B) +REG = 0x990, 0x001A // = 26 +REG = 0x98C, 0x2731 //sensor_fine_IT_min (B) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x2733 //sensor_fine_IT_max_margin (B) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x2735 //Frame Lines (B) +REG = 0x990, 0x0469 // = 1129 +REG = 0x98C, 0x2737 //Line Length (B) +REG = 0x990, 0x034A // = 842 +REG = 0x98C, 0x2739 //Crop_X0 (A) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x273B //Crop_X1 (A) +REG = 0x990, 0x027F // = 639 +REG = 0x98C, 0x273D //Crop_Y0 (A) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x273F //Crop_Y1 (A) +REG = 0x990, 0x01DF // = 479 +REG = 0x98C, 0x2747 //Crop_X0 (B) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x2749 //Crop_X1 (B) +REG = 0x990, 0x027F // = 639 +REG = 0x98C, 0x274B //Crop_Y0 (B) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x274D //Crop_Y1 (B) +REG = 0x990, 0x01DF // = 479 +REG = 0x98C, 0x222D //R9 Step +REG = 0x990, 0x008A // = 138 +REG = 0x98C, 0xA408 //search_f1_50 +REG = 0x990, 0x19 // = 25 +REG = 0x98C, 0xA409 //search_f2_50 +REG = 0x990, 0x1C // = 28 +REG = 0x98C, 0xA40A //search_f1_60 +REG = 0x990, 0x1F // = 31 +REG = 0x98C, 0xA40B //search_f2_60 +REG = 0x990, 0x22 // = 34 +REG = 0x98C, 0x2411 //R9_Step_60_A +REG = 0x990, 0x008A // = 138 +REG = 0x98C, 0x2413 //R9_Step_50_A +REG = 0x990, 0x00A5 // = 165 +REG = 0x98C, 0x2415 //R9_Step_60_B +REG = 0x990, 0x008A // = 138 +REG = 0x98C, 0x2417 //R9_Step_50_B +REG = 0x990, 0x00A5 // = 165 +REG = 0x98C, 0xA40D //Stat_min +REG = 0x990, 0x02 // = 2 +REG = 0x98C, 0xA410 //Min_amplitude +REG = 0x990, 0x01 // = 1 + +//////////////////////////////////////////////////////////////////////////////// +; This file was generated by: MT9V113 (SOC0380) Register Wizard +; Version: 2.9.0.2 Build Date: 06/29/2007 +; +; [PLL PARAMETERS] +; +; Bypass PLL: Unchecked +; Input Frequency: 16.760 +; Use Min Freq.: Unchecked +; Target System Frequency: 27.759 +; Target VCO Frequency: Unspecified +; "M" Value: Unspecified +; "N" Value: Unspecified +; +; Target PLL Frequency: 27.500 MHz +; MT9V113 Input Clock Frequency: 16.760 MHz +; MT9V113 Internal Clock Frequency: 27.759 MHz +; MT9V113 SOC Clock Frequency: 27.759 MHz +; M = 53 +; N = 3 +; Fpdf = 4.190 MHz +; Fvco = 444.140 MHz +; +; [CONTEXT A PARAMETERS] +; +; Requested Frames Per Second: 15.000 +; Output Columns: 640 +; Output Rows: 480 +; Allow Skipping: Unchecked +; Use Context B Line Time: Unchecked +; Low Power: Unchecked +; Blanking Computation: HB Min then VB +; +; Max Frame Time: 66.6667 msec +; Max Frame Clocks: 925291.6 clocks (13.879 MHz) +; Pixel Clock: divided by 1 +; Skip Mode: 1x cols, 1x rows, Bin Mode: No +; Horiz clks: 648 active + 194 blank = 842 total +; Vert rows: 488 active + 610 blank = 1098 total +; Extra Delay: 775 clocks +; +; Actual Frame Clocks: 925291 clocks +; Row Time: 60.666 usec / 842 clocks +; Frame time: 66.666619 msec +; Frames per Sec: 15 fps +; +; 50Hz Flicker Period: 164.84 lines +; 60Hz Flicker Period: 137.37 lines +; +; [CONTEXT B PARAMETERS] +; +; Requested Frames Per Second: 15.000 +; Output Columns: 640 +; Output Rows: 480 +; Allow Skipping: Unchecked +; Use Context A Line Time: Unchecked +; Low Power: Unchecked +; Blanking Computation: HB Min then VB +; +; Max Frame Time: 66.6667 msec +; Max Frame Clocks: 925291.6 clocks (13.879 MHz) +; Pixel Clock: divided by 1 +; Skip Mode: 1x cols, 1x rows, Bin Mode: No +; Horiz clks: 648 active + 194 blank = 842 total +; Vert rows: 488 active + 610 blank = 1098 total +; Extra Delay: 775 clocks +; +; Actual Frame Clocks: 925291 clocks +; Row Time: 60.666 usec / 842 clocks +; Frame time: 66.666619 msec +; Frames per Sec: 15 fps +; +; 50Hz Flicker Period: 164.84 lines +; 60Hz Flicker Period: 137.37 lines +; +; + +[Image Setting ExtClk=16.76MHz Op_Pix=27.5MHz 15fps] +BITFIELD= 0x14, 1, 1 // Bypass PLL +BITFIELD= 0X14, 2, 0 // Power-down PLL +REG = 0x0010, 0x0335 //PLL Dividers = 0x335 +REG = 0x0012, 0x0000 //PLL P Dividers = 0x0 +REG = 0x0014, 0x244B //PLL control: TEST_BYPASS on = 0x244B +DELAY = 1 // Allow PLL to lock +REG = 0x0014, 0x304B //PLL control: PLL_ENABLE on = 0x304B +POLL_REG=0x0014, 0x8000, ==0, DELAY=50, TIMEOUT=20 // Verify PLL lock +BITFIELD= 0x14, 1, 0 //PLL_BYPASS_OFF +REG = 0x98C, 0x2703 //Output Width (A) +REG = 0x990, 0x0280 // = 640 +REG = 0x98C, 0x2705 //Output Height (A) +REG = 0x990, 0x01E0 // = 480 +REG = 0x98C, 0x2707 //Output Width (B) +REG = 0x990, 0x0280 // = 640 +REG = 0x98C, 0x2709 //Output Height (B) +REG = 0x990, 0x01E0 // = 480 +REG = 0x98C, 0x270D //Row Start (A) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x270F //Column Start (A) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2711 //Row End (A) +REG = 0x990, 0x1EB // = 491 +REG = 0x98C, 0x2713 //Column End (A) +REG = 0x990, 0x28B // = 651 +REG = 0x98C, 0x2715 //Row Speed (A) +REG = 0x990, 0x0001 // = 1 +REG = 0x98C, 0x2717 //Read Mode (A) +REG = 0x990, 0x0026 // = 38 +REG = 0x98C, 0x2719 //sensor_fine_correction (A) +REG = 0x990, 0x001A // = 26 +REG = 0x98C, 0x271B //sensor_fine_IT_min (A) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x271D //sensor_fine_IT_max_margin (A) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x271F //Frame Lines (A) +REG = 0x990, 0x044A // = 1098 +REG = 0x98C, 0x2721 //Line Length (A) +REG = 0x990, 0x034A // = 842 +REG = 0x98C, 0x2723 //Row Start (B) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2725 //Column Start (B) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2727 //Row End (B) +REG = 0x990, 0x1EB // = 491 +REG = 0x98C, 0x2729 //Column End (B) +REG = 0x990, 0x28B // = 651 +REG = 0x98C, 0x272B //Row Speed (B) +REG = 0x990, 0x0001 // = 1 +REG = 0x98C, 0x272D //Read Mode (B) +REG = 0x990, 0x0026 // = 38 +REG = 0x98C, 0x272F //sensor_fine_correction (B) +REG = 0x990, 0x001A // = 26 +REG = 0x98C, 0x2731 //sensor_fine_IT_min (B) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x2733 //sensor_fine_IT_max_margin (B) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x2735 //Frame Lines (B) +REG = 0x990, 0x044A // = 1098 +REG = 0x98C, 0x2737 //Line Length (B) +REG = 0x990, 0x034A // = 842 +REG = 0x98C, 0x2739 //Crop_X0 (A) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x273B //Crop_X1 (A) +REG = 0x990, 0x027F // = 639 +REG = 0x98C, 0x273D //Crop_Y0 (A) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x273F //Crop_Y1 (A) +REG = 0x990, 0x01DF // = 479 +REG = 0x98C, 0x2747 //Crop_X0 (B) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x2749 //Crop_X1 (B) +REG = 0x990, 0x027F // = 639 +REG = 0x98C, 0x274B //Crop_Y0 (B) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x274D //Crop_Y1 (B) +REG = 0x990, 0x01DF // = 479 +REG = 0x98C, 0x222D //R9 Step +REG = 0x990, 0x0089 // = 137 +REG = 0x98C, 0xA408 //search_f1_50 +REG = 0x990, 0x19 // = 25 +REG = 0x98C, 0xA409 //search_f2_50 +REG = 0x990, 0x1C // = 28 +REG = 0x98C, 0xA40A //search_f1_60 +REG = 0x990, 0x1F // = 31 +REG = 0x98C, 0xA40B //search_f2_60 +REG = 0x990, 0x22 // = 34 +REG = 0x98C, 0x2411 //R9_Step_60_A +REG = 0x990, 0x0089 // = 137 +REG = 0x98C, 0x2413 //R9_Step_50_A +REG = 0x990, 0x00A5 // = 165 +REG = 0x98C, 0x2415 //R9_Step_60_B +REG = 0x990, 0x0089 // = 137 +REG = 0x98C, 0x2417 //R9_Step_50_B +REG = 0x990, 0x00A5 // = 165 +REG = 0x98C, 0xA40D //Stat_min +REG = 0x990, 0x02 // = 2 +REG = 0x98C, 0xA410 //Min_amplitude +REG = 0x990, 0x01 // = 1 + +//////////////////////////////////////////////////////////////////////////////// +[Image Setting ExtClk=16.76MHz Op_Pix=8.38MHz] +BITFIELD= 0x14, 1, 1 // Bypass PLL +BITFIELD= 0X14, 2, 0 // Power-down PLL + +REG = 0x0010, 0x0518 // PLL DIVIDERS (N=5, M=24) +REG = 0x0012, 0x0000 // PLL P3 DIVIDERS +REG = 0x0014, 0x2147 // Enable PLL and start initialization [1] +DELAY = 10 // Wait for 10us to get PLL lock +REG = 0x0014, 0x2047 // Reset the PLL internal counter [8] +DELAY = 10 // Wait for 10us +REG = 0x0014, 0x2046 // Turn off PLL initialization process [0] +DELAY = 10 // Wait for 10us +REG = 0x0016, 0x42DF // Invert Pixclk output to interface with DEMO2 board [14] + +BITFIELD= 0x14, 1, 0 //PLL_BYPASS_OFF +REG = 0x98C, 0x2703 //Output Width (A) +REG = 0x990, 0x0280 // = 640 +REG = 0x98C, 0x2705 //Output Height (A) +REG = 0x990, 0x01E0 // = 480 +REG = 0x98C, 0x2707 //Output Width (B) +REG = 0x990, 0x0280 // = 640 +REG = 0x98C, 0x2709 //Output Height (B) +REG = 0x990, 0x01E0 // = 480 +REG = 0x98C, 0x270D //Row Start (A) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x270F //Column Start (A) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2711 //Row End (A) +REG = 0x990, 0x1EB // = 491 +REG = 0x98C, 0x2713 //Column End (A) +REG = 0x990, 0x28B // = 651 +REG = 0x98C, 0x2715 //Row Speed (A) +REG = 0x990, 0x0001 // = 1 +REG = 0x98C, 0x2717 //Read Mode (A) +REG = 0x990, 0x0026 // = 38 +REG = 0x98C, 0x2719 //sensor_fine_correction (A) +REG = 0x990, 0x001A // = 26 +REG = 0x98C, 0x271B //sensor_fine_IT_min (A) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x271D //sensor_fine_IT_max_margin (A) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x271F //Frame Lines (A) +REG = 0x990, 0x02D2 // = 722 +REG = 0x98C, 0x2721 //Line Length (A) +REG = 0x990, 0x034A // = 842 +REG = 0x98C, 0x2723 //Row Start (B) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2725 //Column Start (B) +REG = 0x990, 0x004 // = 4 +REG = 0x98C, 0x2727 //Row End (B) +REG = 0x990, 0x1EB // = 491 +REG = 0x98C, 0x2729 //Column End (B) +REG = 0x990, 0x28B // = 651 +REG = 0x98C, 0x272B //Row Speed (B) +REG = 0x990, 0x0001 // = 1 +REG = 0x98C, 0x272D //Read Mode (B) +REG = 0x990, 0x0026 // = 38 +REG = 0x98C, 0x272F //sensor_fine_correction (B) +REG = 0x990, 0x001A // = 26 +REG = 0x98C, 0x2731 //sensor_fine_IT_min (B) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x2733 //sensor_fine_IT_max_margin (B) +REG = 0x990, 0x006B // = 107 +REG = 0x98C, 0x2735 //Frame Lines (B) +REG = 0x990, 0x02D2 // = 722 +REG = 0x98C, 0x2737 //Line Length (B) +REG = 0x990, 0x034A // = 842 +REG = 0x98C, 0x2739 //Crop_X0 (A) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x273B //Crop_X1 (A) +REG = 0x990, 0x027F // = 639 +REG = 0x98C, 0x273D //Crop_Y0 (A) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x273F //Crop_Y1 (A) +REG = 0x990, 0x01DF // = 479 +REG = 0x98C, 0x2747 //Crop_X0 (B) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x2749 //Crop_X1 (B) +REG = 0x990, 0x027F // = 639 +REG = 0x98C, 0x274B //Crop_Y0 (B) +REG = 0x990, 0x0000 // = 0 +REG = 0x98C, 0x274D //Crop_Y1 (B) +REG = 0x990, 0x01DF // = 479 +REG = 0x98C, 0x222D //R9 Step +REG = 0x990, 0x0058 // = 88 +REG = 0x98C, 0xA408 //search_f1_50 +REG = 0x990, 0x0F // = 15 +REG = 0x98C, 0xA409 //search_f2_50 +REG = 0x990, 0x12 // = 18 +REG = 0x98C, 0xA40A //search_f1_60 +REG = 0x990, 0x13 // = 19 +REG = 0x98C, 0xA40B //search_f2_60 +REG = 0x990, 0x16 // = 22 +REG = 0x98C, 0x2411 //R9_Step_60_A +REG = 0x990, 0x0058 // = 88 +REG = 0x98C, 0x2413 //R9_Step_50_A +REG = 0x990, 0x006A // = 106 +REG = 0x98C, 0x2415 //R9_Step_60_B +REG = 0x990, 0x0058 // = 88 +REG = 0x98C, 0x2417 //R9_Step_50_B +REG = 0x990, 0x006A // = 106 +REG = 0x98C, 0xA40D //Stat_min +REG = 0x990, 0x02 // = 2 +REG = 0x98C, 0xA410 //Min_amplitude +REG = 0x990, 0x01 // = 1 + + +[Viewfinder ON] +FIELD_WR = SEQ_CAP_MODE, VIDEO, 0 //capture parameters, VIDEO Off +REG = 0x98C, 0xA103 //Go to Preview Mode +REG = 0x990, 0x01 // = 1 + +[Viewfinder OFF] +FIELD_WR = SEQ_CAP_MODE, VIDEO, 1 //capture parameters, VIDEO On +REG = 0x98C, 0xA103 //Go to Capture Mode +REG = 0x990, 0x02 // = 2 + +[Video Capture ON] +FIELD_WR = SEQ_CAP_MODE, VIDEO, 1 //capture parameters, VIDEO On +REG = 0x98C, 0xA103 //Go to Capture Mode +REG = 0x990, 0x02 // = 2 + +[Video Capture OFF] +REG = 0x98C, 0xA103 //Go to Preview Mode +REG = 0x990, 0x01 // = 1 + +[Lens Calibration Setup] +REG=0x3330, 0x0140 //(2) OUTPUT_FORMAT_TEST +BITFIELD=0x3040, 0x002, 0 + +[Lens Calibration Exit] +BITFIELD=0x3040, 0x002, 1 +REG=0x3330, 0x0000 //(4) OUTPUT_FORMAT_TEST +BITFIELD=0x3210, 0x08, 1 + +[Color Correction Setup] +// All the delay is in ms and the time has not been verified. User can either reduce and omit +// the delay depends on the system implementation. +REG = 0x098C, 0xA115 // Set capture parameter mode +REG = 0x0990, 0x02 +REG = 0x098C, 0x272D // Vertical flip enabled +REG = 0x0990, 0x0026 +REG = 0x098C, 0xA103 // Refresh +REG = 0x0990, 0x06 +DELAY = 10 +REG = 0x098C, 0xA103 // Capture mode +REG = 0x0990, 0x02 +REG = 0x098C, 0xA103 // Refresh +REG = 0x0990, 0x05 +DELAY = 10 +REG = 0x098C, 0xAB04 // Turn off histogram stretch +REG = 0x0990, 0x00 +REG = 0x098C, 0xA355 // AWB mode: lock the gain to unity +REG = 0x0990, 0x21 +DELAY = 10 +REG = 0x098C, 0xA102 // Turn off AWB +REG = 0x0990, 0x00 +DELAY = 10 +BITFIELD = 0x3210, 0x00A0, 0 // Turn off gamma correction and color correction +REG = 0x3028, 0x0008 // ANALOG_GAIN_CODE_GLOBAL + +[Fixed 15fps] +REG = 0x098C, 0xA20C //(1) AE_MAX_INDEX +REG = 0x0990, 0x08 +REG = 0x098C, 0x271F //(1) MODE_SENSOR_FRAME_LENGTH_A +REG = 0x0990, 0x076C + +[Refresh] +REG = 0x98C, 0xA103 //Refresh Sequencer Mode +REG = 0x990, 0x06 // = 6 +POLL_FIELD=SEQ_CMD, !=0, DELAY=10, TIMEOUT=50 +REG = 0x98C, 0xA103 //Refresh Sequencer +REG = 0x990, 0x05 // = 5 +POLL_FIELD=SEQ_CMD, !=0, DELAY=10, TIMEOUT=50 + +[Auto Exposure] +REG = 0x098C, 0xA207 //(2) AE_GATE +REG = 0x0990, 0x1A +REG = 0x098C, 0xA24C //(1) AE_TARGETBUFFERSPEED +REG = 0x0990, 0x10 +REG = 0x098C, 0xA24F //(5) AE_BASETARGET +REG = 0x0990, 0x50 + +[Gamma Correction] +REG = 0x098C, 0xAB04 //(1) HG_MAX_DLEVEL +REG = 0x0990, 0x80 + +REG = 0x098C, 0xAB37 //(1) HG_GAMMA_MORPH_CTRL +REG = 0x0990, 0x03 +REG = 0x098C, 0x2B38 //(1) HG_GAMMASTARTMORPH +REG = 0x0990, 0x0080 +REG = 0x098C, 0x2B3A //(1) HG_GAMMASTOPMORPH +REG = 0x0990, 0x00B0 +REG = 0x098C, 0xAB3C //(2) HG_GAMMA_TABLE_A_0 +REG = 0x0990, 0x00 +REG = 0x098C, 0xAB3D //(2) HG_GAMMA_TABLE_A_1 +REG = 0x0990, 0x02 +REG = 0x098C, 0xAB3E //(2) HG_GAMMA_TABLE_A_2 +REG = 0x0990, 0x08 +REG = 0x098C, 0xAB3F //(2) HG_GAMMA_TABLE_A_3 +REG = 0x0990, 0x18 +REG = 0x098C, 0xAB40 //(2) HG_GAMMA_TABLE_A_4 +REG = 0x0990, 0x38 +REG = 0x098C, 0xAB41 //(2) HG_GAMMA_TABLE_A_5 +REG = 0x0990, 0x55 +REG = 0x098C, 0xAB42 //(2) HG_GAMMA_TABLE_A_6 +REG = 0x0990, 0x72 +REG = 0x098C, 0xAB43 //(2) HG_GAMMA_TABLE_A_7 +REG = 0x0990, 0x8E +REG = 0x098C, 0xAB44 //(2) HG_GAMMA_TABLE_A_8 +REG = 0x0990, 0xA5 +REG = 0x098C, 0xAB45 //(2) HG_GAMMA_TABLE_A_9 +REG = 0x0990, 0xB6 +REG = 0x098C, 0xAB46 //(2) HG_GAMMA_TABLE_A_10 +REG = 0x0990, 0xC5 +REG = 0x098C, 0xAB47 //(2) HG_GAMMA_TABLE_A_11 +REG = 0x0990, 0xD0 +REG = 0x098C, 0xAB48 //(2) HG_GAMMA_TABLE_A_12 +REG = 0x0990, 0xDA +REG = 0x098C, 0xAB49 //(2) HG_GAMMA_TABLE_A_13 +REG = 0x0990, 0xE2 +REG = 0x098C, 0xAB4A //(2) HG_GAMMA_TABLE_A_14 +REG = 0x0990, 0xE9 +REG = 0x098C, 0xAB4B //(2) HG_GAMMA_TABLE_A_15 +REG = 0x0990, 0xF0 +REG = 0x098C, 0xAB4C //(2) HG_GAMMA_TABLE_A_16 +REG = 0x0990, 0xF5 +REG = 0x098C, 0xAB4D //(2) HG_GAMMA_TABLE_A_17 +REG = 0x0990, 0xFA +REG = 0x098C, 0xAB4E //(2) HG_GAMMA_TABLE_A_18 +REG = 0x0990, 0xFF +REG = 0x098C, 0xAB4F //(2) HG_GAMMA_TABLE_B_0 +REG = 0x0990, 0x00 +REG = 0x098C, 0xAB50 //(2) HG_GAMMA_TABLE_B_1 +REG = 0x0990, 0x01 +REG = 0x098C, 0xAB51 //(2) HG_GAMMA_TABLE_B_2 +REG = 0x0990, 0x02 +REG = 0x098C, 0xAB52 //(2) HG_GAMMA_TABLE_B_3 +REG = 0x0990, 0x05 +REG = 0x098C, 0xAB53 //(2) HG_GAMMA_TABLE_B_4 +REG = 0x0990, 0x11 +REG = 0x098C, 0xAB54 //(2) HG_GAMMA_TABLE_B_5 +REG = 0x0990, 0x1E +REG = 0x098C, 0xAB55 //(2) HG_GAMMA_TABLE_B_6 +REG = 0x0990, 0x2D +REG = 0x098C, 0xAB56 //(2) HG_GAMMA_TABLE_B_7 +REG = 0x0990, 0x3F +REG = 0x098C, 0xAB57 //(2) HG_GAMMA_TABLE_B_8 +REG = 0x0990, 0x53 +REG = 0x098C, 0xAB58 //(2) HG_GAMMA_TABLE_B_9 +REG = 0x0990, 0x6B +REG = 0x098C, 0xAB59 //(2) HG_GAMMA_TABLE_B_10 +REG = 0x0990, 0x87 +REG = 0x098C, 0xAB5A //(2) HG_GAMMA_TABLE_B_11 +REG = 0x0990, 0xA0 +REG = 0x098C, 0xAB5B //(2) HG_GAMMA_TABLE_B_12 +REG = 0x0990, 0xB5 +REG = 0x098C, 0xAB5C //(2) HG_GAMMA_TABLE_B_13 +REG = 0x0990, 0xC7 +REG = 0x098C, 0xAB5D //(2) HG_GAMMA_TABLE_B_14 +REG = 0x0990, 0xD6 +REG = 0x098C, 0xAB5E //(2) HG_GAMMA_TABLE_B_15 +REG = 0x0990, 0xE2 +REG = 0x098C, 0xAB5F //(2) HG_GAMMA_TABLE_B_16 +REG = 0x0990, 0xED +REG = 0x098C, 0xAB60 //(2) HG_GAMMA_TABLE_B_17 +REG = 0x0990, 0xF6 +REG = 0x098C, 0xAB61 //(2) HG_GAMMA_TABLE_B_18 +REG = 0x0990, 0xFF + +[Auto White Balance] +REG = 0x098C, 0x2306 //AWB_CCM_L_0 +REG = 0x0990, 0x019B +REG = 0x098C, 0x2308 //AWB_CCM_L_1 +REG = 0x0990, 0xFF4D +REG = 0x098C, 0x230A //AWB_CCM_L_2 +REG = 0x0990, 0x001C +REG = 0x098C, 0x230C //AWB_CCM_L_3 +REG = 0x0990, 0xFF00 +REG = 0x098C, 0x230E //AWB_CCM_L_4 +REG = 0x0990, 0x02FE +REG = 0x098C, 0x2310 //AWB_CCM_L_5 +REG = 0x0990, 0xFF14 +REG = 0x098C, 0x2312 //AWB_CCM_L_6 +REG = 0x0990, 0xFF24 +REG = 0x098C, 0x2314 //AWB_CCM_L_7 +REG = 0x0990, 0xFD7F +REG = 0x098C, 0x2316 //AWB_CCM_L_8 +REG = 0x0990, 0x03E9 +REG = 0x098C, 0x2318 //AWB_CCM_L_9 +REG = 0x0990, 0x002A +REG = 0x098C, 0x231A //AWB_CCM_L_10 +REG = 0x0990, 0x003A +REG = 0x098C, 0x231C //AWB_CCM_RL_0 +REG = 0x0990, 0x0020 +REG = 0x098C, 0x231E //AWB_CCM_RL_1 +REG = 0x0990, 0x0065 +REG = 0x098C, 0x2320 //AWB_CCM_RL_2 +REG = 0x0990, 0xFFB1 +REG = 0x098C, 0x2322 //AWB_CCM_RL_3 +REG = 0x0990, 0x0063 +REG = 0x098C, 0x2324 //AWB_CCM_RL_4 +REG = 0x0990, 0xFE8C +REG = 0x098C, 0x2326 //AWB_CCM_RL_5 +REG = 0x0990, 0x006A +REG = 0x098C, 0x2328 //AWB_CCM_RL_6 +REG = 0x0990, 0x0077 +REG = 0x098C, 0x232A //AWB_CCM_RL_7 +REG = 0x0990, 0x0161 +REG = 0x098C, 0x232C //AWB_CCM_RL_8 +REG = 0x0990, 0xFE76 +REG = 0x098C, 0x232E //AWB_CCM_RL_9 +REG = 0x0990, 0x0009 +REG = 0x098C, 0x2330 //AWB_CCM_RL_10 +REG = 0x0990, 0xFFEC + +//VAR8=3, 0x4A, 0x70 //(1) AWB_GAIN_MIN +//VAR8=3, 0x4B, 0x90 //(1) AWB_GAIN_MAX +//VAR8=3, 0x4C, 0x70 //(1) AWB_GAINMIN_B +//VAR8=3, 0x4D, 0x90 //(1) AWB_GAINMAX_B + +REG = 0x098C, 0xA35D //(1) AWB_STEADY_BGAIN_OUT_MIN +REG = 0x0990, 0x73 +REG = 0x098C, 0xA35E //(1) AWB_STEADY_BGAIN_OUT_MAX +REG = 0x0990, 0x8D + + +[Lens Correction] +REG=0x3658, 0x7D8F //P_RD_P0Q0 +REG=0x365A, 0x314D //P_RD_P0Q1 +REG=0x365C, 0x7912 //P_RD_P0Q2 +REG=0x365E, 0xA10F //P_RD_P0Q3 +REG=0x3660, 0x6874 //P_RD_P0Q4 +REG=0x3680, 0x1F0B //P_RD_P1Q0 +REG=0x3682, 0xD48C //P_RD_P1Q1 +REG=0x3684, 0x0E72 //P_RD_P1Q2 +REG=0x3686, 0x6B51 //P_RD_P1Q3 +REG=0x3688, 0x91F1 //P_RD_P1Q4 +REG=0x36A8, 0x1293 //P_RD_P2Q0 +REG=0x36AA, 0x04F0 //P_RD_P2Q1 +REG=0x36AC, 0x40D6 //P_RD_P2Q2 +REG=0x36AE, 0x1931 //P_RD_P2Q3 +REG=0x36B0, 0xFCD7 //P_RD_P2Q4 +REG=0x36D0, 0x34D1 //P_RD_P3Q0 +REG=0x36D2, 0x5C92 //P_RD_P3Q1 +REG=0x36D4, 0xEDF5 //P_RD_P3Q2 +REG=0x36D6, 0x56B4 //P_RD_P3Q3 +REG=0x36D8, 0x47F9 //P_RD_P3Q4 +REG=0x36F8, 0x4175 //P_RD_P4Q0 +REG=0x36FA, 0xC7F4 //P_RD_P4Q1 +REG=0x36FC, 0xE738 //P_RD_P4Q2 +REG=0x36FE, 0x8C98 //P_RD_P4Q3 +REG=0x3700, 0x4D5C //P_RD_P4Q4 +REG=0x364E, 0x7D0F //P_GR_P0Q0 +REG=0x3650, 0x31CC //P_GR_P0Q1 +REG=0x3652, 0x47D2 //P_GR_P0Q2 +REG=0x3654, 0xC58F //P_GR_P0Q3 +REG=0x3656, 0x2374 //P_GR_P0Q4 +REG=0x3676, 0x232A //P_GR_P1Q0 +REG=0x3678, 0x6186 //P_GR_P1Q1 +REG=0x367A, 0x1852 //P_GR_P1Q2 +REG=0x367C, 0x1F30 //P_GR_P1Q3 +REG=0x367E, 0x9D14 //P_GR_P1Q4 +REG=0x369E, 0x6A52 //P_GR_P2Q0 +REG=0x36A0, 0x3450 //P_GR_P2Q1 +REG=0x36A2, 0x3A96 //P_GR_P2Q2 +REG=0x36A4, 0x93B4 //P_GR_P2Q3 +REG=0x36A6, 0xF5B8 //P_GR_P2Q4 +REG=0x36C6, 0x3D11 //P_GR_P3Q0 +REG=0x36C8, 0x2832 //P_GR_P3Q1 +REG=0x36CA, 0xA816 //P_GR_P3Q2 +REG=0x36CC, 0x2BD4 //P_GR_P3Q3 +REG=0x36CE, 0x7479 //P_GR_P3Q4 +REG=0x36EE, 0x2175 //P_GR_P4Q0 +REG=0x36F0, 0xC714 //P_GR_P4Q1 +REG=0x36F2, 0xC339 //P_GR_P4Q2 +REG=0x36F4, 0x47B6 //P_GR_P4Q3 +REG=0x36F6, 0x0BBD //P_GR_P4Q4 +REG=0x3662, 0x7CAF //P_BL_P0Q0 +REG=0x3664, 0x6BEC //P_BL_P0Q1 +REG=0x3666, 0x4CD2 //P_BL_P0Q2 +REG=0x3668, 0xE80F //P_BL_P0Q3 +REG=0x366A, 0x7B53 //P_BL_P0Q4 +REG=0x368A, 0x2B8B //P_BL_P1Q0 +REG=0x368C, 0x2C0B //P_BL_P1Q1 +REG=0x368E, 0x0EF2 //P_BL_P1Q2 +REG=0x3690, 0x77F0 //P_BL_P1Q3 +REG=0x3692, 0xA1D4 //P_BL_P1Q4 +REG=0x36B2, 0x53B2 //P_BL_P2Q0 +REG=0x36B4, 0x5670 //P_BL_P2Q1 +REG=0x36B6, 0x1D76 //P_BL_P2Q2 +REG=0x36B8, 0xAD10 //P_BL_P2Q3 +REG=0x36BA, 0x8179 //P_BL_P2Q4 +REG=0x36DA, 0x6611 //P_BL_P3Q0 +REG=0x36DC, 0x09D3 //P_BL_P3Q1 +REG=0x36DE, 0xB976 //P_BL_P3Q2 +REG=0x36E0, 0x7F14 //P_BL_P3Q3 +REG=0x36E2, 0x7AD9 //P_BL_P3Q4 +REG=0x3702, 0x16D5 //P_BL_P4Q0 +REG=0x3704, 0x8CD5 //P_BL_P4Q1 +REG=0x3706, 0xD2F9 //P_BL_P4Q2 +REG=0x3708, 0x9316 //P_BL_P4Q3 +REG=0x370A, 0x1BDD //P_BL_P4Q4 +REG=0x366C, 0x7BEF //P_GB_P0Q0 +REG=0x366E, 0x300C //P_GB_P0Q1 +REG=0x3670, 0x4FF2 //P_GB_P0Q2 +REG=0x3672, 0xA2AF //P_GB_P0Q3 +REG=0x3674, 0x1EF4 //P_GB_P0Q4 +REG=0x3694, 0x570B //P_GB_P1Q0 +REG=0x3696, 0xA4A7 //P_GB_P1Q1 +REG=0x3698, 0x1392 //P_GB_P1Q2 +REG=0x369A, 0x4430 //P_GB_P1Q3 +REG=0x369C, 0x82D4 //P_GB_P1Q4 +REG=0x36BC, 0x5F12 //P_GB_P2Q0 +REG=0x36BE, 0x40D0 //P_GB_P2Q1 +REG=0x36C0, 0x2ED6 //P_GB_P2Q2 +REG=0x36C2, 0x95B4 //P_GB_P2Q3 +REG=0x36C4, 0xEA18 //P_GB_P2Q4 +REG=0x36E4, 0x3191 //P_GB_P3Q0 +REG=0x36E6, 0x3632 //P_GB_P3Q1 +REG=0x36E8, 0xA476 //P_GB_P3Q2 +REG=0x36EA, 0xE411 //P_GB_P3Q3 +REG=0x36EC, 0x7339 //P_GB_P3Q4 +REG=0x370C, 0x2655 //P_GB_P4Q0 +REG=0x370E, 0xE994 //P_GB_P4Q1 +REG=0x3710, 0xA5D9 //P_GB_P4Q2 +REG=0x3712, 0x4777 //P_GB_P4Q3 +REG=0x3714, 0x7B9C //P_GB_P4Q4 +REG=0x3644, 0x0158 //POLY_ORIGIN_C +REG=0x3642, 0x00E4 //POLY_ORIGIN_R +BITFIELD=0x3210, 0x0008, 1 //PGA_ENABLE + +[Image Size : VGA] +REG = 0x098C, 0x2703 //MODE_OUTPUT_WIDTH_A +REG = 0x0990, 0x0280 +REG = 0x098C, 0x2705 //MODE_OUTPUT_HEIGHT_A +REG = 0x0990, 0x01E0 +LOAD=Refresh + +[Image Size : QVGA] +REG = 0x098C, 0x2703 //MODE_OUTPUT_WIDTH_A +REG = 0x0990, 0x0140 +REG = 0x098C, 0x2705 //MODE_OUTPUT_HEIGHT_A +REG = 0x0990, 0x00F0 +LOAD=Refresh + +[Image Size : CIF] +REG = 0x098C, 0x2703 //MODE_OUTPUT_WIDTH_A +REG = 0x0990, 0x0160 +REG = 0x098C, 0x2705 //MODE_OUTPUT_HEIGHT_A +REG = 0x0990, 0x0120 +LOAD=Refresh + +[Image Size : QCIF] +REG = 0x098C, 0x2703 //MODE_OUTPUT_WIDTH_A +REG = 0x0990, 0x00B0 +REG = 0x098C, 0x2705 //MODE_OUTPUT_HEIGHT_A +REG = 0x0990, 0x0090 +LOAD=Refresh + +[Effect : Off] +REG = 0x098C, 0x2759 //MODE_SPEC_EFFECTS_A +REG = 0x0990, 0x6440 +REG = 0x098C, 0x275B //MODE_SPEC_EFFECTS_B +REG = 0x0990, 0x6440 +LOAD=Refresh + +[Effect : Mono] +REG = 0x098C, 0x2759 //MODE_SPEC_EFFECTS_A +REG = 0x0990, 0x6441 +REG = 0x098C, 0x275B //MODE_SPEC_EFFECTS_B +REG = 0x0990, 0x6441 +LOAD=Refresh + +[Effect : Sepia] +REG=0x326C, 0x0100 //APERTURE_PARAMETERS +REG = 0x098C, 0xAB3C //HG_GAMMA_TABLE_A_0 +REG = 0x0990, 0x00 +REG = 0x098C, 0xAB3D //HG_GAMMA_TABLE_A_1 +REG = 0x0990, 0x05 +REG = 0x098C, 0xAB3E //HG_GAMMA_TABLE_A_2 +REG = 0x0990, 0x11 +REG = 0x098C, 0xAB3F //HG_GAMMA_TABLE_A_3 +REG = 0x0990, 0x33 +REG = 0x098C, 0xAB40 //HG_GAMMA_TABLE_A_4 +REG = 0x0990, 0x5D +REG = 0x098C, 0xAB41 //HG_GAMMA_TABLE_A_5 +REG = 0x0990, 0x78 +REG = 0x098C, 0xAB42 //HG_GAMMA_TABLE_A_6 +REG = 0x0990, 0x8D +REG = 0x098C, 0xAB43 //HG_GAMMA_TABLE_A_7 +REG = 0x0990, 0x9E +REG = 0x098C, 0xAB44 //HG_GAMMA_TABLE_A_8 +REG = 0x0990, 0xAD +REG = 0x098C, 0xAB45 //HG_GAMMA_TABLE_A_9 +REG = 0x0990, 0xB9 +REG = 0x098C, 0xAB46 //HG_GAMMA_TABLE_A_10 +REG = 0x0990, 0xC4 +REG = 0x098C, 0xAB47 //HG_GAMMA_TABLE_A_11 +REG = 0x0990, 0xCE +REG = 0x098C, 0xAB48 //HG_GAMMA_TABLE_A_12 +REG = 0x0990, 0xD6 +REG = 0x098C, 0xAB49 //HG_GAMMA_TABLE_A_13 +REG = 0x0990, 0xDF +REG = 0x098C, 0xAB4A //HG_GAMMA_TABLE_A_14 +REG = 0x0990, 0xE6 +REG = 0x098C, 0xAB4B //HG_GAMMA_TABLE_A_15 +REG = 0x0990, 0xED +REG = 0x098C, 0xAB4C //HG_GAMMA_TABLE_A_16 +REG = 0x0990, 0xF3 +REG = 0x098C, 0xAB4D //HG_GAMMA_TABLE_A_17 +REG = 0x0990, 0xF9 +REG = 0x098C, 0xAB4E //HG_GAMMA_TABLE_A_18 +REG = 0x0990, 0xFF + +REG = 0x098C, 0x2759 //MODE_SPEC_EFFECTS_A +REG = 0x0990, 0x6442 +REG = 0x098C, 0x275B //MODE_SPEC_EFFECTS_B +REG = 0x0990, 0x6442 +REG = 0x098C, 0x2763 //MODE_COMMONMODESETTINGS_FX_SEPIA_SETTINGS +REG = 0x0990, 0xB01C +LOAD=Refresh + +[Manual WB -> Auto WB] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0F + +[Manual White Balance : P1] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0B +REG = 0x098C, 0xA353 //AWB_CCM_POSITION +REG = 0x0990, 0x00 + +[Manual White Balance : P2] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0B +REG = 0x098C, 0xA353 //AWB_CCM_POSITION +REG = 0x0990, 0x0B + +[Manual White Balance : P3] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0B +REG = 0x098C, 0xA353 //AWB_CCM_POSITION +REG = 0x0990, 0x16 + +[Manual White Balance : P4] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0B +REG = 0x098C, 0xA353 //AWB_CCM_POSITION +REG = 0x0990, 0x21 + +[Manual White Balance : P5] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0B +REG = 0x098C, 0xA353 //AWB_CCM_POSITION +REG = 0x0990, 0x2C + +[Manual White Balance : P6] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0B +REG = 0x098C, 0xA353 //AWB_CCM_POSITION +REG = 0x0990, 0x37 + +[Manual White Balance : P7] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0B +REG = 0x098C, 0xA353 //AWB_CCM_POSITION +REG = 0x0990, 0x42 + +[Manual White Balance : P8] +REG = 0x098C, 0xA102 //SEQ_MODE +REG = 0x0990, 0x0B +REG = 0x098C, 0xA353 //AWB_CCM_POSITION +REG = 0x0990, 0x4D + +[Sharpness : 0] +REG=0x326C, 0x1600 //APERTURE_PARAMETERS diff --git a/build/libraries/camera/ARM7/MT9V113-REV1.sdat b/build/libraries/camera/ARM7/MT9V113-REV1.sdat new file mode 100644 index 0000000..ad7194c --- /dev/null +++ b/build/libraries/camera/ARM7/MT9V113-REV1.sdat @@ -0,0 +1,1287 @@ +//************************************************************************************** +// Copyright 2006 Micron Technology, Inc. All rights reserved. +// +// +// No permission to use, copy, modify, or distribute this software and/or +// its documentation for any purpose has been granted by Micron Technology, Inc. +// If any such permission has been granted ( by separate agreement ), it +// is required that the above copyright notice appear in all copies and +// that both that copyright notice and this permission notice appear in +// supporting documentation, and that the name of Micron Technology, Inc. or any +// of its trademarks may not be used in advertising or publicity pertaining +// to distribution of the software without specific, written prior permission. +// +// +// This software and any associated documentation are provided AS IS and +// without warranty of any kind. MICRON TECHNOLOGY, INC. EXPRESSLY DISCLAIMS +// ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, NONINFRINGEMENT +// OF THIRD PARTY RIGHTS, AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS +// FOR A PARTICULAR PURPOSE. MICRON DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED +// IN THIS SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF THIS SOFTWARE +// WILL BE UNINTERRUPTED OR ERROR-FREE. FURTHERMORE, MICRON DOES NOT WARRANT OR +// MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF ANY +// ACCOMPANYING DOCUMENTATION IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY, +// OR OTHERWISE. +//*************************************************************************************/ +// +//$Revision: 1.4 $ +//$Date: 2007/02/28 08:03:26 $ +// +// The sensor data file should adhere to the following form. Note that +// all of the fields in the chip descriptor section are required. +// The register section contains certain known registers and additional +// registers which are not predefined. The current known registers are: +// CHIP_VERSION_REG +// RESET_REG +// GREEN1_GAIN_REG +// BLUE_GAIN_REG +// RED_GAIN_REG +// GREEN2_GAIN_REG +// HORZ_BLANK_REG +// INTEG_TIME_REG +// VREF_REG +// +// [CHIP_DESCRIPTOR] +// SENSORNAME = "string" +// WIDTH = integer +// HEIGHT = integer +// IMAGE_TYPE = BAYER +// BITS_PER_CLOCK = integer +// CLOCKS_PER_PIXEL = integer +// PIXEL_CLOCK_POLARITY = 0/1 +// SHIP_BASE_ADDRESS = hex +// [END] +// +// [OPTIONAL] +// PART_NUMBER = "string" +// EXTRA_DESC_REG = register +// SENSOR_VERSION = integer +// [END] +// +// [REGISTERS] +// REGDEF = {hex, CORE/IP, int, hex, RW/RO, hex, "string", "string"} +// {BITDEF, hex, RW/RO, "string", "string"} +// {BITDEF, hex, RW/RO, "string", "string"} +// ... +// {BITDEF, hex, RW/RO, "string", "string"} +// [END] +// + +[CHIP_DESCRIPTOR] +SENSORNAME = "MI-0380SOC" +WIDTH = 320 +HEIGHT = 240 +IMAGE_TYPE = YCBCR +BITS_PER_CLOCK = 8 +CLOCKS_PER_PIXEL = 2 +PIXEL_CLOCK_POLARITY = 1 +SHIP_BASE_ADDRESS =( 0x7A 0x78 ) +[END] + +[ADDR_SPACE] +CORE = {REG, 0, "0: Core Registers"} +SOC1 = {REG, 1, "1: SOC1 Registers"} +SOC2 = {REG, 2, "2: SOC2 Registers"} +SYSCTL = {REG, 3, "SYSCTL Registers"} +RX_SS = {REG, 4, "RX_SS Registers"} +XDMA = {REG, 5, "XDMA Registers"} +MON = {MCU, 0, "0: Monitor Variables"} +SEQ = {MCU, 1, "1: Sequencer Variables"} +AE = {MCU, 2, "2: Auto Exposure Variables"} +AWB = {MCU, 3, "3: Auto White Balance Variables"} +FD = {MCU, 4, "4: Anti-Flicker Variables"} +MODE = {MCU, 7, "7: Mode Variables"} +HG = {MCU, 11, "11: Histogram Variables"} +SFR = {SFR, 0, "GPIO Registers"} +[END] + +[OPTIONAL] +PART_NUMBER = "MT9V113" +SENSOR_VERSION = 1 +FULL_WIDTH = 640 +FULL_HEIGHT = 480 +SDAT_VERSION = 2 +REG_ADDR_SIZE = 16 +REG_DATA_SIZE = 16 +VERSION_NAME = "REV1" +[END] + +//REGDEF = {ADDR, TYPE, SPAN, MASK, RW, DEFAULT, DESC, DETAIL} +// {BITDEF, MASK, RW, DESC, DETAIL} +// {BITDEF, MASK, RW, DESC, DETAIL} +// ... +// {BITDEF, MASK, RW, DESC, DETAIL} + +[REGISTERS] +CHIP_VERSION_REG = {0x0000, SYSCTL, 1, 0xFFFF, RO, 0x2280, "k22a_chip_id", ""} +RESERVED_SYSCTL_06 = {0x0006, SYSCTL, 1, 0xC000, RW, 0x0000, "Reserved", ""} +PLL_DIVIDERS = {0x0010, SYSCTL, 1, 0x3FFF, RW, 0x0231, "pll_dividers", ""} + {M, 0x00FF, RW, "0-7: m", ""} + {N, 0x3F00, RW, "8-13: n", ""} +PLL_P_DIVIDERS = {0x0012, SYSCTL, 1, 0x3FFF, RW, 0x0000, "pll_p_dividers", ""} + {BITS_0_3, 0x000F, RW, "0-3: Reserved", ""} + {BITS_4_7, 0x00F0, RW, "4-7: Reserved", ""} + {P3, 0x0F00, RW, "8-11: p3", ""} + {WORD_CLOCK_DIVIDER, 0x3000, RW, "12-13: word_clock_divider", ""} +PLL_CONTROL = {0x0014, SYSCTL, 1, 0x7FFF, RW, 0x2145, "pll_control", ""} + {PLL_BYPASS, 0x0001, RW, "0: pll_bypass", ""} + {PLL_ENABLE, 0x0002, RW, "1: pll_pd", ""} + {BITS_2_3, 0x000C, RW, "2-3: Reserved", ""} + {BIT_4, 0x0010, RW, "4: Reserved", ""} + {RESET_CNTR, 0x0100, RW, "8: reset_cntr", ""} + {BIT_9, 0x0200, RW, "9: Reserved", ""} + {TEST_BYPASS, 0x0400, RW, "10: test_bypass", ""} + {BIT_11, 0x0800, RW, "11: Reserved", ""} + {BIT_12, 0x1000, RW, "12: Reserved", ""} + {CLOCKIN_HYST_EN, 0x2000, RW, "13: clockin_hyst_en", ""} + {BIT_14, 0x4000, RW, "14: Reserved", ""} + {PLL_LOCK_STATUS, 0x8000, RO, "15: pll_lock_status", ""} +CLOCKS_CONTROL = {0x0016, SYSCTL, 1, 0x7FFF, RW, 0x0000, "clocks_control", ""} + {BIT_0, 0x0001, RW, "0: Reserved", ""} + {BIT_1, 0x0002, RW, "1: Reserved", ""} + {BIT_2, 0x0004, RW, "2: Reserved", ""} + {BIT_3, 0x0008, RW, "3: Reserved", ""} + {BIT_4, 0x0010, RW, "4: Reserved", ""} + {BIT_5, 0x0020, RW, "5: Reserved", ""} + {BIT_6, 0x0040, RW, "6: Reserved", ""} + {BIT_7, 0x0080, RW, "7: Reserved", ""} + {BIT_8, 0x0100, RW, "8: Reserved", ""} + {CLK_CLKIN_EN, 0x0200, RW, "9: clk_clkin_en", ""} + {BIT_10, 0x0400, RW, "10: Reserved", ""} + {BITS_11_12, 0x1800, RW, "11-12: Reserved", ""} + {BIT_13, 0x2000, RW, "13: Reserved", ""} + {INVERT_OUTPUT_CLOCK, 0x4000, RW, "14: invert_output_clock", ""} +STANDBY_CONTROL = {0x0018, SYSCTL, 1, 0xC03F, RW, 0x4029, "standby_control_and_status", ""} + {SHIP, 0x0001, RW, "0: standby_i2c", ""} + {BIT_1, 0x0002, RW, "1: Reserved", ""} + {BIT_2, 0x0004, RW, "2: Reserved", ""} + {EN_XIRQ, 0x0008, RW, "3: en_xirq", ""} + {BIT_4, 0x0010, RW, "4: Reserved", ""} + {BIT_5, 0x0020, RW, "5: Reserved", ""} + {STANDBY_DONE, 0x4000, RW, "14: standby_done", ""} + {BIT_15, 0x8000, RO, "15: Reserved", ""} +RESET_AND_MISC_CONTROL = {0x001A, SYSCTL, 1, 0x033B, RW, 0x0010, "reset_and_misc_control", ""} + {RESET_SOC_I2C, 0x0001, RW, "0: reset_soc_i2c", ""} + {MIPI_TX_RESET, 0x0002, RW, "1: mipi_tx_reset", ""} + {BIT_3, 0x0008, RW, "3: Reserved", ""} + {IP_PD_EN, 0x0010, RW, "4: ip_pd_en", ""} + {STOP_CLKIN_IP, 0x0020, RW, "5: stop_clkin_ip", ""} + {OE_N_ENABLE, 0x0100, RW, "8: oe_n_enable", ""} + {PARALLEL_ENABLE, 0x0200, RW, "9: parallel_enable", ""} +MCU_BOOT_MODE = {0x001C, SYSCTL, 1, 0xFFFF, RW, 0x0000, "mcu_boot_mode", ""} + {RESET_MCU, 0x0001, RW, "0: mcu_soft_rst_i2c", ""} + {BIT_1, 0x0002, RW, "1: Reserved", ""} + {BIT_2, 0x0004, RW, "2: Reserved", ""} + {BIT_3, 0x0008, RW, "3: Reserved", ""} + {BITS_4_7, 0x00F0, RW, "4-7: Reserved", ""} + {BITS_8_15, 0xFF00, RO, "8-15: Reserved", ""} +PAD_SLEW = {0x001E, SYSCTL, 1, 0x0777, RW, 0x0400, "pad_slew", ""} + {SLEW_IO, 0x0007, RW, "0-2: slew_io", ""} + {SLEW_GPIO, 0x0070, RW, "4-6: slew_gpio", ""} + {SLEW_PXLCLK, 0x0700, RW, "8-10: slew_pxlclk", ""} + {GPIO_OPSRC_CTRL, 0x1800, RW, "11-12: gpio_opsrc_ctrl", ""} +RESERVED_SYSCTL_20 = {0x0020, SYSCTL, 1, 0x0001, RW, 0x0000, "Reserved", ""} +VDD_DIS_COUNTER = {0x0022, SYSCTL, 1, 0xFFFF, RW, 0x0438, "vdd_dis_counter", ""} +GPI_STATUS = {0x0024, SYSCTL, 1, 0x003B, RO, 0x0003, "gpi_status", ""} + {GPI_STATUS, 0x0003, RW, "0-1: gpi_status", ""} + {MODULE_ID, 0x0038, RW, "3-5: module_id", ""} +RESERVED_SYSCTL_26 = {0x0026, SYSCTL, 1, 0x0001, RW, 0x0001, "Reserved", ""} +RESERVED_SYSCTL_28 = {0x0028, SYSCTL, 1, 0x0001, RW, 0x0001, "Reserved", ""} +RESERVED_SYSCTL_50 = {0x0050, SYSCTL, 1, 0x00FF, RO, 0x0009, "Reserved", ""} +RESERVED_RX_SS_100 = {0x0100, RX_SS, 1, 0x07E7, RW, 0x0000, "Reserved", ""} +RESERVED_RX_SS_102 = {0x0102, RX_SS, 1, 0x03FF, RW, 0x0000, "Reserved", ""} +RESERVED_RX_SS_104 = {0x0104, RX_SS, 1, 0x03FF, RW, 0x0000, "Reserved", ""} +RESERVED_RX_SS_106 = {0x0106, RX_SS, 1, 0x03FF, RW, 0x0000, "Reserved", ""} +RESERVED_RX_SS_108 = {0x0108, RX_SS, 1, 0x03FF, RW, 0x0000, "Reserved", ""} +RESERVED_RX_SS_10A = {0x010A, RX_SS, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_RX_SS_10C = {0x010C, RX_SS, 1, 0x0FFF, RW, 0x0000, "Reserved", ""} +RESERVED_RX_SS_10E = {0x010E, RX_SS, 1, 0x07FF, RW, 0x01E7, "Reserved", ""} +RESERVED_RX_SS_110 = {0x0110, RX_SS, 1, 0x0FFF, RW, 0x0287, "Reserved", ""} +RESERVED_RX_SS_114 = {0x0114, RX_SS, 1, 0x1FFF, RW, 0x0064, "Reserved", ""} +RESERVED_RX_SS_116 = {0x0116, RX_SS, 1, 0x1FFF, RW, 0x000A, "Reserved", ""} +RESERVED_XDMA_982 = {0x0982, XDMA, 1, 0x0003, RW, 0x0000, "Reserved", ""} +RESERVED_XDMA_984 = {0x0984, XDMA, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +MCU_ADDRESS = {0x098C, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_address", ""} + {DRIVER_VARIABLE, 0x00FF, RW, "0-7: logical_offset", ""} + {DRIVER_ID, 0x1F00, RW, "8-12: logical_id", ""} + {SELECT_LOGICAL_ACCESS, 0x6000, RW, "13-14: logical_select", ""} + {ACCESS_8_BIT, 0x8000, RW, "15: access_8bit_mode", ""} +MCU_DATA_0 = {0x0990, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_data0", ""} +MCU_DATA_1 = {0x0992, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_data1", ""} +MCU_DATA_2 = {0x0994, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_data2", ""} +MCU_DATA_3 = {0x0996, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_data3", ""} +MCU_DATA_4 = {0x0998, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_data4", ""} +MCU_DATA_5 = {0x099A, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_data5", ""} +MCU_DATA_6 = {0x099C, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_data6", ""} +MCU_DATA_7 = {0x099E, XDMA, 1, 0xFFFF, RW, 0x0000, "mcu_variable_data7", ""} +RESERVED_CORE_3000 = {0x3000, CORE, 1, 0xFFFF, RW, 0x2280, "Reserved", ""} +RESERVED_CORE_3002 = {0x3002, CORE, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3004 = {0x3004, CORE, 1, 0x0FFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3006 = {0x3006, CORE, 1, 0x07FF, RW, 0x01E7, "Reserved", ""} +RESERVED_CORE_3008 = {0x3008, CORE, 1, 0x0FFF, RW, 0x0287, "Reserved", ""} +RESERVED_CORE_300A = {0x300A, CORE, 1, 0xFFFF, RW, 0x020C, "Reserved", ""} +RESERVED_CORE_300C = {0x300C, CORE, 1, 0xFFFF, RW, 0x038D, "Reserved", ""} +RESERVED_CORE_3010 = {0x3010, CORE, 1, 0xFFFF, RW, 0x001A, "Reserved", ""} +COARSE_INTEGRATION_TIME = {0x3012, CORE, 1, 0xFFFF, RW, 0x0010, "coarse_integration_time_", ""} +FINE_INTEGRATION_TIME = {0x3014, CORE, 1, 0xFFFF, RW, 0x006B, "fine_integration_time_", ""} +RESERVED_CORE_3016 = {0x3016, CORE, 1, 0x0007, RW, 0x0001, "Reserved", ""} +RESERVED_CORE_3018 = {0x3018, CORE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_301A = {0x301A, CORE, 1, 0xD7FF, RW, 0x1218, "Reserved", ""} +RESERVED_CORE_301C = {0x301C, CORE, 1, 0x0103, RW, 0x0000, "Reserved", ""} +DATA_PEDESTAL = {0x301E, CORE, 1, 0x03FF, RO, 0x002A, "data_pedestal_", "Read-only. Can be made read/write by clearing R0x301A-B[3]."} +RESERVED_CORE_3020 = {0x3020, CORE, 1, 0x0100, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3022 = {0x3022, CORE, 1, 0x0101, RW, 0x0001, "Reserved", ""} +RESERVED_CORE_3024 = {0x3024, CORE, 1, 0x0003, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_3026 = {0x3026, CORE, 1, 0xFFFF, RW, 0xFFF0, "Reserved", ""} +ANALOGUE_GAIN_CODE_GLOBAL = {0x3028, CORE, 1, 0x007F, RW, 0x0008, "analogue_gain_code_global_", ""} +ANALOGUE_GAIN_CODE_GREENR = {0x302A, CORE, 1, 0x007F, RW, 0x0008, "analogue_gain_code_greenR_", ""} +ANALOGUE_GAIN_CODE_RED = {0x302C, CORE, 1, 0x007F, RW, 0x0008, "analogue_gain_code_red_", ""} +ANALOGUE_GAIN_CODE_BLUE = {0x302E, CORE, 1, 0x007F, RW, 0x0008, "analogue_gain_code_blue_", ""} +ANALOGUE_GAIN_CODE_GREENB = {0x3030, CORE, 1, 0x007F, RW, 0x0008, "analogue_gain_code_greenB_", ""} +DIGITAL_GAIN_GREENR = {0x3032, CORE, 1, 0x0700, RW, 0x0100, "digital gain greenR", ""} +DIGITAL_GAIN_RED = {0x3034, CORE, 1, 0x0700, RW, 0x0100, "digital gain red", ""} +DIGITAL_GAIN_BLUE = {0x3036, CORE, 1, 0x0700, RW, 0x0100, "digital gain blue", ""} +DIGITAL_GAIN_GREENB = {0x3038, CORE, 1, 0x07FF, RW, 0x0100, "digital gain greenB", ""} +RESERVED_CORE_303A = {0x303A, CORE, 1, 0xFFFF, RO, 0x0AFF, "Reserved", ""} +RESERVED_CORE_303C = {0x303C, CORE, 1, 0x0003, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_3040 = {0x3040, CORE, 1, 0xDEFF, RW, 0x0024, "Reserved", ""} +RESERVED_CORE_3044 = {0x3044, CORE, 1, 0xFF4F, RW, 0x0500, "Reserved", ""} +RESERVED_CORE_3046 = {0x3046, CORE, 1, 0xFF80, RW, 0x0600, "Reserved", ""} +RESERVED_CORE_3048 = {0x3048, CORE, 1, 0x03FF, RW, 0x0008, "Reserved", ""} +RESERVED_CORE_3056 = {0x3056, CORE, 1, 0x0FFF, RW, 0x0220, "Reserved", ""} +RESERVED_CORE_3058 = {0x3058, CORE, 1, 0x0FFF, RW, 0x0220, "Reserved", ""} +RESERVED_CORE_305A = {0x305A, CORE, 1, 0x0FFF, RW, 0x0220, "Reserved", ""} +RESERVED_CORE_305C = {0x305C, CORE, 1, 0x0FFF, RW, 0x0220, "Reserved", ""} +RESERVED_CORE_305E = {0x305E, CORE, 1, 0x0FFF, RW, 0x0220, "Reserved", ""} +RESERVED_CORE_3070 = {0x3070, CORE, 1, 0x0107, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3072 = {0x3072, CORE, 1, 0x03FF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3074 = {0x3074, CORE, 1, 0x03FF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3076 = {0x3076, CORE, 1, 0x03FF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3078 = {0x3078, CORE, 1, 0x03FF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3080 = {0x3080, CORE, 1, 0xFFFF, RW, 0x000A, "Reserved", ""} +RESERVED_CORE_3082 = {0x3082, CORE, 1, 0xFFFF, RW, 0x100D, "Reserved", ""} +RESERVED_CORE_3084 = {0x3084, CORE, 1, 0xFFFF, RW, 0x616A, "Reserved", ""} +RESERVED_CORE_3086 = {0x3086, CORE, 1, 0xFFFF, RW, 0x640E, "Reserved", ""} +RESERVED_CORE_3088 = {0x3088, CORE, 1, 0xFFFF, RW, 0x8060, "Reserved", ""} +RESERVED_CORE_30A0 = {0x30A0, CORE, 1, 0x0001, RO, 0x0001, "Reserved", ""} +RESERVED_CORE_30A2 = {0x30A2, CORE, 1, 0x0007, RW, 0x0001, "Reserved", ""} +RESERVED_CORE_30A4 = {0x30A4, CORE, 1, 0x0001, RO, 0x0001, "Reserved", ""} +RESERVED_CORE_30A6 = {0x30A6, CORE, 1, 0x0007, RW, 0x0001, "Reserved", ""} +RESERVED_CORE_30B0 = {0x30B0, CORE, 1, 0x3F00, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_30B6 = {0x30B6, CORE, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_30B8 = {0x30B8, CORE, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_30BA = {0x30BA, CORE, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_30BC = {0x30BC, CORE, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_30C0 = {0x30C0, CORE, 1, 0x11F7, RW, 0x0020, "Reserved", ""} +RESERVED_CORE_30C2 = {0x30C2, CORE, 1, 0x01FF, RW, 0x00FF, "Reserved", ""} +RESERVED_CORE_30C4 = {0x30C4, CORE, 1, 0x01FF, RW, 0x00FF, "Reserved", ""} +RESERVED_CORE_30C6 = {0x30C6, CORE, 1, 0x01FF, RW, 0x00FF, "Reserved", ""} +RESERVED_CORE_30C8 = {0x30C8, CORE, 1, 0x01FF, RW, 0x00FF, "Reserved", ""} +RESERVED_CORE_30DE = {0x30DE, CORE, 1, 0x0073, RW, 0x0010, "Reserved", ""} +RESERVED_CORE_30E0 = {0x30E0, CORE, 1, 0xFFFF, RW, 0x5504, "Reserved", ""} +RESERVED_CORE_30E2 = {0x30E2, CORE, 1, 0xFFFF, RW, 0x5504, "Reserved", ""} +RESERVED_CORE_30F2 = {0x30F2, CORE, 1, 0xFFFF, RW, 0x5505, "Reserved", ""} +RESERVED_CORE_30F4 = {0x30F4, CORE, 1, 0xFFFF, RW, 0x5603, "Reserved", ""} +RESERVED_CORE_30F6 = {0x30F6, CORE, 1, 0xFFFF, RW, 0x1605, "Reserved", ""} +RESERVED_CORE_30FE = {0x30FE, CORE, 1, 0xFFFF, RW, 0x412E, "Reserved", ""} +RESERVED_CORE_3102 = {0x3102, CORE, 1, 0xFFFF, RW, 0x5433, "Reserved", ""} +RESERVED_CORE_3106 = {0x3106, CORE, 1, 0xFFFF, RW, 0x2D0A, "Reserved", ""} +RESERVED_CORE_310A = {0x310A, CORE, 1, 0xFFFF, RW, 0x5601, "Reserved", ""} +RESERVED_CORE_310C = {0x310C, CORE, 1, 0xFFFF, RW, 0x5601, "Reserved", ""} +RESERVED_CORE_310E = {0x310E, CORE, 1, 0xFFFF, RW, 0x0905, "Reserved", ""} +RESERVED_CORE_3110 = {0x3110, CORE, 1, 0xFFFF, RW, 0x0400, "Reserved", ""} +RESERVED_CORE_3112 = {0x3112, CORE, 1, 0xFFFF, RW, 0xFF00, "Reserved", ""} +RESERVED_CORE_312A = {0x312A, CORE, 1, 0xFFFF, RW, 0xFFFF, "Reserved", ""} +RESERVED_CORE_312C = {0x312C, CORE, 1, 0x00FF, RW, 0x0055, "Reserved", ""} +RESERVED_CORE_312E = {0x312E, CORE, 1, 0xFFFF, RW, 0x1E56, "Reserved", ""} +RESERVED_CORE_3130 = {0x3130, CORE, 1, 0xFFFF, RW, 0x5607, "Reserved", ""} +RESERVED_CORE_3132 = {0x3132, CORE, 1, 0xFFFF, RW, 0x4231, "Reserved", ""} +RESERVED_CORE_3134 = {0x3134, CORE, 1, 0xFFFF, RW, 0x1708, "Reserved", ""} +RESERVED_CORE_3136 = {0x3136, CORE, 1, 0xFFFF, RW, 0xFFFF, "Reserved", ""} +RESERVED_CORE_3138 = {0x3138, CORE, 1, 0xFFFF, RW, 0x2E0A, "Reserved", ""} +RESERVED_CORE_313A = {0x313A, CORE, 1, 0xFFFF, RW, 0x5601, "Reserved", ""} +RESERVED_CORE_313C = {0x313C, CORE, 1, 0xFFFF, RW, 0x1D06, "Reserved", ""} +RESERVED_CORE_313E = {0x313E, CORE, 1, 0xFFFF, RW, 0x1D06, "Reserved", ""} +RESERVED_CORE_3140 = {0x3140, CORE, 1, 0xFFFF, RW, 0x1E01, "Reserved", ""} +RESERVED_CORE_3142 = {0x3142, CORE, 1, 0xFFFF, RW, 0x1C03, "Reserved", ""} +RESERVED_CORE_3146 = {0x3146, CORE, 1, 0xFFFF, RW, 0x1B03, "Reserved", ""} +RESERVED_CORE_316A = {0x316A, CORE, 1, 0xCFFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_316C = {0x316C, CORE, 1, 0xCFFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_316E = {0x316E, CORE, 1, 0xCFFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_3170 = {0x3170, CORE, 1, 0xFFFF, RW, 0x0DA6, "Reserved", ""} +RESERVED_CORE_3180 = {0x3180, CORE, 1, 0x93FF, RW, 0x81FF, "Reserved", ""} +RESERVED_CORE_3182 = {0x3182, CORE, 1, 0x03FF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_3184 = {0x3184, CORE, 1, 0x03FF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_3186 = {0x3186, CORE, 1, 0x03FF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_3188 = {0x3188, CORE, 1, 0x03FF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_31E0 = {0x31E0, CORE, 1, 0x8003, RW, 0x0003, "Reserved", ""} +RESERVED_CORE_31E2 = {0x31E2, CORE, 1, 0x0FFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31E4 = {0x31E4, CORE, 1, 0x0FFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31E8 = {0x31E8, CORE, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31EA = {0x31EA, CORE, 1, 0x0FFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31EC = {0x31EC, CORE, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31EE = {0x31EE, CORE, 1, 0x0FFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31F4 = {0x31F4, CORE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31F6 = {0x31F6, CORE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31F8 = {0x31F8, CORE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31FA = {0x31FA, CORE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_CORE_31FC = {0x31FC, CORE, 1, 0xFFFF, RW, 0x3020, "Reserved", ""} +RESERVED_CORE_31FE = {0x31FE, CORE, 1, 0x007F, RO, 0x0000, "Reserved", ""} +COLOR_PIPELINE_CONTROL = {0x3210, SOC1, 1, 0x0DB8, RW, 0x09B0, "Color_Pipeline_Control", ""} + {PGA_ENABLE, 0x0008, RW, "3: Enable pixel shading correction. All coefficients and other configuration settings (including other fields in this register) must be set up before enabling shading correction.", "Enable pixel shading correction. All coefficients and other configuration settings (including other fields in this register) must be set up before enabling shading correction."} + {ENABLE_2D_APERTURE_CORRECTION, 0x0010, RW, "4: enable 2D aperture correction", "enable 2D aperture correction"} + {COLOR_CORRECTION, 0x0020, RW, "5: Enable color correction", "Enable color correction"} + {GAMMA_CORRECTION, 0x0080, RW, "7: Enable gamma correction.", "Enable gamma correction."} + {DECIMATOR, 0x0100, RW, "8: 1=Enable scale", "1=Enable scale"} + {BIT_10, 0x0400, RW, "10: Reserved", ""} + {BIT_11, 0x0800, RW, "11: Reserved", ""} +RESERVED_SOC1_3216 = {0x3216, SOC1, 1, 0x01FD, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_3218 = {0x3218, SOC1, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_321A = {0x321A, SOC1, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +OFIFO_CONTROL_STATUS = {0x321C, SOC1, 1, 0xFF8F, RW, 0x0003, "Ofifo control status 2", "Ofifo control status 2"} + {TXFIFO_BYPASS, 0x000F, RW, "0-3: 0000=not bypassed 0001=sensor 0010=sam obs 0011=format 0100=test_walkones", "0000=not bypassed 0001=sensor 0010=sam obs 0011=format 0100=test_walkones"} + {SENSOR_BYPASS, 0x0080, RW, "7: 0=normal 1=bypass SOC (Only relevant if txfifo_bypass=0)", "0=normal 1=bypass SOC (Only relevant if txfifo_bypass=0)"} + {BIT_8, 0x0100, RW, "8: Reserved", ""} + {BIT_9, 0x0200, RW, "9: Reserved", ""} + {BIT_10, 0x0400, RW, "10: Reserved", ""} + {BIT_11, 0x0800, RW, "11: Reserved", ""} + {BIT_12, 0x1000, RO, "12: Reserved", ""} + {BIT_13, 0x2000, RO, "13: Reserved", ""} + {BIT_14, 0x4000, RO, "14: Reserved", ""} + {BIT_15, 0x8000, RO, "15: Reserved", ""} +OFIFO_CONTROL_STATUS_2 = {0x321E, SOC1, 1, 0xFFFF, RW, 0x0010, "Ofifo control status 2", "Ofifo control status 2"} + {BITS_0_9, 0x03FF, RW, "0-9: Reserved", ""} + {DISABLE_PV_DURING_BLANK, 0x0400, RW, "10: 1=disable output clock during blank", "1=disable output clock during blank"} + {BITS_11_15, 0xF800, RW, "11-15: Reserved", ""} +RESERVED_SOC1_3220 = {0x3220, SOC1, 1, 0x0FFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_3222 = {0x3222, SOC1, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_3224 = {0x3224, SOC1, 1, 0x07FF, RW, 0x027F, "Reserved", ""} +RESERVED_SOC1_3226 = {0x3226, SOC1, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_3228 = {0x3228, SOC1, 1, 0x07FF, RW, 0x01DF, "Reserved", ""} +RESERVED_SOC1_322A = {0x322A, SOC1, 1, 0x007E, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_322C = {0x322C, SOC1, 1, 0x0FFF, RW, 0x0800, "Reserved", ""} +RESERVED_SOC1_322E = {0x322E, SOC1, 1, 0x0FFF, RW, 0x0800, "Reserved", ""} +RESERVED_SOC1_323E = {0x323E, SOC1, 1, 0xFFFF, RW, 0x1A2D, "Reserved", ""} +RESERVED_SOC1_3240 = {0x3240, SOC1, 1, 0xFFFF, RW, 0xC814, "Reserved", ""} +RESERVED_SOC1_3242 = {0x3242, SOC1, 1, 0xFFFF, RW, 0x7F80, "Reserved", ""} +RESERVED_SOC1_3244 = {0x3244, SOC1, 1, 0x03FF, RW, 0x0310, "Reserved", ""} +RESERVED_SOC1_3254 = {0x3254, SOC1, 1, 0x0003, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_3256 = {0x3256, SOC1, 1, 0x07FF, RW, 0x01E3, "Reserved", ""} +RESERVED_SOC1_325A = {0x325A, SOC1, 1, 0xFFFF, RW, 0x5000, "Reserved", ""} +RESERVED_SOC1_325C = {0x325C, SOC1, 1, 0xFFFF, RW, 0x3C00, "Reserved", ""} +RESERVED_SOC1_3260 = {0x3260, SOC1, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_3262 = {0x3262, SOC1, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_3264 = {0x3264, SOC1, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_3266 = {0x3266, SOC1, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_326A = {0x326A, SOC1, 1, 0x3FFF, RW, 0x1208, "Reserved", ""} +APERTURE_PARAMETERS = {0x326C, SOC1, 1, 0x7FFF, RW, 0x1208, "2D_Aperture_Parameters", ""} + {KNEE, 0x00FF, RW, "0-7: 2D aperture threshold", "2D aperture threshold"} + {GAIN, 0x0700, RW, "8-10: 2D aperture gain", "2D aperture gain"} + {EXP, 0x3800, RW, "11-13: 2D aperture gain's exponent", "2D aperture gain's exponent"} + {ABS, 0x4000, RW, "14: force aperture gain be positive, if set to 1", "force aperture gain be positive, if set to 1"} +RESERVED_SOC1_326E = {0x326E, SOC1, 1, 0x00FF, RW, 0x0080, "Reserved", ""} +RESERVED_SOC1_3270 = {0x3270, SOC1, 1, 0x0FFF, RW, 0x07AA, "Reserved", ""} +RESERVED_SOC1_3272 = {0x3272, SOC1, 1, 0x0FFF, RW, 0x07E4, "Reserved", ""} +RESERVED_SOC1_3274 = {0x3274, SOC1, 1, 0x007F, RW, 0x002A, "Reserved", ""} +BLACK_LEVEL_2ND = {0x3276, SOC1, 1, 0x03FF, RW, 0x0000, "Second Black Level prior to CCM", "Second Black Level prior to CCM"} +BLACK_LEVEL_1ST_RED = {0x327A, SOC1, 1, 0x01FF, RW, 0x002A, "Offset subtracted from red pixels.", "Offset subtracted from red pixels."} +BLACK_LEVEL_1ST_GREEN1 = {0x327C, SOC1, 1, 0x01FF, RW, 0x002A, "Offset subtracted from green1 pixels.", "Offset subtracted from green1 pixels."} +BLACK_LEVEL_1ST_GREEN2 = {0x327E, SOC1, 1, 0x01FF, RW, 0x002A, "Offset subtracted from green2 pixels.", "Offset subtracted from green2 pixels."} +BLACK_LEVEL_1ST_BLUE = {0x3280, SOC1, 1, 0x01FF, RW, 0x002A, "Offset subtracted from blue pixels.", "Offset subtracted from blue pixels."} +THRESH_EDGE_DETECT = {0x328E, SOC1, 1, 0x00FF, RW, 0x000C, "Demosaic Edge Threshold.", "Demosaic Edge Threshold."} +TEST_PATTERN = {0x3290, SOC1, 1, 0x0060, RW, 0x0000, "Test_Pattern", ""} + {EN_MOTO_TP, 0x0020, RW, "5: Enable Test Pattern 0= disable 1= enable", "Enable Test Pattern 0= disable 1= enable"} + {MOTO_10, 0x0040, RW, "6: Pattern Width 0= 8-bit 1= 10-bit", "Pattern Width 0= 8-bit 1= 10-bit"} +RESERVED_SOC1_329E = {0x329E, SOC1, 1, 0x0003, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_32A0 = {0x32A0, SOC1, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_32C0 = {0x32C0, SOC1, 1, 0x7FFF, RW, 0x3923, "Reserved", ""} +RESERVED_SOC1_32C2 = {0x32C2, SOC1, 1, 0x0FFF, RW, 0x0724, "Reserved", ""} +RESERVED_SOC1_32C4 = {0x32C4, SOC1, 1, 0xFFFF, RW, 0x7DCC, "Reserved", ""} +RESERVED_SOC1_32C6 = {0x32C6, SOC1, 1, 0xFFFF, RW, 0x2711, "Reserved", ""} +RESERVED_SOC1_32C8 = {0x32C8, SOC1, 1, 0xFFFF, RW, 0x62E5, "Reserved", ""} +RESERVED_SOC1_32CA = {0x32CA, SOC1, 1, 0xFFFF, RW, 0x690D, "Reserved", ""} +RESERVED_SOC1_32CC = {0x32CC, SOC1, 1, 0x3FFF, RW, 0x2DCD, "Reserved", ""} +RESERVED_SOC1_32D4 = {0x32D4, SOC1, 1, 0x03FF, RW, 0x0080, "Reserved", ""} +RESERVED_SOC1_32D6 = {0x32D6, SOC1, 1, 0x03FF, RW, 0x0080, "Reserved", ""} +RESERVED_SOC1_32D8 = {0x32D8, SOC1, 1, 0x03FF, RW, 0x0080, "Reserved", ""} +RESERVED_SOC1_32DA = {0x32DA, SOC1, 1, 0x03FF, RW, 0x0080, "Reserved", ""} +RESERVED_SOC1_32F4 = {0x32F4, SOC1, 1, 0xFFFF, RW, 0x4F00, "Reserved", ""} +RESERVED_SOC1_32F6 = {0x32F6, SOC1, 1, 0xFFFF, RW, 0x1C02, "Reserved", ""} +RESERVED_SOC1_32F8 = {0x32F8, SOC1, 1, 0xFFFF, RW, 0x1400, "Reserved", ""} +RESERVED_SOC1_32FA = {0x32FA, SOC1, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_332C = {0x332C, SOC1, 1, 0x0001, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_332E = {0x332E, SOC1, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +OUTPUT_FORMAT_TEST = {0x3330, SOC1, 1, 0x0FFF, RW, 0x0000, "Output_Format_Test", ""} + {CR, 0x0001, RW, "0: Disable Cr channel", "Disable Cr channel"} + {Y, 0x0002, RW, "1: Disable Y channel", "Disable Y channel"} + {CB, 0x0004, RW, "2: Disable Cb channel", "Disable Cb channel"} + {RAMP, 0x0038, RW, "3-5: Test ramp output", "Test ramp output"} + {BYPASS_8_2, 0x0040, RW, "6: 8+2 bypass", "8+2 bypass"} + {BIT_7, 0x0080, RW, "7: Reserved", ""} + {USE_LC, 0x0100, RW, "8: Enable Lens Correction Bypass", "Enable Lens Correction Bypass"} + {BIT_9, 0x0200, RW, "9: Reserved", ""} + {BIT_10, 0x0400, RW, "10: Reserved", ""} + {BIT_11, 0x0800, RW, "11: Reserved", ""} +RESERVED_SOC1_3332 = {0x3332, SOC1, 1, 0x0FFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_3334 = {0x3334, SOC1, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_3346 = {0x3346, SOC1, 1, 0x000F, RW, 0x0002, "Reserved", ""} +RESERVED_SOC1_3348 = {0x3348, SOC1, 1, 0xFF7F, RW, 0x6440, "Reserved", ""} +RESERVED_SOC1_334A = {0x334A, SOC1, 1, 0xFFFF, RW, 0xB023, "Reserved", ""} +YUV_YCBCR_CONTROL = {0x337C, SOC1, 1, 0x000F, RW, 0x0006, "YUV_YCbCr_Control", ""} + {MULT_Y_UV, 0x0001, RW, "0: normalize Y in 16-235; U and V in 16-240", "normalize Y in 16-235; U and V in 16-240"} + {BIT_1, 0x0002, RW, "1: Reserved", ""} + {ADD_128, 0x0004, RW, "2: add 128 to U and V", "add 128 to U and V"} + {CLIP, 0x0008, RW, "3: clip Y in 16-235; U and V in 16-240", "clip Y in 16-235; U and V in 16-240"} +RESERVED_SOC1_337E = {0x337E, SOC1, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_33E6 = {0x33E6, SOC1, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_33E8 = {0x33E8, SOC1, 1, 0x7FFF, RW, 0x4401, "Reserved", ""} +RESERVED_SOC1_33EA = {0x33EA, SOC1, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC1_33EC = {0x33EC, SOC1, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC1_33EE = {0x33EE, SOC1, 1, 0x000F, RO, 0x0000, "Reserved", ""} +KERNEL_CONFIG = {0x33F4, SOC1, 1, 0x01FF, RW, 0x0003, "KERNEL_CONFIG", ""} + {DC_ENABLE, 0x0001, RW, "0: Defect correction enable.", "Defect correction enable."} + {BIT_1, 0x0002, RW, "1: Reserved", ""} + {BIT_2, 0x0004, RW, "2: Reserved", ""} + {NR_ENABLE, 0x0008, RW, "3: Noise reduction enable.", "Noise reduction enable."} + {BIT_4, 0x0010, RW, "4: Reserved", ""} + {BIT_5, 0x0020, RW, "5: Reserved", ""} + {BIT_6, 0x0040, RW, "6: Reserved", ""} + {BIT_7, 0x0080, RW, "7: Reserved", ""} + {BIT_8, 0x0100, RW, "8: Reserved", ""} +RESERVED_SOC1_33F6 = {0x33F6, SOC1, 1, 0x00FF, RW, 0x0020, "Reserved", ""} +RESERVED_SOC1_33F8 = {0x33F8, SOC1, 1, 0x00FF, RW, 0x0020, "Reserved", ""} +RESERVED_SOC1_33FA = {0x33FA, SOC1, 1, 0x00FF, RW, 0x0020, "Reserved", ""} +RESERVED_SOC1_33FC = {0x33FC, SOC1, 1, 0x00FF, RW, 0x00FF, "Reserved", ""} +MIPI_CONTROL = {0x3400, SOC2, 1, 0xFFFF, RW, 0x782E, "MIPI_Control", "MIPI_Control"} + {RESTART_EN, 0x0001, RW, "0: MIPI restart enable", "MIPI restart enable"} + {STANDBY_EN, 0x0002, RW, "1: MIPI standby", "MIPI standby"} + {CONT_MIPI_CLK, 0x0004, RW, "2: Continuous MIPI clock", "Continuous MIPI clock"} + {REG_FRAME_SYNC, 0x0008, RO, "3: Frame boundary sync bit", "Frame boundary sync bit"} + {STANDBY_EOF, 0x0010, RW, "4: Wait until eof to react to standby", "Wait until eof to react to standby"} + {BIT_5, 0x0020, RW, "5: Reserved", ""} + {CHAN_NUM, 0x01C0, RW, "6-8: MIPI channel number", "MIPI channel number"} + {MIPI_EN, 0x0200, RW, "9: MIPI enable", "MIPI enable"} + {DATA_TYPE, 0xFC00, RW, "10-15: See Data Sheet for values", "See Data Sheet for values"} +MIPI_STATUS = {0x3402, SOC2, 1, 0x1E31, RW, 0x0011, "MIPI_Status", "MIPI_Status"} + {MIPI_STDBY, 0x0001, RO, "0: MIPI in standby", "MIPI in standby"} + {MIPICCP_IDLE, 0x0010, RO, "4: MIPI idle", "MIPI idle"} + {MIPI_RDY_FOR_DATA, 0x0020, RO, "5: MIPI ready to receive data", "MIPI ready to receive data"} + {BIT_9, 0x0200, RO, "9: Reserved", ""} + {BIT_10, 0x0400, RO, "10: Reserved", ""} + {BIT_11, 0x0800, RW, "11: Reserved", ""} + {BIT_12, 0x1000, RW, "12: Reserved", ""} +CUSTOM_SHORT_PKT = {0x3404, SOC2, 1, 0x3FC0, RW, 0x0000, "MIPI_Custom_Short_Packet", "MIPI_Custom_Short_Packet"} + {FRAME_CNT_RST, 0x0040, RW, "6: Reset the frame count sent in the frame start/end short packets.", "Reset the frame count sent in the frame start/end short packets."} + {FRAME_CNT_EN, 0x0080, RW, "7: Insert frame counter value in WC field", "Insert frame counter value in WC field"} + {CUSTOM_SHORT_PKT_DATA_TYPE, 0x0700, RW, "8-10: Custom short packet data type", "Custom short packet data type"} + {CUSTOM_SHORT_PKT_REQ, 0x0800, RW, "11: Custom short packet request", "Custom short packet request"} + {CUSTOM_SHORT_PKT_FRAME_SYNC, 0x1000, RW, "12: Frame synch for custom short packet", "Frame synch for custom short packet"} + {CUSTOM_SHORT_PKT_RST, 0x2000, RO, "13: Reset for custom short packet", "Reset for custom short packet"} +LINE_BYTE_CNT = {0x3408, SOC2, 1, 0xFFFF, RW, 0x0200, "MIPI line byte count", "MIPI line byte count"} +CUSTOM_SHORT_PKT_WC = {0x340C, SOC2, 1, 0xFFFF, RW, 0x0000, "The contents of the WC field of a custom short packet", "The contents of the WC field of a custom short packet"} +RESERVED_SOC2_340E = {0x340E, SOC2, 1, 0x1E37, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_3410 = {0x3410, SOC2, 1, 0x0F00, RW, 0x0800, "Reserved", ""} +RESERVED_SOC2_3412 = {0x3412, SOC2, 1, 0x3F0F, RW, 0x0705, "Reserved", ""} +RESERVED_SOC2_3414 = {0x3414, SOC2, 1, 0x3F3F, RW, 0x0B01, "Reserved", ""} +RESERVED_SOC2_3416 = {0x3416, SOC2, 1, 0x0F3F, RW, 0x0509, "Reserved", ""} +RESERVED_SOC2_3418 = {0x3418, SOC2, 1, 0x003F, RW, 0x0004, "Reserved", ""} +RESERVED_SOC2_341A = {0x341A, SOC2, 1, 0x7F7F, RW, 0x0608, "Reserved", ""} +AE_ZONE_X = {0x3580, SOC2, 1, 0xFFFF, RW, 0x1300, "ae_zone_x", ""} + {AE_ZONE_X_START, 0x00FF, RW, "0-7: Start of AE window divided by 8", "Start of AE window divided by 8"} + {AE_ZONE_X_WIDTH, 0xFF00, RW, "8-15: Width of each AE zone in x direction divided by 8, minus 1.", "Width of each AE zone in x direction divided by 8, minus 1."} +AE_ZONE_Y = {0x3582, SOC2, 1, 0xFFFF, RW, 0x0E00, "ae_zone_y", ""} + {AE_ZONE_Y_START, 0x00FF, RW, "0-7: Start of AE window divided by 8", "Start of AE window divided by 8"} + {AE_ZONE_Y_WIDTH, 0xFF00, RW, "8-15: Width of each AE zone in y direction divided by 8, minus 1.", "Width of each AE zone in y direction divided by 8, minus 1."} +AE_WINDOW_SIZE_LO = {0x3584, SOC2, 1, 0xFFFF, RW, 0x4B00, "Least significant bits of the size of each AE zone in terms of number of pixels.", "Least significant bits of the size of each AE zone in terms of number of pixels."} +AE_WINDOW_SIZE_HI = {0x3586, SOC2, 1, 0x0001, RW, 0x0000, "Most significant bit of the size of each AE zone in terms of number of pixels.", "Most significant bit of the size of each AE zone in terms of number of pixels."} +RESERVED_SOC2_3588 = {0x3588, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_358A = {0x358A, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_358C = {0x358C, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_358E = {0x358E, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_3590 = {0x3590, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_3592 = {0x3592, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_3594 = {0x3594, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_3596 = {0x3596, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35A2 = {0x35A2, SOC2, 1, 0x00FF, RW, 0x0014, "Reserved", ""} +RESERVED_SOC2_35A4 = {0x35A4, SOC2, 1, 0x07FF, RW, 0x0594, "Reserved", ""} +RESERVED_SOC2_35A6 = {0x35A6, SOC2, 1, 0xFFFF, RW, 0x8000, "Reserved", ""} +RESERVED_SOC2_35A8 = {0x35A8, SOC2, 1, 0xFFFF, RW, 0xA000, "Reserved", ""} +RESERVED_SOC2_35AA = {0x35AA, SOC2, 1, 0x1FFF, RW, 0x030A, "Reserved", ""} +RESERVED_SOC2_35AC = {0x35AC, SOC2, 1, 0x1FFF, RW, 0x030A, "Reserved", ""} +RESERVED_SOC2_35AE = {0x35AE, SOC2, 1, 0x3FFF, RW, 0x000A, "Reserved", ""} +RESERVED_SOC2_35B0 = {0x35B0, SOC2, 1, 0xFFFF, RW, 0x05FA, "Reserved", ""} +RESERVED_SOC2_35B2 = {0x35B2, SOC2, 1, 0x01FF, RW, 0x0001, "Reserved", ""} +RESERVED_SOC2_35B4 = {0x35B4, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35B6 = {0x35B6, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35B8 = {0x35B8, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35BA = {0x35BA, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35BC = {0x35BC, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35BE = {0x35BE, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35C0 = {0x35C0, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35C2 = {0x35C2, SOC2, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_35C4 = {0x35C4, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35C6 = {0x35C6, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35C8 = {0x35C8, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35CA = {0x35CA, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35CC = {0x35CC, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35CE = {0x35CE, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35D0 = {0x35D0, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35D2 = {0x35D2, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35D4 = {0x35D4, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35D6 = {0x35D6, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35D8 = {0x35D8, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35DA = {0x35DA, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35DC = {0x35DC, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35DE = {0x35DE, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35E0 = {0x35E0, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35E2 = {0x35E2, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35E4 = {0x35E4, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35E6 = {0x35E6, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35E8 = {0x35E8, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35EA = {0x35EA, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35EC = {0x35EC, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35EE = {0x35EE, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35F0 = {0x35F0, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35F2 = {0x35F2, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35F4 = {0x35F4, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35F6 = {0x35F6, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35F8 = {0x35F8, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35FA = {0x35FA, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35FC = {0x35FC, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_35FE = {0x35FE, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_3600 = {0x3600, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_3602 = {0x3602, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_3604 = {0x3604, SOC2, 1, 0xFFFF, RW, 0x1B00, "Reserved", ""} +RESERVED_SOC2_3606 = {0x3606, SOC2, 1, 0xFFFF, RW, 0x4C2E, "Reserved", ""} +RESERVED_SOC2_3608 = {0x3608, SOC2, 1, 0xFFFF, RW, 0x9878, "Reserved", ""} +RESERVED_SOC2_360A = {0x360A, SOC2, 1, 0xFFFF, RW, 0xC1B0, "Reserved", ""} +RESERVED_SOC2_360C = {0x360C, SOC2, 1, 0xFFFF, RW, 0xD9CF, "Reserved", ""} +RESERVED_SOC2_360E = {0x360E, SOC2, 1, 0xFFFF, RW, 0xE8E1, "Reserved", ""} +RESERVED_SOC2_3610 = {0x3610, SOC2, 1, 0xFFFF, RW, 0xF2EE, "Reserved", ""} +RESERVED_SOC2_3612 = {0x3612, SOC2, 1, 0xFFFF, RW, 0xF9F6, "Reserved", ""} +RESERVED_SOC2_3614 = {0x3614, SOC2, 1, 0xFFFF, RW, 0xFDFB, "Reserved", ""} +RESERVED_SOC2_3616 = {0x3616, SOC2, 1, 0x00FF, RW, 0x00FF, "Reserved", ""} +RESERVED_SOC2_3618 = {0x3618, SOC2, 1, 0xFFFF, RW, 0x1B00, "Reserved", ""} +RESERVED_SOC2_361A = {0x361A, SOC2, 1, 0xFFFF, RW, 0x4C2E, "Reserved", ""} +RESERVED_SOC2_361C = {0x361C, SOC2, 1, 0xFFFF, RW, 0x9878, "Reserved", ""} +RESERVED_SOC2_361E = {0x361E, SOC2, 1, 0xFFFF, RW, 0xC1B0, "Reserved", ""} +RESERVED_SOC2_3620 = {0x3620, SOC2, 1, 0xFFFF, RW, 0xD9CF, "Reserved", ""} +RESERVED_SOC2_3622 = {0x3622, SOC2, 1, 0xFFFF, RW, 0xE8E1, "Reserved", ""} +RESERVED_SOC2_3624 = {0x3624, SOC2, 1, 0xFFFF, RW, 0xF2EE, "Reserved", ""} +RESERVED_SOC2_3626 = {0x3626, SOC2, 1, 0xFFFF, RW, 0xF9F6, "Reserved", ""} +RESERVED_SOC2_3628 = {0x3628, SOC2, 1, 0xFFFF, RW, 0xFDFB, "Reserved", ""} +RESERVED_SOC2_362A = {0x362A, SOC2, 1, 0x00FF, RW, 0x00FF, "Reserved", ""} +RESERVED_SOC2_362C = {0x362C, SOC2, 1, 0xFFFF, RW, 0x1B00, "Reserved", ""} +RESERVED_SOC2_362E = {0x362E, SOC2, 1, 0xFFFF, RW, 0x4C2E, "Reserved", ""} +RESERVED_SOC2_3630 = {0x3630, SOC2, 1, 0xFFFF, RW, 0x9878, "Reserved", ""} +RESERVED_SOC2_3632 = {0x3632, SOC2, 1, 0xFFFF, RW, 0xC1B0, "Reserved", ""} +RESERVED_SOC2_3634 = {0x3634, SOC2, 1, 0xFFFF, RW, 0xD9CF, "Reserved", ""} +RESERVED_SOC2_3636 = {0x3636, SOC2, 1, 0xFFFF, RW, 0xE8E1, "Reserved", ""} +RESERVED_SOC2_3638 = {0x3638, SOC2, 1, 0xFFFF, RW, 0xF2EE, "Reserved", ""} +RESERVED_SOC2_363A = {0x363A, SOC2, 1, 0xFFFF, RW, 0xF9F6, "Reserved", ""} +RESERVED_SOC2_363C = {0x363C, SOC2, 1, 0xFFFF, RW, 0xFDFB, "Reserved", ""} +RESERVED_SOC2_363E = {0x363E, SOC2, 1, 0x00FF, RW, 0x00FF, "Reserved", ""} +RESERVED_SOC2_3640 = {0x3640, SOC2, 1, 0x01FF, RW, 0x0049, "Reserved", ""} +POLY_ORIGIN_R = {0x3642, SOC2, 1, 0x07FF, RW, 0x00F4, "Center Row", "Center Row"} +POLY_ORIGIN_C = {0x3644, SOC2, 1, 0x07FF, RW, 0x0144, "Center Column", "Center Column"} +RESERVED_SOC2_3646 = {0x3646, SOC2, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_3648 = {0x3648, SOC2, 1, 0x07FF, RW, 0x01E7, "Reserved", ""} +RESERVED_SOC2_364A = {0x364A, SOC2, 1, 0x07FF, RW, 0x0000, "Reserved", ""} +RESERVED_SOC2_364C = {0x364C, SOC2, 1, 0x07FF, RW, 0x0287, "Reserved", ""} +P_GR_P0Q0 = {0x364E, SOC2, 1, 0xFFFF, RW, 0x0010, "P0 coefficients for Green1.", "P0 coefficients for Green1."} +P_GR_P0Q1 = {0x3650, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Green1.", "P0 coefficients for Green1."} +P_GR_P0Q2 = {0x3652, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Green1.", "P0 coefficients for Green1."} +P_GR_P0Q3 = {0x3654, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Green1.", "P0 coefficients for Green1."} +P_GR_P0Q4 = {0x3656, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Green1.", "P0 coefficients for Green1."} +P_RD_P0Q0 = {0x3658, SOC2, 1, 0xFFFF, RW, 0x0010, "P0 coefficients for Red.", "P0 coefficients for Red."} +P_RD_P0Q1 = {0x365A, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Red.", "P0 coefficients for Red."} +P_RD_P0Q2 = {0x365C, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Red.", "P0 coefficients for Red."} +P_RD_P0Q3 = {0x365E, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Red.", "P0 coefficients for Red."} +P_RD_P0Q4 = {0x3660, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Red.", "P0 coefficients for Red."} +P_BL_P0Q0 = {0x3662, SOC2, 1, 0xFFFF, RW, 0x0010, "P0 coefficients for Blue.", "P0 coefficients for Blue."} +P_BL_P0Q1 = {0x3664, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Blue.", "P0 coefficients for Blue."} +P_BL_P0Q2 = {0x3666, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Blue.", "P0 coefficients for Blue."} +P_BL_P0Q3 = {0x3668, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Blue.", "P0 coefficients for Blue."} +P_BL_P0Q4 = {0x366A, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Blue.", "P0 coefficients for Blue."} +P_GB_P0Q0 = {0x366C, SOC2, 1, 0xFFFF, RW, 0x0010, "P0 coefficients for Green2.", "P0 coefficients for Green2."} +P_GB_P0Q1 = {0x366E, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Green2.", "P0 coefficients for Green2."} +P_GB_P0Q2 = {0x3670, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Green2.", "P0 coefficients for Green2."} +P_GB_P0Q3 = {0x3672, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Green2.", "P0 coefficients for Green2."} +P_GB_P0Q4 = {0x3674, SOC2, 1, 0xFFFF, RW, 0x0000, "P0 coefficients for Green2.", "P0 coefficients for Green2."} +P_GR_P1Q0 = {0x3676, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green1.", "P1 coefficients for Green1."} +P_GR_P1Q1 = {0x3678, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green1.", "P1 coefficients for Green1."} +P_GR_P1Q2 = {0x367A, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green1.", "P1 coefficients for Green1."} +P_GR_P1Q3 = {0x367C, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green1.", "P1 coefficients for Green1."} +P_GR_P1Q4 = {0x367E, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green1.", "P1 coefficients for Green1."} +P_RD_P1Q0 = {0x3680, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Red.", "P1 coefficients for Red."} +P_RD_P1Q1 = {0x3682, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Red.", "P1 coefficients for Red."} +P_RD_P1Q2 = {0x3684, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Red.", "P1 coefficients for Red."} +P_RD_P1Q3 = {0x3686, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Red.", "P1 coefficients for Red."} +P_RD_P1Q4 = {0x3688, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Red.", "P1 coefficients for Red."} +P_BL_P1Q0 = {0x368A, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Blue.", "P1 coefficients for Blue."} +P_BL_P1Q1 = {0x368C, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Blue.", "P1 coefficients for Blue."} +P_BL_P1Q2 = {0x368E, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Blue.", "P1 coefficients for Blue."} +P_BL_P1Q3 = {0x3690, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Blue.", "P1 coefficients for Blue."} +P_BL_P1Q4 = {0x3692, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Blue.", "P1 coefficients for Blue."} +P_GB_P1Q0 = {0x3694, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green2.", "P1 coefficients for Green2."} +P_GB_P1Q1 = {0x3696, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green2.", "P1 coefficients for Green2."} +P_GB_P1Q2 = {0x3698, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green2.", "P1 coefficients for Green2."} +P_GB_P1Q3 = {0x369A, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green2.", "P1 coefficients for Green2."} +P_GB_P1Q4 = {0x369C, SOC2, 1, 0xFFFF, RW, 0x0000, "P1 coefficients for Green2.", "P1 coefficients for Green2."} +P_GR_P2Q0 = {0x369E, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green1.", "P2 coefficients for Green1."} +P_GR_P2Q1 = {0x36A0, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green1.", "P2 coefficients for Green1."} +P_GR_P2Q2 = {0x36A2, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green1.", "P2 coefficients for Green1."} +P_GR_P2Q3 = {0x36A4, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green1.", "P2 coefficients for Green1."} +P_GR_P2Q4 = {0x36A6, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green1.", "P2 coefficients for Green1."} +P_RD_P2Q0 = {0x36A8, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Red.", "P2 coefficients for Red."} +P_RD_P2Q1 = {0x36AA, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Red.", "P2 coefficients for Red."} +P_RD_P2Q2 = {0x36AC, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Red.", "P2 coefficients for Red."} +P_RD_P2Q3 = {0x36AE, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Red.", "P2 coefficients for Red."} +P_RD_P2Q4 = {0x36B0, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Red.", "P2 coefficients for Red."} +P_BL_P2Q0 = {0x36B2, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Blue.", "P2 coefficients for Blue."} +P_BL_P2Q1 = {0x36B4, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Blue.", "P2 coefficients for Blue."} +P_BL_P2Q2 = {0x36B6, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Blue.", "P2 coefficients for Blue."} +P_BL_P2Q3 = {0x36B8, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Blue.", "P2 coefficients for Blue."} +P_BL_P2Q4 = {0x36BA, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Blue.", "P2 coefficients for Blue."} +P_GB_P2Q0 = {0x36BC, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green2.", "P2 coefficients for Green2."} +P_GB_P2Q1 = {0x36BE, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green2.", "P2 coefficients for Green2."} +P_GB_P2Q2 = {0x36C0, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green2.", "P2 coefficients for Green2."} +P_GB_P2Q3 = {0x36C2, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green2.", "P2 coefficients for Green2."} +P_GB_P2Q4 = {0x36C4, SOC2, 1, 0xFFFF, RW, 0x0000, "P2 coefficients for Green2.", "P2 coefficients for Green2."} +P_GR_P3Q0 = {0x36C6, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green1.", "P3 coefficients for Green1."} +P_GR_P3Q1 = {0x36C8, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green1.", "P3 coefficients for Green1."} +P_GR_P3Q2 = {0x36CA, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green1.", "P3 coefficients for Green1."} +P_GR_P3Q3 = {0x36CC, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green1.", "P3 coefficients for Green1."} +P_GR_P3Q4 = {0x36CE, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green1.", "P3 coefficients for Green1."} +P_RD_P3Q0 = {0x36D0, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Red.", "P3 coefficients for Red."} +P_RD_P3Q1 = {0x36D2, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Red.", "P3 coefficients for Red."} +P_RD_P3Q2 = {0x36D4, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Red.", "P3 coefficients for Red."} +P_RD_P3Q3 = {0x36D6, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Red.", "P3 coefficients for Red."} +P_RD_P3Q4 = {0x36D8, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Red.", "P3 coefficients for Red."} +P_BL_P3Q0 = {0x36DA, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Blue.", "P3 coefficients for Blue."} +P_BL_P3Q1 = {0x36DC, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Blue.", "P3 coefficients for Blue."} +P_BL_P3Q2 = {0x36DE, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Blue.", "P3 coefficients for Blue."} +P_BL_P3Q3 = {0x36E0, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Blue.", "P3 coefficients for Blue."} +P_BL_P3Q4 = {0x36E2, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Blue.", "P3 coefficients for Blue."} +P_GB_P3Q0 = {0x36E4, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green2.", "P3 coefficients for Green2."} +P_GB_P3Q1 = {0x36E6, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green2.", "P3 coefficients for Green2."} +P_GB_P3Q2 = {0x36E8, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green2.", "P3 coefficients for Green2."} +P_GB_P3Q3 = {0x36EA, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green2.", "P3 coefficients for Green2."} +P_GB_P3Q4 = {0x36EC, SOC2, 1, 0xFFFF, RW, 0x0000, "P3 coefficients for Green2.", "P3 coefficients for Green2."} +P_GR_P4Q0 = {0x36EE, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green1.", "P4 coefficients for Green1."} +P_GR_P4Q1 = {0x36F0, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green1.", "P4 coefficients for Green1."} +P_GR_P4Q2 = {0x36F2, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green1.", "P4 coefficients for Green1."} +P_GR_P4Q3 = {0x36F4, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green1.", "P4 coefficients for Green1."} +P_GR_P4Q4 = {0x36F6, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green1.", "P4 coefficients for Green1."} +P_RD_P4Q0 = {0x36F8, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Red.", "P4 coefficients for Red."} +P_RD_P4Q1 = {0x36FA, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Red.", "P4 coefficients for Red."} +P_RD_P4Q2 = {0x36FC, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Red.", "P4 coefficients for Red."} +P_RD_P4Q3 = {0x36FE, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Red.", "P4 coefficients for Red."} +P_RD_P4Q4 = {0x3700, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Red.", "P4 coefficients for Red."} +P_BL_P4Q0 = {0x3702, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Blue.", "P4 coefficients for Blue."} +P_BL_P4Q1 = {0x3704, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Blue.", "P4 coefficients for Blue."} +P_BL_P4Q2 = {0x3706, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Blue.", "P4 coefficients for Blue."} +P_BL_P4Q3 = {0x3708, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Blue.", "P4 coefficients for Blue."} +P_BL_P4Q4 = {0x370A, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Blue.", "P4 coefficients for Blue."} +P_GB_P4Q0 = {0x370C, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green2.", "P4 coefficients for Green2."} +P_GB_P4Q1 = {0x370E, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green2.", "P4 coefficients for Green2."} +P_GB_P4Q2 = {0x3710, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green2.", "P4 coefficients for Green2."} +P_GB_P4Q3 = {0x3712, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green2.", "P4 coefficients for Green2."} +P_GB_P4Q4 = {0x3714, SOC2, 1, 0xFFFF, RW, 0x0000, "P4 coefficients for Green2.", "P4 coefficients for Green2."} +RESERVED_SOC2_3716 = {0x3716, SOC2, 1, 0xFFFF, RO, 0x0010, "Reserved", ""} +RESERVED_SOC2_3718 = {0x3718, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_371A = {0x371A, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_371C = {0x371C, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_371E = {0x371E, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_3720 = {0x3720, SOC2, 1, 0xFFFF, RO, 0x0010, "Reserved", ""} +RESERVED_SOC2_3722 = {0x3722, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_3724 = {0x3724, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_3726 = {0x3726, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_SOC2_3728 = {0x3728, SOC2, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_3E00 = {0x3E00, CORE, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_CORE_3F00 = {0x3F00, CORE, 1, 0xFFFF, RO, 0x0000, "Reserved", ""} +RESERVED_MON_00 = {0x0000, MON, 1, 0xFFFF, RW, 0xE8CD, "Reserved", ""} +RESERVED_MON_02 = {0x0002, MON, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_MON_03 = {0x0003, MON, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_MON_04 = {0x0004, MON, 1, 0x00FF, RO, 0x0000, "Reserved", ""} +RESERVED_MON_05 = {0x0005, MON, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_06 = {0x0006, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_08 = {0x0008, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_0A = {0x000A, MON, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_0B = {0x000B, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_0D = {0x000D, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_0F = {0x000F, MON, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_10 = {0x0010, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_12 = {0x0012, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_14 = {0x0014, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_16 = {0x0016, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_18 = {0x0018, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_1A = {0x001A, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_1C = {0x001C, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_1E = {0x001E, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_20 = {0x0020, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MON_22 = {0x0022, MON, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_00 = {0x0000, SEQ, 1, 0xFFFF, RW, 0xF035, "Reserved", ""} +SEQ_MODE = {0x0002, SEQ, 1, 0x00FF, RW, 0x000F, "mode", "Setting bit enables corresponding driver"} + {AE, 0x0001, RW, "0: AutoExposure", "ID=2"} + {FD, 0x0002, RW, "1: Flicker Detection", "ID=4"} + {AWB, 0x0004, RW, "2: Auto White Balance", "ID=3"} + {HG, 0x0008, RW, "3: Histogram", "ID=11"} +SEQ_CMD = {0x0003, SEQ, 1, 0x00FF, RW, 0x0000, "cmd", "0-Run;1-Preview;2-Capture;3-Standby;4-Lock;5-Refresh;6-Refresh Mode"} +SEQ_STATE = {0x0004, SEQ, 1, 0x00FF, RW, 0x0003, "state", "0-Run;1-ToPreview;2-Enter;3-Preview;4-Leave;5-ToCapture;6-Enter;7-Capture;8-Leave;9-Standby"} +RESERVED_SEQ_05 = {0x0005, SEQ, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +SEQ_FLASHTYPE = {0x0006, SEQ, 1, 0x00FF, RW, 0x0000, "sharedParams.flashType", ""} + {FLASHTYPE, 0x007F, RW, "0-6: FlashType", "0-None;1-LED;2-Xenon;3-XenonBurst"} + {FLASH_ON_LOCK, 0x0080, RW, "7: flash On in Lock mode", ""} +RESERVED_SEQ_07 = {0x0007, SEQ, 1, 0x00FF, RW, 0x0008, "Reserved", ""} +RESERVED_SEQ_08 = {0x0008, SEQ, 1, 0x00FF, RW, 0x0002, "Reserved", ""} +SEQ_AE_FASTBUFF = {0x0009, SEQ, 1, 0x00FF, RW, 0x0020, "sharedParams.aeFastBuff", ""} +SEQ_AE_FASTSTEP = {0x000A, SEQ, 1, 0x00FF, RW, 0x0001, "sharedParams.aeFastStep", ""} +SEQ_AWB_CONTBUFF = {0x000B, SEQ, 1, 0x00FF, RW, 0x0008, "sharedParams.awbContBuff", ""} +SEQ_AWB_CONTSTEP = {0x000C, SEQ, 1, 0x00FF, RW, 0x0002, "sharedParams.awbContStep", ""} +RESERVED_SEQ_0D = {0x000D, SEQ, 1, 0x00FF, RW, 0x0020, "Reserved", ""} +RESERVED_SEQ_0E = {0x000E, SEQ, 1, 0x00FF, RW, 0x0001, "Reserved", ""} +RESERVED_SEQ_0F = {0x000F, SEQ, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_10 = {0x0010, SEQ, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +SEQ_OPTIONS = {0x0011, SEQ, 1, 0x00FF, RW, 0x00A8, "sharedParams.options", ""} + {BIT_0, 0x0001, RW, "0: Reserved", ""} + {BIT_1, 0x0002, RW, "1: Reserved", ""} + {BIT_2, 0x0004, RW, "2: Reserved", ""} + {SEQ_CROP_WIN_AE, 0x0008, RW, "3: use crop window for AE statistic", ""} + {SEQ_CROP_WIN_AWB, 0x0010, RW, "4: use crop window for AWB statistic", ""} + {BIT_7, 0x0080, RW, "7: Reserved", ""} +RESERVED_SEQ_12 = {0x0012, SEQ, 1, 0x00FF, RW, 0x0010, "Reserved", ""} +SEQ_FLASH_TH = {0x0013, SEQ, 1, 0xFFFF, RW, 0x0000, "sharedParams.flashTH", ""} +SEQ_CAP_MODE = {0x0015, SEQ, 1, 0x00FF, RW, 0x0000, "captureParams.mode", ""} + {XENON_FLASH, 0x0001, RW, "0: Capture w/ Xenon Flash", "Still Only"} + {VIDEO, 0x0002, RW, "1: Capture Video", ""} + {FLASH_OFF_LAST_FRAME, 0x0004, RW, "2: turn flash off before last frame in capture state", "Turn flash off before last frame in capture state"} + {VIDEO_AE_ON, 0x0010, RW, "4: AE On in Capture and Video modes", ""} + {VIDEO_AWB_ON, 0x0020, RW, "5: AWB On in Capture and Video mode", ""} + {VIDEO_HG_ON, 0x0040, RW, "6: HG On in Capture and Video mode", ""} +SEQ_CAP_NUMFRAMES = {0x0016, SEQ, 1, 0x00FF, RW, 0x0003, "captureParams.numFrames", "Number of still frames captured"} +SEQ_PREVIEW_0_AE = {0x0017, SEQ, 1, 0x00FF, RW, 0x0000, "previewParEnter.ae", "0-Off;1-Fast;2-Manual;3-Continuous;4-MDR"} +SEQ_PREVIEW_0_FD = {0x0018, SEQ, 1, 0x00FF, RW, 0x0000, "previewParEnter.fd", "0-Off;1-Continuous;2-Manual"} +SEQ_PREVIEW_0_AWB = {0x0019, SEQ, 1, 0x00FF, RW, 0x0000, "previewParEnter.awb", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_0_HG = {0x001A, SEQ, 1, 0x00FF, RW, 0x0000, "previewParEnter.hg", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_0_FLASH = {0x001B, SEQ, 1, 0x00FF, RW, 0x0000, "previewParEnter.flash", "0-Off;1-On;2-Locked;3-AutoEvaluate;7-User defined"} + {FLASH_CONFIG, 0x007F, RW, "0-6: Flash Configuration", ""} + {BIT_7, 0x0080, RW, "7: Reserved", ""} +SEQ_PREVIEW_0_SKIPFRAME = {0x001C, SEQ, 1, 0x00FF, RW, 0x0040, "previewParEnter.skipframe", ""} + {SKIP_LED_ON, 0x0020, RW, "5: Skip 1st when LED On", ""} + {SKIP_STATE, 0x0040, RW, "6: Skip State", ""} + {TURN_OFF_FEN, 0x0080, RW, "7: Turn off fen", ""} +SEQ_PREVIEW_1_AE = {0x001D, SEQ, 1, 0x00FF, RW, 0x0003, "previewPar.ae", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_1_FD = {0x001E, SEQ, 1, 0x00FF, RW, 0x0002, "previewPar.fd", "0-Off;1-Continuous;2-Manual"} +SEQ_PREVIEW_1_AWB = {0x001F, SEQ, 1, 0x00FF, RW, 0x0003, "previewPar.awb", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_1_HG = {0x0020, SEQ, 1, 0x00FF, RW, 0x0003, "previewPar.hg", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_1_FLASH = {0x0021, SEQ, 1, 0x00FF, RW, 0x0000, "previewPar.flash", "0-Off;1-On;2-Locked;3-AutoEvaluate;7-User defined"} + {FLASH_CONFIG, 0x007F, RW, "0-6: Flash Configuration", ""} + {BIT_7, 0x0080, RW, "7: Reserved", ""} +SEQ_PREVIEW_1_SKIPFRAME = {0x0022, SEQ, 1, 0x00FF, RW, 0x0000, "previewPar.skipframe", ""} + {SKIP_LED_ON, 0x0020, RW, "5: Skip 1st when LED On", ""} + {SKIP_STATE, 0x0040, RW, "6: Skip State", ""} + {TURN_OFF_FEN, 0x0080, RW, "7: Turn off fen", ""} +SEQ_PREVIEW_2_AE = {0x0023, SEQ, 1, 0x00FF, RW, 0x0004, "previewParLeave.ae", "0-Off;1-Fast;2-Manual;3-Continuous;4-MDR"} +SEQ_PREVIEW_2_FD = {0x0024, SEQ, 1, 0x00FF, RW, 0x0000, "previewParLeave.fd", "0-Off;1-Continuous;2-Manual"} +SEQ_PREVIEW_2_AWB = {0x0025, SEQ, 1, 0x00FF, RW, 0x0001, "previewParLeave.awb", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_2_HG = {0x0026, SEQ, 1, 0x00FF, RW, 0x0001, "previewParLeave.hg", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_2_FLASH = {0x0027, SEQ, 1, 0x00FF, RW, 0x0000, "previewParLeave.flash", "0-Off;1-On;2-Locked;3-AutoEvaluate;7-User defined"} + {FLASH_CONFIG, 0x007F, RW, "0-6: Flash Configuration", ""} + {BIT_7, 0x0080, RW, "7: Reserved", ""} +SEQ_PREVIEW_2_SKIPFRAME = {0x0028, SEQ, 1, 0x00FF, RW, 0x0010, "previewParLeave.skipframe", ""} + {BIT_4, 0x0010, RW, "4: Reserved", ""} + {SKIP_LED_ON, 0x0020, RW, "5: Skip 1st when LED On", ""} + {SKIP_STATE, 0x0040, RW, "6: Skip State", ""} + {TURN_OFF_FEN, 0x0080, RW, "7: Turn off fen", ""} +SEQ_PREVIEW_3_AE = {0x0029, SEQ, 1, 0x00FF, RW, 0x0000, "capParEnter.ae", "0-Off;1-Fast;2-Manual;3-Continuous;4-MDR"} +SEQ_PREVIEW_3_FD = {0x002A, SEQ, 1, 0x00FF, RW, 0x0000, "capParEnter.fd", "0-Off;1-Continuous;2-Manual"} +SEQ_PREVIEW_3_AWB = {0x002B, SEQ, 1, 0x00FF, RW, 0x0000, "capParEnter.awb", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_3_HG = {0x002C, SEQ, 1, 0x00FF, RW, 0x0000, "capParEnter.hg", "0-Off;1-Fast;2-Manual;3-Continuous"} +SEQ_PREVIEW_3_FLASH = {0x002D, SEQ, 1, 0x00FF, RW, 0x0000, "capParEnter.flash", "0-Off;1-On;2-Locked;3-AutoEvaluate;7-User defined"} + {FLASH_CONFIG, 0x007F, RW, "0-6: Flash Configuration", ""} + {BIT_7, 0x0080, RW, "7: Reserved", ""} +SEQ_PREVIEW_3_SKIPFRAME = {0x002E, SEQ, 1, 0x00FF, RW, 0x0040, "capParEnter.skipframe", ""} + {SKIP_LED_ON, 0x0020, RW, "5: Skip 1st when LED On", ""} + {SKIP_STATE, 0x0040, RW, "6: Skip State", ""} + {TURN_OFF_FEN, 0x0080, RW, "7: Turn off fen", ""} +RESERVED_SEQ_2F = {0x002F, SEQ, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_30 = {0x0030, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_32 = {0x0032, SEQ, 1, 0xFFFF, RW, 0x0338, "Reserved", ""} +RESERVED_SEQ_34 = {0x0034, SEQ, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_35 = {0x0035, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_37 = {0x0037, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_39 = {0x0039, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_3B = {0x003B, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_3D = {0x003D, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_3F = {0x003F, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_41 = {0x0041, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_43 = {0x0043, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_45 = {0x0045, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_47 = {0x0047, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_49 = {0x0049, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_4B = {0x004B, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_4D = {0x004D, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_4F = {0x004F, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_51 = {0x0051, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_53 = {0x0053, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_55 = {0x0055, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_57 = {0x0057, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SEQ_59 = {0x0059, SEQ, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_00 = {0x0000, AE, 1, 0xFFFF, RW, 0xE6FD, "Reserved", ""} +AE_WINDOW_POS = {0x0002, AE, 1, 0x00FF, RW, 0x0022, "windowPos", "Y0 and X0 (1/16 frame size)"} + {AE_X0, 0x000F, RW, "0-3: X0", ""} + {AE_Y0, 0x00F0, RW, "4-7: Y0", ""} +AE_WINDOW_SIZE = {0x0003, AE, 1, 0x00FF, RW, 0x00BB, "windowSize", "Height and Width"} + {AE_WIDTH, 0x000F, RW, "0-3: width", ""} + {AE_HEIGHT, 0x00F0, RW, "4-7: height", ""} +RESERVED_AE_04 = {0x0004, AE, 1, 0xFFFF, RW, 0x0215, "Reserved", ""} +RESERVED_AE_06 = {0x0006, AE, 1, 0x00FF, RW, 0x0032, "Reserved", ""} +AE_GATE = {0x0007, AE, 1, 0x00FF, RW, 0x000A, "Gate.", "AE sensitivity"} +RESERVED_AE_08 = {0x0008, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_09 = {0x0009, AE, 1, 0x00FF, RW, 0x0002, "Reserved", ""} +RESERVED_AE_0A = {0x000A, AE, 1, 0x00FF, RW, 0x0008, "Reserved", ""} +AE_MIN_INDEX = {0x000B, AE, 1, 0x00FF, RW, 0x0000, "minIndex", ""} +AE_MAX_INDEX = {0x000C, AE, 1, 0x00FF, RW, 0x0018, "maxIndex", "Max allowed zone number"} +AE_MIN_VIRTGAIN = {0x000D, AE, 1, 0x00FF, RW, 0x0010, "minVirtGain", "Min allowed virtual gain"} +AE_MAX_VIRTGAIN = {0x000E, AE, 1, 0x00FF, RW, 0x0080, "maxVirtGain", "Max allowed virtual gain"} +RESERVED_AE_0F = {0x000F, AE, 1, 0x00FF, RW, 0x000D, "Reserved", ""} +RESERVED_AE_10 = {0x0010, AE, 1, 0x00FF, RW, 0x000B, "Reserved", ""} +RESERVED_AE_11 = {0x0011, AE, 1, 0x00FF, RW, 0x0007, "Reserved", ""} +RESERVED_AE_12 = {0x0012, AE, 1, 0xFFFF, RW, 0x0080, "Reserved", ""} +RESERVED_AE_14 = {0x0014, AE, 1, 0x00FF, RW, 0x0020, "Reserved", ""} +RESERVED_AE_15 = {0x0015, AE, 1, 0x00FF, RW, 0x0008, "Reserved", ""} +RESERVED_AE_16 = {0x0016, AE, 1, 0x00FF, RW, 0x0078, "Reserved", ""} +AE_STATUS = {0x0017, AE, 1, 0x00FF, RO, 0x0084, "status", ""} + {BIT_0, 0x0001, RW, "0: Reserved", ""} + {R9_CHANGED, 0x0002, RW, "1: R9 changed", "1- Need to skip frame"} + {READY, 0x0004, RW, "2: Ready", ""} +AE_CURRENT_Y = {0x0018, AE, 1, 0x00FF, RO, 0x0000, "CurrentY", "Last measured luminance"} +AE_R12 = {0x0019, AE, 1, 0xFFFF, RO, 0x0279, "R12", "Current shutter delay value"} +AE_INDEX = {0x001B, AE, 1, 0x00FF, RO, 0x0004, "Index", "Current zone - integration time"} +AE_VIRTGAIN = {0x001C, AE, 1, 0x00FF, RO, 0x0010, "VirtGain", ""} +RESERVED_AE_1D = {0x001D, AE, 1, 0x00FF, RW, 0x000B, "Reserved", ""} +RESERVED_AE_1E = {0x001E, AE, 1, 0x00FF, RW, 0x0009, "Reserved", ""} +RESERVED_AE_1F = {0x001F, AE, 1, 0xFFFF, RW, 0x0080, "Reserved", ""} +RESERVED_AE_21 = {0x0021, AE, 1, 0x00FF, RW, 0x0020, "Reserved", ""} +AE_R9 = {0x0022, AE, 1, 0xFFFF, RO, 0x0010, "R9", "Current R9:0 value"} +RESERVED_AE_24 = {0x0024, AE, 1, 0xFFFF, RW, 0x070D, "Reserved", ""} +RESERVED_AE_26 = {0x0026, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_28 = {0x0028, AE, 1, 0x00FF, RW, 0x0080, "Reserved", ""} +RESERVED_AE_29 = {0x0029, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_2A = {0x002A, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_2C = {0x002C, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +AE_R9_STEP = {0x002D, AE, 1, 0xFFFF, RW, 0x009D, "R9_step", "Integration time of one zone"} +RESERVED_AE_2F = {0x002F, AE, 1, 0x00FF, RW, 0x0002, "Reserved", ""} +RESERVED_AE_30 = {0x0030, AE, 1, 0x00FF, RW, 0x000A, "Reserved", ""} +RESERVED_AE_31 = {0x0031, AE, 1, 0xFFFF, RW, 0x0010, "Reserved", ""} +RESERVED_AE_33 = {0x0033, AE, 1, 0xFFFF, RW, 0x0010, "Reserved", ""} +RESERVED_AE_35 = {0x0035, AE, 1, 0xFFFF, RW, 0x0010, "Reserved", ""} +RESERVED_AE_37 = {0x0037, AE, 1, 0xFFFF, RW, 0x0080, "Reserved", ""} +RESERVED_AE_39 = {0x0039, AE, 1, 0xFFFF, RW, 0x03C0, "Reserved", ""} +RESERVED_AE_3B = {0x003B, AE, 1, 0xFFFF, RW, 0x0C00, "Reserved", ""} +RESERVED_AE_3D = {0x003D, AE, 1, 0x00FF, RW, 0x000A, "Reserved", ""} +RESERVED_AE_3E = {0x003E, AE, 1, 0x00FF, RW, 0x000E, "Reserved", ""} +RESERVED_AE_3F = {0x003F, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_40 = {0x0040, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_42 = {0x0042, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_44 = {0x0044, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_45 = {0x0045, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_47 = {0x0047, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_49 = {0x0049, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +AE_TARGETMIN = {0x004A, AE, 1, 0x00FF, RW, 0x0000, "TargetMin", ""} +AE_TARGETMAX = {0x004B, AE, 1, 0x00FF, RW, 0x0000, "TargetMax", ""} +AE_TARGETBUFFERSPEED = {0x004C, AE, 1, 0x00FF, RW, 0x0000, "TargetBufferSpeed", ""} +RESERVED_AE_4D = {0x004D, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +AE_BASETARGET = {0x004F, AE, 1, 0x00FF, RW, 0x0020, "Exposure BaseTarget", "Values >64 may cause oscillation"} +RESERVED_AE_50 = {0x0050, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_52 = {0x0052, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_54 = {0x0054, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_55 = {0x0055, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_56 = {0x0056, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +AE_EXPCOMPCENTER = {0x0057, AE, 1, 0xFFFF, RW, 0x0000, "Exposure Correction Center", ""} +AE_EXPCOMPLOWLIGHT = {0x0059, AE, 1, 0x00FF, RW, 0x0000, "ExpCompLowLight", ""} +AE_EXPCOMPBRIGHTLIGHT = {0x005A, AE, 1, 0x00FF, RW, 0x0000, "ExpCompBrightLight", ""} +RESERVED_AE_5B = {0x005B, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_5C = {0x005C, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_5D = {0x005D, AE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_5F = {0x005F, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_60 = {0x0060, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AE_61 = {0x0061, AE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AWB_00 = {0x0000, AWB, 1, 0xFFFF, RW, 0xE7A3, "Reserved", ""} +AWB_WINDOW_POS = {0x0002, AWB, 1, 0x00FF, RW, 0x0000, "windowPos", "Y0 and X0"} + {X0, 0x000F, RW, "0-3: X0", ""} + {Y0, 0x00F0, RW, "4-7: Y0", ""} +AWB_WINDOW_SIZE = {0x0003, AWB, 1, 0x00FF, RW, 0x00EF, "windowSize", "Height and width"} + {WIDTH, 0x000F, RW, "0-3: Width", ""} + {HEIGHT, 0x00F0, RW, "4-7: Height", ""} +RESERVED_AWB_04 = {0x0004, AWB, 1, 0xFFFF, RW, 0x023C, "Reserved", ""} +AWB_CCM_L_0 = {0x0006, AWB, 1, 0xFFFF, RW, 0x01B3, "ccmL[0]", "Left CCM K11"} +AWB_CCM_L_1 = {0x0008, AWB, 1, 0xFFFF, RW, 0xFF1A, "ccmL[1]", "Left CCM K12"} +AWB_CCM_L_2 = {0x000A, AWB, 1, 0xFFFF, RW, 0x0033, "ccmL[2]", "Left CCM K13"} +AWB_CCM_L_3 = {0x000C, AWB, 1, 0xFFFF, RW, 0xFF8D, "ccmL[3]", "Left CCM K21"} +AWB_CCM_L_4 = {0x000E, AWB, 1, 0xFFFF, RW, 0x0200, "ccmL[4]", "Left CCM K22"} +AWB_CCM_L_5 = {0x0010, AWB, 1, 0xFFFF, RW, 0xFF73, "ccmL[5]", "Left CCM K23"} +AWB_CCM_L_6 = {0x0012, AWB, 1, 0xFFFF, RW, 0xFF9A, "ccmL[6]", "Left CCM K31"} +AWB_CCM_L_7 = {0x0014, AWB, 1, 0xFFFF, RW, 0xFD1A, "ccmL[7]", "Left CCM K32"} +AWB_CCM_L_8 = {0x0016, AWB, 1, 0xFFFF, RW, 0x024D, "ccmL[8]", "Left CCM K33"} +AWB_CCM_L_9 = {0x0018, AWB, 1, 0xFFFF, RW, 0x001C, "ccmL[9]", "Left CCM Red/Green gain"} +AWB_CCM_L_10 = {0x001A, AWB, 1, 0xFFFF, RW, 0x003A, "ccmL[10]", "Left CCM Blue/Green gain"} +AWB_CCM_RL_0 = {0x001C, AWB, 1, 0xFFFF, RW, 0x000D, "ccmRL[0]", "Delta CCM D11"} +AWB_CCM_RL_1 = {0x001E, AWB, 1, 0xFFFF, RW, 0x0033, "ccmRL[1]", "Delta CCM D12"} +AWB_CCM_RL_2 = {0x0020, AWB, 1, 0xFFFF, RW, 0xFFDA, "ccmRL[2]", "Delta CCM D13"} +AWB_CCM_RL_3 = {0x0022, AWB, 1, 0xFFFF, RW, 0x000D, "ccmRL[3]", "Delta CCM D21"} +AWB_CCM_RL_4 = {0x0024, AWB, 1, 0xFFFF, RW, 0xFFCD, "ccmRL[4]", "Delta CCM D22"} +AWB_CCM_RL_5 = {0x0026, AWB, 1, 0xFFFF, RW, 0x0026, "ccmRL[5]", "Delta CCM D23"} +AWB_CCM_RL_6 = {0x0028, AWB, 1, 0xFFFF, RW, 0x004D, "ccmRL[6]", "Delta CCM D31"} +AWB_CCM_RL_7 = {0x002A, AWB, 1, 0xFFFF, RW, 0x001A, "ccmRL[7]", "Delta CCM D32"} +AWB_CCM_RL_8 = {0x002C, AWB, 1, 0xFFFF, RW, 0x009A, "ccmRL[8]", "Delta CCM D33"} +AWB_CCM_RL_9 = {0x002E, AWB, 1, 0xFFFF, RW, 0x000C, "ccmRL[9]", "Delta CCM Red/Green gain"} +AWB_CCM_RL_10 = {0x0030, AWB, 1, 0xFFFF, RW, 0xFFEC, "ccmRL[10]", "Delta CCM Blue/Green gain"} +AWB_CCM_0 = {0x0032, AWB, 1, 0xFFFF, RW, 0x01BA, "ccm[0]", "Current CCM C11"} +AWB_CCM_1 = {0x0034, AWB, 1, 0xFFFF, RW, 0xFF5B, "ccm[1]", "Current CCM C12"} +AWB_CCM_2 = {0x0036, AWB, 1, 0xFFFF, RW, 0xFFF1, "ccm[2]", "Current CCM C13"} +AWB_CCM_3 = {0x0038, AWB, 1, 0xFFFF, RW, 0xFFC7, "ccm[3]", "Current CCM C21"} +AWB_CCM_4 = {0x003A, AWB, 1, 0xFFFF, RW, 0x01B9, "ccm[4]", "Current CCM C22"} +AWB_CCM_5 = {0x003C, AWB, 1, 0xFFFF, RW, 0xFF87, "ccm[5]", "Current CCM C23"} +AWB_CCM_6 = {0x003E, AWB, 1, 0xFFFF, RW, 0xFFF9, "ccm[6]", "Current CCM C31"} +AWB_CCM_7 = {0x0040, AWB, 1, 0xFFFF, RW, 0xFF32, "ccm[7]", "Current CCM C32"} +AWB_CCM_8 = {0x0042, AWB, 1, 0xFFFF, RW, 0x01DC, "ccm[8]", "Current CCM C33"} +AWB_CCM_9 = {0x0044, AWB, 1, 0xFFFF, RW, 0x003C, "ccm[9]", "Current CCM Red/Green gain"} +AWB_CCM_10 = {0x0046, AWB, 1, 0xFFFF, RW, 0x002B, "ccm[10]", "Current CCM Blue/Green gain"} +AWB_GAIN_BUFFER_SPEED = {0x0048, AWB, 1, 0x00FF, RW, 0x0008, "GainBufferSpeed", "32=fastest; 1=slowest"} +AWB_JUMP_DIVISOR = {0x0049, AWB, 1, 0x00FF, RW, 0x0002, "JumpDivisor", "1=fastest"} +AWB_GAIN_MIN = {0x004A, AWB, 1, 0x00FF, RW, 0x0059, "GainMin_R", "Min AWB digital red gain"} +AWB_GAIN_MAX = {0x004B, AWB, 1, 0x00FF, RW, 0x00A6, "GainMax_R", "Max allowed digital red gain"} +AWB_GAINMIN_B = {0x004C, AWB, 1, 0x00FF, RW, 0x0059, "GainMin_B", "Min AWB digital gain"} +AWB_GAINMAX_B = {0x004D, AWB, 1, 0x00FF, RW, 0x00A6, "GainMax_B", "Max allowed digital gain"} +AWB_GAIN_R = {0x004E, AWB, 1, 0x00FF, RW, 0x0080, "GainR", "Current R digital gain"} +AWB_GAIN_G = {0x004F, AWB, 1, 0x00FF, RW, 0x0080, "GainG", "Current G digital gain"} +AWB_GAIN_B = {0x0050, AWB, 1, 0x00FF, RW, 0x0080, "GainB", "Current B digital gain"} +AWB_CCM_POSITION_MIN = {0x0051, AWB, 1, 0x00FF, RW, 0x0000, "CCMpositionMin", "leftmost - incandescent"} +AWB_CCM_POSITION_MAX = {0x0052, AWB, 1, 0x00FF, RW, 0x007F, "CCMpositionMax", "rightmost - daylight"} +AWB_CCM_POSITION = {0x0053, AWB, 1, 0x00FF, RW, 0x0040, "CCMposition", "0=incandescent 127=daylight"} +AWB_SATURATION = {0x0054, AWB, 1, 0x00FF, RW, 0x0080, "saturation", "128=100%"} +AWB_MODE = {0x0055, AWB, 1, 0x00FF, RW, 0x0000, "mode", ""} + {BIT_0, 0x0001, RW, "0: Reserved", ""} + {BIT_1, 0x0002, RW, "1: Reserved", ""} + {BIT_2, 0x0004, RW, "2: Reserved", ""} + {BIT_3, 0x0008, RW, "3: Reserved", ""} + {BIT_4, 0x0010, RW, "4: Reserved", ""} + {FORCE_UNIT_DGAINS, 0x0020, RW, "5: Force unit gains", ""} + {NORMCCM_OFF, 0x0040, RW, "6: normccm_off", ""} +AWB_GAINR_BUF = {0x0056, AWB, 1, 0xFFFF, RW, 0x0000, "GainR_buf", "Time-buffered R gain"} +AWB_GAINB_BUF = {0x0058, AWB, 1, 0xFFFF, RW, 0x0000, "GainB_buf", "Time-buffered B gain"} +RESERVED_AWB_5A = {0x005A, AWB, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AWB_5B = {0x005B, AWB, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_AWB_5C = {0x005C, AWB, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +AWB_STEADY_BGAIN_OUT_MIN = {0x005D, AWB, 1, 0x00FF, RW, 0x0078, "steadyBGainOutMin", ""} +AWB_STEADY_BGAIN_OUT_MAX = {0x005E, AWB, 1, 0x00FF, RW, 0x0086, "steadyBGainOutMax", ""} +AWB_STEADY_BGAIN_IN_MIN = {0x005F, AWB, 1, 0x00FF, RW, 0x007E, "steadyBGainInMin", ""} +AWB_STEADY_BGAIN_IN_MAX = {0x0060, AWB, 1, 0x00FF, RW, 0x0082, "steadyBGainInMax", ""} +RESERVED_AWB_61 = {0x0061, AWB, 1, 0xFFFF, RW, 0x0040, "Reserved", ""} +RESERVED_AWB_63 = {0x0063, AWB, 1, 0x00FF, RW, 0x00D2, "Reserved", ""} +RESERVED_AWB_64 = {0x0064, AWB, 1, 0x00FF, RW, 0x00F6, "Reserved", ""} +AWB_X0 = {0x0065, AWB, 1, 0x00FF, RW, 0x0010, "X0", ""} +AWB_KR_L = {0x0066, AWB, 1, 0x00FF, RW, 0x00AA, "kR_L", ""} +AWB_KG_L = {0x0067, AWB, 1, 0x00FF, RW, 0x0096, "kG_L", ""} +AWB_KB_L = {0x0068, AWB, 1, 0x00FF, RW, 0x0080, "kB_L", ""} +AWB_KR_R = {0x0069, AWB, 1, 0x00FF, RW, 0x0091, "kR_R", ""} +AWB_KG_R = {0x006A, AWB, 1, 0x00FF, RW, 0x0082, "kG_R", ""} +AWB_KB_R = {0x006B, AWB, 1, 0x00FF, RW, 0x0082, "kB_R", ""} +RESERVED_AWB_6C = {0x006C, AWB, 1, 0x00FF, RW, 0x0018, "Reserved", ""} +RESERVED_AWB_6D = {0x006D, AWB, 1, 0x00FF, RW, 0x0008, "Reserved", ""} +RESERVED_AWB_6E = {0x006E, AWB, 1, 0x00FF, RW, 0x0018, "Reserved", ""} +RESERVED_FD_00 = {0x0000, FD, 1, 0xFFFF, RW, 0xE824, "Reserved", ""} +FD_WINDOW_POSH = {0x0002, FD, 1, 0x00FF, RW, 0x001D, "windowPosH", ""} + {WIDTH, 0x000F, RW, "0-3: width", ""} + {X0, 0x00F0, RW, "4-7: x0", ""} +FD_WINDOW_HEIGHT = {0x0003, FD, 1, 0x00FF, RW, 0x0004, "windowHeight", ""} + {FD_B24, 0x003F, RW, "0-5: flicker measurement window height in rows", ""} +FD_MODE = {0x0004, FD, 1, 0x00FF, RW, 0x0000, "mode", ""} + {BITS_0_3, 0x000F, RO, "0-3: Reserved", ""} + {BIT_4, 0x0010, RW, "4: Reserved", ""} + {CURR_FLICKER_STATE, 0x0020, RO, "5: Current Flicker State", "0=60Hz 1=50Hz"} + {CURR_SETTINGS, 0x0040, RW, "6: Manual Flicker Mode Setting", "0=60Hz 1=50Hz"} + {MANUAL_MODE, 0x0080, RW, "7: Manual Mode", "0=disable 1=enable"} +RESERVED_FD_05 = {0x0005, FD, 1, 0xFFFF, RW, 0x0040, "Reserved", ""} +RESERVED_FD_07 = {0x0007, FD, 1, 0x00FF, RW, 0x0005, "Reserved", ""} +FD_SEARCH_F1_50 = {0x0008, FD, 1, 0x00FF, RW, 0x001E, "search_f1_50", ""} +FD_SEARCH_F2_50 = {0x0009, FD, 1, 0x00FF, RW, 0x0020, "search_f2_50", ""} +FD_SEARCH_F1_60 = {0x000A, FD, 1, 0x00FF, RW, 0x0025, "search_f1_60", ""} +FD_SEARCH_F2_60 = {0x000B, FD, 1, 0x00FF, RW, 0x0027, "search_f2_60", ""} +RESERVED_FD_0C = {0x000C, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +FD_STAT_MIN = {0x000D, FD, 1, 0x00FF, RW, 0x0003, "stat_min", ""} +FD_STAT_MAX = {0x000E, FD, 1, 0x00FF, RW, 0x0005, "stat_max", ""} +RESERVED_FD_0F = {0x000F, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +FD_MIN_AMPLITUDE = {0x0010, FD, 1, 0x00FF, RW, 0x0005, "minAmplitude", ""} +FD_R9_STEP_F60_A = {0x0011, FD, 1, 0xFFFF, RW, 0x009D, "R9_step_0_f60", ""} +FD_R9_STEP_F50_A = {0x0013, FD, 1, 0xFFFF, RW, 0x00BC, "R9_step_0_f50", ""} +FD_R9_STEP_F60_B = {0x0015, FD, 1, 0xFFFF, RW, 0x0000, "R9_step_1_f60", ""} +FD_R9_STEP_F50_B = {0x0017, FD, 1, 0xFFFF, RW, 0x00E0, "R9_step_1_f50", ""} +RESERVED_FD_19 = {0x0019, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_1A = {0x001A, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_1B = {0x001B, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_1C = {0x001C, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_1D = {0x001D, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_1E = {0x001E, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_1F = {0x001F, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_20 = {0x0020, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_21 = {0x0021, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_22 = {0x0022, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_23 = {0x0023, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_24 = {0x0024, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_25 = {0x0025, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_26 = {0x0026, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_27 = {0x0027, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_28 = {0x0028, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_29 = {0x0029, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_2A = {0x002A, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_2B = {0x002B, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_2C = {0x002C, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_2D = {0x002D, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_2E = {0x002E, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_2F = {0x002F, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_30 = {0x0030, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_31 = {0x0031, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_32 = {0x0032, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_33 = {0x0033, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_34 = {0x0034, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_35 = {0x0035, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_36 = {0x0036, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_37 = {0x0037, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_38 = {0x0038, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_39 = {0x0039, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_3A = {0x003A, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_3B = {0x003B, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_3C = {0x003C, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_3D = {0x003D, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_3E = {0x003E, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_3F = {0x003F, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_40 = {0x0040, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_41 = {0x0041, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_42 = {0x0042, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_43 = {0x0043, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_44 = {0x0044, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_45 = {0x0045, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_46 = {0x0046, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_47 = {0x0047, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_FD_48 = {0x0048, FD, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_MODE_00 = {0x0000, MODE, 1, 0xFFFF, RW, 0xE86E, "Reserved", ""} +RESERVED_MODE_02 = {0x0002, MODE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +MODE_OUTPUT_WIDTH_A = {0x0003, MODE, 1, 0xFFFF, RW, 0x0140, "Output Width A", ""} +MODE_OUTPUT_HEIGHT_A = {0x0005, MODE, 1, 0xFFFF, RW, 0x00F0, "Output Height A", ""} +MODE_OUTPUT_WIDTH_B = {0x0007, MODE, 1, 0xFFFF, RW, 0x0280, "Output Width B", ""} +MODE_OUTPUT_HEIGHT_B = {0x0009, MODE, 1, 0xFFFF, RW, 0x01E0, "Output Height B", ""} +RESERVED_MODE_0B = {0x000B, MODE, 1, 0xFFFF, RW, 0x00C8, "Reserved", ""} +MODE_SENSOR_ROW_START_A = {0x000D, MODE, 1, 0xFFFF, RW, 0x0000, "sensor_row_start_A", ""} +MODE_SENSOR_COL_START_A = {0x000F, MODE, 1, 0xFFFF, RW, 0x0000, "sensor_col_start_A", ""} +MODE_SENSOR_ROW_END_A = {0x0011, MODE, 1, 0xFFFF, RW, 0x01E7, "sensor_row_end_A", ""} +MODE_SENSOR_COL_END_A = {0x0013, MODE, 1, 0xFFFF, RW, 0x0287, "sensor_col_end_A", ""} +MODE_SENSOR_ROW_SPEED_A = {0x0015, MODE, 1, 0xFFFF, RW, 0x0111, "sensor_row_speed_A", ""} + {PIXCLK_SPEED, 0x0007, RW, "0-2: Pixel clock speed in mclk periods", "1ADC: Pclk = 2 mclks* bits[0:2]; 2ADC: bits[0:2]"} + {BIT_3, 0x0008, RW, "3: Reserved", ""} + {BITS_4_7, 0x00F0, RW, "4-7: Reserved", ""} + {BITS_8_9, 0x0300, RW, "8-9: Reserved", ""} + {BITS_13_15, 0xE000, RW, "13-15: Reserved", ""} +MODE_SENSOR_READ_MODE_A = {0x0017, MODE, 1, 0xFFFF, RW, 0x0424, "Read Mode A", ""} + {HORIZ_MIRROR, 0x0001, RW, "0: Horizontal Mirror", ""} + {VERT_FLIP, 0x0002, RW, "1: Vertical Flip", ""} + {Y_ODD_INC, 0x001C, RW, "2-4: Y odd increment", ""} + {X_ODD_INC, 0x00E0, RW, "5-7: X odd increment", ""} + {MODE_SENSOR_READ_MODE_A_LOW_POWER_ENABLE, 0x0200, RW, "9: Enable/Disable Low Power Mode", ""} + {XY_BIN_EN, 0x0400, RW, "10: xy bin enable", ""} + {X_BIN_EN, 0x0800, RW, "11: x bin enable", ""} +MODE_SENSOR_FINE_CORRECTION_A = {0x0019, MODE, 1, 0xFFFF, RW, 0x007B, "sensor_fine_correction_A", ""} +MODE_SENSOR_FINE_IT_MIN_A = {0x001B, MODE, 1, 0xFFFF, RW, 0x0408, "sensor_fine_IT_min_A", ""} +MODE_SENSOR_FINE_IT_MAX_MARGIN_A = {0x001D, MODE, 1, 0xFFFF, RW, 0x00AB, "sensor_fine_IT_max_margin_A", ""} +MODE_SENSOR_FRAME_LENGTH_A = {0x001F, MODE, 1, 0xFFFF, RW, 0x0293, "sensor_frameLengthLines_A", ""} +MODE_SENSOR_LINE_LENGTH_PCK_A = {0x0021, MODE, 1, 0xFFFF, RW, 0x07D0, "sensor_lineLengthPck:_A", ""} +MODE_SENSOR_ROW_START_B = {0x0023, MODE, 1, 0xFFFF, RW, 0x0000, "sensor_row_start_B", ""} +MODE_SENSOR_COL_START_B = {0x0025, MODE, 1, 0xFFFF, RW, 0x0000, "sensor_col_start_B", ""} +MODE_SENSOR_ROW_END_B = {0x0027, MODE, 1, 0xFFFF, RW, 0x01E7, "sensor_row_end_B", ""} +MODE_SENSOR_COL_END_B = {0x0029, MODE, 1, 0xFFFF, RW, 0x0287, "sensor_col_end_B", ""} +MODE_SENSOR_ROW_SPEED_B = {0x002B, MODE, 1, 0xFFFF, RW, 0x2111, "sensor_row_speed_B", ""} + {PIXCLK_SPEED, 0x0007, RW, "0-2: Pixel clock speed in mclk periods", "1ADC: Pclk = 2 mclks* bits[0:2]; 2ADC: bits[0:2]"} + {BIT_3, 0x0008, RW, "3: Reserved", ""} + {BITS_4_7, 0x00F0, RW, "4-7: Reserved", ""} + {BITS_8_9, 0x0300, RW, "8-9: Reserved", ""} + {BITS_13_15, 0xE000, RW, "13-15: Reserved", ""} +MODE_SENSOR_READ_MODE_B = {0x002D, MODE, 1, 0xFFFF, RW, 0x0024, "Read Mode B", ""} + {HORIZ_MIRROR, 0x0001, RW, "0: Horizontal Mirror", ""} + {VERT_FLIP, 0x0002, RW, "1: Vertical Flip", ""} + {Y_ODD_INC, 0x001C, RW, "2-4: Y odd increment", ""} + {X_ODD_INC, 0x00E0, RW, "5-7: X odd increment", ""} + {MODE_SENSOR_READ_MODE_B_LOW_POWER_MODE, 0x0200, RW, "9: Enable/Disable Low Power Mode", ""} + {XY_BIN_EN, 0x0400, RW, "10: xy bin enable", ""} + {X_BIN_EN, 0x0800, RW, "11: x bin enable", ""} +MODE_SENSOR_FINE_CORRECTION_B = {0x002F, MODE, 1, 0xFFFF, RW, 0x00A4, "sensor_fine_correction_B", ""} +MODE_SENSOR_FINE_IT_MIN_B = {0x0031, MODE, 1, 0xFFFF, RW, 0x0408, "sensor_fine_IT_min_B", ""} +MODE_SENSOR_FINE_IT_MAX_MARGIN_B = {0x0033, MODE, 1, 0xFFFF, RW, 0x00A4, "sensor_fine_IT_max_margin_B", ""} +MODE_SENSOR_FRAME_LENGTH_B = {0x0035, MODE, 1, 0xFFFF, RW, 0x04ED, "sensor_frameLengthLines_B", ""} +MODE_SENSOR_LINE_LENGTH_PCK_B = {0x0037, MODE, 1, 0xFFFF, RW, 0x0D06, "sensor_lineLengthPck:_B", ""} +MODE_CROP_X0_A = {0x0039, MODE, 1, 0xFFFF, RW, 0x0000, "crop_X0_A", ""} +MODE_CROP_X1_A = {0x003B, MODE, 1, 0xFFFF, RW, 0x027F, "crop_X1_A", ""} +MODE_CROP_Y0_A = {0x003D, MODE, 1, 0xFFFF, RW, 0x0000, "crop_Y0_A", ""} +MODE_CROP_Y1_A = {0x003F, MODE, 1, 0xFFFF, RW, 0x01DF, "crop_Y1_A", ""} +RESERVED_MODE_41 = {0x0041, MODE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MODE_43 = {0x0043, MODE, 1, 0xFFFF, RW, 0x0800, "Reserved", ""} +RESERVED_MODE_45 = {0x0045, MODE, 1, 0xFFFF, RW, 0x0800, "Reserved", ""} +MODE_CROP_X0_B = {0x0047, MODE, 1, 0xFFFF, RW, 0x0000, "crop_X0_B", ""} +MODE_CROP_X1_B = {0x0049, MODE, 1, 0xFFFF, RW, 0x027F, "crop_X1_B", ""} +MODE_CROP_Y0_B = {0x004B, MODE, 1, 0xFFFF, RW, 0x0000, "crop_Y0_B", ""} +MODE_CROP_Y1_B = {0x004D, MODE, 1, 0xFFFF, RW, 0x01DF, "crop_Y1_B", ""} +RESERVED_MODE_4F = {0x004F, MODE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MODE_51 = {0x0051, MODE, 1, 0xFFFF, RW, 0x0800, "Reserved", ""} +RESERVED_MODE_53 = {0x0053, MODE, 1, 0xFFFF, RW, 0x0800, "Reserved", ""} +MODE_OUTPUT_FORMAT_A = {0x0055, MODE, 1, 0xFFFF, RW, 0x0000, "output_format_A", ""} + {SWAP_CHANNELS, 0x0001, RW, "0: Swap Channels", "swaps Cb Cr in YUV and R B in RGB"} + {SWAP_CHROMINANCE_LUMA, 0x0002, RW, "1: Swaps chrominance byte with luminance byte in YUV output.", ""} + {BAYER_OUT, 0x0004, RW, "2: Progressive Bayer", ""} + {MONOCHROME, 0x0008, RW, "3: Monochrome output", ""} + {CCIR656, 0x0010, RW, "4: Use CCIR656 codes when bypassing FIFO", ""} + {OUTPUT_MODE, 0x0020, RW, "5: RGB/YUV output", "0: YUV; 1: RGB"} + {RGB_FORMAT, 0x00C0, RW, "6-7: RGB output format", "0: 565; 1: 555; 2: 444x; 3: x444"} + {PROCESSED_BAYER, 0x0100, RW, "8: Turn on processed Bayer mode", ""} +MODE_OUTPUT_FORMAT_B = {0x0057, MODE, 1, 0xFFFF, RW, 0x0000, "output_format_B", ""} + {SWAP_CHANNELS, 0x0001, RW, "0: Swap Channels", "swaps Cb Cr in YUV and R B in RGB"} + {SWAP_CHROMINANCE_LUMA, 0x0002, RW, "1: Swaps chrominance byte with luminance byte in YUV output.", ""} + {BAYER_OUT, 0x0004, RW, "2: Progressive Bayer", ""} + {MONOCHROME, 0x0008, RW, "3: Monochrome output", ""} + {CCIR656, 0x0010, RW, "4: Use ITU-R BT.656 codes when bypassing FIFO", ""} + {OUTPUT_MODE, 0x0020, RW, "5: RGB/YUV output", "0: YUV; 1: RGB"} + {RGB_FORMAT, 0x00C0, RW, "6-7: RGB output format", "0: 565; 1: 555; 2: 444x; 3: x444"} + {PROCESSED_BAYER, 0x0100, RW, "8: Turn on processed Bayer mode", ""} +MODE_SPEC_EFFECTS_A = {0x0059, MODE, 1, 0xFFFF, RW, 0x6440, "spec_effects_A", ""} + {SELECTION, 0x0007, RW, "0-2: Special effect selection bits", "1: mono; 2: sepia; 3: negative; 4: solarization 5: solarization w/ UV"} + {DITHER_BITWIDTH, 0x0038, RW, "3-5: Bit width of dither", ""} + {DITHER_LUMA, 0x0040, RW, "6: Dither Luma only", ""} + {SOLARIZATION_THRESH, 0xFF00, RW, "8-15: Solarization threshhold", ""} +MODE_SPEC_EFFECTS_B = {0x005B, MODE, 1, 0xFFFF, RW, 0x6440, "spec_effects_B", ""} + {SELECTION, 0x0007, RW, "0-2: Special effect selection bits", "1: mono; 2: sepia; 3: negative; 4: solarization 5: solarization w/ UV"} + {DITHER_BITWIDTH, 0x0038, RW, "3-5: Bit width of dither", ""} + {DITHER_LUMA, 0x0040, RW, "6: Dither Luma only", ""} + {SOLARIZATION_THRESH, 0xFF00, RW, "8-15: Solarization threshhold", ""} +MODE_Y_RGB_OFFSET_A = {0x005D, MODE, 1, 0x00FF, RW, 0x0000, "y_rgb_offset_A", ""} +MODE_Y_RGB_OFFSET_B = {0x005E, MODE, 1, 0x00FF, RW, 0x0000, "y_rgb_offset_B", ""} +RESERVED_MODE_5F = {0x005F, MODE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_MODE_61 = {0x0061, MODE, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +MODE_COMMONMODESETTINGS_FX_SEPIA_SETTINGS = {0x0063, MODE, 1, 0xFFFF, RW, 0x0000, "CommonModeSettings_FX_Sepia_Settings", ""} +RESERVED_MODE_65 = {0x0065, MODE, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +MODE_COMMONMODESETTINGS_TEST_MODE = {0x0066, MODE, 1, 0x00FF, RW, 0x0000, "CommonModeSettings_Test_Mode", ""} +RESERVED_MODE_67 = {0x0067, MODE, 1, 0x00FF, RW, 0x0001, "Reserved", ""} +RESERVED_HG_00 = {0x0000, HG, 1, 0xFFFF, RW, 0x2480, "Reserved", ""} +RESERVED_HG_02 = {0x0002, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_03 = {0x0003, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +HG_MAX_DLEVEL = {0x0004, HG, 1, 0x00FF, RW, 0x0000, "MaxDarkLevel", ""} +RESERVED_HG_05 = {0x0005, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +HG_PERCENT = {0x0006, HG, 1, 0x00FF, RW, 0x0003, "BlackClipPercent", ""} +RESERVED_HG_07 = {0x0007, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +HG_DLEVEL = {0x0008, HG, 1, 0x00FF, RW, 0x0000, "DarkLevel", ""} +RESERVED_HG_09 = {0x0009, HG, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_0B = {0x000B, HG, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_0D = {0x000D, HG, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_0F = {0x000F, HG, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_11 = {0x0011, HG, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_13 = {0x0013, HG, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_15 = {0x0015, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_16 = {0x0016, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_17 = {0x0017, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_18 = {0x0018, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_19 = {0x0019, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_1A = {0x001A, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +HG_BRIGHTNESSMETRIC = {0x001B, HG, 1, 0xFFFF, RW, 0x0000, "BrightnessMetric", ""} +RESERVED_HG_1D = {0x001D, HG, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_1F = {0x001F, HG, 1, 0x00FF, RW, 0x00E0, "Reserved", ""} +RESERVED_HG_20 = {0x0020, HG, 1, 0x00FF, RW, 0x0043, "Reserved", ""} +RESERVED_HG_21 = {0x0021, HG, 1, 0x00FF, RW, 0x0008, "Reserved", ""} +RESERVED_HG_22 = {0x0022, HG, 1, 0x00FF, RW, 0x0002, "Reserved", ""} +RESERVED_HG_23 = {0x0023, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_24 = {0x0024, HG, 1, 0x00FF, RW, 0x000C, "Reserved", ""} +RESERVED_HG_25 = {0x0025, HG, 1, 0x00FF, RW, 0x0014, "Reserved", ""} +RESERVED_HG_26 = {0x0026, HG, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_HG_27 = {0x0027, HG, 1, 0x00FF, RW, 0x0004, "Reserved", ""} +HG_LL_BRIGHTNESSSTART = {0x0028, HG, 1, 0xFFFF, RW, 0x157C, "LL_BrightnessStart", ""} +HG_LL_BRIGHTNESSSTOP = {0x002A, HG, 1, 0xFFFF, RW, 0x1B58, "LL_BrightnessStop", ""} +RESERVED_HG_2C = {0x002C, HG, 1, 0x00FF, RW, 0x0006, "Reserved", ""} +RESERVED_HG_2D = {0x002D, HG, 1, 0x00FF, RW, 0x000E, "Reserved", ""} +RESERVED_HG_2E = {0x002E, HG, 1, 0x00FF, RW, 0x0006, "Reserved", ""} +RESERVED_HG_2F = {0x002F, HG, 1, 0x00FF, RW, 0x0006, "Reserved", ""} +RESERVED_HG_30 = {0x0030, HG, 1, 0x00FF, RW, 0x001E, "Reserved", ""} +RESERVED_HG_31 = {0x0031, HG, 1, 0x00FF, RW, 0x000E, "Reserved", ""} +RESERVED_HG_32 = {0x0032, HG, 1, 0x00FF, RW, 0x001E, "Reserved", ""} +RESERVED_HG_33 = {0x0033, HG, 1, 0x00FF, RW, 0x001E, "Reserved", ""} +RESERVED_HG_34 = {0x0034, HG, 1, 0x00FF, RW, 0x0008, "Reserved", ""} +RESERVED_HG_35 = {0x0035, HG, 1, 0x00FF, RW, 0x0080, "Reserved", ""} +RESERVED_HG_36 = {0x0036, HG, 1, 0x00FF, RW, 0x0028, "Reserved", ""} +HG_GAMMA_MORPH_CTRL = {0x0037, HG, 1, 0x00FF, RW, 0x0003, "GammaMorphCTRL", ""} + {ENABLE_GAMMAMORPH, 0x0003, RW, "0-1: Gamma Morph Enable", "0=Disable, 1=Use Table A, 2=Use Table B, 3=Auto-Morph between Table A and B based on Brightness Metric"} +HG_GAMMASTARTMORPH = {0x0038, HG, 1, 0xFFFF, RW, 0x157C, "GammaStartMorph", ""} +HG_GAMMASTOPMORPH = {0x003A, HG, 1, 0xFFFF, RW, 0x1B58, "GammaStopMorph", ""} +HG_GAMMA_TABLE_A_0 = {0x003C, HG, 1, 0x00FF, RW, 0x0000, "gamma_table_A_0", ""} +HG_GAMMA_TABLE_A_1 = {0x003D, HG, 1, 0x00FF, RW, 0x001B, "gamma_table_A_1", ""} +HG_GAMMA_TABLE_A_2 = {0x003E, HG, 1, 0x00FF, RW, 0x002E, "gamma_table_A_2", ""} +HG_GAMMA_TABLE_A_3 = {0x003F, HG, 1, 0x00FF, RW, 0x004C, "gamma_table_A_3", ""} +HG_GAMMA_TABLE_A_4 = {0x0040, HG, 1, 0x00FF, RW, 0x0078, "gamma_table_A_4", ""} +HG_GAMMA_TABLE_A_5 = {0x0041, HG, 1, 0x00FF, RW, 0x0098, "gamma_table_A_5", ""} +HG_GAMMA_TABLE_A_6 = {0x0042, HG, 1, 0x00FF, RW, 0x00B0, "gamma_table_A_6", ""} +HG_GAMMA_TABLE_A_7 = {0x0043, HG, 1, 0x00FF, RW, 0x00E8, "gamma_table_A_7", ""} +HG_GAMMA_TABLE_A_8 = {0x0044, HG, 1, 0x00FF, RW, 0x00CF, "gamma_table_A_8", ""} +HG_GAMMA_TABLE_A_9 = {0x0045, HG, 1, 0x00FF, RW, 0x00D9, "gamma_table_A_9", ""} +HG_GAMMA_TABLE_A_10 = {0x0046, HG, 1, 0x00FF, RW, 0x00E1, "gamma_table_A_10", ""} +HG_GAMMA_TABLE_A_11 = {0x0047, HG, 1, 0x00FF, RW, 0x00E8, "gamma_table_A_11", ""} +HG_GAMMA_TABLE_A_12 = {0x0048, HG, 1, 0x00FF, RW, 0x00EE, "gamma_table_A_12", ""} +HG_GAMMA_TABLE_A_13 = {0x0049, HG, 1, 0x00FF, RW, 0x00F2, "gamma_table_A_13", ""} +HG_GAMMA_TABLE_A_14 = {0x004A, HG, 1, 0x00FF, RW, 0x00F6, "gamma_table_A_14", ""} +HG_GAMMA_TABLE_A_15 = {0x004B, HG, 1, 0x00FF, RW, 0x00F9, "gamma_table_A_15", ""} +HG_GAMMA_TABLE_A_16 = {0x004C, HG, 1, 0x00FB, RW, 0x00FB, "gamma_table_A_16", ""} +HG_GAMMA_TABLE_A_17 = {0x004D, HG, 1, 0x00FF, RW, 0x00FD, "gamma_table_A_17", ""} +HG_GAMMA_TABLE_A_18 = {0x004E, HG, 1, 0x00FF, RW, 0x00FF, "gamma_table_A_18", ""} +HG_GAMMA_TABLE_B_0 = {0x004F, HG, 1, 0x00FF, RW, 0x0000, "gamma_table_B_0", ""} +HG_GAMMA_TABLE_B_1 = {0x0050, HG, 1, 0x00FF, RW, 0x000F, "gamma_table_B_1", ""} +HG_GAMMA_TABLE_B_2 = {0x0051, HG, 1, 0x00FF, RW, 0x001A, "gamma_table_B_2", ""} +HG_GAMMA_TABLE_B_3 = {0x0052, HG, 1, 0x00FF, RW, 0x002E, "gamma_table_B_3", ""} +HG_GAMMA_TABLE_B_4 = {0x0053, HG, 1, 0x00FF, RW, 0x0050, "gamma_table_B_4", ""} +HG_GAMMA_TABLE_B_5 = {0x0054, HG, 1, 0x00FF, RW, 0x006A, "gamma_table_B_5", ""} +HG_GAMMA_TABLE_B_6 = {0x0055, HG, 1, 0x00FF, RW, 0x0080, "gamma_table_B_6", ""} +HG_GAMMA_TABLE_B_7 = {0x0056, HG, 1, 0x00FF, RW, 0x0091, "gamma_table_B_7", ""} +HG_GAMMA_TABLE_B_8 = {0x0057, HG, 1, 0x00FF, RW, 0x00A1, "gamma_table_B_8", ""} +HG_GAMMA_TABLE_B_9 = {0x0058, HG, 1, 0x00FF, RW, 0x00AF, "gamma_table_B_9", ""} +HG_GAMMA_TABLE_B_10 = {0x0059, HG, 1, 0x00FF, RW, 0x00BB, "gamma_table_B_10", ""} +HG_GAMMA_TABLE_B_11 = {0x005A, HG, 1, 0x00FF, RW, 0x00C6, "gamma_table_B_11", ""} +HG_GAMMA_TABLE_B_12 = {0x005B, HG, 1, 0x00FF, RW, 0x00D0, "gamma_table_B_12", ""} +HG_GAMMA_TABLE_B_13 = {0x005C, HG, 1, 0x00FF, RW, 0x00D9, "gamma_table_B_13", ""} +HG_GAMMA_TABLE_B_14 = {0x005D, HG, 1, 0x00FF, RW, 0x00E2, "gamma_table_B_14", ""} +HG_GAMMA_TABLE_B_15 = {0x005E, HG, 1, 0x00FF, RW, 0x00EA, "gamma_table_B_15", ""} +HG_GAMMA_TABLE_B_16 = {0x005F, HG, 1, 0x00FF, RW, 0x00F1, "gamma_table_B_16", ""} +HG_GAMMA_TABLE_B_17 = {0x0060, HG, 1, 0x00FF, RW, 0x00F9, "gamma_table_B_17", ""} +HG_GAMMA_TABLE_B_18 = {0x0061, HG, 1, 0x00FF, RW, 0x00FF, "gamma_table_B_18", ""} +RESERVED_SFR_1040 = {0x1040, SFR, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_1042 = {0x1042, SFR, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_1044 = {0x1044, SFR, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_1046 = {0x1046, SFR, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_1048 = {0x1048, SFR, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_104A = {0x104A, SFR, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_104C = {0x104C, SFR, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_104D = {0x104D, SFR, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_104E = {0x104E, SFR, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_104F = {0x104F, SFR, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_1050 = {0x1050, SFR, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +GPIO_DATA = {0x1070, SFR, 1, 0x0300, RW, 0x0000, "GPIO Data", ""} + {GPIO_1_0_DATA, 0x0300, RW, "8-9: GPIO Data", ""} +RESERVED_SFR_1072 = {0x1072, SFR, 1, 0x0300, RW, 0x0000, "Reserved", ""} +GPIO_OUTPUT_SET = {0x1074, SFR, 1, 0x0300, RW, 0x0000, "GPIO Output Set", "(write only)"} + {GPIO_1_0_OUTPUT_SET, 0x0300, RW, "8-9: GPIO Output Set", ""} +GPIO_OUTPUT_CLEAR = {0x1076, SFR, 1, 0x0300, RW, 0x0000, "GPIO Output Clear", "(write only)"} + {GPIO_1_0_OUTPUT_CLEAR, 0x0300, RW, "8-9: GPIO Output Clear", ""} +GPIO_DIR = {0x1078, SFR, 1, 0x0300, RW, 0x0300, "GPIO Direction", "Clear the bit for an output; Set the bit for an input"} + {GPIO_1_0_DIR, 0x0300, RW, "8-9: GPIO Direction", ""} +RESERVED_SFR_107A = {0x107A, SFR, 1, 0x0300, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_107C = {0x107C, SFR, 1, 0x0300, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_107E = {0x107E, SFR, 1, 0x0300, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_10B8 = {0x10B8, SFR, 1, 0x00FF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_10B9 = {0x10B9, SFR, 1, 0x0FFF, RW, 0x0000, "Reserved", ""} +RESERVED_SFR_10BB = {0x10BB, SFR, 1, 0x0FFF, RW, 0x0FFF, "Reserved", ""} +RESERVED_SFR_10FD = {0x10FD, SFR, 1, 0xFFFF, RW, 0x0000, "Reserved", ""} +[END] + diff --git a/build/libraries/camera/ARM7/Makefile b/build/libraries/camera/ARM7/Makefile index 65ea7cf..a6c550a 100644 --- a/build/libraries/camera/ARM7/Makefile +++ b/build/libraries/camera/ARM7/Makefile @@ -29,29 +29,27 @@ TWL_PROC = ARM7 SRCDIR = ../common . SRCS = \ - camera_i2c_common.c \ + camera_i2c.c \ camera_i2c_micron.c \ camera_i2c_sharp.c \ camera_control.c \ -L_SET_FILE := A3AFX_EVT2_20fps_16M_PLLoff_hVGA_070209.set \ - A3AFX_EVT2_30fps_16M_QVGA_070206.set \ - A3AFX_EVT2_20fps_16M_070206.set \ - 320x240_noPLL_20fps_070306.set \ - 320x240_PLL_30fps_070306.set \ - A3AFX_EVT3_30fps_Scaledown_16.7M_50Hz.set \ - A3AFX_EVT3_30fps_Subsampling_16.7M_50Hz.set \ +MICRON_INI_FILE := \ + MT9V113-MTM9-2.ini \ + MT9V113-MTM10.ini \ + MT9V113-nin00.ini \ -L_INI_FILE := MT9V113-MTM9-2.ini +MICRON_CONVERT_EXE := convert_micron.pl -L_SET_CONVERT_EXE := convert_samsung.pl -L_INI_CONVERT_EXE := convert_micron.pl +MICRON_INIC_FILE := $(MICRON_INI_FILE:%.ini=%.autogen.c) -L_SETC_FILE := $(L_SET_FILE:%.set=%.autogen.c) -#SRCS += $(L_SETC_FILE) +SHARP_DAT_FILE := \ + 5030_15fpsFIX_x8_CC_FilterKIM_MatrixOn3_PLL.dat \ + 5030_15fps_5fps_adjust2_x8_CC_FilterKIM_MatrixOn3_PLL_1676MHz-1676MHz.dat \ -L_INIC_FILE := $(L_INI_FILE:%.ini=%.autogen.c) -SRCS += $(L_INIC_FILE) +SHARP_CONVERT_EXE := convert_sharp.pl + +SHARP_DATC_FILE := $(SHARP_DAT_FILE:%.dat=%.autogen.c) TARGET_LIB = libcamera_sp$(TWL_LIBSUFFIX).a @@ -77,10 +75,13 @@ do-build: $(TARGETS) include $(TWLSDK_ROOT)/build/buildtools/modulerules +%.autogen.c: %.ini $(MICRON_CONVERT_EXE) + perl $(MICRON_CONVERT_EXE) $< $@ -%.autogen.c: %.ini $(L_INI_CONVERT_EXE) - perl $(L_INI_CONVERT_EXE) $< > $@ +%.autogen.c: %.dat $(SHARP_CONVERT_EXE) + perl $(SHARP_CONVERT_EXE) $< $@ + +$(OBJDIR)/camera_i2c_micron.o: $(MICRON_INIC_FILE) +$(OBJDIR)/camera_i2c_sharp.o: $(SHARP_DATC_FILE) -%.autogen.c: %.set $(L_SET_CONVERT_EXE) - perl $(L_INI_CONVERT_EXE) $< > $@ #===== End of Makefile ===== diff --git a/build/libraries/camera/ARM7/camera_control.c b/build/libraries/camera/ARM7/camera_control.c index 51a56a0..f4fcb1a 100644 --- a/build/libraries/camera/ARM7/camera_control.c +++ b/build/libraries/camera/ARM7/camera_control.c @@ -132,23 +132,12 @@ static void CameraPxiCallback(PXIFifoTag tag, u32 data, BOOL err) switch (cameraWork.command) { // m̃R}hQ - case CAMERA_PXI_COMMAND_SELECT: - // I2C{ - case CAMERA_PXI_COMMAND_WRITE_REGISTERS: - case CAMERA_PXI_COMMAND_READ_REGISTERS: - case CAMERA_PXI_COMMAND_SET_PARAMS: - case CAMERA_PXI_COMMAND_SET_FLAGS: - case CAMERA_PXI_COMMAND_CLEAR_FLAGS: - // I2Cp - case CAMERA_PXI_COMMAND_I2C_INIT: - case CAMERA_PXI_COMMAND_I2C_PRESET: - - case CAMERA_PXI_COMMAND_I2C_PRE_SLEEP: - case CAMERA_PXI_COMMAND_I2C_POST_SLEEP: - - case CAMERA_PXI_COMMAND_I2C_SET_CROPPING: - case CAMERA_PXI_COMMAND_I2C_PAUSE: - case CAMERA_PXI_COMMAND_I2C_RESUME: + case CAMERA_PXI_COMMAND_INIT: + case CAMERA_PXI_COMMAND_ACTIVATE: + case CAMERA_PXI_COMMAND_RESIZE: + case CAMERA_PXI_COMMAND_FRAME_RATE: + case CAMERA_PXI_COMMAND_EFFECT: + case CAMERA_PXI_COMMAND_FLIP: // XbhĊJ if (!OS_SendMessage(&cameraWork.msgQ, NULL, OS_MESSAGE_NOBLOCK)) { @@ -230,13 +219,8 @@ static void CameraThread(void *arg) OSMessage msg; BOOL result; -#if 0 u16 data16a; u16 data16b; - u16 data16c; - u16 data16d; - u8 dataArray[CAMERA_PXI_DATA_SIZE_MAX]; // s蒷f[^i[p -#endif while (TRUE) { @@ -246,8 +230,14 @@ static void CameraThread(void *arg) // R}hɏ]Ċe폈s switch (cameraWork.command) { - case CAMERA_PXI_COMMAND_SELECT: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_SELECT); + case CAMERA_PXI_COMMAND_INIT: + CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_INIT); + result = CAMERA_I2CInit((CameraSelect)cameraWork.data[0]); + CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB + break; + + case CAMERA_PXI_COMMAND_ACTIVATE: + CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_ACTIVATE); if (cameraWork.camera != cameraWork.data[0]) { if (cameraWork.camera != CAMERA_SELECT_NONE) @@ -260,103 +250,40 @@ static void CameraThread(void *arg) cameraWork.camera = (CameraSelect)cameraWork.data[0]; if (cameraWork.camera != CAMERA_SELECT_NONE) { - if (FALSE == CAMERA_I2CStandby(cameraWork.camera, FALSE)) // set ?XXXXXXXXX + if (FALSE == CAMERA_I2CStandby(cameraWork.camera, FALSE)) { CameraReturnResult(cameraWork.command, CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̎sʒB } } } - CameraReturnResult(cameraWork.command, CAMERA_PXI_RESULT_SUCCESS); // ARM9ɏ̐ʒB - break; -#if 0 - // I2C{ - case CAMERA_PXI_COMMAND_WRITE_REGISTERS: // IN: camera, addr, data... OUT: TRUE/FALSE - if (cameraWork.total <= 2) - { - CameraReturnResult(cameraWork.command, CAMERA_PXI_RESULT_INVALID_PARAMETER); - break; - } - result = CAMERA_WriteRegisters((CameraSelect)cameraWork.data[0], cameraWork.data[1], &cameraWork.data[2], (size_t)(cameraWork.total-2)); - CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB + CameraReturnResult(cameraWork.command, CAMERA_PXI_RESULT_SUCCESS_TRUE); // ARM9ɏ̐ʒB break; - case CAMERA_PXI_COMMAND_READ_REGISTERS: // IN: camera, addr, size OUT: TRUE/FALSE, data... - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_READ_REGISTERS); - result = CAMERA_ReadRegisters((CameraSelect)cameraWork.data[0], cameraWork.data[1], dataArray, cameraWork.data[2]); - if (result) - { - CameraReturnResultEx(cameraWork.command, CAMERA_PXI_RESULT_SUCCESS_TRUE, cameraWork.data[2], dataArray); - } - else - { - CameraReturnResult(cameraWork.command, CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̎sʒB - } - break; - - case CAMERA_PXI_COMMAND_SET_PARAMS: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_SET_PARAMS); - result = CAMERA_SetParams((CameraSelect)cameraWork.data[0], cameraWork.data[1], cameraWork.data[2], cameraWork.data[3]); - CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB - break; - - case CAMERA_PXI_COMMAND_SET_FLAGS: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_SET_FLAGS); - result = CAMERA_SetFlags((CameraSelect)cameraWork.data[0], cameraWork.data[1], cameraWork.data[2]); - CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB - break; - - case CAMERA_PXI_COMMAND_CLEAR_FLAGS: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_CLEAR_FLAGS); - result = CAMERA_ClearFlags((CameraSelect)cameraWork.data[0], cameraWork.data[1], cameraWork.data[2]); - CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB - break; -#endif - case CAMERA_PXI_COMMAND_I2C_INIT: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_I2C_INIT); - result = CAMERA_I2CInit((CameraSelect)cameraWork.data[0]); - CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB - break; -#if 0 - case CAMERA_PXI_COMMAND_I2C_PRESET: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_I2C_PRESET); - result = CAMERA_I2CPreset((CameraSelect)cameraWork.data[0], (CameraPreset)cameraWork.data[1]); - CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB - break; -#endif - case CAMERA_PXI_COMMAND_I2C_PRE_SLEEP: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_I2C_PRE_SLEEP); - result = CAMERA_I2CPreSleep(cameraWork.camera); - CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB - break; - - case CAMERA_PXI_COMMAND_I2C_POST_SLEEP: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_I2C_POST_SLEEP); - result = CAMERA_I2CPostSleep(cameraWork.camera); - CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB - break; -#if 0 - case CAMERA_PXI_COMMAND_I2C_SET_CROPPING: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_I2C_SET_CROPPING); + case CAMERA_PXI_COMMAND_RESIZE: + CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_RESIZE); CAMERA_UNPACK_U16(&data16a, &cameraWork.data[1]); CAMERA_UNPACK_U16(&data16b, &cameraWork.data[3]); - CAMERA_UNPACK_U16(&data16c, &cameraWork.data[5]); - CAMERA_UNPACK_U16(&data16d, &cameraWork.data[7]); - result = CAMERA_I2CSetCropping((CameraSelect)cameraWork.data[0], data16a, data16b, data16c, data16d); + result = CAMERA_I2CResize((CameraSelect)cameraWork.data[0], data16a, data16b); CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB break; - case CAMERA_PXI_COMMAND_I2C_PAUSE: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_I2C_PAUSE); - result = CAMERA_I2CPause(cameraWork.camera); + case CAMERA_PXI_COMMAND_FRAME_RATE: + CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_FRAME_RATE); + result = CAMERA_I2CFrameRate((CameraSelect)cameraWork.data[0], cameraWork.data[1]); CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB break; - case CAMERA_PXI_COMMAND_I2C_RESUME: - CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_I2C_RESUME); - result = CAMERA_I2CResume(cameraWork.camera); + case CAMERA_PXI_COMMAND_EFFECT: + CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_EFFECT); + result = CAMERA_I2CEffect((CameraSelect)cameraWork.data[0], (CameraEffect)cameraWork.data[1]); + CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB + break; + + case CAMERA_PXI_COMMAND_FLIP: + CAMERA_PXI_SIZE_CHECK(CAMERA_PXI_SIZE_FLIP); + result = CAMERA_I2CFlip((CameraSelect)cameraWork.data[0], (CameraFlip)cameraWork.data[1]); CameraReturnResult(cameraWork.command, result ? CAMERA_PXI_RESULT_SUCCESS_TRUE : CAMERA_PXI_RESULT_SUCCESS_FALSE); // ARM9ɏ̐ʒB break; -#endif // T|[gȂR}h default: diff --git a/build/libraries/camera/ARM7/camera_i2c_common.c b/build/libraries/camera/ARM7/camera_i2c.c similarity index 61% rename from build/libraries/camera/ARM7/camera_i2c_common.c rename to build/libraries/camera/ARM7/camera_i2c.c index 927e8a9..2203389 100644 --- a/build/libraries/camera/ARM7/camera_i2c_common.c +++ b/build/libraries/camera/ARM7/camera_i2c.c @@ -1,8 +1,8 @@ /*---------------------------------------------------------------------------* Project: TwlSDK - libraties - camera - File: camera_i2c_common.c + File: camera_i2c.c - Copyright 2006 Nintendo. All rights reserved. + Copyright 2007 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo @@ -14,7 +14,8 @@ $NoKeywords: $ *---------------------------------------------------------------------------*/ #include -#include +#include +#include typedef enum { @@ -25,7 +26,7 @@ typedef enum } CAMERAType; -static CAMERAType cameraType = CAMERA_TYPE_MICRON; +static CAMERAType cameraType = CAMERA_TYPE_SHARP; #if 0 CAMERA_I2CInit()J̎ނւ@\L @@ -46,19 +47,19 @@ BOOL CAMERA_I2CInit(CameraSelect camera) (void)I2C_Lock(); if (cameraType == CAMERA_TYPE_MICRON) { - result = CAMERA_M_I2CInit(camera); + result = CAMERAi_M_I2CInit(camera); if (result == FALSE) { cameraType = CAMERA_TYPE_SHARP; } } - if (cameraType == CAMERA_TYPE_SHARP) { - result = CAMERA_S_I2CInit(camera); + result = CAMERAi_S_I2CInit(camera); if (result == FALSE) { - cameraType = CAMERA_TYPE_MICRON; //rotation CAMERA_TYPE_UNKNOWN; + cameraType = CAMERA_TYPE_MICRON; // rotate for next try + //cameraType = CAMERA_TYPE_UNKNOWN; // annihilate camera I2C } } (void)I2C_Unlock(); @@ -79,13 +80,13 @@ BOOL CAMERA_I2CStandby(CameraSelect camera, BOOL standby) { BOOL result = FALSE; (void)I2C_Lock(); - switch (camera) + switch (cameraType) { case CAMERA_TYPE_MICRON: - CAMERA_M_I2CStandby(camera, standby); + result = CAMERAi_M_I2CStandby(camera, standby); break; case CAMERA_TYPE_SHARP: - CAMERA_S_I2CStandby(camera, standby); + result = CAMERAi_S_I2CStandby(camera, standby); break; } (void)I2C_Unlock(); @@ -107,13 +108,41 @@ BOOL CAMERA_I2CResize(CameraSelect camera, u16 width, u16 height) { BOOL result = FALSE; (void)I2C_Lock(); - switch (camera) + switch (cameraType) { case CAMERA_TYPE_MICRON: - CAMERA_M_I2CResize(camera, width, height); + result = CAMERAi_M_I2CResize(camera, width, height); break; case CAMERA_TYPE_SHARP: - CAMERA_S_I2CResize(camera, width, height); + result = CAMERAi_S_I2CResize(camera, width, height); + break; + } + (void)I2C_Unlock(); + return result; +} + + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CFrameRate + + Description: set CAMERA frame rate + + Arguments: camera : one of CameraSelect + rate : fps (0: auto) + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERA_I2CFrameRate(CameraSelect camera, int rate) +{ + BOOL result = FALSE; + (void)I2C_Lock(); + switch (cameraType) + { + case CAMERA_TYPE_MICRON: + result = CAMERAi_M_I2CFrameRate(camera, rate); + break; + case CAMERA_TYPE_SHARP: + result = CAMERAi_S_I2CFrameRate(camera, rate); break; } (void)I2C_Unlock(); @@ -121,25 +150,26 @@ BOOL CAMERA_I2CResize(CameraSelect camera, u16 width, u16 height) } /*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreSleep + Name: CAMERA_I2CEffect - Description: preset CAMERA registers + Description: set CAMERA effect Arguments: camera : one of CameraSelect + effect : one of CameraEffect Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CPreSleep(CameraSelect camera) +BOOL CAMERA_I2CEffect(CameraSelect camera, CameraEffect effect) { BOOL result = FALSE; (void)I2C_Lock(); - switch (camera) + switch (cameraType) { case CAMERA_TYPE_MICRON: - CAMERA_M_I2CPreSleep(camera); + result = CAMERAi_M_I2CEffect(camera, effect); break; case CAMERA_TYPE_SHARP: - CAMERA_M_I2CPreSleep(camera); + result = CAMERAi_S_I2CEffect(camera, effect); break; } (void)I2C_Unlock(); @@ -147,30 +177,29 @@ BOOL CAMERA_I2CPreSleep(CameraSelect camera) } /*---------------------------------------------------------------------------* - Name: CAMERA_I2CPostSleep + Name: CAMERA_I2CFlip - Description: preset CAMERA registers + Description: set CAMERA flip/mirror Arguments: camera : one of CameraSelect + flip : one of CameraFlip Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CPostSleep(CameraSelect camera) +BOOL CAMERA_I2CFlip(CameraSelect camera, CameraFlip flip) { BOOL result = FALSE; (void)I2C_Lock(); - switch (camera) + switch (cameraType) { case CAMERA_TYPE_MICRON: - CAMERA_M_I2CPostSleep(camera); + result = CAMERAi_M_I2CFlip(camera, flip); break; case CAMERA_TYPE_SHARP: - CAMERA_M_I2CPostSleep(camera); + result = CAMERAi_S_I2CFlip(camera, flip); break; } (void)I2C_Unlock(); return result; } - - diff --git a/build/libraries/camera/ARM7/camera_i2c_micron.c b/build/libraries/camera/ARM7/camera_i2c_micron.c index 0baa602..7c5e868 100644 --- a/build/libraries/camera/ARM7/camera_i2c_micron.c +++ b/build/libraries/camera/ARM7/camera_i2c_micron.c @@ -2,7 +2,7 @@ Project: TwlSDK - libraties - camera File: camera_i2c_micron.c - Copyright 2006 Nintendo. All rights reserved. + Copyright 2007 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo @@ -14,47 +14,15 @@ $NoKeywords: $ *---------------------------------------------------------------------------*/ #include -#include +#include -//#define USE_MULTIPLE_IO // use [Read|Write]Registers(); - -// for micron -BOOL CAMERAi_M_Default_Registers( CameraSelect camera ); -BOOL CAMERAi_M_Initialize_Camera( CameraSelect camera ); -BOOL CAMERAi_M_Image_Setting_ExtClk_6_75MHz_Op_Pix_27_5MHz_15fps( CameraSelect camera ); -BOOL CAMERAi_M_Image_Setting_ExtClk_16_76MHz_Op_Pix_27_5MHz_15fps( CameraSelect camera ); -BOOL CAMERAi_M_Viewfinder_ON( CameraSelect camera ); -BOOL CAMERAi_M_Viewfinder_OFF( CameraSelect camera ); -BOOL CAMERAi_M_Video_Capture_ON( CameraSelect camera ); -BOOL CAMERAi_M_Video_Capture_OFF( CameraSelect camera ); -BOOL CAMERAi_M_Lens_Calibration_Setup( CameraSelect camera ); -BOOL CAMERAi_M_Lens_Calibration_Exit( CameraSelect camera ); -BOOL CAMERAi_M_Fixed_15fps( CameraSelect camera ); -BOOL CAMERAi_M_Refresh( CameraSelect camera ); -BOOL CAMERAi_M_Auto_Exposure( CameraSelect camera ); -BOOL CAMERAi_M_Gamma_Correction( CameraSelect camera ); -BOOL CAMERAi_M_Auto_White_Balance( CameraSelect camera ); -BOOL CAMERAi_M_Lens_Correction( CameraSelect camera ); -BOOL CAMERAi_M_Image_Size_VGA( CameraSelect camera ); -BOOL CAMERAi_M_Image_Size_QVGA( CameraSelect camera ); -BOOL CAMERAi_M_Image_Size_CIF( CameraSelect camera ); -BOOL CAMERAi_M_Image_Size_QCIF( CameraSelect camera ); -BOOL CAMERAi_M_Effect_Off( CameraSelect camera ); -BOOL CAMERAi_M_Effect_Mono( CameraSelect camera ); -BOOL CAMERAi_M_Effect_Sepia( CameraSelect camera ); -BOOL CAMERAi_M_Manual_WB_To_Auto_WB( CameraSelect camera ); -BOOL CAMERAi_M_Manual_White_Balance_P1( CameraSelect camera ); -BOOL CAMERAi_M_Manual_White_Balance_P2( CameraSelect camera ); -BOOL CAMERAi_M_Manual_White_Balance_P3( CameraSelect camera ); -BOOL CAMERAi_M_Manual_White_Balance_P4( CameraSelect camera ); -BOOL CAMERAi_M_Manual_White_Balance_P5( CameraSelect camera ); -BOOL CAMERAi_M_Manual_White_Balance_P6( CameraSelect camera ); -BOOL CAMERAi_M_Manual_White_Balance_P7( CameraSelect camera ); -BOOL CAMERAi_M_Manual_White_Balance_P8( CameraSelect camera ); -BOOL CAMERAi_M_Sharpness_0( CameraSelect camera ); +// insert auto-generated code +#include "MT9V113-MTM10.autogen.c" +//#include "MT9V113-MTM9-2.autogen.c" +//#include "MT9V113-nin00.autogen.c" /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CInit + Name: CAMERAi_M_I2CInit Description: initialize CAMERA @@ -62,13 +30,26 @@ BOOL CAMERAi_M_Sharpness_0( CameraSelect camera ); Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CInit(CameraSelect camera) +BOOL CAMERAi_M_I2CInit(CameraSelect camera) { - return CAMERAi_M_Default_Registers(camera); + BOOL rIn = TRUE; + BOOL rOut = TRUE; + // should not send init command same time + if (camera & CAMERA_SELECT_IN) + { + rIn = CAMERAi_M_Default_Registers(CAMERA_SELECT_IN) + && CAMERAi_M_I2CStandby(CAMERA_SELECT_IN, TRUE); + } + if (camera & CAMERA_SELECT_OUT) + { + rOut = CAMERAi_M_Default_Registers(CAMERA_SELECT_OUT) + && CAMERAi_M_I2CStandby(CAMERA_SELECT_OUT, TRUE); + } + return (rIn && rOut); } /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CStandby + Name: CAMERAi_M_I2CStandby Description: standby or resume CAMERA @@ -77,20 +58,22 @@ BOOL CAMERA_M_I2CInit(CameraSelect camera) Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CStandby(CameraSelect camera, BOOL standby) +BOOL CAMERAi_M_I2CStandby(CameraSelect camera, BOOL standby) { if (standby) { + return CAMERAi_M_ClearFlags(camera, 0x001A, 0x0200) // stop to output + && CAMERAi_M_SetFlags(camera, 0x0018, 0x0001); // go to standby } else { + return CAMERAi_M_ClearFlags(camera, 0x0018, 0x0001) // leave standby + && CAMERAi_M_SetFlags(camera, 0x001A, 0x0200); // start to output } - (void)camera; - return TRUE; } /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CResize + Name: CAMERAi_M_I2CResize Description: resize CAMERA @@ -100,45 +83,155 @@ BOOL CAMERA_M_I2CStandby(CameraSelect camera, BOOL standby) Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CResize(CameraSelect camera, u16 width, u16 height) +BOOL CAMERAi_M_I2CResize(CameraSelect camera, u16 width, u16 height) { - return CAMERAi_M_WriteRegister(camera, 0x98c, 0x2703) // width (A) - && CAMERAi_M_WriteRegister(camera, 0x990, width) - && CAMERAi_M_WriteRegister(camera, 0x98c, 0x2705) // height (A) - && CAMERAi_M_WriteRegister(camera, 0x990, height) - && CAMERAi_M_WriteRegister(camera, 0x98c, 0x2707) // width (B) - && CAMERAi_M_WriteRegister(camera, 0x990, width) - && CAMERAi_M_WriteRegister(camera, 0x98c, 0x2709) // height (B) - && CAMERAi_M_WriteRegister(camera, 0x990, height); - // anyone else??? + return CAMERAi_M_WriteMCU(camera, 0x2703, width) // width (A) + && CAMERAi_M_WriteMCU(camera, 0x2705, height) // height (A) +// && CAMERAi_M_WriteMCU(camera, 0x2707, width) // width (B) +// && CAMERAi_M_WriteMCU(camera, 0x2709, height) // height (B) + && CAMERAi_M_Refresh(camera); } /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CPreSleep + Name: CAMERAi_M_I2CFrameRate - Description: preset CAMERA registers + Description: set CAMERA frame rate Arguments: camera : one of CameraSelect + rate : fps (0: auto) Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CPreSleep(CameraSelect camera) +BOOL CAMERAi_M_I2CFrameRate(CameraSelect camera, int rate) { (void)camera; + if (rate == 0) + { + } + else if (rate > 0 && rate <= 30) + { + } return FALSE; } /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CPostSleep + Name: CAMERAi_M_I2CEffect - Description: preset CAMERA registers + Description: set CAMERA effect Arguments: camera : one of CameraSelect + effect : one of CameraEffect Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CPostSleep(CameraSelect camera) +BOOL CAMERAi_M_I2CEffect(CameraSelect camera, CameraEffect effect) { - (void)camera; +#if 0 + SEPIAŃK}RNVύXĂ̂ŁAȊO̓ftHg + K}RNVKpKvB + OSEPIAǂoĂ(IN/OUT)AĐݒ肷邩AŏRead邩EEE + قɃK}RNVύX̂ȂȂA(B)ZsApƂĂǂB +#endif + switch (effect) + { + case CAMERA_EFFECT_NONE: + return CAMERAi_M_Effect_Off(camera); + case CAMERA_EFFECT_MONO: + return CAMERAi_M_Effect_Mono(camera); + case CAMERA_EFFECT_SEPIA: + return CAMERAi_M_Effect_Sepia(camera); + case CAMERA_EFFECT_NEGATIVE: + return CAMERAi_M_WriteMCU(camera, 0x2759, 0x6443) //NEVATIVE_SPEC_EFFECTS_A + && CAMERAi_M_WriteMCU(camera, 0x275B, 0x6443) //NEVATIVE_SPEC_EFFECTS_B + && CAMERAi_M_Refresh(camera); + } return FALSE; } + +/*---------------------------------------------------------------------------* + Name: CAMERAi_M_I2CFlip + + Description: set CAMERA flip/mirror + + Arguments: camera : one of CameraSelect + flip : one of CameraFlip + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERAi_M_I2CFlip(CameraSelect camera, CameraFlip flip) +{ + (void)camera; + switch (flip) + { + case CAMERA_FLIP_NONE: // normal + case CAMERA_FLIP_VERTICAL: // vertical flip + case CAMERA_FLIP_HORIZONTAL:// horizontal mirror + case CAMERA_FLIP_REVERSE: // turn over + return FALSE; + } + return FALSE; +} +#if 0 +/*---------------------------------------------------------------------------* + Name: CAMERAi_M_I2CWhiteBalance + + Description: set CAMERA white balance + + Arguments: camera : one of CameraSelect + type : preset number (0: auto) + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERAi_M_I2CWhiteBalance(CameraSelect camera, int type) +{ + switch (type) + { + case 0: + return CAMERAi_M_Manual_WB_To_Auto_WB(camera); + case 1: + return CAMERAi_M_Manual_White_Balance_P1(camera); + case 2: + return CAMERAi_M_Manual_White_Balance_P2(camera); + case 3: + return CAMERAi_M_Manual_White_Balance_P3(camera); + case 4: + return CAMERAi_M_Manual_White_Balance_P4(camera); + case 5: + return CAMERAi_M_Manual_White_Balance_P5(camera); + case 6: + return CAMERAi_M_Manual_White_Balance_P6(camera); + case 7: + return CAMERAi_M_Manual_White_Balance_P7(camera); + case 8: + return CAMERAi_M_Manual_White_Balance_P8(camera); + } + return FALSE; +} +/*---------------------------------------------------------------------------* + Name: CAMERAi_M_I2CExposure + + Description: set CAMERA exposure + + Arguments: camera : one of CameraSelect + type : preset number (0: auto) + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERAi_M_I2CExposure(CameraSelect camera, int type) +{ + switch (type) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + return TRUE; + } + return FALSE; +} +#endif diff --git a/build/libraries/camera/ARM7/camera_i2c_samsung.c b/build/libraries/camera/ARM7/camera_i2c_samsung.c deleted file mode 100644 index 3c17b19..0000000 --- a/build/libraries/camera/ARM7/camera_i2c_samsung.c +++ /dev/null @@ -1,264 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: TwlSDK - libraties - camera - File: camera_i2c.c - - Copyright 2006 Nintendo. All rights reserved. - - These coded instructions, statements, and computer programs contain - proprietary information of Nintendo of America Inc. and/or Nintendo - Company Ltd., and are protected by Federal copyright law. They may - not be disclosed to third parties or copied or duplicated in any form, - in whole or in part, without the prior written consent of Nintendo. - - $Log: $ - $NoKeywords: $ - *---------------------------------------------------------------------------*/ -#include -#include - -//#define USE_MULTIPLE_IO // use [Read|Write]Registers(); - -// for samsung 1/10 - -extern BOOL CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M_PLLoff_hVGA( CameraSelect camera ); -extern BOOL CAMERAi_I2CPreset_A3AFX_EVT2_30fps_16M_QVGA( CameraSelect camera ); -extern BOOL CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M( CameraSelect camera ); -extern BOOL CAMERAi_I2CPreset_320x240_noPLL_20fps( CameraSelect camera ); -extern BOOL CAMERAi_I2CPreset_320x240_PLL_30fps( CameraSelect camera ); -extern BOOL CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Scaledown_16_7M_50Hz( CameraSelect camera ); -extern BOOL CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Subsampling_16_7M_50Hz( CameraSelect camera ); - -typedef BOOL (*CameraI2CPresetFunc)( CameraSelect camera ); - -static CameraI2CPresetFunc gs_preset[] = { -// CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M_PLLoff_hVGA, -// CAMERAi_I2CPreset_A3AFX_EVT2_30fps_16M_QVGA, - CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M, -// CAMERAi_I2CPreset_320x240_noPLL_20fps, -// CAMERAi_I2CPreset_320x240_PLL_30fps, - CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Scaledown_16_7M_50Hz, - CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Subsampling_16_7M_50Hz, -}; - -BOOL CAMERA_I2CPreset(CameraSelect camera, CameraPreset preset) -{ - BOOL result = FALSE; - if (preset >= CAMERA_PRESET_MAX) { - return result; - } - if (gs_preset[preset] == NULL) { - return result; - } - (void)I2C_Lock(); - result = gs_preset[preset](camera); - (void)I2C_Unlock(); - return result; -} - - -#define PAGE_ADDR 0xef - -#define MIRROR_MODE 0x02 //[6:7] only? -#define WRP_DOWN 0x04 -#define WCP_DOWN 0x06 - -BOOL CAMERA_I2CSetFlipMode(CameraSelect camera, CameraFlipMode mode) -{ - - (void)I2C_Lock(); - - switch (mode) - { - case CAMERA_FLIPMODE_NONE: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x02) == FALSE || - CAMERAi_WriteRegister(camera, MIRROR_MODE, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, WRP_DOWN, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, WCP_DOWN, 0x00) == FALSE) { - goto error; - } - break; - case CAMERA_FLIPMODE_HORIZONTAL: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x02) == FALSE || - CAMERAi_WriteRegister(camera, MIRROR_MODE, 0x40) == FALSE || - CAMERAi_WriteRegister(camera, WRP_DOWN, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, WCP_DOWN, 0x01) == FALSE) { - goto error; - } - break; - case CAMERA_FLIPMODE_VERTICAL: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x02) == FALSE || - CAMERAi_WriteRegister(camera, MIRROR_MODE, 0x80) == FALSE || - CAMERAi_WriteRegister(camera, WRP_DOWN, 0x01) == FALSE || - CAMERAi_WriteRegister(camera, WCP_DOWN, 0x00) == FALSE) { - goto error; - } - break; - case CAMERA_FLIPMODE_HORIZONTAL_VERTICAL: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x02) == FALSE || - CAMERAi_WriteRegister(camera, MIRROR_MODE, 0xC0) == FALSE || - CAMERAi_WriteRegister(camera, WRP_DOWN, 0x01) == FALSE || - CAMERAi_WriteRegister(camera, WCP_DOWN, 0x01) == FALSE) { - goto error; - } - break; - default: - goto error; - } - (void)I2C_Unlock(); - return TRUE; -error: - (void)I2C_Unlock(); - return FALSE; -} - -#define NEVAGIVE_EFFECT_MODE 0xD3 -#define SEPIA_EFFECT_MODE 0xD4 -#define SEPIA_EFFECT_CB 0xD5 -#define SEPIA_EFFECT_CR 0xD6 - -BOOL CAMERA_I2CSetSpecialMode(CameraSelect camera, CameraSpecialMode mode) -{ - - (void)I2C_Lock(); - - switch (mode) - { - case CAMERA_SPECIALMODE_NONE: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, NEVAGIVE_EFFECT_MODE, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_MODE, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CB, 0x2C) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CR, 0x81) == FALSE) { - goto error; - } - break; - case CAMERA_SPECIALMODE_NEVATIVE: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, NEVAGIVE_EFFECT_MODE, 0x01) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_MODE, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CB, 0x2C) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CR, 0x81) == FALSE) { - goto error; - } - break; - case CAMERA_SPECIALMODE_SEPIA: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, NEVAGIVE_EFFECT_MODE, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_MODE, 0x03) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CB, 0x2C) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CR, 0x81) == FALSE) { - goto error; - } - break; - //case CAMERA_SPECIALMODE_AQUA: - case CAMERA_SPECIALMODE_BLUISH: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, NEVAGIVE_EFFECT_MODE, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_MODE, 0x03) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CB, 0xAC) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CR, 0x81) == FALSE) { - goto error; - } - break; - case CAMERA_SPECIALMODE_REDDISH: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, NEVAGIVE_EFFECT_MODE, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_MODE, 0x03) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CB, 0xAC) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CR, 0xC1) == FALSE) { - goto error; - } - break; - case CAMERA_SPECIALMODE_GREENISH: - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, NEVAGIVE_EFFECT_MODE, 0x00) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_MODE, 0x03) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CB, 0xAC) == FALSE || - CAMERAi_WriteRegister(camera, SEPIA_EFFECT_CR, 0x41) == FALSE) { - goto error; - } - break; - default: - goto error; - } - (void)I2C_Unlock(); - return TRUE; -error: - (void)I2C_Unlock(); - return FALSE; -} - -#define DEST_ADDR 0x7F -#define CAPT_ADDR 0xC4 -BOOL CAMERA_I2CSetCroppingParams(CameraSelect camera, u16 width, u16 height) -{ -#ifdef USE_MULTIPLE_IO - u8 data[4]; -#endif - if (width > 640 || height > 480) { - return FALSE; - } - (void)I2C_Lock(); - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x00) == FALSE) { - (void)I2C_Unlock(); - return FALSE; - } - // set destination registers -#ifdef USE_MULTIPLE_IO - data[0] = (height + 0x10) >> 8; - data[1] = (height + 0x10) & 0xFF; - data[2] = (width + 0x10) >> 8; - data[3] = (width + 0x10) & 0xFF; - if (CAMERAi_WriteRegisters(camera, DEST_ADDR, data, 4) == FALSE) { -#else - if (CAMERAi_WriteRegister(camera, DEST_ADDR, (u8)((height + 0x10) >> 8)) == FALSE || - CAMERAi_WriteRegister(camera, DEST_ADDR+1, (u8)((height + 0x10) & 0xFF)) ==FALSE || - CAMERAi_WriteRegister(camera, DEST_ADDR+2, (u8)((width + 0x10) >> 8)) == FALSE || - CAMERAi_WriteRegister(camera, DEST_ADDR+3, (u8)((width + 0x10) & 0xFF)) == FALSE) { -#endif - (void)I2C_Unlock(); - return FALSE; - } - // set capture registers -#ifdef USE_MULTIPLE_IO - data[0] = height >> 8; - data[1] = height & 0xFF; - data[2] = width >> 8; - data[3] = width & 0xFF; - if (CAMERAi_WriteRegisters(camera, CAPT_ADDR, data, 4) == FALSE) { -#else - if (CAMERAi_WriteRegister(camera, CAPT_ADDR, (u8)(height >> 8)) == FALSE || - CAMERAi_WriteRegister(camera, CAPT_ADDR+1, (u8)(height & 0xFF)) ==FALSE || - CAMERAi_WriteRegister(camera, CAPT_ADDR+2, (u8)(width >> 8)) == FALSE || - CAMERAi_WriteRegister(camera, CAPT_ADDR+3, (u8)(width & 0xFF)) == FALSE) { -#endif - (void)I2C_Unlock(); - return FALSE; - } - (void)I2C_Unlock(); - return TRUE; -} - -BOOL CAMERA_I2CGetCroppingParams(CameraSelect camera, u16 *pWidth, u16 *pHeight) -{ - u8 data[4]; - (void)I2C_Lock(); - if (CAMERAi_WriteRegister(camera, PAGE_ADDR, 0x00) == FALSE) { - (void)I2C_Unlock(); - return FALSE; - } - data[0] = CAMERAi_ReadRegister(camera, CAPT_ADDR); - data[1] = CAMERAi_ReadRegister(camera, CAPT_ADDR+1); - data[2] = CAMERAi_ReadRegister(camera, CAPT_ADDR+2); - data[3] = CAMERAi_ReadRegister(camera, CAPT_ADDR+3); - - (void)I2C_Unlock(); - - if (pWidth) { - *pWidth = (u16)(data[3] | (data[2] << 8)); - } - if (pHeight) { - *pHeight = (u16)(data[1] | (data[0] << 8)); - } - return TRUE; -} diff --git a/build/libraries/camera/ARM7/camera_i2c_sharp.c b/build/libraries/camera/ARM7/camera_i2c_sharp.c index bd8e4fc..01459f8 100644 --- a/build/libraries/camera/ARM7/camera_i2c_sharp.c +++ b/build/libraries/camera/ARM7/camera_i2c_sharp.c @@ -2,7 +2,7 @@ Project: TwlSDK - libraties - camera File: camera_i2c_sharp.c - Copyright 2006 Nintendo. All rights reserved. + Copyright 2007 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo @@ -14,14 +14,24 @@ $NoKeywords: $ *---------------------------------------------------------------------------*/ #include -#include +#include -//#define USE_MULTIPLE_IO // use [Read|Write]Registers(); +// insert auto-generated code +//#include "5030_15fpsFIX_x8_CC_FilterKIM_MatrixOn3_PLL.autogen.c" +#include "5030_15fps_5fps_adjust2_x8_CC_FilterKIM_MatrixOn3_PLL_1676MHz-1676MHz.autogen.c" -// for sharp + +#define BANK_ADDR 0x03 +typedef enum +{ + BANK_GROUP_A = 0x00, + BANK_GROUP_B = 0x01, + BANK_GROUP_C = 0x02 +} +BankGroup; /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CInit + Name: CAMERAi_S_I2CInit Description: initialize CAMERA @@ -29,14 +39,28 @@ Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CInit(CameraSelect camera) +BOOL CAMERAi_S_I2CInit(CameraSelect camera) { - (void)camera; - return FALSE; + BOOL rIn = TRUE; + BOOL rOut = TRUE; + // should not send init command same time + if (camera & CAMERA_SELECT_IN) + { + rIn = CAMERAi_S_Initialize(CAMERA_SELECT_IN) + && CAMERAi_S_WriteRegister(CAMERA_SELECT_IN, 0x18, 0x02) // force to order YUYV + && CAMERAi_S_I2CStandby(CAMERA_SELECT_IN, TRUE); + } + if (camera & CAMERA_SELECT_OUT) + { + rOut = CAMERAi_S_Initialize(CAMERA_SELECT_OUT) + && CAMERAi_S_WriteRegister(CAMERA_SELECT_OUT, 0x18, 0x02) // force to order YUYV + && CAMERAi_S_I2CStandby(CAMERA_SELECT_OUT, TRUE); + } + return (rIn && rOut); } /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CStandby + Name: CAMERAi_S_I2CStandby Description: standby or resume CAMERA @@ -45,20 +69,22 @@ BOOL CAMERA_S_I2CInit(CameraSelect camera) Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CStandby(CameraSelect camera, BOOL standby) +BOOL CAMERAi_S_I2CStandby(CameraSelect camera, BOOL standby) { if (standby) { + return CAMERAi_S_WriteRegister(camera, BANK_ADDR, BANK_GROUP_B) + && CAMERAi_S_ClearFlags(camera, 0x04, 0x80); } else { + return CAMERAi_S_WriteRegister(camera, BANK_ADDR, BANK_GROUP_B) + && CAMERAi_S_SetFlags(camera, 0x04, 0x80); } - (void)camera; - return FALSE; } /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CResize + Name: CAMERAi_S_I2CResize Description: resize CAMERA @@ -68,40 +94,76 @@ BOOL CAMERA_S_I2CStandby(CameraSelect camera, BOOL standby) Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CResize(CameraSelect camera, u16 width, u16 height) +BOOL CAMERAi_S_I2CResize(CameraSelect camera, u16 width, u16 height) { - (void)height; - (void)width; + u8 data[2] = { 0, 0 }; + switch (width) + { + case 640: data[0] = 32; break; + case 320: data[0] = 64; break; + case 160: data[0] = 128; break; + } + switch (height) + { + case 480: data[1] = 32; break; + case 240: data[1] = 64; break; + case 120: data[1] = 128; break; + } + if (data[0] && data[1]) + { + return CAMERAi_S_WriteRegister(camera, BANK_ADDR, BANK_GROUP_B) + && CAMERAi_S_WriteRegisters(camera, 0x3D, data, 2); + } + return FALSE; +} + +/*---------------------------------------------------------------------------* + Name: CAMERAi_S_I2CFrameRate + + Description: set CAMERA frame rate + + Arguments: camera : one of CameraSelect + rate : fps (0: auto) + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERAi_S_I2CFrameRate(CameraSelect camera, int rate) +{ + (void)rate; (void)camera; return FALSE; } /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CPreSleep + Name: CAMERAi_S_I2CEffect - Description: preset CAMERA registers + Description: set CAMERA effect Arguments: camera : one of CameraSelect + effect : one of CameraEffect Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CPreSleep(CameraSelect camera) +BOOL CAMERAi_S_I2CEffect(CameraSelect camera, CameraEffect effect) { + (void)effect; (void)camera; return FALSE; } /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CPostSleep + Name: CAMERAi_S_I2CFlip - Description: preset CAMERA registers + Description: set CAMERA flip/mirror Arguments: camera : one of CameraSelect + flip : one of CameraFlip Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CPostSleep(CameraSelect camera) +BOOL CAMERAi_S_I2CFlip(CameraSelect camera, CameraFlip flip) { + (void)flip; (void)camera; return FALSE; } diff --git a/build/libraries/camera/ARM7/convert_micron.pl b/build/libraries/camera/ARM7/convert_micron.pl index c10e3ca..39a2f12 100644 --- a/build/libraries/camera/ARM7/convert_micron.pl +++ b/build/libraries/camera/ARM7/convert_micron.pl @@ -2,9 +2,13 @@ use strict; +# `t@C +my $register_sdat = "MT9V113-REV1.sdat"; + +# ŒtH[}bg my $file_head_format =<<'EOF'; /*---------------------------------------------------------------------------* - Project: TwlSDK - libraties - camera + Project: TwlSDK - libralies - camera File: %1$s Copyright 2007 Nintendo. All rights reserved. @@ -18,8 +22,6 @@ my $file_head_format =<<'EOF'; $Log: $ $NoKeywords: $ *---------------------------------------------------------------------------*/ -#include -#include //#define PRINT_DEBUG @@ -28,20 +30,30 @@ my $file_head_format =<<'EOF'; #define DBG_PRINTF OS_TPrintf #else #define DBG_PRINTF( ... ) ((void)0) -#define DBG_CHAR( c ) ((void)0) #endif +static inline BOOL CAMERAi_M_WriteMCU( CameraSelect camera, u16 addr, u16 value ) +{ + return CAMERAi_M_WriteRegister(camera, 0x98C, addr) + && CAMERAi_M_WriteRegister(camera, 0x990, value); +} +static inline BOOL CAMERAi_M_ReadMCU( CameraSelect camera, u16 addr, u16 *pValue ) +{ + return CAMERAi_M_WriteRegister(camera, 0x98C, addr) + && CAMERAi_M_ReadRegisters(camera, 0x990, pValue, 1); +} + EOF my $file_foot_format =<<'EOF'; EOF my $declare_format =<<'EOF'; -BOOL CAMERAi_M_%s( CameraSelect camera ); +static BOOL CAMERAi_M_%s( CameraSelect camera ); EOF my $func_head_format =<<'EOF'; -BOOL CAMERAi_M_%s( CameraSelect camera ) +static BOOL CAMERAi_M_%s( CameraSelect camera ) { EOF @@ -51,49 +63,54 @@ my $func_foot_format =<<'EOF'; EOF my $call_format =<<'EOF'; - if (CAMERAi_M_%1$s(camera) == FALSE) {%2$s + if (CAMERAi_M_%1$s(camera) == FALSE)%2$s + { DBG_PRINTF("Failed to call CAMERAi_M_%1$s! (%%d)\n", __LINE__); return FALSE; } EOF my $reg_format =<<'EOF'; - if (CAMERAi_M_WriteRegister(camera, %s, %s) == FALSE) {%s + if (CAMERAi_M_WriteRegister(camera, %s, %s) == FALSE)%s + { DBG_PRINTF("Failed to write a register! (%%d)\n", __LINE__); return FALSE; } EOF my $set_format =<<'EOF'; - if (CAMERAi_M_SetFlags(camera, %s, %s) == FALSE) {%s + if (CAMERAi_M_SetFlags(camera, %s, %s) == FALSE)%s + { DBG_PRINTF("Failed to set a register! (%%d)\n", __LINE__); return FALSE; } EOF my $clear_format =<<'EOF'; - if (CAMERAi_M_ClearFlags(camera, %s, %s) == FALSE) {%s + if (CAMERAi_M_ClearFlags(camera, %s, %s) == FALSE)%s + { DBG_PRINTF("Failed to clear a register! (%%d)\n", __LINE__); return FALSE; } EOF -my $sleep_format =<<'EOF'; +my $delay_format =<<'EOF'; OS_Sleep(%s);%s EOF -my $poolreg_format =<<'EOF'; - i = %5$s;%6$s +my $pollreg_format =<<'EOF'; + timeout = %5$s;%6$s while (1) { - u16 data; - if (CAMERAi_M_ReadRegisters(camera, %1$s, &data, 1) == FALSE) { + u16 data; + if (CAMERAi_M_ReadRegisters(camera, %1$s, &data, 1) == FALSE) + { DBG_PRINTF("Failed to read a register! (%%d)\n", __LINE__); return FALSE; } if ((data & %2$s) %3$s) { - if (--i) + if (--timeout) { OS_Sleep(%4$s); continue; @@ -105,8 +122,130 @@ my $poolreg_format =<<'EOF'; } EOF -my @functions = ({name => "", data => "", declare => ""}); # API +my $mcu_format =<<'EOF'; + if (CAMERAi_M_WriteMCU(camera, %s, %s) == FALSE)%s + { + DBG_PRINTF("Failed to write a MCU! (%%d)\n", __LINE__); + return FALSE; + } +EOF +my $fieldset_format =<<'EOF'; + {%3$s + u16 data; + if (CAMERAi_M_ReadMCU(camera, %1$s, &data) == FALSE) + { + DBG_PRINTF("Failed to read a MCU! (%%d)\n", __LINE__); + return FALSE; + } + if (CAMERAi_M_WriteMCU(camera, %1$s, (u16)(data | %2$s)) == FALSE) + { + DBG_PRINTF("Failed to write a MCU! (%%d)\n", __LINE__); + return FALSE; + } + } +EOF + +my $fieldclear_format =<<'EOF'; + {%3$s + u16 data; + if (CAMERAi_M_ReadMCU(camera, %1$s, &data) == FALSE) + { + DBG_PRINTF("Failed to read a MCU! (%%d)\n", __LINE__); + return FALSE; + } + if (CAMERAi_M_WriteMCU(camera, %1$s, (u16)(data & ~%2$s)) == FALSE) + { + DBG_PRINTF("Failed to write a MCU! (%%d)\n", __LINE__); + return FALSE; + } + } +EOF + +my $pollfield_format =<<'EOF'; + timeout = %4$s;%5$s + while (1) + { + u16 data; + if (CAMERAi_M_ReadMCU(camera, %1$s, &data) == FALSE) + { + DBG_PRINTF("Failed to read a MCU! (%%d)\n", __LINE__); + return FALSE; + } + if (data %2$s) + { + if (--timeout) + { + OS_Sleep(%3$s); + continue; + } + DBG_PRINTF("Failed to poll a register! (%%d)\n", __LINE__); + return FALSE; + } + break; + } +EOF + +my $comp_target =<<'EOF'; + if \(CAMERAi_M_WriteRegister\(camera\, 0[xX]0?98[cC]\, ([\w\d]+)\) == FALSE\)([^\r\n]+) + \{ + DBG_PRINTF\(\"Failed to write a register\! \(\%d\)\\n\"\, __LINE__\)\; + return FALSE\; + \} + if \(CAMERAi_M_WriteRegister\(camera\, 0[xX]0?990\, ([\w\d]+)\) == FALSE\)(?:\s*//([^\r\n]+))? + \{ + DBG_PRINTF\(\"Failed to write a register\! \(\%d\)\\n\"\, __LINE__\)\; + return FALSE\; + \} +EOF + +# APIʃf[^x[X +# name: API (ŏAPIO͖) +# data: API{ (̌`) +# comment: Rgs̃e| (API̍ŌɈʒuRgAPIOɏo߂̂) +# declare: API{̂̐擪ɑ}f[^ (1‚̂) +# +my @functions = ({name => "", data => "", comment => "", declare => ""}); + +# `t@Cf[^x[X +my %regmap; # map register/regmap name to the address/mask + +# `t@Cf[^x[X̐ +sub regmap_init { + my %mcu; + open IN, $_[0] or die; + # search space + while() { + if (/^\[ADDR_SPACE\]/) { + while () { + last if (/^\[END\]/); + if (/^([\w\d]+)\s*=\s*\{MCU, (\d+),/) { # only MCU is supported + $mcu{$1} = $2; + } + } + } + if (/^\[REGISTERS\]/) { + my $lastreg = ""; + while () { + last if (/\[END\]/); + if (/(^[\w\d]+)\s*=\s*\{(\w+?),\s*([\w\d]+?),/) { # address entry + if ($mcu{$3}) { # MCU + $regmap{$1}{0} = sprintf("0xA%1X%02X", $mcu{$3}, hex($2)); + } + $lastreg = $1; + } + elsif (/^\s*\{([\w\d]+?),\s*(\w+?),/) { # bitfield entry + $regmap{$lastreg}{$1} = $2; + } + } + } + } + close IN; +# use Data::Dumper; +# print Dumper(\%mcu, \%regmap); +} + +# API̐` sub name_conv { $_ = $_[0]; s/\>/To/g; @@ -114,97 +253,131 @@ sub name_conv { return $_; } +# eR}hCւ̕ϊ sub func_conv { my($key, $value, $comment) = @_; - $comment = " " . $comment; # insert spaces + my @v = split /\s*\,\s*/, $value; # split value + $comment = " " . $comment if ($comment); # insert spaces if ($key eq "LOAD") { return sprintf($call_format, name_conv($value), $comment); } - elsif ($key eq "REG") { - my($reg, $val) = split /\s*\,\s*/, $value; - return sprintf($reg_format, $reg, $val, $comment); + elsif ($key eq "REG") { # address, value + return sprintf($reg_format, $v[0], $v[1], $comment); } - elsif ($key eq "BITFIELD") { - my($reg, $mask, $which) = split /\s*\,\s*/, $value; - if ($which) { - return sprintf($set_format, $reg, $mask, $comment); + elsif ($key eq "BITFIELD") { # address, mask, set/clear + if ($v[2]) { + return sprintf($set_format, $v[0], $v[1], $comment); } else { - return sprintf($clear_format, $reg, $mask, $comment); + return sprintf($clear_format, $v[0], $v[1], $comment); } } - elsif ($key eq "DELAY") { - return sprintf($sleep_format, $value, $comment); + elsif ($key eq "DELAY") { # msec + return sprintf($delay_format, $v[0], $comment); } - elsif ($key eq "POLL_REG") { - my($reg, $mask, $cond, $delay, $timeout) = split /\s*\,\s*/, $value; - $delay =~ s/DELAY\s*=\s*//; - $timeout =~ s/TIMEOUT\s*=\s*//; - ${$functions[$#functions]}{declare} = " int i;\r\n"; - return sprintf($poolreg_format, $reg, $mask, $cond, $delay, $timeout, $comment); + elsif ($key eq "POLL_REG") { # address, mask, condition, delay, timeout + $v[3] =~ s/DELAY\s*=\s*//; + $v[4] =~ s/TIMEOUT\s*=\s*//; + ${$functions[$#functions]}{declare} = " int timeout;\r\n"; + return sprintf($pollreg_format, $v[0], @v[1..4], $comment); } - return " // " . $key . "=" . $value . $comment . "\r\n"; + elsif ($key eq "VAR8") { # page, address, value + return sprintf($mcu_format, sprintf("0xA%1X%02X", $v[0], hex($v[1])), $v[2], $comment); + } + elsif ($key eq "VAR") { # page, address, value + return sprintf($mcu_format, sprintf("0x2%1X%02X", $v[0], hex($v[1])), $v[2], $comment); + } + elsif ($key eq "FIELD_WR") { # name, value OR name, mask, set/clear + if ($v[2] eq "") { + return sprintf($mcu_format, $regmap{$v[0]}{0}, $v[1], $comment); + } + if ($v[2]) { + return sprintf($fieldset_format, $regmap{$v[0]}{0}, $regmap{$v[0]}{$v[1]}, $comment); + } else { + return sprintf($fieldclear_format, $regmap{$v[0]}{0}, $regmap{$v[0]}{$v[1]}, $comment); + } + } + elsif ($key eq "POLL_FIELD") { # name, condition, delay, timeout + $v[2] =~ s/DELAY\s*=\s*//; + $v[3] =~ s/TIMEOUT\s*=\s*//; + ${$functions[$#functions]}{declare} = " int timeout;\r\n"; + return sprintf($pollfield_format, $regmap{$v[0]}{0}, @v[1..3], $comment); + } + return "// IGNORED: " . $key . "=" . $value . $comment . "\r\n"; # ΉR}h } -die "USAGE: convert.pl [INFILE] > [OUTFILE]\n" if ($#ARGV != 0); +# ㏈ (API) +sub comp_func { + $_[0] =~ s/$comp_target/sprintf($mcu_format, $1, $3, $2 . $4)/eg; + return $_[0]; +} + +#烁C + +# `FbN +die "USAGE: $0 INFILE [OUTFILE]\n" if ($#ARGV != 1 and $#ARGV != 0); + +# e평 +regmap_init($register_sdat); my $infile = $ARGV[0]; -(my $outfile = $infile) =~ s/\.ini$/.autogen.c/; +my $outfile = $ARGV[1]; +($outfile = $infile) =~ s/\.ini$/.autogen.c/ unless ($outfile); -open IN, $infile or die "Cannot open the file!\n"; - -my @packets; # pPbgwb_{pPbg̒g̏W܂ -my @data; # f[^Q - -my $first = -1; # 擪AhX -my $current = -1; # ҃AhX +# o̓t@C̃I[v (I[vĂ) +open IN, $infile or die "Cannot open the input file!\n"; +open OUT, ">", $outfile or die "Cannot open the output file!\n"; +# ͏ while () { my $comment = ""; s/[\r\n]+$//; # delete \r and/or \n - s|\;|//|; # replace first ; to // - if (s|(//.*)||) { - $comment = $1; + if (s/(\;|\/\/)(.*)//) { # Rgo + $comment = $1 . $2; } - if (/\s*\[(.+)\]/) { - push @functions, {name => name_conv($1), data => "", declare => ""}; + if (/\s*\[(.+)\]/) { # APIo + push @functions, {name => name_conv($1), data => "", comment => "", declare => ""}; } - elsif (/\s*(.+?)\s*\=\s*(.+?)\s*$/) { + elsif (/\s*(.+?)\s*\=\s*(.+?)\s*$/) { # R}ho + # R}h̎OɃRgꍇ́AdataɈړ + ${$functions[$#functions]}{data} .= ${$functions[$#functions]}{comment}; + ${$functions[$#functions]}{comment} = ""; + # R}hCɕϊdataɒlj ${$functions[$#functions]}{data} .= func_conv($1, $2, $comment); } - elsif (/\S+/) { - print "UNKNOWN STATEMENT: <<", $_, ">>\n"; - ${$functions[$#functions]}{data} .= $_ . $comment . "\r\n"; + elsif (/\S+/) { # m͍so (Rg (G[ɂׂ)) + warn "UNKNOWN STATEMENT: <<", $_, ">>\n"; + ${$functions[$#functions]}{comment} .= "// " . $_ . $comment . "\r\n"; } - elsif ($comment) { - ${$functions[$#functions]}{data} .= $comment . "\r\n"; + elsif ($comment) { # Rĝ + ${$functions[$#functions]}{comment} .= "// " . $comment . "\r\n"; } } -close(IN); +# ͏I +close IN; #use Data::Dumper; #print Dumper(\@functions); -#exit(1); -# output -printf $file_head_format, $outfile; -foreach my $func ( @functions ) { - if ($$func{name}) { - if ($$func{data} !~ /camera/) { - $$func{declare} = "#pragma unused(camera)\r\n"; - } - printf $declare_format, $$func{name}; - } +# o͏ +$outfile =~ s/^.*[\\\/]//; # get basename to print +printf OUT $file_head_format, $outfile; # t@Cwb_o +foreach my $func ( @functions ) { # oςAPI̐錾 + printf OUT $declare_format, $$func{name} if ($$func{name}); } -printf "\r\n"; -foreach my $func ( @functions ) { - if ($$func{name}) { - printf $func_head_format, $$func{name}; - print $$func{declare}, "\r\n" if ($$func{declare}); +printf OUT "\r\n"; +foreach my $func ( @functions ) { # API{̂̏o + if ($$func{name}) { # ŏAPIȌꍇ + printf OUT $func_head_format, $$func{name}; # APIJʂ̏o + print OUT "#pragma unused(camera)\r\n" unless ($$func{data} =~ /camera/); # warningh~ + print OUT $$func{declare}, "\r\n" if ($$func{declare}); # ϐ錾 (if any) } - print $$func{data}; - if ($$func{name}) { - printf $func_foot_format; + print OUT comp_func($$func{data}); # {̂̌㏈{o + if ($$func{name}) { # ŏAPIȌꍇ + printf OUT $func_foot_format ; # ‚ʏo } + print OUT $$func{comment}; # Ō̃Rg̏o (ĂAPÎ߂̂) } -printf $file_foot_format; +printf OUT $file_foot_format; # t@Ctb^o +# o͏I +close OUT; diff --git a/build/libraries/camera/ARM7/convert_samsung.pl b/build/libraries/camera/ARM7/convert_samsung.pl deleted file mode 100644 index 352696e..0000000 --- a/build/libraries/camera/ARM7/convert_samsung.pl +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/perl -- - -my $support_multiple_write = undef; - -my $file_head_format =<<'EOF'; -/*---------------------------------------------------------------------------* - Project: TwlSDK - libraties - camera - File: %1$s - - Copyright 2007 Nintendo. All rights reserved. - - These coded instructions, statements, and computer programs contain - proprietary information of Nintendo of America Inc. and/or Nintendo - Company Ltd., and are protected by Federal copyright law. They may - not be disclosed to third parties or copied or duplicated in any form, - in whole or in part, without the prior written consent of Nintendo. - - $Log: $ - $NoKeywords: $ - *---------------------------------------------------------------------------*/ -#include - -//#define PRINT_DEBUG - -#ifdef PRINT_DEBUG -#include -#define DBG_PRINTF OS_TPrintf -#else -#define DBG_PRINTF( ... ) ((void)0) -#define DBG_CHAR( c ) ((void)0) -#endif - -BOOL %2$s( CameraSelect camera ); -BOOL %2$s( CameraSelect camera ) -{ -EOF - -my $file_foot_format =<<'EOF'; - return TRUE; -} -EOF - -my $packet_first_format =<<'EOF'; - { - const u8 data[] = { -EOF - -my $packet_last_format =<<'EOF'; - }; - if (CAMERAi_WriteRegisters(camera, 0x%s, data, %d) == FALSE) { - DBG_PRINTF("Failed to initialize! (%%d)\n", __LINE__); - return FALSE; - } - } -EOF - -my $packet_single_format =<<'EOF'; - if (CAMERAi_WriteRegister(camera, 0x%s, 0x%s) == FALSE) { - DBG_PRINTF("Failed to initialize! (%%d)\n", __LINE__); - return FALSE; - } -EOF - -sub print_data { - my $text = ''; - my $i = 0; - foreach my $data (@_) { - if ($i % 8 == 0) { - $text .= ' '; - } else { - $text .= ' '; - } - $text .= sprintf('0x%s,', $data); - $i++; - if ($i % 8 == 0) { - $text .= "\n"; - } - } - if ($i % 8 != 0) { - $text .= "\n"; - } - return $text; -} - -sub print_single { - return sprintf($packet_single_format, $_[0], $_[1]); -} - -sub print_packet { - my($first, @data) = @_; - if (@data == 1) { - return print_single($first, $data[0]); - } else { - return $packet_first_format, - print_data(@data), - sprintf($packet_last_format, $first, scalar(@data)); - } -} - -die "USAGE: convert.pl [INFILE] > [OUTFILE]\n" if ($#ARGV != 0); - -my $infile = $ARGV[0]; -(my $funcname = $infile) =~ s/(_\d{6})?\.set$//; -$funcname =~ s/[^0-9a-zA-Z_]/_/g; # -my $outfile = $funcname . ".autogen.c"; -my $funcname = "CAMERAi_I2CPreset_" . $funcname; - -open IN, $infile or die "Cannot open the file!\n"; - -my @packets; # pPbgwb_{pPbg̒g̏W܂ -my @data; # f[^Q - -my $first = -1; # 擪AhX -my $current = -1; # ҃AhX - -if ($support_multiple_write) { - while () { - if (/^s([0-9a-f]{2})([0-9a-f]{2})/i) { - if ($current != hex($1)) { - if ($current >= 0) { - push @packets, print_packet($first, @data); - } - $first = $1; - $current = hex($first); - @data = (); - } - push @data, $2; - $current++; - } - } - # last data - push @packets, print_packet($first, @data); -} else { # AݔΉ - while () { - if (/^s([0-9a-f]{2})([0-9a-f]{2})/i) { - push @packets, print_packet($1, $2); - } - } -} -close(IN); - -# output -printf $file_head_format, $outfile, $funcname; -print @packets; -printf $file_foot_format; diff --git a/build/libraries/camera/ARM7/convert_sharp.pl b/build/libraries/camera/ARM7/convert_sharp.pl new file mode 100644 index 0000000..d7dba0a --- /dev/null +++ b/build/libraries/camera/ARM7/convert_sharp.pl @@ -0,0 +1,168 @@ +#!/usr/bin/perl -- + +use strict; + +# ŒtH[}bg +my $file_head_format =<<'EOF'; +/*---------------------------------------------------------------------------* + Project: TwlSDK - libralies - camera + File: %1$s + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Log: $ + $NoKeywords: $ + *---------------------------------------------------------------------------*/ + +//#define PRINT_DEBUG + +#ifdef PRINT_DEBUG +#include +#define DBG_PRINTF OS_TPrintf +#else +#define DBG_PRINTF( ... ) ((void)0) +#endif + +static BOOL CAMERAi_S_Initialize( CameraSelect camera ) +{ +EOF + +my $file_foot_format =<<'EOF'; + return TRUE; +} +EOF + +my $single_format =<<'EOF'; + if (CAMERAi_S_WriteRegister(camera, 0x%02X, 0x%02X) == FALSE) + { + DBG_PRINTF("Failed to write a register! (%%d)\n", __LINE__); + return FALSE; + } +EOF + +my $multi_head_format =<<'EOF'; + { + const u8 data[] = + { +EOF + +my $multi_foot_format =<<'EOF'; + }; + if (CAMERAi_S_WriteRegisters(camera, 0x%02X, data, %d) == FALSE) + { + DBG_PRINTF("Failed to write registers! (%%d)\n", __LINE__); + return FALSE; + } + } +EOF + +sub print_data { + my $result = ""; + for (my $i = 0; $i < @_; $i++) + { + if (($i % 16) == 0) { + $result .= " " ; + } else { + $result .= " " ; + } + $result .= sprintf("0x%02X,", $_[$i]); + if (($i % 16) == 15) { + $result .= "\r\n"; + } + } + if ((@_ % 16) != 0) { + $result .= "\r\n"; + } + return $result; +} + +sub print_command { + my($addr, @value) = @_; + if (@value == 1) { + return sprintf($single_format, $addr, $value[0]); + } + my $result = $multi_head_format; + for (my $i = 0; $i < @value; $i++) + { + if (($i % 16) == 0) { + $result .= " " ; + } else { + $result .= " " ; + } + $result .= sprintf("0x%02X,", $value[$i]); + if (($i % 16) == 15) { + $result .= "\r\n"; + } + } + if ((@value % 16) != 0) { + $result .= "\r\n"; + } + $result .= sprintf($multi_foot_format, $addr, scalar(@value)); + return $result; +} + +# +# f[^͂LbVāAAAhXo[XgCgɏ +# +my @cache; # LbVf[^ +my $start = -1; # LbV̐擪AhX +my @output; # o̓f[^ +my $comment = ""; # Rg + +#烁C + +# `FbN +die "USAGE: $0 INFILE [OUTFILE]\n" if ($#ARGV != 1 and $#ARGV != 0); + +# e평 +my $infile = $ARGV[0]; +my $outfile = $ARGV[1]; +($outfile = $infile) =~ s/\.ini$/.autogen.c/ unless ($outfile); + +# o̓t@C̃I[v (I[vĂ) +open IN, $infile or die "Cannot open the input file!\n"; +open OUT, ">", $outfile or die "Cannot open the output file!\n"; + +# ͏ +while () { + s/[\r\n]+$//; # delete \r and/or \n + s|\#|// |g; # change comment sign + if (s|(//.*)||) { # Rgo + $comment .= " $1\r\n"; + } + + if (/\s*([\w\d]{2})\s+([\w\d]{2})/) { # f[^o + my ($addr, $value) = (hex($1), hex($2)); + if ($addr != $start + @cache) + { + push @output, print_command($start, @cache) if (@cache); + @cache = ($value); + $start = $addr; + } else { + push @cache, $value; + } + push @output, $comment; # Rgo + $comment = ""; + } + elsif (/\S+/) { # m͍so (Rg (G[ɂׂ)) + warn "UNKNOWN STATEMENT: <<", $_, ">>\n"; + } +} +# ŏIs +push @output, print_command($start, @cache); +# ͏I +close IN; + +# o͏ +$outfile =~ s/^.*[\\\/]//; # get basename to print +printf OUT $file_head_format, $outfile; # t@Cwb_o +print OUT @output; +printf OUT $file_foot_format; # t@Ctb^o +# o͏I +close OUT; diff --git a/build/libraries/camera/ARM9/camera.c b/build/libraries/camera/ARM9/camera.c index 9259368..9fe6336 100644 --- a/build/libraries/camera/ARM9/camera.c +++ b/build/libraries/camera/ARM9/camera.c @@ -19,6 +19,8 @@ /*---------------------------------------------------------------------------* 萔` *---------------------------------------------------------------------------*/ +#define SYNC_TYPE (0 << REG_CAM_CAM_MCNT_SYNC_SHIFT) // 1 if low active +#define RCLK_TYPE (1 << REG_CAM_CAM_MCNT_IRCLK_SHIFT) // 1 if negative edge /*---------------------------------------------------------------------------* ^` @@ -27,33 +29,13 @@ /*---------------------------------------------------------------------------* ÓIϐ` *---------------------------------------------------------------------------*/ -static CameraSelect currentCamera; -static BOOL cameraPreSleepState; + /*---------------------------------------------------------------------------* ֐` *---------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------* - Name: CAMERA_Select - - Description: select camera to activate - - Arguments: camera one of CameraSelect - - Returns: None - *---------------------------------------------------------------------------*/ -BOOL CAMERA_Select( CameraSelect camera ) +static inline void CAMERAi_Wait(u32 clocks) { - if (currentCamera == camera || CAMERA_SELECT_BOTH == camera) - { - return FALSE; - } - if (CAMERA_I2CSelect(camera) != CAMERA_RESULT_SUCCESS) - { - return FALSE; - } - currentCamera = camera; - return TRUE; + OS_SpinWaitSysCycles(clocks << 1); } /*---------------------------------------------------------------------------* @@ -68,13 +50,16 @@ BOOL CAMERA_Select( CameraSelect camera ) void CAMERA_PowerOn( void ) { reg_CFG_CLK |= REG_CFG_CLK_CAM_MASK; - if ((reg_CFG_CLK & REG_CFG_CLK_CAM_CKI_MASK) == 0) { + if ((reg_CFG_CLK & REG_CFG_CLK_CAM_CKI_MASK) == 0) + { + reg_CAM_CAM_MCNT |= (SYNC_TYPE | RCLK_TYPE); // set polarities + reg_CAM_CAM_MCNT |= REG_CAM_CAM_MCNT_V28_MASK; // VDD2.8 POWER ON - OS_SpinWaitSysCycles( 30 ); // wait for over 15 MCLK (10-20) + CAMERAi_Wait( 10 ); // wait for over 10 MCLKs (M:10-20)(S:10ns?) reg_CFG_CLK |= REG_CFG_CLK_CAM_CKI_MASK; // MCLK on - OS_SpinWaitSysCycles( 30 ); // wait for over 15 MCLKs (20-10) + CAMERAi_Wait( 32 ); // wait for over 32 MCLKs (M:20-10)(S:32) reg_CAM_CAM_MCNT |= REG_CAM_CAM_MCNT_RSTN_MASK; // RSTN => Hi - OS_SpinWaitSysCycles( 12000 ); // wait for over 6000 MCLKs + CAMERAi_Wait( 6000 ); // wait for over 6000 MCLKs reg_CAM_CAM_CNT = REG_CAM_CAM_CNT_CL_MASK; // full reset CNT } @@ -91,54 +76,19 @@ void CAMERA_PowerOn( void ) *---------------------------------------------------------------------------*/ void CAMERA_PowerOff( void ) { - if (reg_CFG_CLK & REG_CFG_CLK_CAM_CKI_MASK) { + if (reg_CFG_CLK & REG_CFG_CLK_CAM_CKI_MASK) + { reg_CAM_CAM_CNT &= ~REG_CAM_CAM_CNT_E_MASK; // stop cmaera output reg_CAM_CAM_MCNT &= ~REG_CAM_CAM_MCNT_RSTN_MASK;// RSTN => Lo - OS_SpinWaitSysCycles( 10 ); // wait for over 5 MCLK + CAMERAi_Wait( 10 ); // wait for over 10 MCLKs (M:10)(S:10ns?) reg_CFG_CLK &= ~REG_CFG_CLK_CAM_CKI_MASK; // MCLK off + CAMERAi_Wait( 20 ); // wait for over 20 MCLKs (M:20)(S:0?) reg_CAM_CAM_MCNT &= ~REG_CAM_CAM_MCNT_V28_MASK; // VDD2.8 POWER OFF - OS_SpinWaitSysCycles( 4 ); // wait a moment - } - reg_CFG_CLK &= ~REG_CFG_CLK_CAM_MASK; /* KvH */ -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_PreSleep - - Description: pre-sleep process for CAMERA without power off - - Arguments: None - - Returns: None - *---------------------------------------------------------------------------*/ -void CAMERA_PreSleep( void ) -{ - if (reg_CFG_CLK & REG_CFG_CLK_CAM_CKI_MASK) { - cameraPreSleepState = TRUE; - CAMERA_I2CPreSleep(); - CAMERA_PowerOff(); - } -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_PostSleep - - Description: pre-sleep process for CAMERA without power off - - Arguments: None - - Returns: None - *---------------------------------------------------------------------------*/ -void CAMERA_PostSleep( void ) -{ - if (cameraPreSleepState == TRUE) { - cameraPreSleepState = FALSE; - CAMERA_PowerOn(); - CAMERA_I2CPostSleep(); } + reg_CFG_CLK &= ~REG_CFG_CLK_CAM_MASK; } /*---------------------------------------------------------------------------* @@ -152,7 +102,7 @@ void CAMERA_PostSleep( void ) *---------------------------------------------------------------------------*/ BOOL CAMERA_IsBusy( void ) { - return (reg_CAM_CAM_CNT & REG_CAM_CAM_CNT_E_MASK) ? TRUE : FALSE; + return (reg_CAM_CAM_CNT & REG_CAM_CAM_CNT_E_MASK) >> REG_CAM_CAM_CNT_E_SHIFT; } /*---------------------------------------------------------------------------* @@ -183,50 +133,11 @@ void CAMERA_Stop( void ) reg_CAM_CAM_CNT &= ~REG_CAM_CAM_CNT_E_MASK; } -/*---------------------------------------------------------------------------* - Name: CAMERA_SetSyncLowActive - - Description: set CAMERA sync polarity - - Arguments: isLowActive if low active, set TRUE - - Returns: None - *---------------------------------------------------------------------------*/ -void CAMERA_SetSyncLowActive( BOOL isLowActive ) -{ - if (isLowActive) { - reg_CAM_CAM_CNT |= (1 << REG_CAM_CAM_MCNT_SYNC_SHIFT); - } else { - reg_CAM_CAM_CNT &= ~(1 << REG_CAM_CAM_MCNT_SYNC_SHIFT); - } -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetRclkNegativeEdge - - Description: set CAMERA rclk edge. - Should call while master clock is stopping. - - Arguments: isNegativeEdge if negative edge, set TRUE - - Returns: None - *---------------------------------------------------------------------------*/ -void CAMERA_SetRclkNegativeEdge( BOOL isNegativeEdge ) -{ - if ((reg_CFG_CLK & REG_CFG_CLK_CAM_CKI_MASK) == 0) { - if (isNegativeEdge) { - reg_CAM_CAM_CNT |= (1 << REG_CAM_CAM_MCNT_IRCLK_SHIFT); - } else { - reg_CAM_CAM_CNT &= ~(1 << REG_CAM_CAM_MCNT_IRCLK_SHIFT); - } - } -} - /*---------------------------------------------------------------------------* Name: CAMERA_SetTrimmingParamsCenter - Description: set camera trimming by centering - expecting original image size is VGA. + Description: set camera trimming parameters by centering + NOTE: should call CAMERA_SetTrimming to enable trimming Arguments: destWidth width of image to output destHeight height of image to output @@ -248,8 +159,9 @@ void CAMERA_SetTrimmingParamsCenter(u16 destWidth, u16 destHeight, u16 srcWidth, /*---------------------------------------------------------------------------* Name: CAMERA_SetTrimmingParams - Description: set camera trimming + Description: set camera trimming parameters NOTE: widht = x2 - x1; height = y2 - y1; + NOTE: should call CAMERA_SetTrimming to enable trimming Arguments: x1 X of top-left trimming point (multiple of 2) y1 Y of top-left trimming point @@ -269,7 +181,7 @@ void CAMERA_SetTrimmingParams(u16 x1, u16 y1, u16 x2, u16 y2) /*---------------------------------------------------------------------------* Name: CAMERA_SetTrimming - Description: set trimming enable/disable + Description: set trimming to be enabled/disabled Arguments: enabled TRUE if set trimming will be enabled @@ -277,11 +189,9 @@ void CAMERA_SetTrimmingParams(u16 x1, u16 y1, u16 x2, u16 y2) *---------------------------------------------------------------------------*/ void CAMERA_SetTrimming( BOOL enabled ) { - if (enabled) { - reg_CAM_CAM_CNT |= REG_CAM_CAM_CNT_T_MASK; - } else { - reg_CAM_CAM_CNT &= ~REG_CAM_CAM_CNT_T_MASK; - } + u16 value = reg_CAM_CAM_CNT; + reg_CAM_CAM_CNT = enabled ? (u16)(value | REG_CAM_CAM_CNT_T_MASK) + : (u16)(value & ~REG_CAM_CAM_CNT_T_MASK); } /*---------------------------------------------------------------------------* @@ -295,14 +205,14 @@ void CAMERA_SetTrimming( BOOL enabled ) *---------------------------------------------------------------------------*/ void CAMERA_SetOutputFormat( CameraOutput output ) { - switch (output) { + u16 value = reg_CAM_CAM_CNT; + switch (output) + { case CAMERA_OUTPUT_YUV: - reg_CAM_CAM_CNT &= ~(1 << REG_CAM_CAM_CNT_F_SHIFT); + reg_CAM_CAM_CNT = (u16)(value & ~REG_CAM_CAM_CNT_F_MASK); break; case CAMERA_OUTPUT_RGB: - reg_CAM_CAM_CNT |= (1 << REG_CAM_CAM_CNT_F_SHIFT); - break; - default: + reg_CAM_CAM_CNT = (u16)(value | REG_CAM_CAM_CNT_F_MASK); break; } } @@ -318,7 +228,7 @@ void CAMERA_SetOutputFormat( CameraOutput output ) *---------------------------------------------------------------------------*/ BOOL CAMERA_GetErrorStatus( void ) { - return (reg_CAM_CAM_CNT & REG_CAM_CAM_CNT_ERR_MASK) ? TRUE : FALSE; + return (reg_CAM_CAM_CNT & REG_CAM_CAM_CNT_ERR_MASK) >> REG_CAM_CAM_CNT_ERR_SHIFT; } /*---------------------------------------------------------------------------* @@ -346,11 +256,9 @@ void CAMERA_ClearBuffer( void ) *---------------------------------------------------------------------------*/ void CAMERA_SetMasterIntrrupt( BOOL enabled ) { - if (enabled) { - reg_CAM_CAM_CNT |= REG_CAM_CAM_CNT_IREQ_I_MASK; - } else { - reg_CAM_CAM_CNT &= ~REG_CAM_CAM_CNT_IREQ_I_MASK; - } + u16 value = reg_CAM_CAM_CNT; + reg_CAM_CAM_CNT = enabled ? (u16)(value | REG_CAM_CAM_CNT_IREQ_I_MASK) + : (u16)(value & ~REG_CAM_CAM_CNT_IREQ_I_MASK); } /*---------------------------------------------------------------------------* @@ -378,11 +286,9 @@ void CAMERA_SetVsyncIntrrupt( CameraIntrVsync type ) *---------------------------------------------------------------------------*/ void CAMERA_SetBufferErrorIntrrupt( BOOL enabled ) { - if (enabled) { - reg_CAM_CAM_CNT |= REG_CAM_CAM_CNT_IREQ_BE_MASK; - } else { - reg_CAM_CAM_CNT &= ~REG_CAM_CAM_CNT_IREQ_BE_MASK; - } + u16 value = reg_CAM_CAM_CNT; + reg_CAM_CAM_CNT = enabled ? (u16)(value | REG_CAM_CAM_CNT_IREQ_BE_MASK) + : (u16)(value & ~REG_CAM_CAM_CNT_IREQ_BE_MASK); } /*---------------------------------------------------------------------------* diff --git a/build/libraries/camera/ARM9/camera_api.c b/build/libraries/camera/ARM9/camera_api.c index c1334dc..a409a8b 100644 --- a/build/libraries/camera/ARM9/camera_api.c +++ b/build/libraries/camera/ARM9/camera_api.c @@ -61,7 +61,7 @@ static CAMERAWork cameraWork; ֐` *---------------------------------------------------------------------------*/ static BOOL CameraSendPxiCommand(CAMERAPxiCommand command, u8 size, u8 data); -static BOOL CameraSendPxiData(u8 *pData); +static void CameraSendPxiData(u8 *pData); static void CameraPxiCallback(PXIFifoTag tag, u32 data, BOOL err); static void CameraSyncCallback(CAMERAResult result, void *arg); static void CameraCallCallbackAndUnlock(CAMERAResult result); @@ -97,498 +97,6 @@ void CAMERA_Init(void) PXI_SetFifoRecvCallback(PXI_FIFO_TAG_CAMERA, CameraPxiCallback); } -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CSelectAsync - - Description: select CAMERA to activate - async version - - Arguments: camera - one of CameraSelect - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CSelectAsync(CameraSelect camera, CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_SELECT; - const u8 size = CAMERA_PXI_SIZE_SELECT; - OSIntrMode enabled; - - SDK_NULL_ASSERT(callback); - - if (CAMERA_SELECT_BOTH == camera) - { - return CAMERA_RESULT_ILLEGAL_PARAMETER; - } - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - return CameraSendPxiCommand(command, size, (u8)camera) ? CAMERA_RESULT_SUCCESS : CAMERA_RESULT_SEND_ERROR; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CSelect - - Description: select CAMERA to activate - sync version. - - Arguments: camera - one of CameraSelect - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CSelect(CameraSelect camera) -{ - cameraWork.result = CAMERA_I2CSelectAsync(camera, CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} - - -/*---------------------------------------------------------------------------* - Name: CAMERA_WriteRegistersAsync - - Description: write CAMERA registers via I2C. - async version. - - Arguments: camera - one of CameraSelect - addr - start address - bufp - buffer to write - length - length of bufp - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_WriteRegistersAsync(CameraSelect camera, u8 addr, const u8* bufp, size_t length, CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_WRITE_REGISTERS; - u8 size; // variable!! - OSIntrMode enabled; - u8 data[CAMERA_PXI_DATA_SIZE_MAX]; - int i; - - SDK_NULL_ASSERT(bufp); - SDK_NULL_ASSERT(callback); - - if (CAMERA_SELECT_NONE == camera) - { - return CAMERA_RESULT_ILLEGAL_PARAMETER; - } - if (length + 3 > CAMERA_PXI_DATA_SIZE_MAX) - { - return CAMERA_RESULT_ILLEGAL_PARAMETER; // too long - } - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - // f[^쐬 - data[0] = (u8)camera; - data[1] = addr; - data[2] = (u8)length; - MI_CpuCopy8(bufp, &data[3], length); - size = (u8)(length + 3); - - // R}hM - if (CameraSendPxiCommand(command, size, data[0]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - for (i = 1; i < size; i+=3) { - if (CameraSendPxiData(&data[i]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - } - - return CAMERA_RESULT_SUCCESS; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_WriteRegisters - - Description: write CAMERA registers via I2C. - sync version. - - Arguments: camera - one of CameraSelect - addr - start address - bufp - buffer to write - length - length of bufp - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_WriteRegisters(CameraSelect camera, u8 addr, const u8* bufp, size_t length) -{ - cameraWork.result = CAMERA_WriteRegistersAsync(camera, addr, bufp, length, CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ReadRegistersAsync - - Description: read CAMERA registers via I2C. - - Arguments: camera - one of CameraSelect - addr - start address - bufp - buffer to read - length - length of bufp - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ReadRegistersAsync(CameraSelect camera, u8 addr, u8* bufp, size_t length, CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_READ_REGISTERS; - const u8 size = CAMERA_PXI_SIZE_READ_REGISTERS; - OSIntrMode enabled; - u8 data[size]; - int i; - - SDK_NULL_ASSERT(bufp); - SDK_NULL_ASSERT(callback); - - if (CAMERA_SELECT_NONE == camera) - { - return CAMERA_RESULT_ILLEGAL_PARAMETER; - } - if (length + 1 > CAMERA_PXI_DATA_SIZE_MAX) - { - return CAMERA_RESULT_ILLEGAL_PARAMETER; // too long - } - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - // f[^쐬 - data[0] = (u8)camera; - data[1] = addr; - data[2] = (u8)length; - - // ۑ - cameraWork.data = bufp; - cameraWork.size = (u8)length; - - // R}hM - if (CameraSendPxiCommand(command, size, data[0]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - for (i = 1; i < size; i+=3) { - if (CameraSendPxiData(&data[i]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - } - - return CAMERA_RESULT_SUCCESS; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ReadRegisters - - Description: set CAMERA key normally - sync version. - - Arguments: camera - one of CameraSelect - addr - start address - bufp - buffer to read - length - length of bufp - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ReadRegisters(CameraSelect camera, u8 addr, u8* bufp, size_t length) -{ - cameraWork.result = CAMERA_ReadRegistersAsync(camera, addr, bufp, length, CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetParamsAsync - - Description: set register as reg = (reg & ~mask) | (bits & mask); - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - mask - mask to touch - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetParamsAsync(CameraSelect camera, u8 addr, u8 bits, u8 mask, CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_SET_PARAMS; - const u8 size = CAMERA_PXI_SIZE_SET_PARAMS; - OSIntrMode enabled; - u8 data[size]; - int i; - - SDK_NULL_ASSERT(callback); - - if (CAMERA_SELECT_NONE == camera) - { - return CAMERA_RESULT_ILLEGAL_PARAMETER; - } - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - // f[^쐬 - data[0] = (u8)camera; - data[1] = addr; - data[2] = bits; - data[3] = mask; - - // R}hM - if (CameraSendPxiCommand(command, size, data[0]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - for (i = 1; i < size; i+=3) { - if (CameraSendPxiData(&data[i]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - } - - return CAMERA_RESULT_SUCCESS; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetParams - - Description: set register as reg = (reg & ~mask) | (bits & mask); - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - mask - mask to touch - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetParams(CameraSelect camera, u8 addr, u8 bits, u8 mask) -{ - cameraWork.result = CAMERA_SetParamsAsync(camera, addr, bits, mask, CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetFlagsAsync - - Description: set register as reg |= bits; - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetFlagsAsync(CameraSelect camera, u8 addr, u8 bits, CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_SET_FLAGS; - const u8 size = CAMERA_PXI_SIZE_SET_FLAGS; - OSIntrMode enabled; - u8 data[size]; - int i; - - SDK_NULL_ASSERT(callback); - - if (CAMERA_SELECT_NONE == camera) - { - return CAMERA_RESULT_ILLEGAL_PARAMETER; - } - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - // f[^쐬 - data[0] = (u8)camera; - data[1] = addr; - data[2] = bits; - - // R}hM - if (CameraSendPxiCommand(command, size, data[0]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - for (i = 1; i < size; i+=3) { - if (CameraSendPxiData(&data[i]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - } - - return CAMERA_RESULT_SUCCESS; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetFlags - - Description: set register as reg |= bits; - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetFlags(CameraSelect camera, u8 addr, u8 bits) -{ - cameraWork.result = CAMERA_SetFlagsAsync(camera, addr, bits, CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ClearFlagsAsync - - Description: set register as reg &= ~bits; - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to clear - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ClearFlagsAsync(CameraSelect camera, u8 addr, u8 bits, CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_CLEAR_FLAGS; - const u8 size = CAMERA_PXI_SIZE_CLEAR_FLAGS; - OSIntrMode enabled; - u8 data[size]; - int i; - - SDK_NULL_ASSERT(callback); - - if (CAMERA_SELECT_NONE == camera) - { - return CAMERA_RESULT_ILLEGAL_PARAMETER; - } - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - // f[^쐬 - data[0] = (u8)camera; - data[1] = addr; - data[2] = bits; - - // R}hM - if (CameraSendPxiCommand(command, size, data[0]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - for (i = 1; i < size; i+=3) { - if (CameraSendPxiData(&data[i]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } - } - - return CAMERA_RESULT_SUCCESS; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ClearFlags - - Description: set register as reg &= ~bits; - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ClearFlags(CameraSelect camera, u8 addr, u8 bits) -{ - cameraWork.result = CAMERA_ClearFlagsAsync(camera, addr, bits, CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} - /*---------------------------------------------------------------------------* Name: CAMERA_I2CInitAsync @@ -603,8 +111,8 @@ CAMERAResult CAMERA_ClearFlags(CameraSelect camera, u8 addr, u8 bits) *---------------------------------------------------------------------------*/ CAMERAResult CAMERA_I2CInitAsync(CameraSelect camera, CAMERACallback callback, void *arg) { - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_I2C_INIT; - const u8 size = CAMERA_PXI_SIZE_I2C_INIT; + const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_INIT; + const u8 size = CAMERA_PXI_SIZE_INIT; OSIntrMode enabled; SDK_NULL_ASSERT(callback); @@ -648,24 +156,85 @@ CAMERAResult CAMERA_I2CInit(CameraSelect camera) } return cameraWork.result; } -#if 0 -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPresetAsync - Description: set camera registers with specified preset via I2C +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CActivateAsync + + Description: activate specified CAMERA (goto standby if NONE is specified) async version Arguments: camera - one of CameraSelect - preset - preset type callback - 񓯊ĂɌĂяo֐w arg - R[obN֐̌ĂяöwB Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPresetAsync(CameraSelect camera, CameraPreset preset, CAMERACallback callback, void *arg) +CAMERAResult CAMERA_I2CActivateAsync(CameraSelect camera, CAMERACallback callback, void *arg) { - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_I2C_PRESET; - const u8 size = CAMERA_PXI_SIZE_I2C_PRESET; + const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_ACTIVATE; + const u8 size = CAMERA_PXI_SIZE_ACTIVATE; + OSIntrMode enabled; + + SDK_NULL_ASSERT(callback); + + if (CAMERA_SELECT_BOTH == camera) + { + return CAMERA_RESULT_ILLEGAL_PARAMETER; + } + + enabled = OS_DisableInterrupts(); + if (cameraWork.lock) + { + (void)OS_RestoreInterrupts(enabled); + return CAMERA_RESULT_BUSY; + } + cameraWork.lock = TRUE; + (void)OS_RestoreInterrupts(enabled); + // R[obNݒ + cameraWork.callback = callback; + cameraWork.callbackArg = arg; + + return CameraSendPxiCommand(command, size, (u8)camera) ? CAMERA_RESULT_SUCCESS : CAMERA_RESULT_SEND_ERROR; +} + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CActivate + + Description: activate specified CAMERA (goto standby if NONE is specified) + sync version. + + Arguments: camera - one of CameraSelect + + Returns: CAMERAResult + *---------------------------------------------------------------------------*/ +CAMERAResult CAMERA_I2CActivate(CameraSelect camera) +{ + cameraWork.result = CAMERA_I2CActivateAsync(camera, CameraSyncCallback, 0); + if (cameraWork.result == CAMERA_RESULT_SUCCESS) + { + CameraWaitBusy(); + } + return cameraWork.result; +} + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CResizeAsync + + Description: resize CAMERA output image + async version + + Arguments: camera - one of CameraResize + width - width of the image + height - height of the image + callback - 񓯊ĂɌĂяo֐w + arg - R[obN֐̌ĂяöwB + + Returns: CAMERAResult + *---------------------------------------------------------------------------*/ +CAMERAResult CAMERA_I2CResizeAsync(CameraSelect camera, u16 width, u16 height, CAMERACallback callback, void *arg) +{ + const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_RESIZE; + const u8 size = CAMERA_PXI_SIZE_RESIZE; OSIntrMode enabled; u8 data[size]; int i; @@ -691,7 +260,8 @@ CAMERAResult CAMERA_I2CPresetAsync(CameraSelect camera, CameraPreset preset, CAM // f[^쐬 data[0] = (u8)camera; - data[1] = (u8)preset; + CAMERA_PACK_U16(&data[1], &width); + CAMERA_PACK_U16(&data[3], &height); // R}hM if (CameraSendPxiCommand(command, size, data[0]) == FALSE) @@ -699,164 +269,132 @@ CAMERAResult CAMERA_I2CPresetAsync(CameraSelect camera, CameraPreset preset, CAM return CAMERA_RESULT_SEND_ERROR; } for (i = 1; i < size; i+=3) { - if (CameraSendPxiData(&data[i]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } + CameraSendPxiData(&data[i]); } return CAMERA_RESULT_SUCCESS; } /*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreset + Name: CAMERA_I2CResize - Description: set camera registers with specified preset via I2C + Description: resize CAMERA output image sync version. + Arguments: camera - one of CameraResize + width - width of the image + height - height of the image + + Returns: CAMERAResult + *---------------------------------------------------------------------------*/ +CAMERAResult CAMERA_I2CResize(CameraSelect camera, u16 width, u16 height) +{ + cameraWork.result = CAMERA_I2CResizeAsync(camera, width, height, CameraSyncCallback, 0); + if (cameraWork.result == CAMERA_RESULT_SUCCESS) + { + CameraWaitBusy(); + } + return cameraWork.result; +} + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CFrameRateAsync + + Description: set CAMERA frame rate (0 means automatic) + async version + Arguments: camera - one of CameraSelect - preset - preset type - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPreset(CameraSelect camera, CameraPreset preset) -{ - cameraWork.result = CAMERA_I2CPresetAsync(camera, preset, CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} -#endif -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreSleepAsync - - Description: pre-sleep process in camera registers via I2C - async version. - - Arguments: callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPreSleepAsync(CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_I2C_PRE_SLEEP; - const u8 size = CAMERA_PXI_SIZE_I2C_PRE_SLEEP; - OSIntrMode enabled; - - SDK_NULL_ASSERT(callback); - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - return CameraSendPxiCommand(command, size, 0) ? CAMERA_RESULT_SUCCESS : CAMERA_RESULT_SEND_ERROR; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreSleep - - Description: pre-sleep process in camera registers via I2C - sync version. - - Arguments: None. - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPreSleep(void) -{ - cameraWork.result = CAMERA_I2CPreSleepAsync(CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} - - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPostSleepAsync - - Description: post-sleep process in camera registers via I2C - async version. - - Arguments: callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPostSleepAsync(CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_I2C_POST_SLEEP; - const u8 size = CAMERA_PXI_SIZE_I2C_POST_SLEEP; - OSIntrMode enabled; - - SDK_NULL_ASSERT(callback); - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - return CameraSendPxiCommand(command, size, 0) ? CAMERA_RESULT_SUCCESS : CAMERA_RESULT_SEND_ERROR; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPostSleep - - Description: post-sleep process in camera registers via I2C - sync version. - - Arguments: None. - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPostSleep(void) -{ - cameraWork.result = CAMERA_I2CPostSleepAsync(CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetCroppingAsync - - Description: set offset and size - - Arguments: camera - one of CameraSelect - x_off - x offset to start capturing - y_off - y offset to start capturing - width - width of image - height - height of image + rate - frame rate (fps) callback - 񓯊ĂɌĂяo֐w arg - R[obN֐̌ĂяöwB Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetCroppingAsync(CameraSelect camera, u16 x_off, u16 y_off, u16 width, u16 height, CAMERACallback callback, void *arg) +CAMERAResult CAMERA_I2CFrameRateAsync(CameraSelect camera, int rate, CAMERACallback callback, void *arg) { - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_I2C_SET_CROPPING; - const u8 size = CAMERA_PXI_SIZE_I2C_SET_CROPPING; + const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_FRAME_RATE; + const u8 size = CAMERA_PXI_SIZE_FRAME_RATE; + OSIntrMode enabled; + u8 data[size]; + int i; + + SDK_NULL_ASSERT(callback); + + if (CAMERA_SELECT_NONE == camera) + { + return CAMERA_RESULT_ILLEGAL_PARAMETER; + } + if (rate < 0 || rate > 30) + { + return CAMERA_RESULT_ILLEGAL_PARAMETER; + } + + enabled = OS_DisableInterrupts(); + if (cameraWork.lock) + { + (void)OS_RestoreInterrupts(enabled); + return CAMERA_RESULT_BUSY; + } + cameraWork.lock = TRUE; + (void)OS_RestoreInterrupts(enabled); + // R[obNݒ + cameraWork.callback = callback; + cameraWork.callbackArg = arg; + + // f[^쐬 + data[0] = (u8)camera; + data[1] = (u8)rate; + + // R}hM + if (CameraSendPxiCommand(command, size, data[0]) == FALSE) + { + return CAMERA_RESULT_SEND_ERROR; + } + for (i = 1; i < size; i+=3) { + CameraSendPxiData(&data[i]); + } + + return CAMERA_RESULT_SUCCESS; +} + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CFrameRate + + Description: set CAMERA frame rate (0 means automatic) + sync version. + + Arguments: camera - one of CameraSelect + rate - frame rate (fps) + + Returns: CAMERAResult + *---------------------------------------------------------------------------*/ +CAMERAResult CAMERA_I2CFrameRate(CameraSelect camera, int rate) +{ + cameraWork.result = CAMERA_I2CFrameRateAsync(camera, rate, CameraSyncCallback, 0); + if (cameraWork.result == CAMERA_RESULT_SUCCESS) + { + CameraWaitBusy(); + } + return cameraWork.result; +} + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CEffectAsync + + Description: set CAMERA frame rate (0 means automatic) + async version + + Arguments: camera - one of CameraSelect + effect - one of CameraEffect + callback - 񓯊ĂɌĂяo֐w + arg - R[obN֐̌ĂяöwB + + Returns: CAMERAResult + *---------------------------------------------------------------------------*/ +CAMERAResult CAMERA_I2CEffectAsync(CameraSelect camera, CameraEffect effect, CAMERACallback callback, void *arg) +{ + const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_EFFECT; + const u8 size = CAMERA_PXI_SIZE_EFFECT; OSIntrMode enabled; u8 data[size]; int i; @@ -882,10 +420,7 @@ CAMERAResult CAMERA_SetCroppingAsync(CameraSelect camera, u16 x_off, u16 y_off, // f[^쐬 data[0] = (u8)camera; - CAMERA_PACK_U16(&data[1], &x_off); - CAMERA_PACK_U16(&data[3], &y_off); - CAMERA_PACK_U16(&data[5], &width); - CAMERA_PACK_U16(&data[7], &height); + data[1] = (u8)effect; // R}hM if (CameraSendPxiCommand(command, size, data[0]) == FALSE) @@ -893,31 +428,26 @@ CAMERAResult CAMERA_SetCroppingAsync(CameraSelect camera, u16 x_off, u16 y_off, return CAMERA_RESULT_SEND_ERROR; } for (i = 1; i < size; i+=3) { - if (CameraSendPxiData(&data[i]) == FALSE) - { - return CAMERA_RESULT_SEND_ERROR; - } + CameraSendPxiData(&data[i]); } return CAMERA_RESULT_SUCCESS; } /*---------------------------------------------------------------------------* - Name: CAMERA_SetCropping + Name: CAMERA_I2CEffect - Description: set offset and size + Description: set CAMERA frame rate (0 means automatic) + sync version. Arguments: camera - one of CameraSelect - x_off - x offset to start capturing - y_off - y offset to start capturing - width - width of image - height - height of image + effect - one of CameraEffect Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetCropping(CameraSelect camera, u16 x_off, u16 y_off, u16 width, u16 height) +CAMERAResult CAMERA_I2CEffect(CameraSelect camera, CameraEffect effect) { - cameraWork.result = CAMERA_SetCroppingAsync(camera, x_off, y_off, width, height, CameraSyncCallback, 0); + cameraWork.result = CAMERA_I2CEffectAsync(camera, effect, CameraSyncCallback, 0); if (cameraWork.result == CAMERA_RESULT_SUCCESS) { CameraWaitBusy(); @@ -926,24 +456,33 @@ CAMERAResult CAMERA_SetCropping(CameraSelect camera, u16 x_off, u16 y_off, u16 w } /*---------------------------------------------------------------------------* - Name: CAMERA_PauseAsync + Name: CAMERA_I2CFlipAsync - Description: pause camera via I2C - async version. + Description: set CAMERA frame rate (0 means automatic) + async version - Arguments: callback - 񓯊ĂɌĂяo֐w + Arguments: camera - one of CameraSelect + flip - one of CameraFlip + callback - 񓯊ĂɌĂяo֐w arg - R[obN֐̌ĂяöwB Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_PauseAsync(CAMERACallback callback, void *arg) +CAMERAResult CAMERA_I2CFlipAsync(CameraSelect camera, CameraFlip flip, CAMERACallback callback, void *arg) { - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_I2C_PAUSE; - const u8 size = CAMERA_PXI_SIZE_I2C_PAUSE; + const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_FLIP; + const u8 size = CAMERA_PXI_SIZE_FLIP; OSIntrMode enabled; + u8 data[size]; + int i; SDK_NULL_ASSERT(callback); + if (CAMERA_SELECT_NONE == camera) + { + return CAMERA_RESULT_ILLEGAL_PARAMETER; + } + enabled = OS_DisableInterrupts(); if (cameraWork.lock) { @@ -956,22 +495,36 @@ CAMERAResult CAMERA_PauseAsync(CAMERACallback callback, void *arg) cameraWork.callback = callback; cameraWork.callbackArg = arg; - return CameraSendPxiCommand(command, size, 0) ? CAMERA_RESULT_SUCCESS : CAMERA_RESULT_SEND_ERROR; + // f[^쐬 + data[0] = (u8)camera; + data[1] = (u8)flip; + + // R}hM + if (CameraSendPxiCommand(command, size, data[0]) == FALSE) + { + return CAMERA_RESULT_SEND_ERROR; + } + for (i = 1; i < size; i+=3) { + CameraSendPxiData(&data[i]); + } + + return CAMERA_RESULT_SUCCESS; } /*---------------------------------------------------------------------------* - Name: CAMERA_Pause + Name: CAMERA_I2CFlip - Description: pause camera via I2C + Description: set CAMERA frame rate (0 means automatic) sync version. - Arguments: None. + Arguments: camera - one of CameraSelect + flip - one of CameraFlip Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_Pause(void) +CAMERAResult CAMERA_I2CFlip(CameraSelect camera, CameraFlip flip) { - cameraWork.result = CAMERA_PauseAsync(CameraSyncCallback, 0); + cameraWork.result = CAMERA_I2CFlipAsync(camera, flip, CameraSyncCallback, 0); if (cameraWork.result == CAMERA_RESULT_SUCCESS) { CameraWaitBusy(); @@ -979,59 +532,6 @@ CAMERAResult CAMERA_Pause(void) return cameraWork.result; } -/*---------------------------------------------------------------------------* - Name: CAMERA_ResumeAsync - - Description: resume camera from pausing via I2C - async version. - - Arguments: callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ResumeAsync(CAMERACallback callback, void *arg) -{ - const CAMERAPxiCommand command = CAMERA_PXI_COMMAND_I2C_RESUME; - const u8 size = CAMERA_PXI_SIZE_I2C_RESUME; - OSIntrMode enabled; - - SDK_NULL_ASSERT(callback); - - enabled = OS_DisableInterrupts(); - if (cameraWork.lock) - { - (void)OS_RestoreInterrupts(enabled); - return CAMERA_RESULT_BUSY; - } - cameraWork.lock = TRUE; - (void)OS_RestoreInterrupts(enabled); - // R[obNݒ - cameraWork.callback = callback; - cameraWork.callbackArg = arg; - - return CameraSendPxiCommand(command, size, 0) ? CAMERA_RESULT_SUCCESS : CAMERA_RESULT_SEND_ERROR; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_Resume - - Description: resume camera from pausing via I2C - sync version. - - Arguments: None. - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_Resume(void) -{ - cameraWork.result = CAMERA_ResumeAsync(CameraSyncCallback, 0); - if (cameraWork.result == CAMERA_RESULT_SUCCESS) - { - CameraWaitBusy(); - } - return cameraWork.result; -} /*---------------------------------------------------------------------------* Name: CameraSendPxiCommand @@ -1065,17 +565,14 @@ static BOOL CameraSendPxiCommand(CAMERAPxiCommand command, u8 size, u8 data) Arguments: pData - 3oCgf[^̐擪ւ̃|C^ - Returns: BOOL - PXIɑ΂đMꍇTRUEA - PXIɂ鑗MɎsꍇFALSEԂB + Returns: None *---------------------------------------------------------------------------*/ -static BOOL CameraSendPxiData(u8 *pData) +static void CameraSendPxiData(u8 *pData) { u32 pxiData = (u32)((pData[0] << 16) | (pData[1] << 8) | pData[2]); - if (0 > PXI_SendWordByFifo(PXI_FIFO_TAG_CAMERA, pxiData, 0)) + while (0 > PXI_SendWordByFifo(PXI_FIFO_TAG_CAMERA, pxiData, 0)) { - return FALSE; } - return TRUE; } /*---------------------------------------------------------------------------* diff --git a/build/libraries/i2c/ARM7/src/i2c_instruction.c b/build/libraries/i2c/ARM7/src/i2c_instruction.c index c1540a6..94c8be1 100644 --- a/build/libraries/i2c/ARM7/src/i2c_instruction.c +++ b/build/libraries/i2c/ARM7/src/i2c_instruction.c @@ -1,8 +1,8 @@ /*---------------------------------------------------------------------------* - Project: TwlSDK - libraties - I2C_ - File: I2C__instruction.c + Project: TwlSDK - libraties - i2c + File: i2c_instruction.c - Copyright 2006-2007 Nintendo. All rights reserved. + Copyright 2007 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo @@ -16,6 +16,25 @@ #include #include +//#define PRINT_DEBUG +//#define PRINT_DEBUG_MINI // rough version + +#ifdef PRINT_DEBUG +#include +#define DBG_PRINTF OS_TPrintf +#undef PRINT_DEBUG_MINI // because of the alternative option +#else +#define DBG_PRINTF( ... ) ((void)0) +#endif +#ifdef PRINT_DEBUG_MINI +#include +#define DBG_PRINT_FUNC() OS_TPrintf("%s(0x%02X, 0x%02X, ...);\n", __func__, I2C_DeviceAddrTable[id], reg) +#define DBG_PRINT_ERR() OS_TPrintf(" Failed(%d) @ %d\n", error, r) +#else +#define DBG_PRINT_FUNC() ((void)0) +#define DBG_PRINT_ERR() ((void)0) +#endif + #define RETRY_COUNT 8 static u8 I2C_DeviceAddrTable[I2C_SLAVE_NUM] = { @@ -73,23 +92,27 @@ static inline void I2Ci_StopPhase2( void ) static inline void I2Ci_SetData( u8 data ) { + DBG_PRINTF(">%02X", data); reg_EXI_I2CD = data; } static inline u8 I2Ci_GetData( void ) { + DBG_PRINTF("<%02X", reg_EXI_I2CD); return reg_EXI_I2CD; } static inline BOOL I2Ci_GetResult( void ) { I2Ci_Wait(); + DBG_PRINTF("%c", (reg_EXI_I2CCNT & REG_EXI_I2CCNT_ACK_MASK) ? '.' : '*'); return (BOOL)((reg_EXI_I2CCNT & REG_EXI_I2CCNT_ACK_MASK) >> REG_EXI_I2CCNT_ACK_SHIFT); } static inline BOOL I2Ci_SendStart( I2CSlave id ) { + DBG_PRINTF("\n"); I2Ci_Wait(); I2Ci_SetData( (u8)(I2C_DeviceAddrTable[id] | (u8)I2C_WRITE) ); I2Ci_Start(); @@ -150,14 +173,16 @@ static inline u8 I2Ci_WaitReceiveLast( void ) static inline BOOL I2Ci_SendMiddle16( u16 data ) { - return I2Ci_SendMiddle( (u8)(data >> 8) ) - && I2Ci_SendMiddle( (u8)(data && 0xFF) ); + BOOL rHi = I2Ci_SendMiddle( (u8)(data >> 8) ); + BOOL rLo = I2Ci_SendMiddle( (u8)(data & 0xFF) ); + return (rHi && rLo); } static inline BOOL I2Ci_SendLast16( u16 data ) { - return I2Ci_SendMiddle( (u8)(data >> 8) ) - && I2Ci_SendLast( (u8)(data && 0xFF) ); + BOOL rHi = I2Ci_SendMiddle( (u8)(data >> 8) ); + BOOL rLo = I2Ci_SendLast( (u8)(data & 0xFF) ); + return (rHi && rLo); } static inline u16 I2Ci_WaitReceiveMiddle16( void ) @@ -399,6 +424,7 @@ BOOL I2Ci_WriteRegister( I2CSlave id, u8 reg, u8 data ) { int r; int error; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -406,6 +432,7 @@ BOOL I2Ci_WriteRegister( I2CSlave id, u8 reg, u8 data ) if (I2Ci_SendMiddle( reg ) == FALSE) error++; if (I2Ci_SendLast( data ) == FALSE) error++; if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : TRUE; } @@ -423,6 +450,7 @@ BOOL I2Ci_WriteRegister16( I2CSlave id, u16 reg, u16 data ) { int r; int error; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -430,7 +458,8 @@ BOOL I2Ci_WriteRegister16( I2CSlave id, u16 reg, u16 data ) if (I2Ci_SendMiddle16( reg ) == FALSE) error++; if (I2Ci_SendLast16( data ) == FALSE) error++; if (error == 0) break; - }OS_TPrintf("%s(%d<%d>, %d, %d); => error = %d, r = %d\n", __func__, id, I2C_DeviceAddrTable[id], reg, data, error, r); + DBG_PRINT_ERR(); + } return error ? FALSE : TRUE; } @@ -448,6 +477,7 @@ u8 I2Ci_ReadRegister( I2CSlave id, u8 reg ) int r; u8 data; int error; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -456,6 +486,7 @@ u8 I2Ci_ReadRegister( I2CSlave id, u8 reg ) if (I2Ci_ReceiveStart( id ) == FALSE) error++; data = I2Ci_WaitReceiveLast(); if (error == 0) break; + DBG_PRINT_ERR(); } return error ? (u8)0xee : data; } @@ -473,6 +504,7 @@ u8 I2Ci_ReadRegisterSC( I2CSlave id, u8 reg ) int r; u8 data; int error; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -481,6 +513,7 @@ u8 I2Ci_ReadRegisterSC( I2CSlave id, u8 reg ) if (I2Ci_ReceiveStart( id ) == FALSE) error++; data = I2Ci_WaitReceiveLast(); if (error == 0) break; + DBG_PRINT_ERR(); } return error ? (u8)0xee : data; } @@ -498,6 +531,7 @@ u16 I2Ci_ReadRegister16( I2CSlave id, u16 reg ) int r; u16 data; int error; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -506,6 +540,7 @@ u16 I2Ci_ReadRegister16( I2CSlave id, u16 reg ) if (I2Ci_ReceiveStart( id ) == FALSE) error++; data = I2Ci_WaitReceiveLast16(); if (error == 0) break; + DBG_PRINT_ERR(); } return error ? (u16)0xeeee : data; } @@ -524,6 +559,7 @@ BOOL I2Ci_VerifyRegister( I2CSlave id, u8 reg, u8 data ) int r; int error; BOOL result; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -536,6 +572,7 @@ BOOL I2Ci_VerifyRegister( I2CSlave id, u8 reg, u8 data ) result = FALSE; } if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : (result ? TRUE : FALSE); } @@ -553,6 +590,7 @@ BOOL I2Ci_VerifyRegisterSC( I2CSlave id, u8 reg, u8 data ) int r; int error; BOOL result; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -565,6 +603,7 @@ BOOL I2Ci_VerifyRegisterSC( I2CSlave id, u8 reg, u8 data ) result = FALSE; } if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : (result ? TRUE : FALSE); } @@ -582,6 +621,7 @@ BOOL I2Ci_VerifyRegister16( I2CSlave id, u16 reg, u16 data ) int r; int error; BOOL result; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -594,6 +634,7 @@ BOOL I2Ci_VerifyRegister16( I2CSlave id, u16 reg, u16 data ) result = FALSE; } if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : (result ? TRUE : FALSE); } @@ -614,6 +655,7 @@ BOOL I2Ci_WriteRegisters( I2CSlave id, u8 reg, const u8 *bufp, size_t size ) int r; int error; const u8 *ptr; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -626,6 +668,7 @@ BOOL I2Ci_WriteRegisters( I2CSlave id, u8 reg, const u8 *bufp, size_t size ) } if (I2Ci_SendLast( *ptr++ ) == FALSE) error++; if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : TRUE; } @@ -645,6 +688,7 @@ BOOL I2Ci_WriteRegisters16( I2CSlave id, u16 reg, const u16 *bufp, size_t size ) int r; int error; const u16 *ptr; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -657,6 +701,7 @@ BOOL I2Ci_WriteRegisters16( I2CSlave id, u16 reg, const u16 *bufp, size_t size ) } if (I2Ci_SendLast16( *ptr++ ) == FALSE) error++; if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : TRUE; } @@ -676,6 +721,7 @@ BOOL I2Ci_ReadRegisters( I2CSlave id, u8 reg, u8 *bufp, size_t size ) int r; int error; u8 *ptr; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -696,6 +742,7 @@ BOOL I2Ci_ReadRegisters( I2CSlave id, u8 reg, u8 *bufp, size_t size ) { (void)I2Ci_WaitReceiveLast(); } + DBG_PRINT_ERR(); } return error ? FALSE : TRUE; } @@ -714,6 +761,7 @@ BOOL I2Ci_ReadRegistersSC( I2CSlave id, u8 reg, u8 *bufp, size_t size ) int r; int error; u8 *ptr; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -734,6 +782,7 @@ BOOL I2Ci_ReadRegistersSC( I2CSlave id, u8 reg, u8 *bufp, size_t size ) { (void)I2Ci_WaitReceiveLast(); } + DBG_PRINT_ERR(); } return error ? FALSE : TRUE; } @@ -752,6 +801,7 @@ BOOL I2Ci_ReadRegisters16( I2CSlave id, u16 reg, u16 *bufp, size_t size ) int r; int error; u16 *ptr; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -772,6 +822,7 @@ BOOL I2Ci_ReadRegisters16( I2CSlave id, u16 reg, u16 *bufp, size_t size ) { (void)I2Ci_WaitReceiveLast16(); } + DBG_PRINT_ERR(); } return error ? FALSE : TRUE; } @@ -792,6 +843,7 @@ BOOL I2Ci_VerifyRegisters( I2CSlave id, u8 reg, const u8 *bufp, size_t size ) int error; const u8 *ptr; BOOL result; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -811,6 +863,7 @@ BOOL I2Ci_VerifyRegisters( I2CSlave id, u8 reg, const u8 *bufp, size_t size ) result = FALSE; } if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : (result ? TRUE : FALSE); } @@ -830,6 +883,7 @@ BOOL I2Ci_VerifyRegistersSC( I2CSlave id, u8 reg, const u8 *bufp, size_t size ) int error; const u8 *ptr; BOOL result; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -849,6 +903,7 @@ BOOL I2Ci_VerifyRegistersSC( I2CSlave id, u8 reg, const u8 *bufp, size_t size ) result = FALSE; } if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : (result ? TRUE : FALSE); } @@ -868,6 +923,7 @@ BOOL I2Ci_VerifyRegisters16( I2CSlave id, u16 reg, const u16 *bufp, size_t size int error; const u16 *ptr; BOOL result; + DBG_PRINT_FUNC(); for (r = 0; r < RETRY_COUNT; r++) { error = 0; @@ -887,40 +943,7 @@ BOOL I2Ci_VerifyRegisters16( I2CSlave id, u16 reg, const u16 *bufp, size_t size result = FALSE; } if (error == 0) break; + DBG_PRINT_ERR(); } return error ? FALSE : (result ? TRUE : FALSE); } - -#if 0 -//================================================================================ -// INTERRUPT -//================================================================================ -/*---------------------------------------------------------------------------* - Name: I2Ci_EnableInterrupt - - Description: enable I2C interrupt for each device. - - Arguments: None. - - Returns: None. - *---------------------------------------------------------------------------*/ -void I2Ci_EnableInterrupt( void ) -{ - OS_EnableIrqMask( OS_IE_I2C ); -} - -/*---------------------------------------------------------------------------* - Name: I2Ci_DisableInterrupt - - Description: disable I2C interrupt for each device. - - Arguments: None. - - Returns: None. - *---------------------------------------------------------------------------*/ -void I2Ci_DisableInterrupt( void ) -{ - OS_DisableIrqMask( OS_IE_I2C ); -} -#endif - diff --git a/build/tests/camera/Makefile b/build/tests/camera/Makefile index e3c54c1..15c6563 100644 --- a/build/tests/camera/Makefile +++ b/build/tests/camera/Makefile @@ -20,8 +20,8 @@ include $(TWLSDK_ROOT)/build/buildtools/commondefs #---------------------------------------------------------------------------- -SUBDIRS = camera-1 - +SUBDIRS = camera-1 \ + camera-2 \ #---------------------------------------------------------------------------- diff --git a/build/tests/camera/camera-1/ARM7/src/main.c b/build/tests/camera/camera-1/ARM7/src/main.c index c6988c5..db351a2 100644 --- a/build/tests/camera/camera-1/ARM7/src/main.c +++ b/build/tests/camera/camera-1/ARM7/src/main.c @@ -1,5 +1,5 @@ /*---------------------------------------------------------------------------* - Project: TwlSDK - tests - snd - channel + Project: TwlSDK - tests - camera File: main.c Copyright 2007 Nintendo. All rights reserved. @@ -61,14 +61,14 @@ void TwlSpMain(void) (void)OS_EnableIrq(); (void)OS_EnableInterrupts(); - // J - CAMERA_Init(THREAD_PRIO_CAMERA); - // {^̓T[` (void)PAD_InitXYButton(); // SPI -// SPI_Init(THREAD_PRIO_SPI); + SPI_Init(THREAD_PRIO_SPI); + + // J + CAMERA_Init(THREAD_PRIO_CAMERA); while (TRUE) { diff --git a/build/tests/camera/camera-1/ARM9/src/main.c b/build/tests/camera/camera-1/ARM9/src/main.c index e681da0..b202b9c 100644 --- a/build/tests/camera/camera-1/ARM9/src/main.c +++ b/build/tests/camera/camera-1/ARM9/src/main.c @@ -1,8 +1,8 @@ /*---------------------------------------------------------------------------* - Project: TwlSDK - SND - demos - capture + Project: TwlSDK - tests - camera File: main.c - Copyright 2005,2006 Nintendo. All rights reserved. + Copyright 2007 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo @@ -17,9 +17,13 @@ #include #include -#define DMA_NO 5 -#define WIDTH 256 -#define HEIGHT 192 +#define DMA_NO 5 // gpDMAԍ(4-7) +#define WIDTH 256 // C[W̕ +#define HEIGHT 192 // C[W̍ +#define NUMS 1 // obt@ + +#define LINES_AT_ONCE CAMERA_GET_MAX_LINES(WIDTH) // ̓]C +#define BYTES_PER_LINE CAMERA_GET_LINE_BYTES(WIDTH) // ꃉC̓]oCg static void VBlankIntr(void); static void CameraIntr(void); @@ -48,55 +52,151 @@ void TwlMain() (void)OS_EnableIrqMask(OS_IE_V_BLANK); (void)OS_EnableIrq(); (void)GX_VBlankIntr(TRUE); - { - u16 bg_color = GX_RGB(31, 0, 0); - GX_LoadBGPltt(&bg_color, 0, sizeof(u16)); - } + (void)OS_EnableInterrupts(); // VRAM\[h GX_SetBankForLCDC(GX_VRAM_LCDC_A); MI_CpuClearFast((void *)HW_LCDC_VRAM_A, WIDTH*HEIGHT*2); GX_SetGraphicsMode(GX_DISPMODE_VRAM_A, GX_BGMODE_0, GX_BG0_AS_2D); - GX_SetDispSelect(GX_DISP_SELECT_SUB_MAIN); + //GX_SetDispSelect(GX_DISP_SELECT_SUB_MAIN); OS_WaitVBlankIntr(); GX_DispOn(); // J - CAMERA_Init(); - CAMERA_PowerOn(); + CAMERA_Init(); // create camera thread + CAMERA_PowerOn(); // wakeup camera module - result = CAMERA_I2CInit(CAMERA_SELECT_BOTH); + result = CAMERA_I2CInit(CAMERA_SELECT_IN); if (result != CAMERA_RESULT_SUCCESS_TRUE) { OS_TPrintf("CAMERA_I2CInit was failed. (%d)\n", result); - } - else - { - OS_TPrintf("CAMERA_I2CInit was done.\n"); CAMERA_PowerOff(); OS_Terminate(); } + OS_TPrintf("CAMERA_I2CInit was done successfully.\n"); - CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 640, 480); // clipped by camera i/f + result = CAMERA_I2CActivate(CAMERA_SELECT_IN); + if (result != CAMERA_RESULT_SUCCESS_TRUE) + { + OS_TPrintf("CAMERA_I2CActivate was failed. (%d)\n", result); + } +#if 0 + result = CAMERA_I2CResize(CAMERA_SELECT_IN, 320, 240); + if (result != CAMERA_RESULT_SUCCESS_TRUE) + { + OS_TPrintf("CAMERA_I2CResize was failed. (%d)\n", result); + } +#endif + CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 320, 240); // clipped by camera i/f CAMERA_SetTrimming(TRUE); CAMERA_SetOutputFormat(CAMERA_OUTPUT_RGB); CAMERA_SetTransferLines(CAMERA_GET_MAX_LINES(WIDTH)); // J荞ݐݒ - CAMERA_SetVsyncIntrrupt(CAMERA_INTR_VSYNC_NEGATIVE_EDGE); + //CAMERA_SetVsyncIntrrupt(CAMERA_INTR_VSYNC_POSITIVE_EDGE); // almost end of vblank + CAMERA_SetVsyncIntrrupt(CAMERA_INTR_VSYNC_NEGATIVE_EDGE); // almost begin of vblank CAMERA_SetBufferErrorIntrrupt(TRUE); CAMERA_SetMasterIntrrupt(TRUE); OS_SetIrqFunction(OS_IE_CAM, CameraIntr); (void)OS_EnableIrqMask(OS_IE_CAM); - // JX^[g + // JX^[g (DMA͂ŊJnĂȂĂǂ) CAMERA_ClearBuffer(); - // DMA will be started by CameraIntr() + CAMERA_DmaRecvAsync(DMA_NO, (void *)HW_LCDC_VRAM_A, BYTES_PER_LINE * LINES_AT_ONCE, BYTES_PER_LINE * HEIGHT); CAMERA_Start(); + OS_TPrintf("Camera is shooting a movie...\n"); while (1) { + u16 pad; + u16 trg; + static u16 old = 0xffff; // ignore the trigger by first data + OS_WaitVBlankIntr(); + + pad = PAD_Read(); + trg = (u16)(pad & ~old); + old = pad; + + if (trg & PAD_BUTTON_A) + { + OS_TPrintf("call CAMERA_I2CActivate(CAMERA_SELECT_IN)... "); + result = CAMERA_I2CActivate(CAMERA_SELECT_IN); + OS_TPrintf("%s\n", result == CAMERA_RESULT_SUCCESS_TRUE ? "SUCCESS" : "FAILED"); + } + if (trg & PAD_BUTTON_B) + { + OS_TPrintf("call CAMERA_I2CActivate(CAMERA_SELECT_OUT)... "); + result = CAMERA_I2CActivate(CAMERA_SELECT_OUT); + OS_TPrintf("%s\n", result == CAMERA_RESULT_SUCCESS_TRUE ? "SUCCESS" : "FAILED"); + } + if (trg & PAD_BUTTON_R) + { + OS_TPrintf("call CAMERA_I2CActivate(CAMERA_SELECT_NONE)... "); + result = CAMERA_I2CActivate(CAMERA_SELECT_NONE); + OS_TPrintf("%s\n", result == CAMERA_RESULT_SUCCESS_TRUE ? "SUCCESS" : "FAILED"); + } + if (trg & PAD_BUTTON_START) // start/stop to capture + { + if (OS_GetIrqMask() & OS_IE_CAM) + { + // clear the handler + (void)OS_DisableIrqMask(OS_IE_CAM); + OS_TPrintf("call CAMERA_Stop()... "); + CAMERA_Stop(); + while (CAMERA_IsBusy()) + { + } + OS_TPrintf("Camera was stopped.\n"); + } + else + { + // set the handler + OS_SetIrqFunction(OS_IE_CAM, CameraIntr); + (void)OS_EnableIrqMask(OS_IE_CAM); + + CAMERA_ClearBuffer(); + CAMERA_Start(); + OS_TPrintf("Camera is shooting a movie...\n"); + } + } + if (trg & PAD_BUTTON_SELECT) // power on/off + { + if (reg_CFG_CLK & REG_CFG_CLK_CAM_CKI_MASK) + { + OS_TPrintf("call CAMERA_I2CActivate(CAMERA_SELECT_NONE)... "); + result = CAMERA_I2CActivate(CAMERA_SELECT_NONE); + OS_TPrintf("%s\n", result == CAMERA_RESULT_SUCCESS_TRUE ? "SUCCESS" : "FAILED"); + OS_TPrintf("call CAMERA_PowerOff()... "); + CAMERA_PowerOff(); + OS_TPrintf("Done.\n"); + } + else + { + OS_TPrintf("call CAMERA_PowerOn()... "); + CAMERA_PowerOn(); + OS_TPrintf("Done.\n"); + OS_TPrintf("call CAMERA_I2CInit(CAMERA_SELECT_IN)... "); + result = CAMERA_I2CInit(CAMERA_SELECT_IN); + OS_TPrintf("%s\n", result == CAMERA_RESULT_SUCCESS_TRUE ? "SUCCESS" : "FAILED"); + // resize + OS_TPrintf("call CAMERA_I2CResize(CAMERA_SELECT_IN)... "); + result = CAMERA_I2CResize(CAMERA_SELECT_IN, 320, 240); + OS_TPrintf("%s\n", result == CAMERA_RESULT_SUCCESS_TRUE ? "SUCCESS" : "FAILED"); + // activate inside camera first + OS_TPrintf("call CAMERA_I2CActivate(CAMERA_SELECT_IN)... "); + result = CAMERA_I2CActivate(CAMERA_SELECT_IN); + OS_TPrintf("%s\n", result == CAMERA_RESULT_SUCCESS_TRUE ? "SUCCESS" : "FAILED"); + // set misc registers + CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 320, 240); // clipped by camera i/f + CAMERA_SetTrimming(TRUE); + CAMERA_SetOutputFormat(CAMERA_OUTPUT_RGB); + CAMERA_SetTransferLines(CAMERA_GET_MAX_LINES(WIDTH)); + CAMERA_SetVsyncIntrrupt(CAMERA_INTR_VSYNC_POSITIVE_EDGE); // almost end of vblank + CAMERA_SetBufferErrorIntrrupt(TRUE); + CAMERA_SetMasterIntrrupt(TRUE); + } + } } } @@ -107,49 +207,68 @@ void VBlankIntr(void) { OS_SetIrqCheckFlag(OS_IE_V_BLANK); // checking VBlank interrupt } + +//-------------------------------------------------------------------------------- +// J荞ݏ (G[Vsync̗Ŕ) +// +#if 0 + StartDMAJnȂꍇAStart̃^C~OɂẮAŏɃG[mn܂B + StartDMAJnĂꍇAStart̃^C~OɂẮADMA~ĂȂn܂B + DMÅǗJVsyncDMA荞݂ɕςĂǂB +#endif #define PRINT_RATE 32 void CameraIntr(void) { - if (CAMERA_GetErrorStatus()) + OS_TPrintf("."); + OS_SetIrqCheckFlag(OS_IE_CAM); // checking camera interrupt + + if (CAMERA_GetErrorStatus()) // error? { OS_TPrintf("Error was occurred.\n"); - CAMERA_Stop(); - MIi_StopExDma(DMA_NO); - while (CAMERA_IsBusy()) + // ~ + CAMERA_Stop(); // J~ + MIi_StopExDma(DMA_NO); // DMA~ + while (CAMERA_IsBusy()) // ҂ { } + // JĊJ CAMERA_ClearBuffer(); - CAMERA_DmaRecvAsync(DMA_NO, (void *)HW_LCDC_VRAM_A, CAMERA_GET_LINE_BYTES(WIDTH) * CAMERA_GET_MAX_LINES(WIDTH), CAMERA_GET_LINE_BYTES(WIDTH) * HEIGHT); CAMERA_Start(); + return; // waiting next frame (skip current frame) + } + + // ȍ~Vsync̏ + + if (MIi_IsExDmaBusy(DMA_NO)) // NOT done to capture last frame? + { + OS_TPrintf("DMA was not done until VBlank.\n"); + return; // waiting next frame (skip current frame) + } + if (CAMERA_IsBusy() == FALSE) // done to execute stop command? + { + OS_TPrintf("Finished receiving final frame.\n"); + // disable this handler? } else { + // start to capture for next frame + CAMERA_DmaRecvAsync(DMA_NO, (void *)HW_LCDC_VRAM_A, BYTES_PER_LINE * LINES_AT_ONCE, BYTES_PER_LINE * HEIGHT); + } + + // debug print + { + static OSTick begin = 0; static int count = 0; - static OSTick prev = 0; - static OSTick save[PRINT_RATE]; - OSTick current = OS_GetTick(); - if (MIi_IsExDmaBusy(DMA_NO)) + if (begin == 0) // first time { - OS_TPrintf("DMA was not done until VBlank.\n"); - OS_SetIrqCheckFlag(OS_IE_CAM); - return; + begin = OS_GetTick(); } - CAMERA_DmaRecvAsync(DMA_NO, (void *)HW_LCDC_VRAM_A, CAMERA_GET_LINE_BYTES(WIDTH) * CAMERA_GET_MAX_LINES(WIDTH), CAMERA_GET_LINE_BYTES(WIDTH) * HEIGHT); - if (count == PRINT_RATE) + else if (++count == PRINT_RATE) { - int i; - OSTick uspf = 0; - for (i = 0; i < count; i++) - { - uspf += OS_TicksToMicroSeconds(save[i]); - } - uspf /= count; + OSTick uspf = OS_TicksToMicroSeconds(OS_GetTick() - begin) / count; OS_TPrintf("%2d.%03d fps\n", (int)(1000000LL / uspf), (int)(1000000000LL / uspf) % 1000); count = 0; + begin = OS_GetTick(); } - if (prev) - save[count++] = current - prev; - prev = current; } - OS_SetIrqCheckFlag(OS_IE_CAM); // checking camera interrupt } diff --git a/build/tests/camera/camera-2/ARM7/Makefile b/build/tests/camera/camera-2/ARM7/Makefile new file mode 100644 index 0000000..e66c30e --- /dev/null +++ b/build/tests/camera/camera-2/ARM7/Makefile @@ -0,0 +1,44 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - CAMERA - demos - camera-2 +# File: Makefile +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Log: $ +# $NoKeywords: $ +#---------------------------------------------------------------------------- + +SUBDIRS = + + +#---------------------------------------------------------------------------- + +#TWL_CODEGEN = THUMB +TWL_PROC = ARM7 + +TARGET_BIN = main.axf + +SRCS = main.c + +#SRCDIR = # using default +#LCFILE = # using default + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/build/tests/camera/camera-2/ARM7/src/main.c b/build/tests/camera/camera-2/ARM7/src/main.c new file mode 100644 index 0000000..db351a2 --- /dev/null +++ b/build/tests/camera/camera-2/ARM7/src/main.c @@ -0,0 +1,167 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - camera + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Log: main.c,v $ + $NoKeywords: $ + *---------------------------------------------------------------------------*/ + +#include +#include + +/*---------------------------------------------------------------------------* + 萔` + *---------------------------------------------------------------------------*/ +// ===== XbhDx ===== + +#define THREAD_PRIO_SPI 2 +#define THREAD_PRIO_CAMERA 6 + +/*---------------------------------------------------------------------------* + ֐` + *---------------------------------------------------------------------------*/ +static OSHeapHandle InitializeAllocateSystem(void); +static void VBlankIntr(void); + +/*---------------------------------------------------------------------------* + Name: TwlSpMain + + Description: Initialize and do main + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +void TwlSpMain(void) +{ + OSHeapHandle heapHandle; + + // OS + OS_Init(); + OS_InitThread(); + + // PXIAARM9Ɠ + PXI_Init(); + + // q[v̈ݒ + heapHandle = InitializeAllocateSystem(); + + // ݋ + (void)OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)GX_VBlankIntr(TRUE); + (void)OS_EnableIrq(); + (void)OS_EnableInterrupts(); + + // {^̓T[` + (void)PAD_InitXYButton(); + + // SPI + SPI_Init(THREAD_PRIO_SPI); + + // J + CAMERA_Init(THREAD_PRIO_CAMERA); + + while (TRUE) + { + OS_Halt(); + + //---- check reset + if (OS_IsResetOccurred()) + { + OS_ResetSystem(); + } + } +} + +/*---------------------------------------------------------------------------* + Name: InitializeAllocateSystem + + Description: ăVXeB + + Arguments: None. + + Returns: None. + *---------------------------------------------------------------------------*/ +static OSHeapHandle InitializeAllocateSystem(void) +{ + void *tempLo; + OSHeapHandle hh; + + OS_TPrintf("OS_GetWramSubPrivArenaLo() = %p\n", OS_GetWramSubPrivArenaLo()); + OS_TPrintf("OS_GetWramSubPrivArenaHi() = %p\n", OS_GetWramSubPrivArenaHi()); + OS_TPrintf("OS_GetWramSubArenaLo() = %p\n", OS_GetWramSubArenaLo()); + OS_TPrintf("OS_GetWramSubArenaHi() = %p\n", OS_GetWramSubArenaHi()); + OS_TPrintf("OS_GetSubPrivArenaLo() = %p\n", OS_GetSubPrivArenaLo()); + OS_TPrintf("OS_GetSubPrivArenaHi() = %p\n", OS_GetSubPrivArenaHi()); + + OS_TPrintf("call OS_SetWramSubPrivArenaHi(0x0380f980); to fix arena.\n"); + OS_SetWramSubPrivArenaHi((void*)0x0380f980); + + // ď + tempLo = OS_InitAlloc(OS_ARENA_WRAM_SUBPRIV, + OS_GetWramSubPrivArenaLo(), OS_GetWramSubPrivArenaHi(), 1); + + // A[i0NA + MI_CpuClear8(tempLo, (u32)OS_GetWramSubPrivArenaHi() - (u32)tempLo); + + // A[iʃAhXݒ + OS_SetArenaLo(OS_ARENA_WRAM_SUBPRIV, tempLo); + + // q[v쐬 + hh = OS_CreateHeap(OS_ARENA_WRAM_SUBPRIV, + OS_GetWramSubPrivArenaLo(), OS_GetWramSubPrivArenaHi()); + + if (hh < 0) + { + OS_Panic("ARM7: Fail to create heap.\n"); + } + + // Jgq[vɐݒ + (void)OS_SetCurrentHeap(OS_ARENA_WRAM_SUBPRIV, hh); + + return hh; +} + +/*---------------------------------------------------------------------------* + Name: VBlankIntr + + Description: VBlank interrupt handler + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +#ifndef SDK_TEG + +extern BOOL PMi_Initialized; +void PM_SelfBlinkProc(void); + +static void VBlankIntr(void) +{ + //---- LED blink system + if (PMi_Initialized) + { + PM_SelfBlinkProc(); + } +} + +#else + +static void VBlankIntr(void) +{ +} + +#endif + +/*---------------------------------------------------------------------------* + End of file + *---------------------------------------------------------------------------*/ diff --git a/build/tests/camera/camera-2/ARM9/Makefile b/build/tests/camera/camera-2/ARM9/Makefile new file mode 100644 index 0000000..9101302 --- /dev/null +++ b/build/tests/camera/camera-2/ARM9/Makefile @@ -0,0 +1,41 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - CAMERA - demos - camera-2 +# File: Makefile +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Log: Makefile,v $ +# $NoKeywords: $ +#---------------------------------------------------------------------------- + +SUBDIRS = + + +#---------------------------------------------------------------------------- + +#TWL_CODEGEN = THUMB + +TARGET_BIN = main.axf + +SRCS = main.c + +#SRCDIR = # using default +#LCFILE = # using default + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + +#===== End of Makefile ===== diff --git a/build/tests/camera/camera-2/ARM9/src/main.c b/build/tests/camera/camera-2/ARM9/src/main.c new file mode 100644 index 0000000..a86c611 --- /dev/null +++ b/build/tests/camera/camera-2/ARM9/src/main.c @@ -0,0 +1,232 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - tests - camera + File: main.c + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Log: main.c,v $ + $NoKeywords: $ + *---------------------------------------------------------------------------*/ + +#include +#include + +#define DMA_NO 5 // gpDMAԍ(4-7) +#define DMA_IE OS_IE_DMA5 // Ή銄荞 +#define WIDTH 256 // C[W̕ +#define HEIGHT 192 // C[W̍ + +#define LINES_AT_ONCE CAMERA_GET_MAX_LINES(WIDTH) // ̓]C +#define BYTES_PER_LINE CAMERA_GET_LINE_BYTES(WIDTH) // ꃉC̓]oCg + +#if 0 + J瑗Ăf[^At[Pʂ菬PʂŏꍇA + CAMERA_DmaRecvInfinity() płBƂp邵ȂB + (DMAȂňSɃJ̃f[^擾iȂƂɒӁIII) +#endif + +static void VBlankIntr(void); +static void CameraDmaIntr(void); +static void CameraErrIntr(void); + +#include +volatile int lineNumber = 0; +#include +static BOOL effect = FALSE; +static u16 pipeBuffer[BYTES_PER_LINE * LINES_AT_ONCE / sizeof(u16)] ATTRIBUTE_ALIGN(4); +/*---------------------------------------------------------------------------* + Name: TwlMain + + Description: main + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +void TwlMain() +{ + CAMERAResult result; + + // + OS_Init(); + OS_InitThread(); + GX_Init(); + OS_InitTick(); + + // VuN荞ݐݒ + OS_SetIrqFunction(OS_IE_V_BLANK, VBlankIntr); + (void)OS_EnableIrqMask(OS_IE_V_BLANK); + (void)OS_EnableIrq(); + (void)GX_VBlankIntr(TRUE); + (void)OS_EnableInterrupts(); + + // VRAM\[h + GX_SetBankForLCDC(GX_VRAM_LCDC_A); + MI_CpuClearFast((void *)HW_LCDC_VRAM_A, WIDTH*HEIGHT*2); + GX_SetGraphicsMode(GX_DISPMODE_VRAM_A, GX_BGMODE_0, GX_BG0_AS_2D); + //GX_SetDispSelect(GX_DISP_SELECT_SUB_MAIN); + OS_WaitVBlankIntr(); + GX_DispOn(); + + // J + CAMERA_Init(); // create camera thread + CAMERA_PowerOn(); // wakeup camera module + + result = CAMERA_I2CInit(CAMERA_SELECT_IN); + if (result != CAMERA_RESULT_SUCCESS_TRUE) + { + OS_TPrintf("CAMERA_I2CInit was failed. (%d)\n", result); + CAMERA_PowerOff(); + OS_Terminate(); + } + OS_TPrintf("CAMERA_I2CInit was done successfully.\n"); + + result = CAMERA_I2CActivate(CAMERA_SELECT_IN); + if (result != CAMERA_RESULT_SUCCESS_TRUE) + { + OS_TPrintf("CAMERA_I2CActivate was failed. (%d)\n", result); + } +#if 0 + result = CAMERA_I2CResize(CAMERA_SELECT_IN, 320, 240); + if (result != CAMERA_RESULT_SUCCESS_TRUE) + { + OS_TPrintf("CAMERA_I2CResize was failed. (%d)\n", result); + } +#endif + CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 320, 240); // clipped by camera i/f + CAMERA_SetTrimming(TRUE); + CAMERA_SetOutputFormat(CAMERA_OUTPUT_RGB); + CAMERA_SetTransferLines(CAMERA_GET_MAX_LINES(WIDTH)); + + // DMA荞ݐݒ + OS_SetIrqFunction(DMA_IE, CameraDmaIntr); + (void)OS_EnableIrqMask(DMA_IE); + + // DMAX^[g (IɎ~߂ȂiɗL) + MIi_StopExDma(DMA_NO); + CAMERA_DmaPipeInfinity(DMA_NO, pipeBuffer, BYTES_PER_LINE * LINES_AT_ONCE); + + // J荞ݐݒ + CAMERA_SetBufferErrorIntrrupt(TRUE); + CAMERA_SetMasterIntrrupt(TRUE); + OS_SetIrqFunction(OS_IE_CAM, CameraErrIntr); + (void)OS_EnableIrqMask(OS_IE_CAM); + + // JX^[g + lineNumber = 0; + CAMERA_ClearBuffer(); + CAMERA_Start(); + OS_TPrintf("Camera is shooting a movie...\n"); + + while (1) + { + u16 pad; + u16 trg; + static u16 old = 0;//0xffff; // ignore the trigger by first data + + OS_WaitVBlankIntr(); + + pad = PAD_Read(); + trg = (u16)(pad & ~old); + old = pad; + + if (trg & PAD_BUTTON_A) + { + effect ^= 1; + DC_StoreRange(&effect, sizeof(effect)); + OS_TPrintf("Effect %s\n", effect ? "ON" : "OFF"); + } + } +} + +//-------------------------------------------------------------------------------- +// uuN荞ݏ +// +void VBlankIntr(void) +{ + OS_SetIrqCheckFlag(OS_IE_V_BLANK); // checking VBlank interrupt +} + +//-------------------------------------------------------------------------------- +// DMA荞ݏ (dH) +// +#define PRINT_RATE 32 +void CameraDmaIntr(void) +{ + int line = lineNumber; + OS_SetIrqCheckFlag(DMA_IE); // checking dma interrupt + + // Kvȏăt[obt@ɃRs[ + if (effect) + { + int i; + u32 *src = (u32*)pipeBuffer; + u32 *dest = (u32*)HW_LCDC_VRAM_A + line * WIDTH / 2; + for (i = 0; i < WIDTH * LINES_AT_ONCE / 2; i++) // pack 2 pixel data + { + dest[i] = ~src[i]; // reverse (if using RGBA format, set bitOR with 0x10001000) + } + } + else + { + MI_CpuCopy8(pipeBuffer, (u16*)HW_LCDC_VRAM_A + line * WIDTH, sizeof(pipeBuffer)); + } + DC_InvalidateRange(pipeBuffer, sizeof(pipeBuffer)); + + line += LINES_AT_ONCE; + if (line >= HEIGHT) + { + static OSTick begin = 0; + static int count = 0; + // KvȂdestFramẽXbvȂ + + // debug print + OS_TPrintf("."); + if (begin == 0) // first time + { + begin = OS_GetTick(); + } + else if (++count == PRINT_RATE) + { + OSTick uspf = OS_TicksToMicroSeconds(OS_GetTick() - begin) / count; + OS_TPrintf("%2d.%03d fps\n", (int)(1000000LL / uspf), (int)(1000000000LL / uspf) % 1000); + count = 0; + begin = OS_GetTick(); + } + DC_StoreRange(&begin, sizeof(begin)); + DC_StoreRange(&count, sizeof(count)); + + lineNumber = 0; + } + else + { + lineNumber = line; + } +} + +//-------------------------------------------------------------------------------- +// J荞ݏ (G[Ȃ͂) +// +#if 0 + DMA͕uvCŗǂH +#endif +void CameraErrIntr(void) +{ + OS_SetIrqCheckFlag(OS_IE_CAM); // checking camera interrupt + + OS_TPrintf("Error was occurred.\n"); + + // J~ + CAMERA_Stop(); + lineNumber = 0; + + // JĊJ + CAMERA_ClearBuffer(); + CAMERA_Start(); +} diff --git a/build/tests/camera/camera-2/Makefile b/build/tests/camera/camera-2/Makefile new file mode 100644 index 0000000..078ec37 --- /dev/null +++ b/build/tests/camera/camera-2/Makefile @@ -0,0 +1,32 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: TwlSDK - build +# File: Makefile +# +# Copyright 2007 Nintendo. All rights reserved. +# +# These coded instructions, statements, and computer programs contain +# proprietary information of Nintendo of America Inc. and/or Nintendo +# Company Ltd., and are protected by Federal copyright law. They may +# not be disclosed to third parties or copied or duplicated in any form, +# in whole or in part, without the prior written consent of Nintendo. +# +# $Log: $ +# $NoKeywords: $ +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +SUBDIRS = \ + ARM7 \ + ARM9 \ + +#---------------------------------------------------------------------------- + +include $(TWLSDK_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/include/twl/camera.h b/include/twl/camera.h index b717d32..d52d00a 100644 --- a/include/twl/camera.h +++ b/include/twl/camera.h @@ -22,7 +22,7 @@ #ifdef SDK_ARM7 -#include +#include #include #else diff --git a/include/twl/camera/ARM7/control.h b/include/twl/camera/ARM7/control.h index 8ede0da..a697c0a 100644 --- a/include/twl/camera/ARM7/control.h +++ b/include/twl/camera/ARM7/control.h @@ -29,7 +29,7 @@ extern "C" { 萔` *---------------------------------------------------------------------------*/ #define CAMERA_MESSAGE_ARRAY_MAX 4 // XbhpbZ[WL[̃TCY -#define CAMERA_THREAD_STACK_SIZE 256 // Xbh̃X^bNTCY +#define CAMERA_THREAD_STACK_SIZE 512 // Xbh̃X^bNTCY /*---------------------------------------------------------------------------* \̒` diff --git a/include/twl/camera/ARM7/i2c.h b/include/twl/camera/ARM7/i2c.h new file mode 100644 index 0000000..e757b0e --- /dev/null +++ b/include/twl/camera/ARM7/i2c.h @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------* + Project: TwlSDK - camera + File: i2c.h + + Copyright 2007 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Log: $ + $NoKeywords: $ + *---------------------------------------------------------------------------*/ +#ifndef TWL_CAMERA_I2C_COMMON_H_ +#define TWL_CAMERA_I2C_COMMON_H_ + +#include +#include + +#ifdef _cplusplus +extern "C" { +#endif + +//================================================================================ +// I2C API +//================================================================================ + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CInit + + Description: initialize CAMERA + + Arguments: camera : one of CameraSelect + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERA_I2CInit(CameraSelect camera); + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CStandby + + Description: standby or resume CAMERA + + Arguments: camera : one of CameraSelect + standby : TRUE if goto standby mode + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERA_I2CStandby(CameraSelect camera, BOOL standby); + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CResize + + Description: resize CAMERA + + Arguments: camera : one of CameraSelect + width : width of output image + height : height of output image + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERA_I2CResize(CameraSelect camera, u16 width, u16 height); + + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CFrameRate + + Description: set CAMERA frame rate + + Arguments: camera : one of CameraSelect + rate : fps (0: auto) + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERA_I2CFrameRate(CameraSelect camera, int rate); + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CEffect + + Description: set CAMERA effect + + Arguments: camera : one of CameraSelect + effect : one of CameraEffect + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERA_I2CEffect(CameraSelect camera, CameraEffect effect); + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CFlip + + Description: set CAMERA flip/mirror + + Arguments: camera : one of CameraSelect + flip : one of CameraFlip + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERA_I2CFlip(CameraSelect camera, CameraFlip flip); + +#ifdef _cplusplus +} /* extern "C" */ +#endif + +/* TWL_CAMERA_I2C_COMMON_H_ */ +#endif diff --git a/include/twl/camera/ARM7/i2c_common.h b/include/twl/camera/ARM7/i2c_common.h deleted file mode 100644 index 23f8216..0000000 --- a/include/twl/camera/ARM7/i2c_common.h +++ /dev/null @@ -1,262 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: TwlSDK - camera - File: i2c_common.h - - Copyright 2007 Nintendo. All rights reserved. - - These coded instructions, statements, and computer programs contain - proprietary information of Nintendo of America Inc. and/or Nintendo - Company Ltd., and are protected by Federal copyright law. They may - not be disclosed to third parties or copied or duplicated in any form, - in whole or in part, without the prior written consent of Nintendo. - - $Log: $ - $NoKeywords: $ - *---------------------------------------------------------------------------*/ -#ifndef TWL_CAMERA_I2C_COMMON_H_ -#define TWL_CAMERA_I2C_COMMON_H_ - -#include -#include -#include -#include -#include - -#ifdef _cplusplus -extern "C" { -#endif - -#if 0 -//================================================================================ -// I2C_ ACCESS -//================================================================================ -/*---------------------------------------------------------------------------* - Name: CAMERA_WriteRegister - - Description: set value to decive register through I2C_. - - Arguments: camera : one of CameraSelect - reg : decive register - data : value to be written - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_WriteRegister( CameraSelect camera, u16 reg, u16 data ) -{ - return cameraType ? CAMERAi_S_WriteRegister(camera, reg, data) - : CAMERAi_M_WriteRegister(camera, reg, data); -} -static inline BOOL CAMERA_WriteRegister( CameraSelect camera, u16 reg, u16 data ) -{ - return cameraType ? CAMERA_S_WriteRegister(camera, reg, data) - : CAMERA_M_WriteRegister(camera, reg, data); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ReadRegister - - Description: get value from decive register through I2C_. - - Arguments: camera : one of CameraSelect w/o BOTH - reg : decive register - - Returns: value which is read from specified decive register - *---------------------------------------------------------------------------*/ -static inline u16 CAMERAi_ReadRegister( CameraSelect camera, u16 reg ) -{ - return cameraType ? CAMERAi_S_ReadRegister(camera, reg) - : CAMERAi_M_ReadRegister(camera, reg); -} -static inline u16 CAMERA_ReadRegister( CameraSelect camera, u16 reg ) -{ - return cameraType ? CAMERA_S_ReadRegister(camera, reg) - : CAMERA_M_ReadRegister(camera, reg); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_WriteRegisters - - Description: set value to decive registers through I2C_. - - Arguments: camera : one of CameraSelect - reg : decive register - bufp : data array to be written - size : data size - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_WriteRegisters( CameraSelect camera, u16 reg, const u16 *bufp, size_t size ) -{ - return cameraType ? CAMERAi_S_WriteRegisters(camera, reg, bufp, size) - : CAMERAi_M_WriteRegisters(camera, reg, bufp, size); -} -static inline BOOL CAMERA_WriteRegisters( CameraSelect camera, u16 reg, const u16 *bufp, size_t size ) -{ - return cameraType ? CAMERA_S_WriteRegisters(camera, reg, bufp, size) - : CAMERA_M_WriteRegisters(camera, reg, bufp, size); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ReadRegisters - - Description: get value from decive registers through I2C_. - - Arguments: camera : one of CameraSelect w/o BOTH - reg : decive register - bufp : data array to be read - size : data size - - Returns: value which is read from specified decive register - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_ReadRegisters( CameraSelect camera, u16 reg, u16 *bufp, size_t size ) -{ - return cameraType ? CAMERAi_S_ReadRegisters(camera, reg, bufp, size) - : CAMERAi_M_ReadRegisters(camera, reg, bufp, size); -} -static inline BOOL CAMERA_ReadRegisters( CameraSelect camera, u16 reg, u16 *bufp, size_t size ) -{ - return cameraType ? CAMERA_S_ReadRegisters(camera, reg, bufp, size) - : CAMERA_M_ReadRegisters(camera, reg, bufp, size); -} - -//================================================================================ -// I2C_ BIT CONTROL -//================================================================================ -/*---------------------------------------------------------------------------* - Name: CAMERA_SetParamsM - - Description: set control bit to device register - - Arguments: camera : one of CameraSelect - reg : device register - setBits : bits to set - maskBits : bits to mask - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_SetParams( CameraSelect camera, u16 reg, u16 setBits, u16 maskBits ) -{ - return cameraType ? CAMERAi_S_SetParams(camera, reg, setBits, maskBits) - : CAMERAi_M_SetParams(camera, reg, setBits, maskBits); -} -static inline BOOL CAMERA_SetParams( CameraSelect camera, u16 reg, u16 setBits, u16 maskBits ) -{ - return cameraType ? CAMERA_S_SetParams(camera, reg, setBits, maskBits) - : CAMERA_M_SetParams(camera, reg, setBits, maskBits); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetFlagsM - - Description: set control bit to device register - - Arguments: camera : one of CameraSelect - reg : device register - setBits : bits to set - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_SetFlags( CameraSelect camera, u16 reg, u16 setBits ) -{ - return cameraType ? CAMERAi_S_SetFlags(camera, reg, setBits) - : CAMERAi_M_SetFlags(camera, reg, setBits); -} -static inline BOOL CAMERA_SetFlags( CameraSelect camera, u16 reg, u16 setBits ) -{ - return cameraType ? CAMERA_S_SetFlags(camera, reg, setBits) - : CAMERA_M_SetFlags(camera, reg, setBits); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ClearFlagsM - - Description: clear control bit to device register - - Arguments: camera : one of CameraSelect - reg : device register - clrBits : bits to clear - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_ClearFlags( CameraSelect camera, u16 reg, u16 clrBits ) -{ - return cameraType ? CAMERAi_S_ClearFlags(camera, reg, clrBits) - : CAMERAi_M_ClearFlags(camera, reg, clrBits); -} - -static inline BOOL CAMERA_ClearFlags( CameraSelect camera, u16 reg, u16 clrBits ) -{ - return cameraType ? CAMERA_S_ClearFlags(camera, reg, clrBits) - : CAMERA_M_ClearFlags(camera, reg, clrBits); -} -#endif - -//================================================================================ -// I2C_ API -//================================================================================ - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CInit - - Description: initialize CAMERA - - Arguments: camera : one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CInit(CameraSelect camera); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CStandby - - Description: standby or resume CAMERA - - Arguments: camera : one of CameraSelect - standby : TRUE if goto standby mode - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CStandby(CameraSelect camera, BOOL standby); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CResize - - Description: resize CAMERA - - Arguments: camera : one of CameraSelect - width : width of output image - height : height of output image - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CResize(CameraSelect camera, u16 width, u16 height); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreSleep - - Description: preset CAMERA registers - - Arguments: camera : one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CPreSleep(CameraSelect camera); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPostSleep - - Description: preset CAMERA registers - - Arguments: camera : one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CPostSleep(CameraSelect camera); - - -#ifdef _cplusplus -} /* extern "C" */ -#endif - -/* TWL_CAMERA_I2C_COMMON_H_ */ -#endif diff --git a/include/twl/camera/ARM7/i2c_micron.h b/include/twl/camera/ARM7/i2c_micron.h index 90467a0..fcf20aa 100644 --- a/include/twl/camera/ARM7/i2c_micron.h +++ b/include/twl/camera/ARM7/i2c_micron.h @@ -16,11 +16,7 @@ #ifndef TWL_CAMERA_I2C_MICRON_H_ #define TWL_CAMERA_I2C_MICRON_H_ -#include #include -#include - -#define CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO #if 0 WriteNONEw肷TRUEŕԂAReadNONEw肷FALSEŕԂB @@ -33,12 +29,12 @@ extern "C" { #endif //================================================================================ -// I2C_ ACCESS +// I2C ACCESS //================================================================================ /*---------------------------------------------------------------------------* - Name: CAMERA_M_WriteRegister + Name: CAMERAi_M_WriteRegister - Description: set value to decive register through I2C_. + Description: set value to decive register through I2C. Arguments: camera : one of CameraSelect reg : decive register @@ -76,9 +72,9 @@ static inline BOOL CAMERA_M_WriteRegister( CameraSelect camera, u16 reg, u16 dat } /*---------------------------------------------------------------------------* - Name: CAMERA_M_ReadRegister + Name: CAMERAi_M_ReadRegister - Description: get value from decive register through I2C_. + Description: get value from decive register through I2C. Arguments: camera : one of CameraSelect w/o BOTH reg : decive register @@ -109,9 +105,9 @@ static inline u16 CAMERA_M_ReadRegister( CameraSelect camera, u16 reg ) } /*---------------------------------------------------------------------------* - Name: CAMERA_M_WriteRegisters + Name: CAMERAi_M_WriteRegisters - Description: set value to decive registers through I2C_. + Description: set value to decive registers through I2C. Arguments: camera : one of CameraSelect reg : decive register @@ -126,35 +122,11 @@ static inline BOOL CAMERAi_M_WriteRegisters( CameraSelect camera, u16 reg, const BOOL rOut = TRUE; if (camera & CAMERA_SELECT_IN) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters16( I2C_SLAVE_CAMERA_MICRON_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - rIn = (size == 0 ? TRUE : FALSE); -#else rIn = I2Ci_WriteRegisters16( I2C_SLAVE_CAMERA_MICRON_IN, reg, bufp, size ); -#endif } if (camera & CAMERA_SELECT_OUT) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters16( I2C_SLAVE_CAMERA_MICRON_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - rOut = (size == 0 ? TRUE : FALSE); -#else rOut = I2Ci_WriteRegisters16( I2C_SLAVE_CAMERA_MICRON_OUT, reg, bufp, size ); -#endif } return (rIn && rOut); } @@ -164,47 +136,19 @@ static inline BOOL CAMERA_M_WriteRegisters( CameraSelect camera, u16 reg, const BOOL rOut = TRUE; if (camera & CAMERA_SELECT_IN) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters16( I2C_SLAVE_CAMERA_MICRON_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - (void)I2C_Unlock(); - rIn = (size == 0 ? TRUE : FALSE); -#else rOut = I2C_WriteRegisters16( I2C_SLAVE_CAMERA_MICRON_IN, reg, bufp, size ); -#endif } if (camera & CAMERA_SELECT_OUT) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters16( I2C_SLAVE_CAMERA_MICRON_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - (void)I2C_Unlock(); - rOut = (size == 0 ? TRUE : FALSE); -#else rOut = I2C_WriteRegisters16( I2C_SLAVE_CAMERA_MICRON_OUT, reg, bufp, size ); -#endif } return (rIn && rOut); } /*---------------------------------------------------------------------------* - Name: CAMERA_M_ReadRegisters + Name: CAMERAi_M_ReadRegisters - Description: get value from decive registers through I2C_. + Description: get value from decive registers through I2C. Arguments: camera : one of CameraSelect w/o BOTH reg : decive register @@ -215,32 +159,6 @@ static inline BOOL CAMERA_M_WriteRegisters( CameraSelect camera, u16 reg, const *---------------------------------------------------------------------------*/ static inline BOOL CAMERAi_M_ReadRegisters( CameraSelect camera, u16 reg, u16 *bufp, size_t size ) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - switch (camera) - { - case CAMERA_SELECT_IN: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegisters16( I2C_SLAVE_CAMERA_MICRON_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - case CAMERA_SELECT_OUT: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegisters16( I2C_SLAVE_CAMERA_MICRON_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - } - return (size == 0 ? TRUE : FALSE); -#else switch (camera) { case CAMERA_SELECT_IN: @@ -249,38 +167,9 @@ static inline BOOL CAMERAi_M_ReadRegisters( CameraSelect camera, u16 reg, u16 *b return I2Ci_ReadRegisters16( I2C_SLAVE_CAMERA_MICRON_OUT, reg, bufp, size ); } return FALSE; -#endif } static inline BOOL CAMERA_M_ReadRegisters( CameraSelect camera, u16 reg, u16 *bufp, size_t size ) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); - switch (camera) - { - case CAMERA_SELECT_IN: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegisters16( I2C_SLAVE_CAMERA_MICRON_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - case CAMERA_SELECT_OUT: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegisters16( I2C_SLAVE_CAMERA_MICRON_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - } - (void)I2C_Unlock(); - return (size == 0 ? TRUE : FALSE); -#else switch (camera) { case CAMERA_SELECT_IN: @@ -289,14 +178,13 @@ static inline BOOL CAMERA_M_ReadRegisters( CameraSelect camera, u16 reg, u16 *bu return I2C_ReadRegisters16( I2C_SLAVE_CAMERA_MICRON_OUT, reg, bufp, size ); } return FALSE; -#endif } //================================================================================ -// I2C_ BIT CONTROL +// I2C BIT CONTROL //================================================================================ /*---------------------------------------------------------------------------* - Name: CAMERA_M_SetParams + Name: CAMERAi_M_SetParams Description: set control bit to device register @@ -337,7 +225,7 @@ static inline BOOL CAMERA_M_SetParams( CameraSelect camera, u16 reg, u16 setBits } /*---------------------------------------------------------------------------* - Name: CAMERA_M_SetFlags + Name: CAMERAi_M_SetFlags Description: set control bit to device register @@ -357,7 +245,7 @@ static inline BOOL CAMERA_M_SetFlags( CameraSelect camera, u16 reg, u16 setBits } /*---------------------------------------------------------------------------* - Name: CAMERA_M_ClearFlags + Name: CAMERAi_M_ClearFlags Description: clear control bit to device register @@ -378,10 +266,10 @@ static inline BOOL CAMERA_M_ClearFlags( CameraSelect camera, u16 reg, u16 clrBit //================================================================================ -// I2C_ API +// I2C API //================================================================================ /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CInit + Name: CAMERAi_M_I2CInit Description: initialize CAMERA @@ -389,10 +277,10 @@ static inline BOOL CAMERA_M_ClearFlags( CameraSelect camera, u16 reg, u16 clrBit Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CInit(CameraSelect camera); +BOOL CAMERAi_M_I2CInit(CameraSelect camera); /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CStandby + Name: CAMERAi_M_I2CStandby Description: standby or resume CAMERA @@ -401,10 +289,10 @@ BOOL CAMERA_M_I2CInit(CameraSelect camera); Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CStandby(CameraSelect camera, BOOL standby); +BOOL CAMERAi_M_I2CStandby(CameraSelect camera, BOOL standby); /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CResize + Name: CAMERAi_M_I2CResize Description: resize CAMERA @@ -414,30 +302,69 @@ BOOL CAMERA_M_I2CStandby(CameraSelect camera, BOOL standby); Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CResize(CameraSelect camera, u16 width, u16 height); +BOOL CAMERAi_M_I2CResize(CameraSelect camera, u16 width, u16 height); + /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CPreSleep + Name: CAMERAi_M_I2CFrameRate - Description: preset CAMERA registers + Description: set CAMERA frame rate Arguments: camera : one of CameraSelect + rate : fps (0: auto) Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CPreSleep(CameraSelect camera); +BOOL CAMERAi_M_I2CFrameRate(CameraSelect camera, int rate); /*---------------------------------------------------------------------------* - Name: CAMERA_M_I2CPostSleep + Name: CAMERAi_M_I2CEffect - Description: preset CAMERA registers + Description: set CAMERA effect Arguments: camera : one of CameraSelect + effect : one of CameraEffect Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_M_I2CPostSleep(CameraSelect camera); +BOOL CAMERAi_M_I2CEffect(CameraSelect camera, CameraEffect effect); +/*---------------------------------------------------------------------------* + Name: CAMERAi_M_I2CFlip + + Description: set CAMERA flip/mirror + + Arguments: camera : one of CameraSelect + flip : one of CameraFlip + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERAi_M_I2CFlip(CameraSelect camera, CameraFlip flip); + +#if 0 +/*---------------------------------------------------------------------------* + Name: CAMERAi_M_I2CWhiteBalance + + Description: set CAMERA white balance + + Arguments: camera : one of CameraSelect + type : preset number (0: auto) + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERAi_M_I2CWhiteBalance(CameraSelect camera, int type); +/*---------------------------------------------------------------------------* + Name: CAMERAi_M_I2CExposure + + Description: set CAMERA exposure + + Arguments: camera : one of CameraSelect + type : preset number (0: auto) + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERAi_M_I2CExposure(CameraSelect camera, int type); +#endif #ifdef _cplusplus } /* extern "C" */ diff --git a/include/twl/camera/ARM7/i2c_samsung.h b/include/twl/camera/ARM7/i2c_samsung.h deleted file mode 100644 index cc4768b..0000000 --- a/include/twl/camera/ARM7/i2c_samsung.h +++ /dev/null @@ -1,546 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: TwlSDK - camera - File: camera_i2c.h - - Copyright 2007 Nintendo. All rights reserved. - - These coded instructions, statements, and computer programs contain - proprietary information of Nintendo of America Inc. and/or Nintendo - Company Ltd., and are protected by Federal copyright law. They may - not be disclosed to third parties or copied or duplicated in any form, - in whole or in part, without the prior written consent of Nintendo. - - $Log: $ - $NoKeywords: $ - *---------------------------------------------------------------------------*/ -#ifndef TWL_CAMERA_CAMERA_I2CH_ -#define TWL_CAMERA_CAMERA_I2CH_ - -#include -#include -#include - -#define CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - -#if 0 - WriteNONEw肷TRUEŕԂAReadNONEw肷FALSEŕԂB - WriteBOTHw肷Ɨɏ݁AReadBOTHw肷FALSEŕԂB - SetParamsWriteƓdlB -#endif - -#ifdef _cplusplus -extern "C" { -#endif - -//================================================================================ -// I2C_ ACCESS -//================================================================================ -/*---------------------------------------------------------------------------* - Name: CAMERA_WriteRegister - - Description: set value to decive register through I2C_. - - Arguments: camera : one of CameraSelect - reg : decive register - data : value to be written - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_WriteRegister( CameraSelect camera, u8 reg, u8 data ) -{ - BOOL rIn = TRUE; - BOOL rOut = TRUE; - if (camera & CAMERA_SELECT_IN) - { - rIn = I2Ci_WriteRegister( I2C_SLAVE_CAMERA_IN, reg, data ); - } - if (camera & CAMERA_SELECT_OUT) - { - rOut = I2Ci_WriteRegister( I2C_SLAVE_CAMERA_OUT, reg, data ); - } - return (rIn && rOut); -} -static inline BOOL CAMERA_WriteRegister( CameraSelect camera, u8 reg, u8 data ) -{ - BOOL rIn = TRUE; - BOOL rOut = TRUE; - if (camera & CAMERA_SELECT_IN) - { - rIn = I2C_WriteRegister( I2C_SLAVE_CAMERA_IN, reg, data ); - } - if (camera & CAMERA_SELECT_OUT) - { - rOut = I2C_WriteRegister( I2C_SLAVE_CAMERA_OUT, reg, data ); - } - return (rIn && rOut); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ReadRegister - - Description: get value from decive register through I2C_. - - Arguments: camera : one of CameraSelect w/o BOTH - reg : decive register - - Returns: value which is read from specified decive register - *---------------------------------------------------------------------------*/ -static inline u8 CAMERAi_ReadRegister( CameraSelect camera, u8 reg ) -{ - switch (camera) - { - case CAMERA_SELECT_IN: - return I2Ci_ReadRegisterSC( I2C_SLAVE_CAMERA_IN, reg ); - case CAMERA_SELECT_OUT: - return I2Ci_ReadRegisterSC( I2C_SLAVE_CAMERA_OUT, reg ); - } - return FALSE; -} -static inline u8 CAMERA_ReadRegister( CameraSelect camera, u8 reg ) -{ - switch (camera) - { - case CAMERA_SELECT_IN: - return I2C_ReadRegisterSC( I2C_SLAVE_CAMERA_IN, reg ); - case CAMERA_SELECT_OUT: - return I2C_ReadRegisterSC( I2C_SLAVE_CAMERA_OUT, reg ); - } - return FALSE; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_WriteRegisters - - Description: set value to decive registers through I2C_. - - Arguments: camera : one of CameraSelect - reg : decive register - bufp : data array to be written - size : data size - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_WriteRegisters( CameraSelect camera, u8 reg, const u8 *bufp, size_t size ) -{ - BOOL rIn = TRUE; - BOOL rOut = TRUE; - if (camera & CAMERA_SELECT_IN) - { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - rIn = (size == 0 ? TRUE : FALSE); -#else - rIn = I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_IN, reg, bufp, size ); -#endif - } - if (camera & CAMERA_SELECT_OUT) - { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - rOut = (size == 0 ? TRUE : FALSE); -#else - rOut = I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_OUT, reg, bufp, size ); -#endif - } - return (rIn && rOut); -} -static inline BOOL CAMERA_WriteRegisters( CameraSelect camera, u8 reg, const u8 *bufp, size_t size ) -{ - BOOL rIn = TRUE; - BOOL rOut = TRUE; - if (camera & CAMERA_SELECT_IN) - { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - (void)I2C_Unlock(); - rIn = (size == 0 ? TRUE : FALSE); -#else - rOut = I2C_WriteRegisters( I2C_SLAVE_CAMERA_IN, reg, bufp, size ); -#endif - } - if (camera & CAMERA_SELECT_OUT) - { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - (void)I2C_Unlock(); - rOut = (size == 0 ? TRUE : FALSE); -#else - rOut = I2C_WriteRegisters( I2C_SLAVE_CAMERA_OUT, reg, bufp, size ); -#endif - } - return (rIn && rOut); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ReadRegisters - - Description: get value from decive registers through I2C_. - - Arguments: camera : one of CameraSelect w/o BOTH - reg : decive register - bufp : data array to be read - size : data size - - Returns: value which is read from specified decive register - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_ReadRegisters( CameraSelect camera, u8 reg, u8 *bufp, size_t size ) -{ -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - switch (camera) - { - case CAMERA_SELECT_IN: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegistersSC( I2C_SLAVE_CAMERA_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - case CAMERA_SELECT_OUT: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegistersSC( I2C_SLAVE_CAMERA_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - } - return (size == 0 ? TRUE : FALSE); -#else - switch (camera) - { - case CAMERA_SELECT_IN: - return I2Ci_ReadRegistersSC( I2C_SLAVE_CAMERA_IN, reg, bufp, size ); - case CAMERA_SELECT_OUT: - return I2Ci_ReadRegistersSC( I2C_SLAVE_CAMERA_OUT, reg, bufp, size ); - } - return FALSE; -#endif -} -static inline BOOL CAMERA_ReadRegisters( CameraSelect camera, u8 reg, u8 *bufp, size_t size ) -{ -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); - switch (camera) - { - case CAMERA_SELECT_IN: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegistersSC( I2C_SLAVE_CAMERA_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - case CAMERA_SELECT_OUT: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegistersSC( I2C_SLAVE_CAMERA_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - } - (void)I2C_Unlock(); - return (size == 0 ? TRUE : FALSE); -#else - switch (camera) - { - case CAMERA_SELECT_IN: - return I2C_ReadRegistersSC( I2C_SLAVE_CAMERA_IN, reg, bufp, size ); - case CAMERA_SELECT_OUT: - return I2C_ReadRegistersSC( I2C_SLAVE_CAMERA_OUT, reg, bufp, size ); - } - return FALSE; -#endif -} - -//================================================================================ -// I2C_ BIT CONTROL -//================================================================================ -/*---------------------------------------------------------------------------* - Name: CAMERA_SetParams - - Description: set control bit to device register - - Arguments: camera : one of CameraSelect - reg : device register - setBits : bits to set - maskBits : bits to mask - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_SetParams( CameraSelect camera, u8 reg, u8 setBits, u8 maskBits ) -{ - BOOL rIn = TRUE; - BOOL rOut = TRUE; - if (camera & CAMERA_SELECT_IN) - { - rIn = I2Ci_SetParams( I2C_SLAVE_CAMERA_IN, reg, setBits, maskBits ); - } - if (camera & CAMERA_SELECT_OUT) - { - rOut = I2Ci_SetParams( I2C_SLAVE_CAMERA_OUT, reg, setBits, maskBits ); - } - return (rIn && rOut); -} -static inline BOOL CAMERA_SetParams( CameraSelect camera, u8 reg, u8 setBits, u8 maskBits ) -{ - BOOL rIn = TRUE; - BOOL rOut = TRUE; - if (camera & CAMERA_SELECT_IN) - { - rIn = I2C_SetParams( I2C_SLAVE_CAMERA_IN, reg, setBits, maskBits ); - } - if (camera & CAMERA_SELECT_OUT) - { - rOut = I2C_SetParams( I2C_SLAVE_CAMERA_OUT, reg, setBits, maskBits ); - } - return (rIn && rOut); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetFlags - - Description: set control bit to device register - - Arguments: camera : one of CameraSelect - reg : device register - setBits : bits to set - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_SetFlags( CameraSelect camera, u8 reg, u8 setBits ) -{ - return CAMERAi_SetParams( camera, reg, setBits, setBits ); -} -static inline BOOL CAMERA_SetFlags( CameraSelect camera, u8 reg, u8 setBits ) -{ - return CAMERA_SetParams( camera, reg, setBits, setBits ); -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_ClearFlags - - Description: clear control bit to device register - - Arguments: camera : one of CameraSelect - reg : device register - clrBits : bits to clear - - Returns: None - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERAi_ClearFlags( CameraSelect camera, u8 reg, u8 clrBits ) -{ - return CAMERAi_SetParams( camera, reg, 0, clrBits ); -} -static inline BOOL CAMERA_ClearFlags( CameraSelect camera, u8 reg, u8 clrBits ) -{ - return CAMERA_SetParams( camera, reg, 0, clrBits ); -} - -//================================================================================ -// I2C_ API -//================================================================================ -#define CAMERA_I2CSetCropping(c, x, y, w, h) CAMERA_I2CSetCroppingParams(c, w, h) - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CSetFlipMode - - Description: set CAMERA's flip mode - - Arguments: camera : one of CameraSelect - mode : one of CameraFlipMode to apply - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CSetFlipMode(CameraSelect camera, CameraFlipMode mode); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CSetSpecialMode - - Description: set CAMERA's special mode - - Arguments: camera : one of CameraSelect - mode : one of CameraSpecialMode to apply - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CSetSpecialMode(CameraSelect camera, CameraSpecialMode mode); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CSetCroppingParams - - Description: set CAMERA_ cropping parameters. - - Arguments: camera : one of CameraSelect - width : width of image (up to 640) - height : height of image (up to 480) - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CSetCroppingParams(CameraSelect camera, u16 width, u16 height); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CGetCroppingParams - - Description: get current CAMERA_ cropping parameters. - - Arguments: camera : one of CameraSelect - pWidth : address to store the width - pHeight : address to store the height - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CGetCroppingParams(CameraSelect camera, u16 *pWidth, u16 *pHeight); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPause - - Description: pause to send frame - - Arguments: camera : one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERA_I2CPause(CameraSelect camera) -{ - BOOL result; - (void)I2C_Lock(); - result = CAMERAi_WriteRegister( camera, 0xef, 0x00 ) && - CAMERAi_ClearFlags( camera, 0xde, 0x04 ); - (void)I2C_Unlock(); - return result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CResume - - Description: resume from pause state - - Arguments: camera : one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERA_I2CResume(CameraSelect camera) -{ - BOOL result; - (void)I2C_Lock(); - result = CAMERAi_WriteRegister( camera, 0xef, 0x00 ) && - CAMERAi_SetFlags( camera, 0xde, 0x04 ); - (void)I2C_Unlock(); - return result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreSleep - - Description: pre-sleep - - Arguments: camera : one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERA_I2CPreSleep(CameraSelect camera) -{ - BOOL result; - (void)I2C_Lock(); - (void)camera; // not impremented yet - (void)I2C_Unlock(); - return result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPostSleep - - Description: post-sleep - - Arguments: camera : one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERA_I2CPostSleep(CameraSelect camera) -{ - BOOL result; - (void)I2C_Lock(); - (void)camera; // not impremented yet - (void)I2C_Unlock(); - return result; -} - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreset - - Description: preset CAMERA registers - - Arguments: camera : one of CameraSelect - preset : one of CameraPreset - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_I2CPreset(CameraSelect camera, CameraPreset preset); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CInit - - Description: initialize CAMERA - - Arguments: camera : one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -static inline BOOL CAMERA_I2CInit(CameraSelect camera) -{ - if (CAMERA_I2CPreset(camera, CAMERA_PRESET_DEFAULT) == FALSE) { - return FALSE; - } - if (CAMERA_I2CSetFlipMode(camera, CAMERA_FLIPMODE_DEFAULT) == FALSE) { - return FALSE; - } - return TRUE; -} - - -#ifdef _cplusplus -} /* extern "C" */ -#endif - -/* TWL_CAMERA_CAMERA_I2CH_ */ -#endif diff --git a/include/twl/camera/ARM7/i2c_sharp.h b/include/twl/camera/ARM7/i2c_sharp.h index 6120863..d48e422 100644 --- a/include/twl/camera/ARM7/i2c_sharp.h +++ b/include/twl/camera/ARM7/i2c_sharp.h @@ -16,11 +16,7 @@ #ifndef TWL_CAMERA_I2C_SHARP_H_ #define TWL_CAMERA_I2C_SHARP_H_ -#include #include -#include - -#define CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO #if 0 WriteNONEw肷TRUEŕԂAReadNONEw肷FALSEŕԂB @@ -33,12 +29,12 @@ extern "C" { #endif //================================================================================ -// I2C_ ACCESS +// I2C ACCESS //================================================================================ /*---------------------------------------------------------------------------* - Name: CAMERA_S_WriteRegister + Name: CAMERAi_S_WriteRegister - Description: set value to decive register through I2C_. + Description: set value to decive register through I2C. Arguments: camera : one of CameraSelect reg : decive register @@ -52,11 +48,11 @@ static inline BOOL CAMERAi_S_WriteRegister( CameraSelect camera, u8 reg, u8 data BOOL rOut = TRUE; if (camera & CAMERA_SELECT_IN) { - rIn = I2Ci_WriteRegister( I2C_SLAVE_CAMERA_MICRON_IN, reg, data ); + rIn = I2Ci_WriteRegister( I2C_SLAVE_CAMERA_SHARP_IN, reg, data ); } if (camera & CAMERA_SELECT_OUT) { - rOut = I2Ci_WriteRegister( I2C_SLAVE_CAMERA_MICRON_OUT, reg, data ); + rOut = I2Ci_WriteRegister( I2C_SLAVE_CAMERA_SHARP_OUT, reg, data ); } return (rIn && rOut); } @@ -66,19 +62,19 @@ static inline BOOL CAMERA_S_WriteRegister( CameraSelect camera, u8 reg, u8 data BOOL rOut = TRUE; if (camera & CAMERA_SELECT_IN) { - rIn = I2C_WriteRegister( I2C_SLAVE_CAMERA_MICRON_IN, reg, data ); + rIn = I2C_WriteRegister( I2C_SLAVE_CAMERA_SHARP_IN, reg, data ); } if (camera & CAMERA_SELECT_OUT) { - rOut = I2C_WriteRegister( I2C_SLAVE_CAMERA_MICRON_OUT, reg, data ); + rOut = I2C_WriteRegister( I2C_SLAVE_CAMERA_SHARP_OUT, reg, data ); } return (rIn && rOut); } /*---------------------------------------------------------------------------* - Name: CAMERA_S_ReadRegister + Name: CAMERAi_S_ReadRegister - Description: get value from decive register through I2C_. + Description: get value from decive register through I2C. Arguments: camera : one of CameraSelect w/o BOTH reg : decive register @@ -90,9 +86,9 @@ static inline u8 CAMERAi_S_ReadRegister( CameraSelect camera, u8 reg ) switch (camera) { case CAMERA_SELECT_IN: - return I2Ci_ReadRegister( I2C_SLAVE_CAMERA_MICRON_IN, reg ); + return I2Ci_ReadRegister( I2C_SLAVE_CAMERA_SHARP_IN, reg ); case CAMERA_SELECT_OUT: - return I2Ci_ReadRegister( I2C_SLAVE_CAMERA_MICRON_OUT, reg ); + return I2Ci_ReadRegister( I2C_SLAVE_CAMERA_SHARP_OUT, reg ); } return FALSE; } @@ -101,17 +97,17 @@ static inline u8 CAMERA_S_ReadRegister( CameraSelect camera, u8 reg ) switch (camera) { case CAMERA_SELECT_IN: - return I2C_ReadRegister( I2C_SLAVE_CAMERA_MICRON_IN, reg ); + return I2C_ReadRegister( I2C_SLAVE_CAMERA_SHARP_IN, reg ); case CAMERA_SELECT_OUT: - return I2C_ReadRegister( I2C_SLAVE_CAMERA_MICRON_OUT, reg ); + return I2C_ReadRegister( I2C_SLAVE_CAMERA_SHARP_OUT, reg ); } return FALSE; } /*---------------------------------------------------------------------------* - Name: CAMERA_S_WriteRegisters + Name: CAMERAi_S_WriteRegisters - Description: set value to decive registers through I2C_. + Description: set value to decive registers through I2C. Arguments: camera : one of CameraSelect reg : decive register @@ -126,35 +122,11 @@ static inline BOOL CAMERAi_S_WriteRegisters( CameraSelect camera, u8 reg, const BOOL rOut = TRUE; if (camera & CAMERA_SELECT_IN) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_MICRON_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - rIn = (size == 0 ? TRUE : FALSE); -#else - rIn = I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_MICRON_IN, reg, bufp, size ); -#endif + rIn = I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_SHARP_IN, reg, bufp, size ); } if (camera & CAMERA_SELECT_OUT) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_MICRON_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - rOut = (size == 0 ? TRUE : FALSE); -#else - rOut = I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_MICRON_OUT, reg, bufp, size ); -#endif + rOut = I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_SHARP_OUT, reg, bufp, size ); } return (rIn && rOut); } @@ -164,47 +136,19 @@ static inline BOOL CAMERA_S_WriteRegisters( CameraSelect camera, u8 reg, const u BOOL rOut = TRUE; if (camera & CAMERA_SELECT_IN) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_MICRON_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - (void)I2C_Unlock(); - rIn = (size == 0 ? TRUE : FALSE); -#else - rOut = I2C_WriteRegisters( I2C_SLAVE_CAMERA_MICRON_IN, reg, bufp, size ); -#endif + rOut = I2C_WriteRegisters( I2C_SLAVE_CAMERA_SHARP_IN, reg, bufp, size ); } if (camera & CAMERA_SELECT_OUT) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); - while ( size > 0 ) - { - if ( FALSE == I2Ci_WriteRegisters( I2C_SLAVE_CAMERA_MICRON_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - (void)I2C_Unlock(); - rOut = (size == 0 ? TRUE : FALSE); -#else - rOut = I2C_WriteRegisters( I2C_SLAVE_CAMERA_MICRON_OUT, reg, bufp, size ); -#endif + rOut = I2C_WriteRegisters( I2C_SLAVE_CAMERA_SHARP_OUT, reg, bufp, size ); } return (rIn && rOut); } /*---------------------------------------------------------------------------* - Name: CAMERA_S_ReadRegisters + Name: CAMERAi_S_ReadRegisters - Description: get value from decive registers through I2C_. + Description: get value from decive registers through I2C. Arguments: camera : one of CameraSelect w/o BOTH reg : decive register @@ -215,88 +159,32 @@ static inline BOOL CAMERA_S_WriteRegisters( CameraSelect camera, u8 reg, const u *---------------------------------------------------------------------------*/ static inline BOOL CAMERAi_S_ReadRegisters( CameraSelect camera, u8 reg, u8 *bufp, size_t size ) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO switch (camera) { case CAMERA_SELECT_IN: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegisters( I2C_SLAVE_CAMERA_MICRON_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; + return I2Ci_ReadRegisters( I2C_SLAVE_CAMERA_SHARP_IN, reg, bufp, size ); case CAMERA_SELECT_OUT: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegisters( I2C_SLAVE_CAMERA_MICRON_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - } - return (size == 0 ? TRUE : FALSE); -#else - switch (camera) - { - case CAMERA_SELECT_IN: - return I2Ci_ReadRegisters( I2C_SLAVE_CAMERA_MICRON_IN, reg, bufp, size ); - case CAMERA_SELECT_OUT: - return I2Ci_ReadRegisters( I2C_SLAVE_CAMERA_MICRON_OUT, reg, bufp, size ); + return I2Ci_ReadRegisters( I2C_SLAVE_CAMERA_SHARP_OUT, reg, bufp, size ); } return FALSE; -#endif } static inline BOOL CAMERA_S_ReadRegisters( CameraSelect camera, u8 reg, u8 *bufp, size_t size ) { -#ifdef CAMERA_DOES_NOT_SUPPORT_MULTIPLE_IO - (void)I2C_Lock(); switch (camera) { case CAMERA_SELECT_IN: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegisters( I2C_SLAVE_CAMERA_MICRON_IN, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; + return I2C_ReadRegisters( I2C_SLAVE_CAMERA_SHARP_IN, reg, bufp, size ); case CAMERA_SELECT_OUT: - while ( size > 0 ) - { - if ( FALSE == I2Ci_ReadRegisters( I2C_SLAVE_CAMERA_MICRON_OUT, reg++, bufp++, 1 ) ) - { - break; - } - size--; - } - break; - } - (void)I2C_Unlock(); - return (size == 0 ? TRUE : FALSE); -#else - switch (camera) - { - case CAMERA_SELECT_IN: - return I2C_ReadRegisters( I2C_SLAVE_CAMERA_MICRON_IN, reg, bufp, size ); - case CAMERA_SELECT_OUT: - return I2C_ReadRegisters( I2C_SLAVE_CAMERA_MICRON_OUT, reg, bufp, size ); + return I2C_ReadRegisters( I2C_SLAVE_CAMERA_SHARP_OUT, reg, bufp, size ); } return FALSE; -#endif } //================================================================================ -// I2C_ BIT CONTROL +// I2C BIT CONTROL //================================================================================ /*---------------------------------------------------------------------------* - Name: CAMERA_S_SetParams + Name: CAMERAi_S_SetParams Description: set control bit to device register @@ -313,11 +201,11 @@ static inline BOOL CAMERAi_S_SetParams( CameraSelect camera, u8 reg, u8 setBits, BOOL rOut = TRUE; if (camera & CAMERA_SELECT_IN) { - rIn = I2Ci_SetParams( I2C_SLAVE_CAMERA_MICRON_IN, reg, setBits, maskBits ); + rIn = I2Ci_SetParams( I2C_SLAVE_CAMERA_SHARP_IN, reg, setBits, maskBits ); } if (camera & CAMERA_SELECT_OUT) { - rOut = I2Ci_SetParams( I2C_SLAVE_CAMERA_MICRON_OUT, reg, setBits, maskBits ); + rOut = I2Ci_SetParams( I2C_SLAVE_CAMERA_SHARP_OUT, reg, setBits, maskBits ); } return (rIn && rOut); } @@ -327,17 +215,17 @@ static inline BOOL CAMERA_S_SetParams( CameraSelect camera, u8 reg, u8 setBits, BOOL rOut = TRUE; if (camera & CAMERA_SELECT_IN) { - rIn = I2C_SetParams( I2C_SLAVE_CAMERA_MICRON_IN, reg, setBits, maskBits ); + rIn = I2C_SetParams( I2C_SLAVE_CAMERA_SHARP_IN, reg, setBits, maskBits ); } if (camera & CAMERA_SELECT_OUT) { - rOut = I2C_SetParams( I2C_SLAVE_CAMERA_MICRON_OUT, reg, setBits, maskBits ); + rOut = I2C_SetParams( I2C_SLAVE_CAMERA_SHARP_OUT, reg, setBits, maskBits ); } return (rIn && rOut); } /*---------------------------------------------------------------------------* - Name: CAMERA_S_SetFlags + Name: CAMERAi_S_SetFlags Description: set control bit to device register @@ -357,7 +245,7 @@ static inline BOOL CAMERA_S_SetFlags( CameraSelect camera, u8 reg, u8 setBits ) } /*---------------------------------------------------------------------------* - Name: CAMERA_S_ClearFlags + Name: CAMERAi_S_ClearFlags Description: clear control bit to device register @@ -378,10 +266,10 @@ static inline BOOL CAMERA_S_ClearFlags( CameraSelect camera, u8 reg, u8 clrBits //================================================================================ -// I2C_ API +// I2C API //================================================================================ /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CInit + Name: CAMERAi_S_I2CInit Description: initialize CAMERA @@ -389,10 +277,10 @@ static inline BOOL CAMERA_S_ClearFlags( CameraSelect camera, u8 reg, u8 clrBits Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CInit(CameraSelect camera); +BOOL CAMERAi_S_I2CInit(CameraSelect camera); /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CStandby + Name: CAMERAi_S_I2CStandby Description: standby or resume CAMERA @@ -401,10 +289,10 @@ BOOL CAMERA_S_I2CInit(CameraSelect camera); Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CStandby(CameraSelect camera, BOOL standby); +BOOL CAMERAi_S_I2CStandby(CameraSelect camera, BOOL standby); /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CResize + Name: CAMERAi_S_I2CResize Description: resize CAMERA @@ -414,30 +302,44 @@ BOOL CAMERA_S_I2CStandby(CameraSelect camera, BOOL standby); Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CResize(CameraSelect camera, u16 width, u16 height); +BOOL CAMERAi_S_I2CResize(CameraSelect camera, u16 width, u16 height); + /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CPreSleep + Name: CAMERAi_S_I2CFrameRate - Description: preset CAMERA registers + Description: set CAMERA frame rate Arguments: camera : one of CameraSelect + rate : fps (0: auto) Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CPreSleep(CameraSelect camera); +BOOL CAMERAi_S_I2CFrameRate(CameraSelect camera, int rate); /*---------------------------------------------------------------------------* - Name: CAMERA_S_I2CPostSleep + Name: CAMERAi_S_I2CEffect - Description: preset CAMERA registers + Description: set CAMERA effect Arguments: camera : one of CameraSelect + effect : one of CameraEffect Returns: TRUE if success *---------------------------------------------------------------------------*/ -BOOL CAMERA_S_I2CPostSleep(CameraSelect camera); +BOOL CAMERAi_S_I2CEffect(CameraSelect camera, CameraEffect effect); +/*---------------------------------------------------------------------------* + Name: CAMERAi_S_I2CFlip + + Description: set CAMERA flip/mirror + + Arguments: camera : one of CameraSelect + flip : one of CameraFlip + + Returns: TRUE if success + *---------------------------------------------------------------------------*/ +BOOL CAMERAi_S_I2CFlip(CameraSelect camera, CameraFlip flip); #ifdef _cplusplus } /* extern "C" */ diff --git a/include/twl/camera/ARM9/camera.h b/include/twl/camera/ARM9/camera.h index 92f8fad..ffd7885 100644 --- a/include/twl/camera/ARM9/camera.h +++ b/include/twl/camera/ARM9/camera.h @@ -42,30 +42,6 @@ typedef enum { CAMERA_INTR_VSYNC_POSITIVE_EDGE = (3 << REG_CAM_CAM_CNT_IREQ_VS_SHIFT) } CameraIntrVsync; -/*---------------------------------------------------------------------------* - Name: CAMERA_Select - - Description: select camera to activate - - Arguments: camera one of CameraSelect - - Returns: TRUE if success - *---------------------------------------------------------------------------*/ -BOOL CAMERA_Select( CameraSelect camera ); - -#if 0 -/*---------------------------------------------------------------------------* - Name: CAMERA_SetStbyn - - Description: set stbyn - - Arguments: BOOL High/Low - - Returns: BOOL last state - *---------------------------------------------------------------------------*/ -BOOL CAMERA_SetStbyn( BOOL high ); -#endif - /*---------------------------------------------------------------------------* Name: CAMERA_PowerOn @@ -88,28 +64,6 @@ void CAMERA_PowerOn( void ); *---------------------------------------------------------------------------*/ void CAMERA_PowerOff( void ); -/*---------------------------------------------------------------------------* - Name: cameraPreSleep - - Description: pre-sleep process for CAMERA without power off - - Arguments: None - - Returns: None - *---------------------------------------------------------------------------*/ -void CAMERA_PreSleep( void ); - -/*---------------------------------------------------------------------------* - Name: CAMERA_PostSleep - - Description: pre-sleep process for CAMERA without power off - - Arguments: None - - Returns: None - *---------------------------------------------------------------------------*/ -void CAMERA_PostSleep( void ); - /*---------------------------------------------------------------------------* Name: CAMERA_IsBusy @@ -143,34 +97,10 @@ void CAMERA_Start( void ); *---------------------------------------------------------------------------*/ void CAMERA_Stop( void ); -/*---------------------------------------------------------------------------* - Name: CAMERA_SetSyncLowActive - - Description: set CAMERA sync polarity - - Arguments: isLowActive if low active, set TRUE - - Returns: None - *---------------------------------------------------------------------------*/ -void CAMERA_SetSyncLowActive( BOOL isLowActive ); - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetRclkNegativeEdge - - Description: set CAMERA rclk edge. - Should call while master clock is stopping. - - Arguments: isNegativeEdge if negative edge, set TRUE - - Returns: None - *---------------------------------------------------------------------------*/ -void CAMERA_SetRclkNegativeEdge( BOOL isNegativeEdge ); - /*---------------------------------------------------------------------------* Name: CAMERA_SetTrimmingParamsCenter Description: set camera trimming parameters by centering - expecting original image size is VGA. NOTE: should call CAMERA_SetTrimming to enable trimming Arguments: destWidth width of image to output @@ -201,7 +131,7 @@ void CAMERA_SetTrimmingParams(u16 x1, u16 y1, u16 x2, u16 y2); /*---------------------------------------------------------------------------* Name: CAMERA_SetTrimming - Description: set trimming enable/disable + Description: set trimming to be enabled/disabled Arguments: enabled TRUE if set trimming will be enabled diff --git a/include/twl/camera/ARM9/camera_api.h b/include/twl/camera/ARM9/camera_api.h index 7f739b0..9cb823d 100644 --- a/include/twl/camera/ARM9/camera_api.h +++ b/include/twl/camera/ARM9/camera_api.h @@ -29,7 +29,7 @@ extern "C" { typedef enum CAMERAResult { CAMERA_RESULT_SUCCESS = 0, - CAMERA_RESULT_SUCCESS_TRUE, + CAMERA_RESULT_SUCCESS_TRUE = 0, CAMERA_RESULT_SUCCESS_FALSE, CAMERA_RESULT_BUSY, CAMERA_RESULT_ILLEGAL_PARAMETER, @@ -55,181 +55,6 @@ typedef void (*CAMERACallback)(CAMERAResult result, void *arg); *---------------------------------------------------------------------------*/ void CAMERA_Init(void); -/*---------------------------------------------------------------------------* - Name: CAMERAi_I2CSelectAsync - - Description: select CAMERA to activate - async version - - Arguments: camera - one of CameraSelect - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CSelectAsync(CameraSelect camera, CAMERACallback callback, void *arg); - -/*---------------------------------------------------------------------------* - Name: CAMERAi_I2CSelect - - Description: select CAMERA to activate - sync version. - - Arguments: camera - one of CameraSelect - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CSelect(CameraSelect camera); - -/*---------------------------------------------------------------------------* - Name: CAMERA_WriteRegistersAsync - - Description: write CAMERA registers via I2C. - async version. - - Arguments: camera - one of CameraSelect - addr - start address - bufp - buffer to write - length - length of bufp - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_WriteRegistersAsync(CameraSelect camera, u8 addr, const u8* bufp, size_t length, CAMERACallback callback, void *arg); - -/*---------------------------------------------------------------------------* - Name: CAMERA_WriteRegisters - - Description: write CAMERA registers via I2C. - sync version. - - Arguments: camera - one of CameraSelect - addr - start address - bufp - buffer to write - length - length of bufp - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_WriteRegisters(CameraSelect camera, u8 addr, const u8* bufp, size_t length); - -/*---------------------------------------------------------------------------* - Name: CAMERA_ReadRegistersAsync - - Description: read CAMERA registers via I2C. - - Arguments: camera - one of CameraSelect - addr - start address - bufp - buffer to read - length - length of bufp - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ReadRegistersAsync(CameraSelect camera, u8 addr, u8* bufp, size_t length, CAMERACallback callback, void *arg); - -/*---------------------------------------------------------------------------* - Name: CAMERA_ReadRegisters - - Description: set CAMERA key normally - sync version. - - Arguments: camera - one of CameraSelect - addr - start address - bufp - buffer to read - length - length of bufp - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ReadRegisters(CameraSelect camera, u8 addr, u8* bufp, size_t length); - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetParamsAsync - - Description: set register as reg = (reg & ~mask) | (bits & mask); - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - mask - mask to touch - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetParamsAsync(CameraSelect camera, u8 addr, u8 bits, u8 mask, CAMERACallback callback, void *arg); - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetParams - - Description: set register as reg = (reg & ~mask) | (bits & mask); - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - mask - mask to touch - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetParams(CameraSelect camera, u8 addr, u8 bits, u8 mask); - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetFlagsAsync - - Description: set register as reg |= bits; - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetFlagsAsync(CameraSelect camera, u8 addr, u8 bits, CAMERACallback callback, void *arg); - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetFlags - - Description: set register as reg |= bits; - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetFlags(CameraSelect camera, u8 addr, u8 bits); - -/*---------------------------------------------------------------------------* - Name: CAMERA_ClearFlagsAsync - - Description: set register as reg &= ~bits; - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to clear - callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ClearFlagsAsync(CameraSelect camera, u8 addr, u8 bits, CAMERACallback callback, void *arg); - -/*---------------------------------------------------------------------------* - Name: CAMERA_ClearFlags - - Description: set register as reg &= ~bits; - - Arguments: camera - one of CameraSelect - addr - address to access - bits - bits to set - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ClearFlags(CameraSelect camera, u8 addr, u8 bits); - /*---------------------------------------------------------------------------* Name: CAMERA_I2CInitAsync @@ -255,166 +80,146 @@ CAMERAResult CAMERA_I2CInitAsync(CameraSelect camera, CAMERACallback callback, v Returns: CAMERAResult *---------------------------------------------------------------------------*/ CAMERAResult CAMERA_I2CInit(CameraSelect camera); -#if 0 -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPresetAsync - Description: set camera registers with specified preset via I2C +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CActivateAsync + + Description: activate specified CAMERA (goto standby if NONE is specified) async version Arguments: camera - one of CameraSelect - preset - preset type callback - 񓯊ĂɌĂяo֐w arg - R[obN֐̌ĂяöwB Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPresetAsync(CameraSelect camera, CameraPreset preset, CAMERACallback callback, void *arg); +CAMERAResult CAMERA_I2CActivateAsync(CameraSelect camera, CAMERACallback callback, void *arg); /*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreset + Name: CAMERA_I2CActivate - Description: set camera registers with specified preset via I2C + Description: activate specified CAMERA (goto standby if NONE is specified) sync version. Arguments: camera - one of CameraSelect - preset - preset type Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPreset(CameraSelect camera, CameraPreset preset); -#endif -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreSleepAsync - - Description: pre-sleep process in camera registers via I2C - async version. - - Arguments: callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPreSleepAsync(CAMERACallback callback, void *arg); +CAMERAResult CAMERA_I2CActivate(CameraSelect camera); /*---------------------------------------------------------------------------* - Name: CAMERA_I2CPreSleep + Name: CAMERAi_I2CResizeAsync - Description: pre-sleep process in camera registers via I2C - sync version. + Description: resize CAMERA output image + async version - Arguments: None. - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPreSleep(void); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPostSleepAsync - - Description: post-sleep process in camera registers via I2C - async version. - - Arguments: callback - 񓯊ĂɌĂяo֐w - arg - R[obN֐̌ĂяöwB - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPostSleepAsync(CAMERACallback callback, void *arg); - -/*---------------------------------------------------------------------------* - Name: CAMERA_I2CPostSleep - - Description: post-sleep process in camera registers via I2C - sync version. - - Arguments: None. - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_I2CPostSleep(void); - -/*---------------------------------------------------------------------------* - Name: CAMERA_SetCroppingAsync - - Description: set offset and size - - Arguments: camera - one of CameraSelect - x_off - x offset to start capturing - y_off - y offset to start capturing - width - width of image - height - height of image + Arguments: camera - one of CameraResize + width - width of the image + height - height of the image callback - 񓯊ĂɌĂяo֐w arg - R[obN֐̌ĂяöwB Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetCroppingAsync(CameraSelect camera, u16 x_off, u16 y_off, u16 width, u16 height, CAMERACallback callback, void *arg); +CAMERAResult CAMERA_I2CResizeAsync(CameraSelect camera, u16 width, u16 height, CAMERACallback callback, void *arg); /*---------------------------------------------------------------------------* - Name: CAMERA_SetCropping + Name: CAMERAi_I2CResize - Description: set offset and size + Description: resize CAMERA output image + sync version. + + Arguments: camera - one of CameraResize + width - width of the image + height - height of the image + + Returns: CAMERAResult + *---------------------------------------------------------------------------*/ +CAMERAResult CAMERA_I2CResize(CameraSelect camera, u16 width, u16 height); + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CFrameRateAsync + + Description: set CAMERA frame rate (0 means automatic) + async version Arguments: camera - one of CameraSelect - x_off - x offset to start capturing - y_off - y offset to start capturing - width - width of image - height - height of image - - Returns: CAMERAResult - *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_SetCropping(CameraSelect camera, u16 x_off, u16 y_off, u16 width, u16 height); - -/*---------------------------------------------------------------------------* - Name: CAMERA_PauseAsync - - Description: pause camera via I2C - async version. - - Arguments: callback - 񓯊ĂɌĂяo֐w + rate - frame rate (fps) + callback - 񓯊ĂɌĂяo֐w arg - R[obN֐̌ĂяöwB Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_PauseAsync(CAMERACallback callback, void *arg); +CAMERAResult CAMERA_I2CFrameRateAsync(CameraSelect camera, int rate, CAMERACallback callback, void *arg); /*---------------------------------------------------------------------------* - Name: CAMERA_Pause + Name: CAMERA_I2CFrameRate - Description: pause camera via I2C + Description: set CAMERA frame rate (0 means automatic) sync version. - Arguments: None. + Arguments: camera - one of CameraSelect + rate - frame rate (fps) Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_Pause(void); +CAMERAResult CAMERA_I2CFrameRate(CameraSelect camera, int rate); /*---------------------------------------------------------------------------* - Name: CAMERA_ResumeAsync + Name: CAMERA_I2CEffectAsync - Description: resume camera from pausing via I2C - async version. + Description: set CAMERA frame rate (0 means automatic) + async version - Arguments: callback - 񓯊ĂɌĂяo֐w + Arguments: camera - one of CameraSelect + effect - one of CameraEffect + callback - 񓯊ĂɌĂяo֐w arg - R[obN֐̌ĂяöwB Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_ResumeAsync(CAMERACallback callback, void *arg); +CAMERAResult CAMERA_I2CEffectAsync(CameraSelect camera, CameraEffect effect, CAMERACallback callback, void *arg); /*---------------------------------------------------------------------------* - Name: CAMERA_Resume + Name: CAMERA_I2CEffect - Description: resume camera from pausing via I2C + Description: set CAMERA frame rate (0 means automatic) sync version. - Arguments: None. + Arguments: camera - one of CameraSelect + effect - one of CameraEffect Returns: CAMERAResult *---------------------------------------------------------------------------*/ -CAMERAResult CAMERA_Resume(void); +CAMERAResult CAMERA_I2CEffect(CameraSelect camera, CameraEffect effect); + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CFlipAsync + + Description: set CAMERA frame rate (0 means automatic) + async version + + Arguments: camera - one of CameraSelect + flip - one of CameraFlip + callback - 񓯊ĂɌĂяo֐w + arg - R[obN֐̌ĂяöwB + + Returns: CAMERAResult + *---------------------------------------------------------------------------*/ +CAMERAResult CAMERA_I2CFlipAsync(CameraSelect camera, CameraFlip flip, CAMERACallback callback, void *arg); + +/*---------------------------------------------------------------------------* + Name: CAMERA_I2CFlip + + Description: set CAMERA frame rate (0 means automatic) + sync version. + + Arguments: camera - one of CameraSelect + flip - one of CameraFlip + + Returns: CAMERAResult + *---------------------------------------------------------------------------*/ +CAMERAResult CAMERA_I2CFlip(CameraSelect camera, CameraFlip flip); /*===========================================================================*/ diff --git a/include/twl/camera/ARM9/transfer.h b/include/twl/camera/ARM9/transfer.h index db4f946..71233da 100644 --- a/include/twl/camera/ARM9/transfer.h +++ b/include/twl/camera/ARM9/transfer.h @@ -21,7 +21,7 @@ #include #define CAMERA_DMA_BLOCK_SIZE MI_EXDMA_BLOCK_64B -#define CAMERA_DMA_INTERVAL 8 +#define CAMERA_DMA_INTERVAL 2 #define CAMERA_DMA_PRESCALER MI_EXDMA_PRESCALER_1 #ifdef __cplusplus @@ -73,22 +73,22 @@ static inline void CAMERA_DmaRecvAsync(u32 dmaNo, void *dest, u32 unit, u32 leng } /*---------------------------------------------------------------------------* - Name: CAMERA_DmaRecvInfinity + Name: CAMERA_DmaPipeInfinity Description: receiving data from CAMERA buffer. - Once starting DMA, it will transfer every frame automatically. + Once starting DMA, it will transfer every unit data to same + destination address. You should call MIi_StopExDma(dmaNo) to stop Arguments: dmaNo : DMA channel No. (4 - 7) dest : destination address unit : transfer length at once (byte)(width * lines at once) - length : transfer length (byte) (frame size) Returns: None *---------------------------------------------------------------------------*/ -static inline void CAMERA_DmaRecvInfinity(u32 dmaNo, void *dest, u32 unit, u32 length) +static inline void CAMERA_DmaPipeInfinity(u32 dmaNo, void *dest, u32 unit) { - MIi_ExDmaRecvAsyncCore( dmaNo, (void*)REG_CAM_DAT_ADDR, dest, length, unit, + MIi_ExDmaRecvAsyncCore( dmaNo, (void*)REG_CAM_DAT_ADDR, dest, unit, unit, CAMERA_DMA_BLOCK_SIZE, CAMERA_DMA_INTERVAL, CAMERA_DMA_PRESCALER, MI_EXDMA_CONTINUOUS_ON, MI_EXDMA_SRC_RLD_OFF, MI_EXDMA_DEST_RLD_ON, MI_EXDMA_TIMING_CAMERA ); diff --git a/include/twl/camera/common/fifo.h b/include/twl/camera/common/fifo.h index e001c2b..502d16e 100644 --- a/include/twl/camera/common/fifo.h +++ b/include/twl/camera/common/fifo.h @@ -47,48 +47,32 @@ extern "C" { // PXIR}h` typedef enum CAMERAPxiCommand { - CAMERA_PXI_COMMAND_SELECT = 0x00, // ANeBuI - // I2C{ - CAMERA_PXI_COMMAND_WRITE_REGISTERS = 0x10, - CAMERA_PXI_COMMAND_READ_REGISTERS = 0x11, - CAMERA_PXI_COMMAND_SET_PARAMS = 0x12, - CAMERA_PXI_COMMAND_SET_FLAGS = 0x13, - CAMERA_PXI_COMMAND_CLEAR_FLAGS = 0x14, - // I2Cp - CAMERA_PXI_COMMAND_I2C_INIT = 0x20, // ėp - CAMERA_PXI_COMMAND_I2C_PRESET = 0x21, // evZbg + CAMERA_PXI_COMMAND_INIT = 0x00, // - CAMERA_PXI_COMMAND_I2C_PRE_SLEEP = 0x28, // X[vO - CAMERA_PXI_COMMAND_I2C_POST_SLEEP = 0x29, // X[v㏈ + CAMERA_PXI_COMMAND_ACTIVATE = 0x10, // ANeBuI - CAMERA_PXI_COMMAND_I2C_SET_CROPPING = 0x30, // ʒuƃTCYݒ + CAMERA_PXI_COMMAND_RESIZE = 0x30, // TCYݒ + CAMERA_PXI_COMMAND_FRAME_RATE = 0x31, // t[[gݒ + CAMERA_PXI_COMMAND_EFFECT = 0x32, // GtFNgݒ + CAMERA_PXI_COMMAND_FLIP = 0x33, // ]ݒ - CAMERA_PXI_COMMAND_I2C_PAUSE = 0x38, // ꎞ~ - CAMERA_PXI_COMMAND_I2C_RESUME = 0x39 // A + CAMERA_PXI_COMMAND_UNKNOWN } CAMERAPxiCommand; // PXIR}hTCY` typedef enum CAMERAPxiSize { - CAMERA_PXI_SIZE_SELECT = 1, // camera - // I2C{ - CAMERA_PXI_SIZE_WRITE_REGISTERS = CAMERA_PXI_DATA_SIZE_MAX, // camera, addr, size, data... - CAMERA_PXI_SIZE_READ_REGISTERS = 3, // camera, addr, size - CAMERA_PXI_SIZE_SET_PARAMS = 4, // camera, addr, bits, mask - CAMERA_PXI_SIZE_SET_FLAGS = 3, // camera, addr, bits - CAMERA_PXI_SIZE_CLEAR_FLAGS = 3, // camera, addr, bits - // I2Cp - CAMERA_PXI_SIZE_I2C_INIT = 1, // camera - CAMERA_PXI_SIZE_I2C_PRESET = 2, // camera, preset + CAMERA_PXI_SIZE_INIT = 1, // camera - CAMERA_PXI_SIZE_I2C_PRE_SLEEP = 0, - CAMERA_PXI_SIZE_I2C_POST_SLEEP = 0, + CAMERA_PXI_SIZE_ACTIVATE = 1, // camera - CAMERA_PXI_SIZE_I2C_SET_CROPPING = 9, // camera, (u16)x_offset, (u16)y_offset, (u16)width, (u16)height + CAMERA_PXI_SIZE_RESIZE = 5, // camera, (u16)width, (u16)height + CAMERA_PXI_SIZE_FRAME_RATE = 2, // camera, rate + CAMERA_PXI_SIZE_EFFECT = 2, // camera, effect + CAMERA_PXI_SIZE_FLIP = 2, // camera, flip - CAMERA_PXI_SIZE_I2C_PAUSE = 0, - CAMERA_PXI_SIZE_I2C_RESUME = 0 + CAMERA_PXI_SIZE_UNKNOWN } CAMERAPxiSize; diff --git a/include/twl/camera/common/types.h b/include/twl/camera/common/types.h index 4e9648c..12f6a3d 100644 --- a/include/twl/camera/common/types.h +++ b/include/twl/camera/common/types.h @@ -22,21 +22,36 @@ extern "C" { /*===========================================================================*/ -typedef enum { +typedef enum +{ CAMERA_SELECT_NONE = 0, CAMERA_SELECT_IN = (1<<0), CAMERA_SELECT_OUT = (1<<1), CAMERA_SELECT_BOTH = (CAMERA_SELECT_IN|CAMERA_SELECT_OUT) -} CameraSelect; +} +CameraSelect; -typedef enum { - CAMERA_FUNC_INIT, - CAMERA_FUNC_STANDBY, - CAMERA_FUNC_RESIZE, - CAMERA_FUNC_PRESLEEP, - CAMERA_FUNC_POSTSLEEP, - CAMERA_FUNC_MAX -} CameraFunct; +typedef enum +{ + CAMERA_EFFECT_NONE, + CAMERA_EFFECT_MONO, + CAMERA_EFFECT_SEPIA, + CAMERA_EFFECT_NEGATIVE, + + CAMERA_EFFECT_MAX +} +CameraEffect; + +typedef enum +{ + CAMERA_FLIP_NONE, + CAMERA_FLIP_VERTICAL, + CAMERA_FLIP_HORIZONTAL, + CAMERA_FLIP_REVERSE, + + CAMERA_FLIP_MAX +} +CameraFlip; /*===========================================================================*/ diff --git a/include/twl/i2c/ARM7/i2c.h b/include/twl/i2c/ARM7/i2c.h index ca60617..f1d88c7 100644 --- a/include/twl/i2c/ARM7/i2c.h +++ b/include/twl/i2c/ARM7/i2c.h @@ -51,8 +51,8 @@ I2CReadWrite; #define I2C_ADDR_CODEC (0x18 << 1) -#define I2C_ADDR_CAMERA_MICRON_IN 0x78 // MICRON -#define I2C_ADDR_CAMERA_MICRON_OUT 0x7A // MICRON +#define I2C_ADDR_CAMERA_MICRON_IN 0x7A // MICRON +#define I2C_ADDR_CAMERA_MICRON_OUT 0x78 // MICRON #define I2C_ADDR_CAMERA_SHARP_IN 0xE0 // SHARP #define I2C_ADDR_CAMERA_SHARP_OUT 0xA0 // SHARP @@ -495,33 +495,6 @@ static inline BOOL I2C_VerifyRegisters16( I2CSlave id, u16 reg, const u16 *bufp, return result; } -#if 0 -//================================================================================ -// INTERRUPT -//================================================================================ -/*---------------------------------------------------------------------------* - Name: I2Ci_EnableInterrupt - - Description: enable I2C interrupt for each device. - - Arguments: None. - - Returns: None. - *---------------------------------------------------------------------------*/ -void I2Ci_EnableInterrupt( void ); - -/*---------------------------------------------------------------------------* - Name: I2Ci_DisableInterrupt - - Description: disable I2C interrupt for each device. - - Arguments: None. - - Returns: None. - *---------------------------------------------------------------------------*/ -void I2Ci_DisableInterrupt( void ); -#endif - #ifdef __cplusplus } /* extern "C" */ #endif