LibDriver GT30L32S4W
Loading...
Searching...
No Matches
driver_gt30l32s4w_read_test.c
Go to the documentation of this file.
1
36
38
39static gt30l32s4w_handle_t gs_handle;
40
49{
50 uint8_t res;
51 uint8_t buf[130];
53
54 /* link function */
61
62 /* get chip information */
63 res = gt30l32s4w_info(&info);
64 if (res != 0)
65 {
66 gt30l32s4w_interface_debug_print("gt30l32s4w: get info failed.\n");
67
68 return 1;
69 }
70 else
71 {
72 /* print chip information */
73 gt30l32s4w_interface_debug_print("gt30l32s4w: chip is %s.\n", info.chip_name);
74 gt30l32s4w_interface_debug_print("gt30l32s4w: manufacturer is %s.\n", info.manufacturer_name);
75 gt30l32s4w_interface_debug_print("gt30l32s4w: interface is %s.\n", info.interface);
76 gt30l32s4w_interface_debug_print("gt30l32s4w: driver version is %d.%d.\n", info.driver_version / 1000, (info.driver_version % 1000) / 100);
77 gt30l32s4w_interface_debug_print("gt30l32s4w: min supply voltage is %0.1fV.\n", info.supply_voltage_min_v);
78 gt30l32s4w_interface_debug_print("gt30l32s4w: max supply voltage is %0.1fV.\n", info.supply_voltage_max_v);
79 gt30l32s4w_interface_debug_print("gt30l32s4w: max current is %0.2fmA.\n", info.max_current_ma);
80 gt30l32s4w_interface_debug_print("gt30l32s4w: max temperature is %0.1fC.\n", info.temperature_max);
81 gt30l32s4w_interface_debug_print("gt30l32s4w: min temperature is %0.1fC.\n", info.temperature_min);
82 }
83
84 /* start read test */
85 gt30l32s4w_interface_debug_print("gt30l32s4w: start read test.\n");
86
87 /* gt30l32s4w init */
88 res = gt30l32s4w_init(&gs_handle);
89 if (res != 0)
90 {
91 gt30l32s4w_interface_debug_print("gt30l32s4w: init failed.\n");
92
93 return 1;
94 }
95
96 /* normal read test */
97 gt30l32s4w_interface_debug_print("gt30l32s4w: normal read test.\n");
98
99 /* normal read */
100 res = gt30l32s4w_set_mode(&gs_handle, GT30L32S4W_MODE_READ);
101 if (res != 0)
102 {
103 gt30l32s4w_interface_debug_print("gt30l32s4w: set mode failed.\n");
104 (void)gt30l32s4w_deinit(&gs_handle);
105
106 return 1;
107 }
108
109 /* gt30l32s4w_read_char_12x12 test */
110 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_12x12 test.\n");
111
112 /* read char 12x12 */
113 res = gt30l32s4w_read_char_12x12(&gs_handle, 0xD7D6U, buf);
114 if (res != 0)
115 {
116 gt30l32s4w_interface_debug_print("gt30l32s4w: read char 12x12 failed.\n");
117 (void)gt30l32s4w_deinit(&gs_handle);
118
119 return 1;
120 }
121
122 /* output */
123 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_12X12_GB2312, buf, 24);
124
125 /* gt30l32s4w_read_char_15x16 test */
126 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_15x16 test.\n");
127
128 /* read char 15x16 */
129 res = gt30l32s4w_read_char_15x16(&gs_handle, 0xD7D6U, buf);
130 if (res != 0)
131 {
132 gt30l32s4w_interface_debug_print("gt30l32s4w: read char 15x16 failed.\n");
133 (void)gt30l32s4w_deinit(&gs_handle);
134
135 return 1;
136 }
137
138 /* output */
139 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_15X16_GB2312, buf, 32);
140
141 /* gt30l32s4w_read_char_24x24 test */
142 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_24x24 test.\n");
143
144 /* read char 24x24 */
145 res = gt30l32s4w_read_char_24x24(&gs_handle, 0xD7D6U, buf);
146 if (res != 0)
147 {
148 gt30l32s4w_interface_debug_print("gt30l32s4w: read char 24x24 failed.\n");
149 (void)gt30l32s4w_deinit(&gs_handle);
150
151 return 1;
152 }
153
154 /* output */
155 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_24X24_GB2312, buf, 72);
156
157 /* gt30l32s4w_read_char_32x32 test */
158 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_32x32 test.\n");
159
160 /* read char 32x32 */
161 res = gt30l32s4w_read_char_32x32(&gs_handle, 0xD7D6U, buf);
162 if (res != 0)
163 {
164 gt30l32s4w_interface_debug_print("gt30l32s4w: read char 32x32 failed.\n");
165 (void)gt30l32s4w_deinit(&gs_handle);
166
167 return 1;
168 }
169
170 /* output */
171 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_32X32_GB2312, buf, 128);
172
173 /* gt30l32s4w_read_char_extend_6x12 test */
174 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_extend_6x12 test.\n");
175
176 /* read char extend 6x12 */
177 res = gt30l32s4w_read_char_extend_6x12(&gs_handle, 0xAAA1U, buf);
178 if (res != 0)
179 {
180 gt30l32s4w_interface_debug_print("gt30l32s4w: read char extend 6x12 failed.\n");
181 (void)gt30l32s4w_deinit(&gs_handle);
182
183 return 1;
184 }
185
186 /* output */
188
189 /* gt30l32s4w_read_char_extend_8x16 test */
190 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_extend_8x16 test.\n");
191
192 /* read char extend 8x16 */
193 res = gt30l32s4w_read_char_extend_8x16(&gs_handle, 0xAAA1U, buf);
194 if (res != 0)
195 {
196 gt30l32s4w_interface_debug_print("gt30l32s4w: read char extend 8x16 failed.\n");
197 (void)gt30l32s4w_deinit(&gs_handle);
198
199 return 1;
200 }
201
202 /* output */
204
205 /* gt30l32s4w_read_char_special_8x16 test */
206 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_special_8x16 test.\n");
207
208 /* read char special 8x16 */
209 res = gt30l32s4w_read_char_special_8x16(&gs_handle, 0xACB1U, buf);
210 if (res != 0)
211 {
212 gt30l32s4w_interface_debug_print("gt30l32s4w: read char special 8x16 failed.\n");
213 (void)gt30l32s4w_deinit(&gs_handle);
214
215 return 1;
216 }
217
218 /* output */
220
221 /* gt30l32s4w_read_char_extend_12x24 test */
222 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_extend_12x24 test.\n");
223
224 /* read char extend 12x24 */
225 res = gt30l32s4w_read_char_extend_12x24(&gs_handle, 0xAAA1U, buf);
226 if (res != 0)
227 {
228 gt30l32s4w_interface_debug_print("gt30l32s4w: read char extend 12x24 failed.\n");
229 (void)gt30l32s4w_deinit(&gs_handle);
230
231 return 1;
232 }
233
234 /* output */
236
237 /* gt30l32s4w_read_char_extend_16x32 test */
238 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_extend_16x32 test.\n");
239
240 /* read char extend 16x32 */
241 res = gt30l32s4w_read_char_extend_16x32(&gs_handle, 0xAAA1U, buf);
242 if (res != 0)
243 {
244 gt30l32s4w_interface_debug_print("gt30l32s4w: read char extend 16x32 failed.\n");
245 (void)gt30l32s4w_deinit(&gs_handle);
246
247 return 1;
248 }
249
250 /* output */
252
253 /* gt30l32s4w_read_ascii_5x7 test */
254 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_5x7 test.\n");
255
256 /* read ascii 5x7 */
257 res = gt30l32s4w_read_ascii_5x7(&gs_handle, '!', buf);
258 if (res != 0)
259 {
260 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 5x7 failed.\n");
261 (void)gt30l32s4w_deinit(&gs_handle);
262
263 return 1;
264 }
265
266 /* output */
267 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_5X7_ASCII, buf, 8);
268
269 /* gt30l32s4w_read_ascii_7x8 test */
270 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_7x8 test.\n");
271
272 /* read ascii 7x8 */
273 res = gt30l32s4w_read_ascii_7x8(&gs_handle, '!', buf);
274 if (res != 0)
275 {
276 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 7x8 failed.\n");
277 (void)gt30l32s4w_deinit(&gs_handle);
278
279 return 1;
280 }
281
282 /* output */
283 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_7X8_ASCII, buf, 8);
284
285 /* gt30l32s4w_read_ascii_6x12 test */
286 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_6x12 test.\n");
287
288 /* read ascii 6x12 */
289 res = gt30l32s4w_read_ascii_6x12(&gs_handle, '!', buf);
290 if (res != 0)
291 {
292 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 6x12 failed.\n");
293 (void)gt30l32s4w_deinit(&gs_handle);
294
295 return 1;
296 }
297
298 /* output */
299 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_6X12_ASCII, buf, 12);
300
301 /* gt30l32s4w_read_ascii_8x16 test */
302 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_8x16 test.\n");
303
304 /* read ascii 8x16 */
305 res = gt30l32s4w_read_ascii_8x16(&gs_handle, '!', buf);
306 if (res != 0)
307 {
308 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 8x16 failed.\n");
309 (void)gt30l32s4w_deinit(&gs_handle);
310
311 return 1;
312 }
313
314 /* output */
315 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_8X16_ASCII, buf, 16);
316
317 /* gt30l32s4w_read_ascii_12x24 test */
318 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_12x24 test.\n");
319
320 /* read ascii 12x24 */
321 res = gt30l32s4w_read_ascii_12x24(&gs_handle, '!', buf);
322 if (res != 0)
323 {
324 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 12x24 failed.\n");
325 (void)gt30l32s4w_deinit(&gs_handle);
326
327 return 1;
328 }
329
330 /* output */
331 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_12X24_ASCII, buf, 48);
332
333 /* gt30l32s4w_read_ascii_16x32 test */
334 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_16x32 test.\n");
335
336 /* read ascii 16x32 */
337 res = gt30l32s4w_read_ascii_16x32(&gs_handle, '!', buf);
338 if (res != 0)
339 {
340 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 16x32 failed.\n");
341 (void)gt30l32s4w_deinit(&gs_handle);
342
343 return 1;
344 }
345
346 /* output */
347 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_16X32_ASCII, buf, 64);
348
349 /* gt30l32s4w_read_ascii_arial_12 test */
350 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_arial_12 test.\n");
351
352 /* read ascii arial 12 */
353 res = gt30l32s4w_read_ascii_arial_12(&gs_handle, '?', buf);
354 if (res != 0)
355 {
356 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii arial 12 failed.\n");
357 (void)gt30l32s4w_deinit(&gs_handle);
358
359 return 1;
360 }
361
362 /* output */
364
365 /* gt30l32s4w_read_ascii_times_12 test */
366 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_times_12 test.\n");
367
368 /* read ascii times 12 */
369 res = gt30l32s4w_read_ascii_times_12(&gs_handle, '?', buf);
370 if (res != 0)
371 {
372 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii times 12 failed.\n");
373 (void)gt30l32s4w_deinit(&gs_handle);
374
375 return 1;
376 }
377
378 /* output */
380
381 /* gt30l32s4w_read_ascii_arial_16 test */
382 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_arial_16 test.\n");
383
384 /* read ascii arial 16 */
385 res = gt30l32s4w_read_ascii_arial_16(&gs_handle, '?', buf);
386 if (res != 0)
387 {
388 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii arial 16 failed.\n");
389 (void)gt30l32s4w_deinit(&gs_handle);
390
391 return 1;
392 }
393
394 /* output */
396
397 /* gt30l32s4w_read_ascii_times_16 test */
398 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_times_16 test.\n");
399
400 /* read ascii times 16 */
401 res = gt30l32s4w_read_ascii_times_16(&gs_handle, '?', buf);
402 if (res != 0)
403 {
404 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii times 16 failed.\n");
405 (void)gt30l32s4w_deinit(&gs_handle);
406
407 return 1;
408 }
409
410 /* output */
412
413 /* gt30l32s4w_read_ascii_arial_24 test */
414 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_arial_24 test.\n");
415
416 /* read ascii arial 24 */
417 res = gt30l32s4w_read_ascii_arial_24(&gs_handle, '?', buf);
418 if (res != 0)
419 {
420 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii arial 24 failed.\n");
421 (void)gt30l32s4w_deinit(&gs_handle);
422
423 return 1;
424 }
425
426 /* output */
428
429 /* gt30l32s4w_read_ascii_times_24 test */
430 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_times_24 test.\n");
431
432 /* read ascii times 24 */
433 res = gt30l32s4w_read_ascii_times_24(&gs_handle, '?', buf);
434 if (res != 0)
435 {
436 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii times 24 failed.\n");
437 (void)gt30l32s4w_deinit(&gs_handle);
438
439 return 1;
440 }
441
442 /* output */
444
445 /* gt30l32s4w_read_ascii_arial_32 test */
446 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_arial_32 test.\n");
447
448 /* read ascii arial 32 */
449 res = gt30l32s4w_read_ascii_arial_32(&gs_handle, '?', buf);
450 if (res != 0)
451 {
452 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii arial 32 failed.\n");
453 (void)gt30l32s4w_deinit(&gs_handle);
454
455 return 1;
456 }
457
458 /* output */
459 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_32_ARIAL_ASCII, buf, 130);
460
461 /* gt30l32s4w_read_ascii_times_32 test */
462 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_times_32 test.\n");
463
464 /* read ascii times 32 */
465 res = gt30l32s4w_read_ascii_times_32(&gs_handle, '?', buf);
466 if (res != 0)
467 {
468 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii times 32 failed.\n");
469 (void)gt30l32s4w_deinit(&gs_handle);
470
471 return 1;
472 }
473
474 /* output */
475 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_32_TIMES_ASCII, buf, 130);
476
477 /* fast read test */
478 gt30l32s4w_interface_debug_print("gt30l32s4w: fast read test.\n");
479
480 /* fast read */
482 if (res != 0)
483 {
484 gt30l32s4w_interface_debug_print("gt30l32s4w: set mode failed.\n");
485 (void)gt30l32s4w_deinit(&gs_handle);
486
487 return 1;
488 }
489
490 /* gt30l32s4w_read_char_12x12 test */
491 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_12x12 test.\n");
492
493 /* read char 12x12 */
494 res = gt30l32s4w_read_char_12x12(&gs_handle, 0xD7D6U, buf);
495 if (res != 0)
496 {
497 gt30l32s4w_interface_debug_print("gt30l32s4w: read char 12x12 failed.\n");
498 (void)gt30l32s4w_deinit(&gs_handle);
499
500 return 1;
501 }
502
503 /* output */
504 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_12X12_GB2312, buf, 24);
505
506 /* gt30l32s4w_read_char_15x16 test */
507 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_15x16 test.\n");
508
509 /* read char 15x16 */
510 res = gt30l32s4w_read_char_15x16(&gs_handle, 0xD7D6U, buf);
511 if (res != 0)
512 {
513 gt30l32s4w_interface_debug_print("gt30l32s4w: read char 15x16 failed.\n");
514 (void)gt30l32s4w_deinit(&gs_handle);
515
516 return 1;
517 }
518
519 /* output */
520 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_15X16_GB2312, buf, 32);
521
522 /* gt30l32s4w_read_char_24x24 test */
523 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_24x24 test.\n");
524
525 /* read char 24x24 */
526 res = gt30l32s4w_read_char_24x24(&gs_handle, 0xD7D6U, buf);
527 if (res != 0)
528 {
529 gt30l32s4w_interface_debug_print("gt30l32s4w: read char 24x24 failed.\n");
530 (void)gt30l32s4w_deinit(&gs_handle);
531
532 return 1;
533 }
534
535 /* output */
536 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_24X24_GB2312, buf, 72);
537
538 /* gt30l32s4w_read_char_32x32 test */
539 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_32x32 test.\n");
540
541 /* read char 32x32 */
542 res = gt30l32s4w_read_char_32x32(&gs_handle, 0xD7D6U, buf);
543 if (res != 0)
544 {
545 gt30l32s4w_interface_debug_print("gt30l32s4w: read char 32x32 failed.\n");
546 (void)gt30l32s4w_deinit(&gs_handle);
547
548 return 1;
549 }
550
551 /* output */
552 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_32X32_GB2312, buf, 128);
553
554 /* gt30l32s4w_read_char_extend_6x12 test */
555 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_extend_6x12 test.\n");
556
557 /* read char extend 6x12 */
558 res = gt30l32s4w_read_char_extend_6x12(&gs_handle, 0xAAA1U, buf);
559 if (res != 0)
560 {
561 gt30l32s4w_interface_debug_print("gt30l32s4w: read char extend 6x12 failed.\n");
562 (void)gt30l32s4w_deinit(&gs_handle);
563
564 return 1;
565 }
566
567 /* output */
569
570 /* gt30l32s4w_read_char_extend_8x16 test */
571 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_extend_8x16 test.\n");
572
573 /* read char extend 8x16 */
574 res = gt30l32s4w_read_char_extend_8x16(&gs_handle, 0xAAA1U, buf);
575 if (res != 0)
576 {
577 gt30l32s4w_interface_debug_print("gt30l32s4w: read char extend 8x16 failed.\n");
578 (void)gt30l32s4w_deinit(&gs_handle);
579
580 return 1;
581 }
582
583 /* output */
585
586 /* gt30l32s4w_read_char_special_8x16 test */
587 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_special_8x16 test.\n");
588
589 /* read char special 8x16 */
590 res = gt30l32s4w_read_char_special_8x16(&gs_handle, 0xACB1U, buf);
591 if (res != 0)
592 {
593 gt30l32s4w_interface_debug_print("gt30l32s4w: read char special 8x16 failed.\n");
594 (void)gt30l32s4w_deinit(&gs_handle);
595
596 return 1;
597 }
598
599 /* output */
601
602 /* gt30l32s4w_read_char_extend_12x24 test */
603 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_extend_12x24 test.\n");
604
605 /* read char extend 12x24 */
606 res = gt30l32s4w_read_char_extend_12x24(&gs_handle, 0xAAA1U, buf);
607 if (res != 0)
608 {
609 gt30l32s4w_interface_debug_print("gt30l32s4w: read char extend 12x24 failed.\n");
610 (void)gt30l32s4w_deinit(&gs_handle);
611
612 return 1;
613 }
614
615 /* output */
617
618 /* gt30l32s4w_read_char_extend_16x32 test */
619 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_char_extend_16x32 test.\n");
620
621 /* read char extend 16x32 */
622 res = gt30l32s4w_read_char_extend_16x32(&gs_handle, 0xAAA1U, buf);
623 if (res != 0)
624 {
625 gt30l32s4w_interface_debug_print("gt30l32s4w: read char extend 16x32 failed.\n");
626 (void)gt30l32s4w_deinit(&gs_handle);
627
628 return 1;
629 }
630
631 /* output */
633
634 /* gt30l32s4w_read_ascii_5x7 test */
635 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_5x7 test.\n");
636
637 /* read ascii 5x7 */
638 res = gt30l32s4w_read_ascii_5x7(&gs_handle, '!', buf);
639 if (res != 0)
640 {
641 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 5x7 failed.\n");
642 (void)gt30l32s4w_deinit(&gs_handle);
643
644 return 1;
645 }
646
647 /* output */
648 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_5X7_ASCII, buf, 8);
649
650 /* gt30l32s4w_read_ascii_7x8 test */
651 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_7x8 test.\n");
652
653 /* read ascii 7x8 */
654 res = gt30l32s4w_read_ascii_7x8(&gs_handle, '!', buf);
655 if (res != 0)
656 {
657 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 7x8 failed.\n");
658 (void)gt30l32s4w_deinit(&gs_handle);
659
660 return 1;
661 }
662
663 /* output */
664 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_7X8_ASCII, buf, 8);
665
666 /* gt30l32s4w_read_ascii_6x12 test */
667 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_6x12 test.\n");
668
669 /* read ascii 6x12 */
670 res = gt30l32s4w_read_ascii_6x12(&gs_handle, '!', buf);
671 if (res != 0)
672 {
673 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 6x12 failed.\n");
674 (void)gt30l32s4w_deinit(&gs_handle);
675
676 return 1;
677 }
678
679 /* output */
680 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_6X12_ASCII, buf, 12);
681
682 /* gt30l32s4w_read_ascii_8x16 test */
683 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_8x16 test.\n");
684
685 /* read ascii 8x16 */
686 res = gt30l32s4w_read_ascii_8x16(&gs_handle, '!', buf);
687 if (res != 0)
688 {
689 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 8x16 failed.\n");
690 (void)gt30l32s4w_deinit(&gs_handle);
691
692 return 1;
693 }
694
695 /* output */
696 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_8X16_ASCII, buf, 16);
697
698 /* gt30l32s4w_read_ascii_12x24 test */
699 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_12x24 test.\n");
700
701 /* read ascii 12x24 */
702 res = gt30l32s4w_read_ascii_12x24(&gs_handle, '!', buf);
703 if (res != 0)
704 {
705 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 12x24 failed.\n");
706 (void)gt30l32s4w_deinit(&gs_handle);
707
708 return 1;
709 }
710
711 /* output */
712 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_12X24_ASCII, buf, 48);
713
714 /* gt30l32s4w_read_ascii_16x32 test */
715 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_16x32 test.\n");
716
717 /* read ascii 16x32 */
718 res = gt30l32s4w_read_ascii_16x32(&gs_handle, '!', buf);
719 if (res != 0)
720 {
721 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii 16x32 failed.\n");
722 (void)gt30l32s4w_deinit(&gs_handle);
723
724 return 1;
725 }
726
727 /* output */
728 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_16X32_ASCII, buf, 64);
729
730 /* gt30l32s4w_read_ascii_arial_12 test */
731 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_arial_12 test.\n");
732
733 /* read ascii arial 12 */
734 res = gt30l32s4w_read_ascii_arial_12(&gs_handle, '?', buf);
735 if (res != 0)
736 {
737 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii arial 12 failed.\n");
738 (void)gt30l32s4w_deinit(&gs_handle);
739
740 return 1;
741 }
742
743 /* output */
745
746 /* gt30l32s4w_read_ascii_times_12 test */
747 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_times_12 test.\n");
748
749 /* read ascii times 12 */
750 res = gt30l32s4w_read_ascii_times_12(&gs_handle, '?', buf);
751 if (res != 0)
752 {
753 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii times 12 failed.\n");
754 (void)gt30l32s4w_deinit(&gs_handle);
755
756 return 1;
757 }
758
759 /* output */
761
762 /* gt30l32s4w_read_ascii_arial_16 test */
763 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_arial_16 test.\n");
764
765 /* read ascii arial 16 */
766 res = gt30l32s4w_read_ascii_arial_16(&gs_handle, '?', buf);
767 if (res != 0)
768 {
769 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii arial 16 failed.\n");
770 (void)gt30l32s4w_deinit(&gs_handle);
771
772 return 1;
773 }
774
775 /* output */
777
778 /* gt30l32s4w_read_ascii_times_16 test */
779 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_times_16 test.\n");
780
781 /* read ascii times 16 */
782 res = gt30l32s4w_read_ascii_times_16(&gs_handle, '?', buf);
783 if (res != 0)
784 {
785 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii times 16 failed.\n");
786 (void)gt30l32s4w_deinit(&gs_handle);
787
788 return 1;
789 }
790
791 /* output */
793
794 /* gt30l32s4w_read_ascii_arial_24 test */
795 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_arial_24 test.\n");
796
797 /* read ascii arial 24 */
798 res = gt30l32s4w_read_ascii_arial_24(&gs_handle, '?', buf);
799 if (res != 0)
800 {
801 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii arial 24 failed.\n");
802 (void)gt30l32s4w_deinit(&gs_handle);
803
804 return 1;
805 }
806
807 /* output */
809
810 /* gt30l32s4w_read_ascii_times_24 test */
811 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_times_24 test.\n");
812
813 /* read ascii times 24 */
814 res = gt30l32s4w_read_ascii_times_24(&gs_handle, '?', buf);
815 if (res != 0)
816 {
817 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii times 24 failed.\n");
818 (void)gt30l32s4w_deinit(&gs_handle);
819
820 return 1;
821 }
822
823 /* output */
825
826 /* gt30l32s4w_read_ascii_arial_32 test */
827 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_arial_32 test.\n");
828
829 /* read ascii arial 32 */
830 res = gt30l32s4w_read_ascii_arial_32(&gs_handle, '?', buf);
831 if (res != 0)
832 {
833 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii arial 32 failed.\n");
834 (void)gt30l32s4w_deinit(&gs_handle);
835
836 return 1;
837 }
838
839 /* output */
840 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_32_ARIAL_ASCII, buf, 130);
841
842 /* gt30l32s4w_read_ascii_times_32 test */
843 gt30l32s4w_interface_debug_print("gt30l32s4w: gt30l32s4w_read_ascii_times_32 test.\n");
844
845 /* read ascii times 32 */
846 res = gt30l32s4w_read_ascii_times_32(&gs_handle, '?', buf);
847 if (res != 0)
848 {
849 gt30l32s4w_interface_debug_print("gt30l32s4w: read ascii times 32 failed.\n");
850 (void)gt30l32s4w_deinit(&gs_handle);
851
852 return 1;
853 }
854
855 /* output */
856 (void)gt30l32s4w_print_pattern(&gs_handle, GT30L32S4W_TYPE_32_TIMES_ASCII, buf, 130);
857
858 /* finish read test */
859 gt30l32s4w_interface_debug_print("gt30l32s4w: finish read test.\n");
860 (void)gt30l32s4w_deinit(&gs_handle);
861
862 return 0;
863}
driver gt30l32s4w read test header file
uint8_t gt30l32s4w_read_char_extend_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
read char extend 8x16
uint8_t gt30l32s4w_read_ascii_5x7(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[8])
read ascii 5x7
uint8_t gt30l32s4w_read_ascii_arial_24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[74])
read ascii arial 24
uint8_t gt30l32s4w_read_ascii_times_12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[26])
read ascii times 12
uint8_t gt30l32s4w_read_ascii_arial_32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[130])
read ascii arial 32
uint8_t gt30l32s4w_read_char_12x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[24])
read char 12x12
uint8_t gt30l32s4w_read_char_24x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[72])
read char 24x24
uint8_t gt30l32s4w_set_mode(gt30l32s4w_handle_t *handle, gt30l32s4w_mode_t mode)
set mode
uint8_t gt30l32s4w_read_char_extend_12x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[48])
read char extend 12x24
uint8_t gt30l32s4w_read_ascii_times_32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[130])
read ascii times 32
uint8_t gt30l32s4w_init(gt30l32s4w_handle_t *handle)
initialize the chip
uint8_t gt30l32s4w_read_char_extend_6x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[12])
read char extend 6x12
struct gt30l32s4w_info_s gt30l32s4w_info_t
gt30l32s4w information structure definition
uint8_t gt30l32s4w_read_ascii_16x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[64])
read ascii 16x32
uint8_t gt30l32s4w_deinit(gt30l32s4w_handle_t *handle)
close the chip
uint8_t gt30l32s4w_read_char_extend_16x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[64])
read char extend 16x32
uint8_t gt30l32s4w_read_ascii_times_24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[74])
read ascii times 24
uint8_t gt30l32s4w_info(gt30l32s4w_info_t *info)
get chip's information
uint8_t gt30l32s4w_read_ascii_12x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[48])
read ascii 12x24
uint8_t gt30l32s4w_print_pattern(gt30l32s4w_handle_t *handle, gt30l32s4w_type_t type, uint8_t *buf, uint8_t len)
print pattern
uint8_t gt30l32s4w_read_char_15x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[32])
read char 15x16
uint8_t gt30l32s4w_read_char_special_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
read char special 8x16
uint8_t gt30l32s4w_read_ascii_6x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[12])
read ascii 6x12
uint8_t gt30l32s4w_read_ascii_arial_16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[34])
read ascii arial 16
uint8_t gt30l32s4w_read_ascii_7x8(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[8])
read ascii 7x8
struct gt30l32s4w_handle_s gt30l32s4w_handle_t
gt30l32s4w handle structure definition
uint8_t gt30l32s4w_read_ascii_times_16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[34])
read ascii times 16
uint8_t gt30l32s4w_read_ascii_arial_12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[26])
read ascii arial 12
uint8_t gt30l32s4w_read_ascii_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
read ascii 8x16
uint8_t gt30l32s4w_read_char_32x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[128])
read char 32x32
@ GT30L32S4W_MODE_READ
@ GT30L32S4W_MODE_FAST_MODE
@ GT30L32S4W_TYPE_24X24_GB2312
@ GT30L32S4W_TYPE_6X12_ASCII
@ GT30L32S4W_TYPE_12_TIMES_ASCII
@ GT30L32S4W_TYPE_12X12_GB2312
@ GT30L32S4W_TYPE_12_ARIAL_ASCII
@ GT30L32S4W_TYPE_32_ARIAL_ASCII
@ GT30L32S4W_TYPE_8X16_GB2312_EX
@ GT30L32S4W_TYPE_32_TIMES_ASCII
@ GT30L32S4W_TYPE_16X32_ASCII
@ GT30L32S4W_TYPE_7X8_ASCII
@ GT30L32S4W_TYPE_16_TIMES_ASCII
@ GT30L32S4W_TYPE_12X24_ASCII
@ GT30L32S4W_TYPE_16X32_GB2312_EX
@ GT30L32S4W_TYPE_24_TIMES_ASCII
@ GT30L32S4W_TYPE_8X16_ASCII
@ GT30L32S4W_TYPE_16_ARIAL_ASCII
@ GT30L32S4W_TYPE_24_ARIAL_ASCII
@ GT30L32S4W_TYPE_12X24_GB2312_EX
@ GT30L32S4W_TYPE_8X16_GB2312_SP
@ GT30L32S4W_TYPE_15X16_GB2312
@ GT30L32S4W_TYPE_32X32_GB2312
@ GT30L32S4W_TYPE_6X12_GB2312_EX
@ GT30L32S4W_TYPE_5X7_ASCII
uint8_t gt30l32s4w_interface_spi_deinit(void)
interface spi bus deinit
void gt30l32s4w_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t gt30l32s4w_interface_spi_init(void)
interface spi bus init
void gt30l32s4w_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t gt30l32s4w_interface_spi_write_read(uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
interface spi bus write read
uint8_t gt30l32s4w_read_test(void)
read test