test_zbar.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. /*
  2. * Copyright (c) 2022 OpenLuat & AirM2M
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. * this software and associated documentation files (the "Software"), to deal in
  6. * the Software without restriction, including without limitation the rights to
  7. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  8. * the Software, and to permit persons to whom the Software is furnished to do so,
  9. * subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in all
  12. * copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  16. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  17. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  18. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. */
  21. #include "user.h"
  22. #include "zbar.h"
  23. #include "symbol.h"
  24. #include "image.h"
  25. #if 1
  26. #define CAMERA_WIDTH 320
  27. #define CAMERA_HEIGHT 240
  28. #else
  29. #define CAMERA_WIDTH 160
  30. #define CAMERA_HEIGHT 80
  31. #endif
  32. #define GC032A_I2C_ADDRESS 0x21
  33. #define OV2640_I2C_ADDRESS 0x30
  34. static const I2C_CommonRegDataStruct GC032A_InitRegQueue[] =
  35. {
  36. {0xf3, 0xff},
  37. {0xf7, 0x01},
  38. {0xf8, 0x03},
  39. {0xf9, 0xce},
  40. {0xfa, 0x00},
  41. {0xfc, 0x02},
  42. {0xfe, 0x02},
  43. {0x81, 0x03},
  44. {0xfe,0x00},
  45. {0x03,0x01},
  46. {0x04,0xc2},
  47. {0x05,0x01},
  48. {0x06,0xc2},
  49. {0x07,0x00},
  50. {0x08,0x08},
  51. {0x0a,0x04},
  52. {0x0c,0x04},
  53. {0x0d,0x01},
  54. {0x0e,0xe8},
  55. {0x0f,0x02},
  56. {0x10,0x88},
  57. //{0x17,0x55},
  58. {0x17,0x54},
  59. {0x19,0x04},
  60. {0x1a,0x0a},
  61. {0x1f,0x40},
  62. {0x20,0x30},
  63. {0x2e,0x80},
  64. {0x2f,0x2b},
  65. {0x30,0x1a},
  66. {0xfe,0x02},
  67. {0x03,0x02},
  68. {0x06,0x60},
  69. {0x05,0xd7},
  70. {0x12,0x89},
  71. {0xfe,0x00},
  72. {0x18,0x02},
  73. {0xfe,0x02},
  74. {0x40,0x22},
  75. {0x45,0x00},
  76. {0x46,0x00},
  77. {0x49,0x20},
  78. {0xfe,0x01},
  79. {0x0a,0xc5},
  80. {0x45,0x00},
  81. {0xfe,0x00},
  82. {0x40,0xff},
  83. {0x41,0x25},
  84. {0x42,0x83},
  85. {0x43,0x10},
  86. {0x46,0x26},
  87. {0x49,0x03},
  88. {0x4f,0x01},
  89. {0xde,0x84},
  90. {0xfe,0x02},
  91. {0x22,0xf6},
  92. {0xfe,0x01},
  93. {0x12,0xa0},
  94. {0x13,0x3a},
  95. {0xc1,0x3c},
  96. {0xc2,0x50},
  97. {0xc3,0x00},
  98. {0xc4,0x32},
  99. {0xc5,0x24},
  100. {0xc6,0x16},
  101. {0xc7,0x08},
  102. {0xc8,0x08},
  103. {0xc9,0x00},
  104. {0xca,0x20},
  105. {0xdc,0x8a},
  106. {0xdd,0xa0},
  107. {0xde,0xa6},
  108. {0xdf,0x75},
  109. {0xfe,0x01},
  110. {0x7c,0x09},
  111. {0x65,0x00},
  112. {0x7c,0x08},
  113. {0x56,0xf4},
  114. {0x66,0x0f},
  115. {0x67,0x84},
  116. {0x6b,0x80},
  117. {0x6d,0x12},
  118. {0x6e,0xb0},
  119. {0x86,0x00},
  120. {0x87,0x00},
  121. {0x88,0x00},
  122. {0x89,0x00},
  123. {0x8a,0x00},
  124. {0x8b,0x00},
  125. {0x8c,0x00},
  126. {0x8d,0x00},
  127. {0x8e,0x00},
  128. {0x8f,0x00},
  129. {0x90,0xef},
  130. {0x91,0xe1},
  131. {0x92,0x0c},
  132. {0x93,0xef},
  133. {0x94,0x65},
  134. {0x95,0x1f},
  135. {0x96,0x0c},
  136. {0x97,0x2d},
  137. {0x98,0x20},
  138. {0x99,0xaa},
  139. {0x9a,0x3f},
  140. {0x9b,0x2c},
  141. {0x9c,0x5f},
  142. {0x9d,0x3e},
  143. {0x9e,0xaa},
  144. {0x9f,0x67},
  145. {0xa0,0x60},
  146. {0xa1,0x00},
  147. {0xa2,0x00},
  148. {0xa3,0x0a},
  149. {0xa4,0xb6},
  150. {0xa5,0xac},
  151. {0xa6,0xc1},
  152. {0xa7,0xac},
  153. {0xa8,0x55},
  154. {0xa9,0xc3},
  155. {0xaa,0xa4},
  156. {0xab,0xba},
  157. {0xac,0xa8},
  158. {0xad,0x55},
  159. {0xae,0xc8},
  160. {0xaf,0xb9},
  161. {0xb0,0xd4},
  162. {0xb1,0xc3},
  163. {0xb2,0x55},
  164. {0xb3,0xd8},
  165. {0xb4,0xce},
  166. {0xb5,0x00},
  167. {0xb6,0x00},
  168. {0xb7,0x05},
  169. {0xb8,0xd6},
  170. {0xb9,0x8c},
  171. {0xfe,0x01},
  172. {0xd0,0x40},
  173. {0xd1,0xf8},
  174. {0xd2,0x00},
  175. {0xd3,0xfa},
  176. {0xd4,0x45},
  177. {0xd5,0x02},
  178. {0xd6,0x30},
  179. {0xd7,0xfa},
  180. {0xd8,0x08},
  181. {0xd9,0x08},
  182. {0xda,0x58},
  183. {0xdb,0x02},
  184. {0xfe,0x00},
  185. {0xfe,0x00},
  186. {0xba,0x00},
  187. {0xbb,0x04},
  188. {0xbc,0x0a},
  189. {0xbd,0x0e},
  190. {0xbe,0x22},
  191. {0xbf,0x30},
  192. {0xc0,0x3d},
  193. {0xc1,0x4a},
  194. {0xc2,0x5d},
  195. {0xc3,0x6b},
  196. {0xc4,0x7a},
  197. {0xc5,0x85},
  198. {0xc6,0x90},
  199. {0xc7,0xa5},
  200. {0xc8,0xb5},
  201. {0xc9,0xc2},
  202. {0xca,0xcc},
  203. {0xcb,0xd5},
  204. {0xcc,0xde},
  205. {0xcd,0xea},
  206. {0xce,0xf5},
  207. {0xcf,0xff},
  208. {0xfe,0x00},
  209. {0x5a,0x08},
  210. {0x5b,0x0f},
  211. {0x5c,0x15},
  212. {0x5d,0x1c},
  213. {0x5e,0x28},
  214. {0x5f,0x36},
  215. {0x60,0x45},
  216. {0x61,0x51},
  217. {0x62,0x6a},
  218. {0x63,0x7d},
  219. {0x64,0x8d},
  220. {0x65,0x98},
  221. {0x66,0xa2},
  222. {0x67,0xb5},
  223. {0x68,0xc3},
  224. {0x69,0xcd},
  225. {0x6a,0xd4},
  226. {0x6b,0xdc},
  227. {0x6c,0xe3},
  228. {0x6d,0xf0},
  229. {0x6e,0xf9},
  230. {0x6f,0xff},
  231. {0xfe,0x00},
  232. {0x70,0x50},
  233. {0xfe,0x00},
  234. {0x4f,0x01},
  235. {0xfe,0x01},
  236. {0x44,0x04},
  237. {0x1f,0x30},
  238. {0x20,0x40},
  239. {0x26,0x9a},
  240. {0x27,0x02},
  241. {0x28,0x0d},
  242. {0x29,0x02},
  243. {0x2a,0x0d},
  244. {0x2b,0x02},
  245. {0x2c,0x58},
  246. {0x2d,0x07},
  247. {0x2e,0xd2},
  248. {0x2f,0x0b},
  249. {0x30,0x6e},
  250. {0x31,0x0e},
  251. {0x32,0x70},
  252. {0x33,0x12},
  253. {0x34,0x0c},
  254. {0x3c,0x20},
  255. {0x3e,0x20},
  256. {0x3f,0x2d},
  257. {0x40,0x40},
  258. {0x41,0x5b},
  259. {0x42,0x82},
  260. {0x43,0xb7},
  261. {0x04,0x0a},
  262. {0x02,0x79},
  263. {0x03,0xc0},
  264. {0xcc,0x08},
  265. {0xcd,0x08},
  266. {0xce,0xa4},
  267. {0xcf,0xec},
  268. {0xfe,0x00},
  269. {0x81,0xb8},
  270. {0x82,0x12},
  271. {0x83,0x0a},
  272. {0x84,0x01},
  273. {0x86,0x25},
  274. {0x87,0x18},
  275. {0x88,0x10},
  276. {0x89,0x70},
  277. {0x8a,0x20},
  278. {0x8b,0x10},
  279. {0x8c,0x08},
  280. {0x8d,0x0a},
  281. {0xfe,0x00},
  282. {0x8f,0xaa},
  283. {0x90,0x9c},
  284. {0x91,0x52},
  285. {0x92,0x03},
  286. {0x93,0x03},
  287. {0x94,0x08},
  288. {0x95,0x44},
  289. {0x97,0x00},
  290. {0x98,0x00},
  291. {0xfe,0x00},
  292. {0xa1,0x30},
  293. {0xa2,0x41},
  294. {0xa4,0x30},
  295. {0xa5,0x20},
  296. {0xaa,0x30},
  297. {0xac,0x32},
  298. {0xfe,0x00},
  299. {0xd1,0x3c},
  300. {0xd2,0x3c},
  301. {0xd3,0x38},
  302. {0xd6,0xf4},
  303. {0xd7,0x1d},
  304. {0xdd,0x73},
  305. {0xde,0x84},
  306. {0xfe,0x01},
  307. {0x13,0x20},
  308. {0xfe,0x00},
  309. {0x4f,0x00},
  310. {0x03,0x00},
  311. {0x04,0xa0},
  312. {0x71,0x60},
  313. {0x72,0x40},
  314. {0x42,0x80},
  315. {0x77,0x64},
  316. {0x78,0x40},
  317. {0x79,0x60},
  318. {0xfe, 0x00},
  319. // {0x44, 0x06}, //改成RGB565输出
  320. {0x44,0x90}, //输出灰度
  321. {0x46, 0x0f}, //决定了VSYNC,HSYNC, pixclk
  322. };
  323. enum
  324. {
  325. DECODE_DONE = USER_EVENT_ID_START + 100,
  326. };
  327. typedef struct
  328. {
  329. HANDLE NotifyTaskHandler;
  330. uint8_t TestBuf[4096];
  331. uint8_t *DataCache;
  332. uint32_t TotalSize;
  333. uint32_t CurSize;
  334. uint16_t Width;
  335. uint16_t Height;
  336. uint8_t DataBytes;
  337. uint8_t IsDecode;
  338. uint8_t BufferFull;
  339. }QR_DecodeCtrlStruct;
  340. static QR_DecodeCtrlStruct prvDecodeQR;
  341. static int32_t prvCamera_DCMICB(void *pData, void *pParam)
  342. {
  343. Buffer_Struct *RxBuf = (Buffer_Struct *)pData;
  344. if (!pData)
  345. {
  346. if (!prvDecodeQR.DataCache)
  347. {
  348. prvDecodeQR.DataCache = malloc(prvDecodeQR.TotalSize);
  349. prvDecodeQR.BufferFull = 0;
  350. }
  351. else
  352. {
  353. if (prvDecodeQR.TotalSize != prvDecodeQR.CurSize)
  354. {
  355. // DBG_ERR("%d, %d", prvDecodeQR.CurSize, prvDecodeQR.TotalSize);
  356. }
  357. else if (!prvDecodeQR.IsDecode)
  358. {
  359. prvDecodeQR.IsDecode = 1;
  360. Task_SendEvent(prvDecodeQR.NotifyTaskHandler, DECODE_DONE, prvDecodeQR.DataCache, 0, 0);
  361. prvDecodeQR.DataCache = malloc(prvDecodeQR.TotalSize);
  362. prvDecodeQR.BufferFull = 0;
  363. }
  364. else
  365. {
  366. prvDecodeQR.BufferFull = 1;
  367. }
  368. }
  369. prvDecodeQR.CurSize = 0;
  370. return 0;
  371. }
  372. if (prvDecodeQR.DataCache)
  373. {
  374. if (prvDecodeQR.BufferFull)
  375. {
  376. if (!prvDecodeQR.IsDecode)
  377. {
  378. prvDecodeQR.IsDecode = 1;
  379. Task_SendEvent(prvDecodeQR.NotifyTaskHandler, DECODE_DONE, prvDecodeQR.DataCache, 0, 0);
  380. prvDecodeQR.DataCache = malloc(prvDecodeQR.TotalSize);
  381. prvDecodeQR.BufferFull = 0;
  382. prvDecodeQR.CurSize = 0;
  383. }
  384. else
  385. {
  386. return 0;
  387. }
  388. }
  389. }
  390. else
  391. {
  392. prvDecodeQR.DataCache = malloc(prvDecodeQR.TotalSize);
  393. prvDecodeQR.BufferFull = 0;
  394. prvDecodeQR.CurSize = 0;
  395. }
  396. memcpy(&prvDecodeQR.DataCache[prvDecodeQR.CurSize], RxBuf->Data, RxBuf->MaxLen * 4);
  397. prvDecodeQR.CurSize += RxBuf->MaxLen * 4;
  398. if (prvDecodeQR.TotalSize < prvDecodeQR.CurSize)
  399. {
  400. DBG_ERR("%d,%d", prvDecodeQR.TotalSize, prvDecodeQR.CurSize);
  401. prvDecodeQR.CurSize = 0;
  402. }
  403. return 0;
  404. }
  405. static int32_t prvTest_VUartCB(void *pData, void *pParam)
  406. {
  407. uint32_t UartID = (uint32_t)pData;
  408. uint32_t State = (uint32_t)pParam;
  409. uint16_t ReadLen;
  410. switch (State)
  411. {
  412. case UART_CB_TX_BUFFER_DONE:
  413. case UART_CB_TX_ALL_DONE:
  414. // DBG("usb send ok");
  415. // Core_PrintMemInfo();
  416. break;
  417. case UART_CB_RX_BUFFER_FULL:
  418. case UART_CB_RX_TIMEOUT:
  419. case UART_CB_RX_NEW:
  420. ReadLen = Core_VUartRxBufferRead(UartID, prvDecodeQR.TestBuf, sizeof(prvDecodeQR.TestBuf));
  421. Core_VUartBufferTx(UartID, prvDecodeQR.TestBuf, ReadLen);
  422. break;
  423. case UART_CB_ERROR:
  424. DBG("usb disconnect");
  425. Core_VUartBufferTxStop(UartID); //也可以选择不清除,USB连上后,会自动重发,但是会有重复发送的情况,需要用户去处理
  426. break;
  427. case UART_CB_CONNECTED:
  428. break;
  429. }
  430. }
  431. static int32_t prvTest_VHIDCB(void *pData, void *pParam)
  432. {
  433. uint32_t USB_ID = (uint32_t)pData;
  434. uint32_t State = (uint32_t)pParam;
  435. uint16_t ReadLen;
  436. switch (State)
  437. {
  438. case USB_HID_NOT_READY:
  439. case USB_HID_READY:
  440. case USB_HID_SEND_DONE:
  441. DBG("%d", State);
  442. break;
  443. }
  444. }
  445. static void zbar_task(void *pData)
  446. {
  447. OS_EVENT Event;
  448. unsigned int len;
  449. int ret;
  450. char *string;
  451. zbar_t *zbar;
  452. LCD_DrawStruct *draw;
  453. Core_VUartInit(VIRTUAL_UART0, 0, 1, 0, 0, 0, prvTest_VUartCB);
  454. Core_VHIDInit(USB_ID0, prvTest_VHIDCB);
  455. while (1) {
  456. Task_GetEvent(prvDecodeQR.NotifyTaskHandler, DECODE_DONE, &Event, NULL, 0);
  457. draw = zalloc(sizeof(LCD_DrawStruct));
  458. draw->Mode = SPI_MODE_0;
  459. draw->Speed = 48000000;
  460. draw->SpiID = HSPI_ID0;
  461. draw->CSPin = GPIOC_14;
  462. draw->DCPin = 72;
  463. draw->x1 = 0;
  464. draw->x2 = prvDecodeQR.Width - 1;
  465. draw->y1 = 0;
  466. draw->y2 = prvDecodeQR.Height - 1;
  467. draw->xoffset = 0;
  468. draw->yoffset = 0;
  469. draw->Size = prvDecodeQR.TotalSize;
  470. draw->ColorMode = COLOR_MODE_GRAY;
  471. draw->Data = Event.Param1;
  472. Core_CameraDraw(draw);
  473. zbar = zbar_create();
  474. ret = zbar_run(zbar, prvDecodeQR.Width, prvDecodeQR.Height, Event.Param1);
  475. if (ret > 0)
  476. {
  477. string = zbar_get_data_ptr(zbar, &len);
  478. memcpy(prvDecodeQR.TestBuf, string, len);
  479. Core_VUartBufferTx(VIRTUAL_UART0, prvDecodeQR.TestBuf, len);
  480. DBG("%.*s", len, string);
  481. // Core_PrintMemInfo();
  482. Core_VHIDUploadData(USB_ID0, string, len);
  483. }
  484. zbar_destory(zbar);
  485. free(Event.Param1);
  486. prvDecodeQR.IsDecode = 0;
  487. }
  488. }
  489. void DecodeQR_TestInit(void)
  490. {
  491. uint8_t Reg = 0xf0;
  492. uint8_t Data[2];
  493. uint32_t i;
  494. prvDecodeQR.DataCache = NULL;
  495. prvDecodeQR.Width = CAMERA_WIDTH;
  496. prvDecodeQR.Height = CAMERA_HEIGHT;
  497. prvDecodeQR.TotalSize = prvDecodeQR.Width * prvDecodeQR.Height;
  498. prvDecodeQR.DataBytes = 1;
  499. prvDecodeQR.NotifyTaskHandler = Task_Create(zbar_task, NULL, 8 * 1024, 1, "test zbar");
  500. GPIO_Config(GPIOD_06, 0, 0);
  501. GPIO_Config(GPIOD_07, 0, 0);
  502. // GPIO_ExtiSetHWTimerCB(GC032A_IOCB, NULL);
  503. GPIO_Iomux(GPIOE_01, 3);
  504. GPIO_Iomux(GPIOE_02, 3);
  505. GPIO_Iomux(GPIOE_03, 3);
  506. GPIO_Iomux(GPIOD_01, 3);
  507. GPIO_Iomux(GPIOD_02, 3);
  508. GPIO_Iomux(GPIOD_03, 3);
  509. GPIO_Iomux(GPIOD_08, 3);
  510. GPIO_Iomux(GPIOD_09, 3);
  511. GPIO_Iomux(GPIOD_10, 3);
  512. GPIO_Iomux(GPIOD_11, 3);
  513. GPIO_Iomux(GPIOE_00, 3);
  514. GPIO_Iomux(GPIOE_06, 2);
  515. GPIO_Iomux(GPIOE_07, 2);
  516. GPIO_Iomux(GPIOA_05, 2);
  517. // GPIO_Config(GPIOE_03, 1, 1);
  518. // GPIO_ExtiConfig(GPIOE_03, 0, 1, 0);
  519. HWTimer_SetPWM(HW_TIMER5, 24000000, 0, 0);
  520. Task_DelayMS(1);
  521. GPIO_Output(GPIOD_06, 1);
  522. GPIO_Output(GPIOD_07, 1);
  523. Task_DelayUS(10);
  524. GPIO_Output(GPIOD_07, 0);
  525. I2C_MasterSetup(I2C_ID0, 400000);
  526. Data[0] = 0xf4;
  527. Data[1] = 0x10;
  528. I2C_BlockWrite(I2C_ID0, GC032A_I2C_ADDRESS, Data, 2, 10, NULL, 0);
  529. I2C_BlockRead(I2C_ID0, GC032A_I2C_ADDRESS, &Reg, 1, Data, 2, 10, NULL, 0);
  530. if ((0x23 == Data[0]) && (0x2a == Data[1]))
  531. {
  532. DBG("识别到GC032A控制芯片");
  533. }
  534. else
  535. {
  536. DBG("没有识别到GC032A控制芯片");
  537. return;
  538. }
  539. // Data[0] = 0xfe;
  540. // Data[1] = 0x00;
  541. // Reg = 0x44;
  542. // I2C_BlockWrite(I2C_ID0, GC032A_I2C_ADDRESS, Data, 2, 10, NULL, 0);
  543. // I2C_BlockRead(I2C_ID0, GC032A_I2C_ADDRESS, &Reg, Data, 2, 10, NULL, 0);
  544. // DBG("%x,%x", Data[0], Data[1]);
  545. for(i = 0; i < sizeof(GC032A_InitRegQueue)/sizeof(I2C_CommonRegDataStruct); i++)
  546. {
  547. I2C_BlockWrite(I2C_ID0, GC032A_I2C_ADDRESS, GC032A_InitRegQueue[i].Data, 2, 10, NULL, 0);
  548. }
  549. // DBG("GC032A Init Done");
  550. // I2C_Prepare(I2C_ID0, GC032A_I2C_ADDRESS, 1, GC032A_InitDone, 0);
  551. // I2C_MasterWriteRegQueue(I2C_ID0, GC032A_InitRegQueue, sizeof(GC032A_InitRegQueue)/sizeof(I2C_CommonRegDataStruct), 10, 0);
  552. DCMI_Setup(0, 0, 0, 8, 0);
  553. DCMI_SetCallback(prvCamera_DCMICB, 0);
  554. DCMI_SetCROPConfig(1, (480-prvDecodeQR.Height)/2, ((640-prvDecodeQR.Width)/2)*prvDecodeQR.DataBytes, prvDecodeQR.Height - 1, prvDecodeQR.DataBytes*prvDecodeQR.Width - 1); //裁剪中间的240*320图像
  555. DCMI_CaptureSwitch(1, (prvDecodeQR.Width * prvDecodeQR.DataBytes * prvDecodeQR.Height) / 80, 0, 0, 0, NULL); //240 * 2 / 4 * 12,一次DMA传输有12行数据,一共传输20次
  556. }