camdata.h
上传用户:zbk8730
上传日期:2017-08-10
资源大小:12168k
文件大小:7k
源码类别:

uCOS

开发平台:

C/C++

  1. /*****************************************
  2.   NAME: camdata.h
  3.   DESC: data for initializing camera module
  4.   HISTORY:  2004.01.16:draft ver 0.0
  5.  *****************************************/
  6. #ifndef __CAMDATA_H__
  7. #define __CAMDATA_H__
  8. #ifdef __cplusplus
  9. extern "C"{
  10. #endif
  11. #include "Camdef.h"
  12. #define CAM_ACT_HSIZE (640) // Max 640
  13. #define CAM_ACT_VSIZE (480) // Max 480
  14. #define CAM_STX (0x2f) //47
  15. #define CAM_STY (6) //6
  16. #define CAM_ENDX (((CAM_ACT_HSIZE)/4) + CAM_STX)
  17. #define CAM_ENDY ((CAM_ACT_VSIZE/2) + CAM_STY-1)
  18. const unsigned char Ov7620_Yuv16bit[][2] = {
  19. {0x12, 0x80}, // Camera Soft reset. Self cleared after reset.
  20. {0x17, CAM_STX}, //
  21. {0x18, CAM_ENDX}, // (207-47)*4 = 640
  22. {0x19, CAM_STY}, //
  23. {0x1a, CAM_ENDY}, // ((244-5)+1)*2=480
  24. {0x01, 0x80}, // set blue gain
  25. {0x02, 0x80}, // set red gain
  26. {0x03, 0xb0},
  27. {0x06, 0x70}, // set brightness
  28. {0x07, 0x00},
  29. {0x0c, 0x24}, // set blue background
  30. {0x0d, 0x24}, // set red background
  31. {0x10, 0xff}, // set exposure time, brightness control
  32. {0x11, 0x40}, // set frame rate 27Mhz/[(0+1)*2]=13.5MHz
  33. {0x12, 0x24}, // set YUV mode, enable AGC/AWB, mirror image.
  34. {0x15, 0x01}, // Use PCLK rising edge to latch data
  35. {0x16, 0x03}, //
  36. {0x12, 0x64}, // set YUV mode, enable AGC/AWB, mirror image.
  37. {0x13, 0x01}, // YUV 16-bit format, Disable AEC/AGC/AWB
  38. {0x14, 0x84}, // turn off GAMMA
  39. {0x24, 0x3a}, //
  40. {0x25, 0x60}, //
  41. {0x28, 0x20}, // Progressive mode.
  42. {0x2d, 0x95}, //
  43. {0x67, 0x92}, //
  44. {0x74, 0x00} //
  45. };
  46. const unsigned char Ov7620_YCbCr8bit[][2] = {
  47. {0x12, 0x80}, // Camera Soft reset. Self cleared after reset.
  48. {0x00, 0x00},
  49. {0x01, 0x80}, // set blue gain
  50. {0x02, 0x80}, // set red gain
  51. {0x03, 0xb0},
  52. {0x06, 0x60}, // set brightness
  53. {0x0c, 0x24}, // set blue background
  54. {0x0d, 0x24}, // set red background
  55. {0x10, 0xff}, // set exposure time, brightness control
  56. {0x11, 0x80}, // set frame rate CLK_input = PCLK
  57. {0x13, 0x21}, // set 8 Bit YUV mode
  58. {0x14, 0x94}, 
  59. {0x16, 0x03}, //
  60. {0x17, 0x2f}, //
  61. {0x18, 0xcf},         // (207-47)*4 = 640
  62. {0x19, 0x06}, //
  63. {0x1a, 0xf5},         // ((244-5)+1)*2=480
  64. {0x1b, 0x00},
  65. {0x20, 0x00},
  66. {0x21, 0x80},
  67. {0x22, 0x80},
  68. {0x23, 0x00},
  69. {0x26, 0xa2},
  70. {0x27, 0xea},
  71. {0x29, 0x00},
  72. {0x2a, 0x00},
  73. {0x2b, 0x00},
  74. {0x2c, 0x88},
  75. {0x2e, 0x80},
  76. {0x2f, 0x44},
  77. {0x60, 0x27},
  78. {0x61, 0x82},
  79. {0x62, 0x5f},
  80. {0x63, 0xd5},
  81. {0x64, 0x57},
  82. {0x65, 0x83},
  83. {0x66, 0x55},
  84. {0x68, 0xcf},
  85. {0x69, 0x76},
  86. {0x6a, 0x22},
  87. {0x6b, 0x00},
  88. {0x6c, 0x08},
  89. {0x6d, 0x48},
  90. {0x6e, 0x80},
  91. {0x6f, 0x0c},
  92. {0x70, 0x89},
  93. {0x71, 0x00},
  94. {0x72, 0x14},
  95. {0x73, 0x54},
  96. {0x75, 0x0e},
  97. {0x76, 0x00},
  98. {0x77, 0xff},
  99. {0x78, 0x80},
  100. {0x79, 0x80},
  101. {0x7a, 0x80},
  102. {0x7b, 0xe6},
  103. {0x7c, 0x00},
  104. {0x24, 0x10},
  105. {0x25, 0x8a},
  106. {0x28, 0x20},
  107. {0x2d, 0x95},
  108. {0x67, 0x92},
  109. {0x74, 0x00},
  110. {0x15, 0x41}, // inversed PCLK : falling edge to get data, 8 Bit -U-V- sequence....
  111. {0x12, 0x34},  // enable AGC/AWB, mirror image. YUYV-must set at last..
  112. };
  113. const unsigned char Au70h[][2] = {
  114.     {0x01,0x0b}, /*0x04*/ //5x5 interpolation VGA mode
  115. #if AU70H_VIDEO_SIZE==640
  116. {0x08,0x00},
  117. {0x09,0xc0},
  118. {0x0a,0x01},
  119. {0x0b,0x00},
  120. {0x0c,0x01},
  121. {0x0d,0xe0},
  122. {0x0e,0x02},
  123. {0x0f,0x80},
  124. #elif AU70H_VIDEO_SIZE==1152
  125. {0x08,0x00},
  126. {0x09,0x02},
  127. {0x0a,0x00},
  128. {0x0b,0x02},
  129. {0x0c,0x03},
  130. {0x0d,0x60},
  131. {0x0e,0x04},
  132. {0x0f,0x80},
  133. #endif
  134. {0x18,0x01},
  135. {0x19,0x3f},
  136. {0x1a,0x13},
  137. {0x1b,0x7f},
  138. {0x1c,0x08},
  139. {0x20,0x13},
  140. {0x21,0x01},
  141. {0x22,0x01},
  142. {0x23,0x01},
  143. {0x27,0xf0},
  144. {0x30,0xfe},
  145. {0x31,0x31}, //YCbCr 8bit 0x31,0x11
  146. {0x32,0x00},
  147. {0x33,0x03},
  148. {0x67,0xa5},  //???
  149. {0x68,0x2c},
  150. {0x69,0x2a},
  151. {0x73,0x79},
  152. {0x75,0x03},
  153. {0x76,0x08},
  154. {0x77,0x35},
  155. {0x81,0x19},
  156. {0x90,0x01},
  157. {0x91,0x06},
  158. {0x92,0x1a},
  159. {0x93,0x80},
  160. {0x6a,0x01},
  161. {0x6b,0x38},
  162. {0x6c,0x80},
  163. {0x6d,0x09},
  164. {0x6e,0xc4},
  165. {0x6f,0x00},
  166. {0x60,0x99},
  167. {0x63,0x03},
  168. {0x64,0xa9},
  169. {0x65,0x80},
  170. {0x66,0x30},
  171. {0x70,0x44},
  172. {0x71,0x00},
  173. //{0x14,0x8},
  174. //{0x16,0x8},
  175. {0x70,0x45},
  176. {0x71,0x02},
  177. {0x66,0x70}
  178. };
  179. const unsigned char S5X532_YCbCr8bit[][2] = 
  180. // page 5
  181. {0xec,0x05},
  182. {0x08,0x55},
  183. {0x0a,0x75},
  184. {0x0c,0x90},
  185. {0x0e,0x18},
  186. {0x12,0x09},
  187. {0x14,0x9d},
  188. {0x16,0x90},
  189. {0x1a,0x18},
  190. {0x1c,0x0c},
  191. {0x1e,0x09},
  192. {0x20,0x06},
  193. {0x22,0x20},
  194. {0x2a,0x00},
  195. {0x2d,0x04},
  196. {0x12,0x24},
  197. // page 3
  198. {0xec,0x03},
  199. {0x0c,0x09},
  200. {0x6c,0x09},
  201. {0x2b,0x10}, // momo clock inversion
  202. // page 2
  203. {0xec,0x02},
  204. {0x03,0x09},
  205. {0x05,0x08},
  206. {0x06,0x01},
  207. {0x07,0xf8},
  208. {0x15,0x25},
  209. {0x30,0x29},
  210. {0x36,0x12},
  211. {0x38,0x04},
  212. {0x1b,0x77}, // 24MHz : 0x77, 12MHz : 0x22
  213. {0x1c,0x77}, // 24MHz : 0x77, 12MHz : 0x22
  214. // page 1
  215. {0xec,0x01},
  216. {0x00,0x03}, // 
  217. {0x0a,0x08}, // 0x0-QQVGA, 0x06-CIF, 0x02-QCIF, 0x08-VGA, 0x04-QVGA, 0x0a-SXGA
  218. {0x0c,0x00}, // Pattern selectio. 0-CIS, 1-Color bar, 2-Ramp, 3-Blue screen
  219. {0x10,0x27}, // 0x21-ITU-R656(CbYCrY), 0x25-ITU-R601(CbYCrY), 0x26-ITU-R601(YCrYCb)
  220. {0x50,0x21}, // Hblank
  221. {0x51,0x00}, // Hblank
  222. {0x52,0xA1}, // Hblank
  223. {0x53,0x02}, // Hblank
  224. {0x54,0x01}, // Vblank
  225. {0x55,0x00}, // Vblank
  226. {0x56,0xE1}, // Vblank 
  227. {0x57,0x01}, // Vblank
  228. {0x58,0x21}, // Hsync
  229. {0x59,0x00}, // Hsync
  230. {0x5a,0xA1}, // Hsync
  231. {0x5b,0x02}, // Hsync
  232. {0x5c,0x03}, // Vref
  233. {0x5d,0x00}, // Vref
  234. {0x5e,0x05}, // Vref
  235. {0x5f,0x00}, // Vref
  236. {0x70,0x0E},
  237. {0x71,0xD6},
  238. {0x72,0x30},
  239. {0x73,0xDB},
  240. {0x74,0x0E},
  241. {0x75,0xD6},
  242. {0x76,0x18},
  243. {0x77,0xF5},
  244. {0x78,0x0E},
  245. {0x79,0xD6},
  246. {0x7a,0x28},
  247. {0x7b,0xE6},
  248. {0x50,0x00},
  249. {0x5c,0x00},
  250. // page 0
  251. {0xec,0x00},
  252. {0x79,0x01},
  253. {0x58,0x90},
  254. {0x59,0xA0},
  255. {0x5a,0x50},
  256. {0x5b,0x70},
  257. {0x5c,0xD0},
  258. {0x5d,0xC0},
  259. {0x5e,0x28},
  260. {0x5f,0x08},
  261. {0x50,0x90},
  262. {0x51,0xA0},
  263. {0x52,0x50},
  264. {0x53,0x70},
  265. {0x54,0xD0},
  266. {0x55,0xC0},
  267. {0x56,0x28},
  268. {0x57,0x00},
  269. {0x48,0x90},
  270. {0x49,0xA0},
  271. {0x4a,0x50},
  272. {0x4b,0x70},
  273. {0x4c,0xD0},
  274. {0x4d,0xC0},
  275. {0x4e,0x28},
  276. {0x4f,0x08},
  277. {0x72,0x82}, // main clock = 24MHz:0xd2, 16M:0x82, 12M:0x54
  278. {0x75,0x05} // absolute vertical mirror.  junon
  279. };
  280. const unsigned char S5X3A1_YCbCr8bit[][2] = 
  281. // page 0
  282. {0xec,0x00},
  283. // {0x72,0xd2}, //main clock = 27MHz:0x00, 24MHz:0xd2, ...
  284. {0x01,0x00}, //SXGA
  285. // page 1
  286. {0xec,0x01},
  287. {0x0b,0x10}, // href type
  288. {0x5c,0x01}, // href type
  289. {0x5d,0x00}, // href type
  290. {0x5e,0x01}, // href type
  291. {0x5f,0x04}, // href type
  292. // page 0
  293. {0xec,0x00}
  294. };
  295. #ifdef __cplusplus
  296. }
  297. #endif
  298. #endif /*__CAMDATA_H__*/