LibDriver GT30L32S4W
Loading...
Searching...
No Matches
driver_gt30l32s4w.c
Go to the documentation of this file.
1
36
37#include "driver_gt30l32s4w.h"
38
42#define CHIP_NAME "Genitop GT30L32S4W"
43#define MANUFACTURER_NAME "Genitop"
44#define SUPPLY_VOLTAGE_MIN 2.7f
45#define SUPPLY_VOLTAGE_MAX 3.3f
46#define MAX_CURRENT 20.0f
47#define TEMPERATURE_MIN -40.0f
48#define TEMPERATURE_MAX 85.0f
49#define DRIVER_VERSION 1000
50
54#define GT30L32S4W_ADDRESS_12X12_GB2312 0x00000
55#define GT30L32S4W_ADDRESS_15X16_GB2312 0x2C9D0
56#define GT30L32S4W_ADDRESS_24X24_GB2312 0x68190
57#define GT30L32S4W_ADDRESS_32X32_GB2312 0xEDF00
58#define GT30L32S4W_ADDRESS_6X12_GB2312 0x1DBE0C
59#define GT30L32S4W_ADDRESS_6X12_ASCII 0x1DBE00
60#define GT30L32S4W_ADDRESS_12_ARIAL_ASCII 0x1DC400
61#define GT30L32S4W_ADDRESS_12_TIMES_ASCII 0x1DCDC0
62#define GT30L32S4W_ADDRESS_8X16_GB2312 0x1DD790
63#define GT30L32S4W_ADDRESS_8X16_ASCII 0x1DD780
64#define GT30L32S4W_ADDRESS_5X7_ASCII 0x1DDF80
65#define GT30L32S4W_ADDRESS_7X8_ASCII 0x1DE280
66#define GT30L32S4W_ADDRESS_16_ARIAL_ASCII 0x1DE580
67#define GT30L32S4W_ADDRESS_16_TIMES_ASCII 0x1DF240
68#define GT30L32S4W_ADDRESS_12X24_GB2312 0x1DFF30
69#define GT30L32S4W_ADDRESS_12X24_ASCII 0x1DFF00
70#define GT30L32S4W_ADDRESS_24_ARIAL_ASCII 0x1E22D0
71#define GT30L32S4W_ADDRESS_24_TIMES_ASCII 0x1E3E90
72#define GT30L32S4W_ADDRESS_16X32_GB2312 0x1E5A90
73#define GT30L32S4W_ADDRESS_16X32_ASCII 0x1E5A50
74#define GT30L32S4W_ADDRESS_32_ARIAL_ASCII 0x1E99D0
75#define GT30L32S4W_ADDRESS_32_TIMES_ASCII 0x1ECA90
76#define GT30L32S4W_ADDRESS_8X16_GB2312_SP 0x1F2880
77
89static uint8_t a_gt30l32s4w_spi_read(gt30l32s4w_handle_t *handle, uint32_t addr, uint8_t *out_buf, uint32_t out_len)
90{
91 uint8_t reg[5];
92
93 if (handle->mode == GT30L32S4W_MODE_READ) /* read mode */
94 {
95 reg[0] = GT30L32S4W_MODE_READ; /* read mode */
96 reg[1] = (addr >> 16) & 0xFF; /* addr 2 */
97 reg[2] = (addr >> 8) & 0xFF; /* addr 1 */
98 reg[3] = (addr >> 0) & 0xFF; /* addr 0 */
99
100 if (handle->spi_write_read(reg, 4, out_buf, out_len) != 0) /* read data */
101 {
102 return 1; /* return error */
103 }
104
105 return 0; /* success return 0 */
106 }
107 else if (handle->mode == GT30L32S4W_MODE_FAST_MODE) /* fast read mode */
108 {
109 reg[0] = GT30L32S4W_MODE_FAST_MODE; /* fast read mode */
110 reg[1] = (addr >> 16) & 0xFF; /* addr 2 */
111 reg[2] = (addr >> 8) & 0xFF; /* addr 1 */
112 reg[3] = (addr >> 0) & 0xFF; /* addr 0 */
113 reg[4] = 0x00; /* dummy */
114
115 if (handle->spi_write_read(reg, 5, out_buf, out_len) != 0) /* read data */
116 {
117 return 1; /* return error */
118 }
119
120 return 0; /* success return 0 */
121 }
122 else
123 {
124 handle->debug_print("gt30l32s4w: mode is invalid.\n"); /* mode is invalid */
125
126 return 1; /* return error */
127 }
128}
129
142{
143 const char buf_check[] = {0x00, 0x10, 0x28, 0x28, 0x28, 0x44, 0x44, 0x7C,
144 0x82, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00};
145 uint8_t buf[16];
146
147 if (handle == NULL) /* check handle */
148 {
149 return 2; /* return error */
150 }
151 if (handle->debug_print == NULL) /* check debug_print */
152 {
153 return 3; /* return error */
154 }
155 if (handle->spi_init == NULL) /* check spi_init */
156 {
157 handle->debug_print("gt30l32s4w: spi_init is null.\n"); /* spi_init is null */
158
159 return 3; /* return error */
160 }
161 if (handle->spi_deinit == NULL) /* check spi_init */
162 {
163 handle->debug_print("gt30l32s4w: spi_deinit is null.\n"); /* spi_deinit is null */
164
165 return 3; /* return error */
166 }
167 if (handle->spi_write_read == NULL) /* check spi_write_read */
168 {
169 handle->debug_print("gt30l32s4w: spi_write_read is null.\n"); /* spi_write_read is null */
170
171 return 3; /* return error */
172 }
173 if (handle->delay_ms == NULL) /* check delay_ms */
174 {
175 handle->debug_print("gt30l32s4w: delay_ms is null.\n"); /* delay_ms is null */
176
177 return 3; /* return error */
178 }
179
180 if (handle->spi_init() != 0) /* spi init */
181 {
182 handle->debug_print("gt30l32s4w: spi init failed.\n"); /* spi init failed */
183
184 return 3; /* return error */
185 }
186 handle->mode = GT30L32S4W_MODE_READ; /* read mode */
187 if (a_gt30l32s4w_spi_read(handle,
189 ((uint8_t)('A') - 0x20) * 16,
190 buf, 16) != 0) /* spi read */
191 {
192 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
193 (void)handle->spi_deinit(); /* spi deinit */
194
195 return 4; /* return error */
196 }
197 if (strncmp((const char *)buf, buf_check, 16) != 0) /* check buffer */
198 {
199 handle->debug_print("gt30l32s4w: spi check error.\n"); /* spi check error */
200 (void)handle->spi_deinit(); /* spi deinit */
201
202 return 4; /* return error */
203 }
204 handle->inited = 1; /* flag initialization */
205
206 return 0; /* success return 0 */
207}
208
220{
221 if (handle == NULL) /* check handle */
222 {
223 return 2; /* return error */
224 }
225 if (handle->inited != 1) /* check handle initialization */
226 {
227 return 3; /* return error */
228 }
229
230 if (handle->spi_deinit() != 0) /* spi deinit */
231 {
232 handle->debug_print("gt30l32s4w: spi deinit failed.\n"); /* spi deinit failed */
233
234 return 1; /* return error */
235 }
236 handle->inited = 0; /* flag close */
237
238 return 0; /* success return 0 */
239}
240
252{
253 if (handle == NULL) /* check handle */
254 {
255 return 2; /* return error */
256 }
257 if (handle->inited != 1) /* check handle initialization */
258 {
259 return 3; /* return error */
260 }
261
262 handle->mode = mode; /* set mode */
263
264 return 0; /* success return 0 */
265}
266
278{
279 if (handle == NULL) /* check handle */
280 {
281 return 2; /* return error */
282 }
283 if (handle->inited != 1) /* check handle initialization */
284 {
285 return 3; /* return error */
286 }
287
288 *mode = (gt30l32s4w_mode_t)(handle->mode); /* get mode */
289
290 return 0; /* success return 0 */
291}
292
306uint8_t gt30l32s4w_read_char_12x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[24])
307{
308 uint8_t msb;
309 uint8_t lsb;
310 uint32_t addr;
311
312 if (handle == NULL) /* check handle */
313 {
314 return 2; /* return error */
315 }
316 if (handle->inited != 1) /* check handle initialization */
317 {
318 return 3; /* return error */
319 }
320
321 msb = (ch >> 8) & 0xFF; /* msb */
322 lsb = (ch >> 0) & 0xFF; /* lsb */
323 addr = GT30L32S4W_ADDRESS_12X12_GB2312; /* base address */
324 if ((msb >= 0xA1) && (msb <= 0xA9) && (lsb >= 0xA1)) /* range 1 */
325 {
326 addr =((msb - 0xA1) * 94 + (lsb - 0xA1)) * 24 + addr; /* set address */
327 }
328 else if ((msb >= 0xB0) && (msb <= 0xF7) && (lsb >= 0xA1)) /* range 2 */
329 {
330 addr = ((msb - 0xB0) * 94 + (lsb - 0xA1) + 846) * 24 + addr; /* set address */
331 }
332 else
333 {
334 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
335
336 return 4; /* return error */
337 }
338
339 if (a_gt30l32s4w_spi_read(handle, addr, buf, 24) != 0) /* spi read */
340 {
341 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
342
343 return 1; /* return error */
344 }
345
346 return 0; /* success return 0 */
347}
348
362uint8_t gt30l32s4w_read_char_15x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[32])
363{
364 uint8_t msb;
365 uint8_t lsb;
366 uint32_t addr;
367
368 if (handle == NULL) /* check handle */
369 {
370 return 2; /* return error */
371 }
372 if (handle->inited != 1) /* check handle initialization */
373 {
374 return 3; /* return error */
375 }
376
377 msb = (ch >> 8) & 0xFF; /* msb */
378 lsb = (ch >> 0) & 0xFF; /* lsb */
379 addr = GT30L32S4W_ADDRESS_15X16_GB2312; /* base address */
380 if ((msb >= 0xA1) && (msb <= 0xA9) && (lsb >= 0xA1)) /* range 1 */
381 {
382 addr =((msb - 0xA1) * 94 + (lsb - 0xA1)) * 32 + addr; /* set address */
383 }
384 else if ((msb >= 0xB0) && (msb <= 0xF7) && (lsb >= 0xA1)) /* range 2 */
385 {
386 addr = ((msb - 0xB0) * 94 + (lsb - 0xA1) + 846) * 32 + addr; /* set address */
387 }
388 else
389 {
390 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
391
392 return 4; /* return error */
393 }
394
395 if (a_gt30l32s4w_spi_read(handle, addr, buf, 32) != 0) /* spi read */
396 {
397 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
398
399 return 1; /* return error */
400 }
401
402 return 0; /* success return 0 */
403}
404
418uint8_t gt30l32s4w_read_char_24x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[72])
419{
420 uint8_t msb;
421 uint8_t lsb;
422 uint32_t addr;
423
424 if (handle == NULL) /* check handle */
425 {
426 return 2; /* return error */
427 }
428 if (handle->inited != 1) /* check handle initialization */
429 {
430 return 3; /* return error */
431 }
432
433 msb = (ch >> 8) & 0xFF; /* msb */
434 lsb = (ch >> 0) & 0xFF; /* lsb */
435 addr = GT30L32S4W_ADDRESS_24X24_GB2312; /* base address */
436 if ((msb >= 0xA1) && (msb <= 0xA9) && (lsb >= 0xA1)) /* range 1 */
437 {
438 addr =((msb - 0xA1) * 94 + (lsb - 0xA1)) * 72 + addr; /* set address */
439 }
440 else if ((msb >= 0xB0) && (msb <= 0xF7) && (lsb >= 0xA1)) /* range 2 */
441 {
442 addr = ((msb - 0xB0) * 94 + (lsb - 0xA1) + 846) * 72 + addr; /* set address */
443 }
444 else
445 {
446 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
447
448 return 4; /* return error */
449 }
450
451 if (a_gt30l32s4w_spi_read(handle, addr, buf, 72) != 0) /* spi read */
452 {
453 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
454
455 return 1; /* return error */
456 }
457
458 return 0; /* success return 0 */
459}
460
474uint8_t gt30l32s4w_read_char_32x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[128])
475{
476 uint8_t msb;
477 uint8_t lsb;
478 uint32_t addr;
479
480 if (handle == NULL) /* check handle */
481 {
482 return 2; /* return error */
483 }
484 if (handle->inited != 1) /* check handle initialization */
485 {
486 return 3; /* return error */
487 }
488
489 msb = (ch >> 8) & 0xFF; /* msb */
490 lsb = (ch >> 0) & 0xFF; /* lsb */
491 addr = GT30L32S4W_ADDRESS_32X32_GB2312; /* base address */
492 if ((msb >= 0xA1) && (msb <= 0xA9) && (lsb >= 0xA1)) /* range 1 */
493 {
494 addr =((msb - 0xA1) * 94 + (lsb - 0xA1)) * 128 + addr; /* set address */
495 }
496 else if ((msb >= 0xB0) && (msb <= 0xF7) && (lsb >= 0xA1)) /* range 2 */
497 {
498 addr = ((msb - 0xB0) * 94 + (lsb - 0xA1) + 846) * 128 + addr; /* set address */
499 }
500 else
501 {
502 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
503
504 return 4; /* return error */
505 }
506
507 if (a_gt30l32s4w_spi_read(handle, addr, buf, 128) != 0) /* spi read */
508 {
509 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
510
511 return 1; /* return error */
512 }
513
514 return 0; /* success return 0 */
515}
516
530uint8_t gt30l32s4w_read_char_extend_6x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[12])
531{
532 uint32_t addr;
533
534 if (handle == NULL) /* check handle */
535 {
536 return 2; /* return error */
537 }
538 if (handle->inited != 1) /* check handle initialization */
539 {
540 return 3; /* return error */
541 }
542
543 addr = GT30L32S4W_ADDRESS_6X12_GB2312; /* base address */
544 if ((ch >= 0xAAA1U) && (ch <= 0xAAFEU)) /* range 1 */
545 {
546 addr =(ch - 0xAAA1U) * 12 + addr; /* set address */
547 }
548 else if ((ch >= 0xABA1U) && (ch <= 0xABC0U)) /* range 2 */
549 {
550 addr = (ch - 0xABA1U + 95) * 12 + addr; /* set address */
551 }
552 else
553 {
554 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
555
556 return 4; /* return error */
557 }
558
559 if (a_gt30l32s4w_spi_read(handle, addr, buf, 12) != 0) /* spi read */
560 {
561 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
562
563 return 1; /* return error */
564 }
565
566 return 0; /* success return 0 */
567}
568
582uint8_t gt30l32s4w_read_char_extend_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
583{
584 uint32_t addr;
585
586 if (handle == NULL) /* check handle */
587 {
588 return 2; /* return error */
589 }
590 if (handle->inited != 1) /* check handle initialization */
591 {
592 return 3; /* return error */
593 }
594
595 addr = GT30L32S4W_ADDRESS_8X16_GB2312; /* base address */
596 if ((ch >= 0xAAA1U) && (ch <= 0xAAFEU)) /* range 1 */
597 {
598 addr =(ch - 0xAAA1U) * 16 + addr; /* set address */
599 }
600 else if ((ch >= 0xABA1U) && (ch <= 0xABC0U)) /* range 2 */
601 {
602 addr = (ch - 0xABA1U + 95) * 16 + addr; /* set address */
603 }
604 else
605 {
606 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
607
608 return 4; /* return error */
609 }
610
611 if (a_gt30l32s4w_spi_read(handle, addr, buf, 16) != 0) /* spi read */
612 {
613 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
614
615 return 1; /* return error */
616 }
617
618 return 0; /* success return 0 */
619}
620
634uint8_t gt30l32s4w_read_char_special_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
635{
636 uint32_t addr;
637
638 if (handle == NULL) /* check handle */
639 {
640 return 2; /* return error */
641 }
642 if (handle->inited != 1) /* check handle initialization */
643 {
644 return 3; /* return error */
645 }
646
647 addr = GT30L32S4W_ADDRESS_8X16_GB2312_SP; /* base address */
648 if ((ch >= 0xACA1U) && (ch <= 0xACDFU)) /* range 1 */
649 {
650 addr = (ch - 0xACA1U) * 16 + addr; /* set address */
651 }
652 else
653 {
654 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
655
656 return 4; /* return error */
657 }
658
659 if (a_gt30l32s4w_spi_read(handle, addr, buf, 16) != 0) /* spi read */
660 {
661 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
662
663 return 1; /* return error */
664 }
665
666 return 0; /* success return 0 */
667}
668
682uint8_t gt30l32s4w_read_char_extend_12x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[48])
683{
684 uint32_t addr;
685
686 if (handle == NULL) /* check handle */
687 {
688 return 2; /* return error */
689 }
690 if (handle->inited != 1) /* check handle initialization */
691 {
692 return 3; /* return error */
693 }
694
695 addr = GT30L32S4W_ADDRESS_12X24_GB2312; /* base address */
696 if ((ch >= 0xAAA1U) && (ch <= 0xAAFEU)) /* range 1 */
697 {
698 addr =(ch - 0xAAA1U) * 48 + addr; /* set address */
699 }
700 else if ((ch >= 0xABA1U) && (ch <= 0xABC0U)) /* range 2 */
701 {
702 addr = (ch - 0xABA1U + 95) * 48 + addr; /* set address */
703 }
704 else
705 {
706 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
707
708 return 4; /* return error */
709 }
710
711 if (a_gt30l32s4w_spi_read(handle, addr, buf, 48) != 0) /* spi read */
712 {
713 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
714
715 return 1; /* return error */
716 }
717
718 return 0; /* success return 0 */
719}
720
734uint8_t gt30l32s4w_read_char_extend_16x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[64])
735{
736 uint32_t addr;
737
738 if (handle == NULL) /* check handle */
739 {
740 return 2; /* return error */
741 }
742 if (handle->inited != 1) /* check handle initialization */
743 {
744 return 3; /* return error */
745 }
746
747 addr = GT30L32S4W_ADDRESS_16X32_GB2312; /* base address */
748 if ((ch >= 0xAAA1U) && (ch <= 0xAAFEU)) /* range 1 */
749 {
750 addr =(ch - 0xAAA1U) * 64 + addr; /* set address */
751 }
752 else if ((ch >= 0xABA1U) && (ch <= 0xABC0U)) /* range 2 */
753 {
754 addr = (ch - 0xABA1U + 95) * 64 + addr; /* set address */
755 }
756 else
757 {
758 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
759
760 return 4; /* return error */
761 }
762
763 if (a_gt30l32s4w_spi_read(handle, addr, buf, 64) != 0) /* spi read */
764 {
765 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
766
767 return 1; /* return error */
768 }
769
770 return 0; /* success return 0 */
771}
772
786uint8_t gt30l32s4w_read_ascii_5x7(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[8])
787{
788 uint32_t addr;
789
790 if (handle == NULL) /* check handle */
791 {
792 return 2; /* return error */
793 }
794 if (handle->inited != 1) /* check handle initialization */
795 {
796 return 3; /* return error */
797 }
798
799 addr = GT30L32S4W_ADDRESS_5X7_ASCII; /* base address */
800 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
801 {
802 addr = (ch - 0x20) * 8 + addr; /* set address */
803 }
804 else
805 {
806 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
807
808 return 4; /* return error */
809 }
810
811 if (a_gt30l32s4w_spi_read(handle, addr, buf, 8) != 0) /* spi read */
812 {
813 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
814
815 return 1; /* return error */
816 }
817
818 return 0; /* success return 0 */
819}
820
834uint8_t gt30l32s4w_read_ascii_7x8(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[8])
835{
836 uint32_t addr;
837
838 if (handle == NULL) /* check handle */
839 {
840 return 2; /* return error */
841 }
842 if (handle->inited != 1) /* check handle initialization */
843 {
844 return 3; /* return error */
845 }
846
847 addr = GT30L32S4W_ADDRESS_7X8_ASCII; /* base address */
848 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
849 {
850 addr = (ch - 0x20) * 8 + addr; /* set address */
851 }
852 else
853 {
854 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
855
856 return 4; /* return error */
857 }
858
859 if (a_gt30l32s4w_spi_read(handle, addr, buf, 8) != 0) /* spi read */
860 {
861 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
862
863 return 1; /* return error */
864 }
865
866 return 0; /* success return 0 */
867}
868
882uint8_t gt30l32s4w_read_ascii_6x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[12])
883{
884 uint32_t addr;
885
886 if (handle == NULL) /* check handle */
887 {
888 return 2; /* return error */
889 }
890 if (handle->inited != 1) /* check handle initialization */
891 {
892 return 3; /* return error */
893 }
894
895 addr = GT30L32S4W_ADDRESS_6X12_ASCII; /* base address */
896 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
897 {
898 addr = (ch - 0x20) * 12 + addr; /* set address */
899 }
900 else
901 {
902 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
903
904 return 4; /* return error */
905 }
906
907 if (a_gt30l32s4w_spi_read(handle, addr, buf, 12) != 0) /* spi read */
908 {
909 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
910
911 return 1; /* return error */
912 }
913
914 return 0; /* success return 0 */
915}
916
930uint8_t gt30l32s4w_read_ascii_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
931{
932 uint32_t addr;
933
934 if (handle == NULL) /* check handle */
935 {
936 return 2; /* return error */
937 }
938 if (handle->inited != 1) /* check handle initialization */
939 {
940 return 3; /* return error */
941 }
942
943 addr = GT30L32S4W_ADDRESS_8X16_ASCII; /* base address */
944 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
945 {
946 addr = (ch - 0x20) * 16 + addr; /* set address */
947 }
948 else
949 {
950 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
951
952 return 4; /* return error */
953 }
954
955 if (a_gt30l32s4w_spi_read(handle, addr, buf, 16) != 0) /* spi read */
956 {
957 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
958
959 return 1; /* return error */
960 }
961
962 return 0; /* success return 0 */
963}
964
978uint8_t gt30l32s4w_read_ascii_12x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[48])
979{
980 uint32_t addr;
981
982 if (handle == NULL) /* check handle */
983 {
984 return 2; /* return error */
985 }
986 if (handle->inited != 1) /* check handle initialization */
987 {
988 return 3; /* return error */
989 }
990
991 addr = GT30L32S4W_ADDRESS_12X24_ASCII; /* base address */
992 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
993 {
994 addr = (ch - 0x20) * 48 + addr; /* set address */
995 }
996 else
997 {
998 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
999
1000 return 4; /* return error */
1001 }
1002
1003 if (a_gt30l32s4w_spi_read(handle, addr, buf, 48) != 0) /* spi read */
1004 {
1005 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1006
1007 return 1; /* return error */
1008 }
1009
1010 return 0; /* success return 0 */
1011}
1012
1026uint8_t gt30l32s4w_read_ascii_16x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[64])
1027{
1028 uint32_t addr;
1029
1030 if (handle == NULL) /* check handle */
1031 {
1032 return 2; /* return error */
1033 }
1034 if (handle->inited != 1) /* check handle initialization */
1035 {
1036 return 3; /* return error */
1037 }
1038
1039 addr = GT30L32S4W_ADDRESS_16X32_ASCII; /* base address */
1040 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1041 {
1042 addr = (ch - 0x20) * 64 + addr; /* set address */
1043 }
1044 else
1045 {
1046 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1047
1048 return 4; /* return error */
1049 }
1050
1051 if (a_gt30l32s4w_spi_read(handle, addr, buf, 64) != 0) /* spi read */
1052 {
1053 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1054
1055 return 1; /* return error */
1056 }
1057
1058 return 0; /* success return 0 */
1059}
1060
1074uint8_t gt30l32s4w_read_ascii_arial_12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[26])
1075{
1076 uint32_t addr;
1077
1078 if (handle == NULL) /* check handle */
1079 {
1080 return 2; /* return error */
1081 }
1082 if (handle->inited != 1) /* check handle initialization */
1083 {
1084 return 3; /* return error */
1085 }
1086
1087 addr = GT30L32S4W_ADDRESS_12_ARIAL_ASCII; /* base address */
1088 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1089 {
1090 addr = (ch - 0x20) * 26 + addr; /* set address */
1091 }
1092 else
1093 {
1094 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1095
1096 return 4; /* return error */
1097 }
1098
1099 if (a_gt30l32s4w_spi_read(handle, addr, buf, 26) != 0) /* spi read */
1100 {
1101 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1102
1103 return 1; /* return error */
1104 }
1105
1106 return 0; /* success return 0 */
1107}
1108
1122uint8_t gt30l32s4w_read_ascii_times_12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[26])
1123{
1124 uint32_t addr;
1125
1126 if (handle == NULL) /* check handle */
1127 {
1128 return 2; /* return error */
1129 }
1130 if (handle->inited != 1) /* check handle initialization */
1131 {
1132 return 3; /* return error */
1133 }
1134
1135 addr = GT30L32S4W_ADDRESS_12_TIMES_ASCII; /* base address */
1136 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1137 {
1138 addr = (ch - 0x20) * 26 + addr; /* set address */
1139 }
1140 else
1141 {
1142 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1143
1144 return 4; /* return error */
1145 }
1146
1147 if (a_gt30l32s4w_spi_read(handle, addr, buf, 26) != 0) /* spi read */
1148 {
1149 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1150
1151 return 1; /* return error */
1152 }
1153
1154 return 0; /* success return 0 */
1155}
1156
1170uint8_t gt30l32s4w_read_ascii_arial_16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[34])
1171{
1172 uint32_t addr;
1173
1174 if (handle == NULL) /* check handle */
1175 {
1176 return 2; /* return error */
1177 }
1178 if (handle->inited != 1) /* check handle initialization */
1179 {
1180 return 3; /* return error */
1181 }
1182
1183 addr = GT30L32S4W_ADDRESS_16_ARIAL_ASCII; /* base address */
1184 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1185 {
1186 addr = (ch - 0x20) * 34 + addr; /* set address */
1187 }
1188 else
1189 {
1190 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1191
1192 return 4; /* return error */
1193 }
1194
1195 if (a_gt30l32s4w_spi_read(handle, addr, buf, 34) != 0) /* spi read */
1196 {
1197 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1198
1199 return 1; /* return error */
1200 }
1201
1202 return 0; /* success return 0 */
1203}
1204
1218uint8_t gt30l32s4w_read_ascii_times_16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[34])
1219{
1220 uint32_t addr;
1221
1222 if (handle == NULL) /* check handle */
1223 {
1224 return 2; /* return error */
1225 }
1226 if (handle->inited != 1) /* check handle initialization */
1227 {
1228 return 3; /* return error */
1229 }
1230
1231 addr = GT30L32S4W_ADDRESS_16_TIMES_ASCII; /* base address */
1232 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1233 {
1234 addr = (ch - 0x20) * 34 + addr; /* set address */
1235 }
1236 else
1237 {
1238 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1239
1240 return 4; /* return error */
1241 }
1242
1243 if (a_gt30l32s4w_spi_read(handle, addr, buf, 34) != 0) /* spi read */
1244 {
1245 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1246
1247 return 1; /* return error */
1248 }
1249
1250 return 0; /* success return 0 */
1251}
1252
1266uint8_t gt30l32s4w_read_ascii_arial_24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[74])
1267{
1268 uint32_t addr;
1269
1270 if (handle == NULL) /* check handle */
1271 {
1272 return 2; /* return error */
1273 }
1274 if (handle->inited != 1) /* check handle initialization */
1275 {
1276 return 3; /* return error */
1277 }
1278
1279 addr = GT30L32S4W_ADDRESS_24_ARIAL_ASCII; /* base address */
1280 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1281 {
1282 addr = (ch - 0x20) * 74 + addr; /* set address */
1283 }
1284 else
1285 {
1286 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1287
1288 return 4; /* return error */
1289 }
1290
1291 if (a_gt30l32s4w_spi_read(handle, addr, buf, 74) != 0) /* spi read */
1292 {
1293 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1294
1295 return 1; /* return error */
1296 }
1297
1298 return 0; /* success return 0 */
1299}
1300
1314uint8_t gt30l32s4w_read_ascii_times_24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[74])
1315{
1316 uint32_t addr;
1317
1318 if (handle == NULL) /* check handle */
1319 {
1320 return 2; /* return error */
1321 }
1322 if (handle->inited != 1) /* check handle initialization */
1323 {
1324 return 3; /* return error */
1325 }
1326
1327 addr = GT30L32S4W_ADDRESS_24_TIMES_ASCII; /* base address */
1328 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1329 {
1330 addr = (ch - 0x20) * 74 + addr; /* set address */
1331 }
1332 else
1333 {
1334 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1335
1336 return 4; /* return error */
1337 }
1338
1339 if (a_gt30l32s4w_spi_read(handle, addr, buf, 74) != 0) /* spi read */
1340 {
1341 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1342
1343 return 1; /* return error */
1344 }
1345
1346 return 0; /* success return 0 */
1347}
1348
1362uint8_t gt30l32s4w_read_ascii_arial_32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[130])
1363{
1364 uint32_t addr;
1365
1366 if (handle == NULL) /* check handle */
1367 {
1368 return 2; /* return error */
1369 }
1370 if (handle->inited != 1) /* check handle initialization */
1371 {
1372 return 3; /* return error */
1373 }
1374
1375 addr = GT30L32S4W_ADDRESS_32_ARIAL_ASCII; /* base address */
1376 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1377 {
1378 addr = (ch - 0x20) * 130 + addr; /* set address */
1379 }
1380 else
1381 {
1382 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1383
1384 return 4; /* return error */
1385 }
1386
1387 if (a_gt30l32s4w_spi_read(handle, addr, buf, 130) != 0) /* spi read */
1388 {
1389 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1390
1391 return 1; /* return error */
1392 }
1393
1394 return 0; /* success return 0 */
1395}
1396
1410uint8_t gt30l32s4w_read_ascii_times_32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[130])
1411{
1412 uint32_t addr;
1413
1414 if (handle == NULL) /* check handle */
1415 {
1416 return 2; /* return error */
1417 }
1418 if (handle->inited != 1) /* check handle initialization */
1419 {
1420 return 3; /* return error */
1421 }
1422
1423 addr = GT30L32S4W_ADDRESS_32_TIMES_ASCII; /* base address */
1424 if ((ch >= 0x20) && (ch <= 0x7E)) /* range 1 */
1425 {
1426 addr = (ch - 0x20) * 130 + addr; /* set address */
1427 }
1428 else
1429 {
1430 handle->debug_print("gt30l32s4w: char is invalid.\n"); /* char is invalid */
1431
1432 return 4; /* return error */
1433 }
1434
1435 if (a_gt30l32s4w_spi_read(handle, addr, buf, 130) != 0) /* spi read */
1436 {
1437 handle->debug_print("gt30l32s4w: spi read failed.\n"); /* spi read failed */
1438
1439 return 1; /* return error */
1440 }
1441
1442 return 0; /* success return 0 */
1443}
1444
1459uint8_t gt30l32s4w_print_pattern(gt30l32s4w_handle_t *handle, gt30l32s4w_type_t type, uint8_t *buf, uint8_t len)
1460{
1461 uint16_t i;
1462 uint16_t j;
1463 uint16_t point;
1464 char str_buf[129];
1465
1466 if (handle == NULL) /* check handle */
1467 {
1468 return 2; /* return error */
1469 }
1470 if (handle->inited != 1) /* check handle initialization */
1471 {
1472 return 3; /* return error */
1473 }
1474
1475 switch (type) /* check type */
1476 {
1477 case GT30L32S4W_TYPE_12X12_GB2312 : /* 12x12 gb2312 */
1478 {
1479 if (len != 24) /* check length */
1480 {
1481 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1482
1483 return 4; /* return error */
1484 }
1485 for (i = 0; i < 12; i++) /* 12 */
1486 {
1487 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1488 for (j = 0; j < 12; j++) /* 12 */
1489 {
1490 point = i * 16 + j; /* get point */
1491 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1492 {
1493 str_buf[j * 3 + 0] = '#'; /* # */
1494 str_buf[j * 3 + 1] = '#'; /* # */
1495 str_buf[j * 3 + 2] = '#'; /* # */
1496 }
1497 else
1498 {
1499 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1500 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1501 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1502 }
1503 }
1504 handle->debug_print("%s\n", str_buf); /* print buffer */
1505 }
1506
1507 break; /* break */
1508 }
1509 case GT30L32S4W_TYPE_15X16_GB2312 : /* 15x16 gb2312 */
1510 {
1511 if (len != 32) /* check length */
1512 {
1513 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1514
1515 return 4; /* return error */
1516 }
1517 for (i = 0; i < 16; i++) /* 16 */
1518 {
1519 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1520 for (j = 0; j < 15; j++) /* 15 */
1521 {
1522 point = i * 16 + j; /* get point */
1523 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1524 {
1525 str_buf[j * 3 + 0] = '#'; /* # */
1526 str_buf[j * 3 + 1] = '#'; /* # */
1527 str_buf[j * 3 + 2] = '#'; /* # */
1528 }
1529 else
1530 {
1531 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1532 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1533 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1534 }
1535 }
1536 handle->debug_print("%s\n", str_buf); /* print buffer */
1537 }
1538
1539 break; /* break */
1540 }
1541 case GT30L32S4W_TYPE_24X24_GB2312 : /* 24x24 gb2312 */
1542 {
1543 if (len != 72) /* check length */
1544 {
1545 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1546
1547 return 4; /* return error */
1548 }
1549 for (i = 0; i < 24; i++) /* 24 */
1550 {
1551 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1552 for (j = 0; j < 24; j++) /* 24 */
1553 {
1554 point = i * 24 + j; /* get point */
1555 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1556 {
1557 str_buf[j * 3 + 0] = '#'; /* # */
1558 str_buf[j * 3 + 1] = '#'; /* # */
1559 str_buf[j * 3 + 2] = '#'; /* # */
1560 }
1561 else
1562 {
1563 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1564 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1565 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1566 }
1567 }
1568 handle->debug_print("%s\n", str_buf); /* print buffer */
1569 }
1570
1571 break; /* break */
1572 }
1573 case GT30L32S4W_TYPE_32X32_GB2312 : /* 32x32 gb2312 */
1574 {
1575 if (len != 128) /* check length */
1576 {
1577 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1578
1579 return 4; /* return error */
1580 }
1581 for (i = 0; i < 32; i++) /* 32 */
1582 {
1583 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1584 for (j = 0; j < 32; j++) /* 32 */
1585 {
1586 point = i * 32 + j; /* get point */
1587 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1588 {
1589 str_buf[j * 3 + 0] = '#'; /* # */
1590 str_buf[j * 3 + 1] = '#'; /* # */
1591 str_buf[j * 3 + 2] = '#'; /* # */
1592 }
1593 else
1594 {
1595 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1596 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1597 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1598 }
1599 }
1600 handle->debug_print("%s\n", str_buf); /* print buffer */
1601 }
1602
1603 break; /* break */
1604 }
1605 case GT30L32S4W_TYPE_6X12_GB2312_EX : /* 6x12 gb2312 extend */
1606 {
1607 if (len != 12) /* check length */
1608 {
1609 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1610
1611 return 4; /* return error */
1612 }
1613 for (i = 0; i < 12; i++) /* 12 */
1614 {
1615 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1616 for (j = 0; j < 6; j++) /* 6 */
1617 {
1618 point = i * 8 + j; /* get point */
1619 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1620 {
1621 str_buf[j * 3 + 0] = '#'; /* # */
1622 str_buf[j * 3 + 1] = '#'; /* # */
1623 str_buf[j * 3 + 2] = '#'; /* # */
1624 }
1625 else
1626 {
1627 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1628 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1629 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1630 }
1631 }
1632 handle->debug_print("%s\n", str_buf); /* print buffer */
1633 }
1634
1635 break; /* break */
1636 }
1637 case GT30L32S4W_TYPE_8X16_GB2312_EX : /* 8x16 gb2312 extend */
1638 {
1639 if (len != 16) /* check length */
1640 {
1641 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1642
1643 return 4; /* return error */
1644 }
1645 for (i = 0; i < 16; i++) /* 16 */
1646 {
1647 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1648 for (j = 0; j < 8; j++) /* 8 */
1649 {
1650 point = i * 8 + j; /* get point */
1651 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1652 {
1653 str_buf[j * 3 + 0] = '#'; /* # */
1654 str_buf[j * 3 + 1] = '#'; /* # */
1655 str_buf[j * 3 + 2] = '#'; /* # */
1656 }
1657 else
1658 {
1659 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1660 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1661 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1662 }
1663 }
1664 handle->debug_print("%s\n", str_buf); /* print buffer */
1665 }
1666
1667 break; /* break */
1668 }
1669 case GT30L32S4W_TYPE_8X16_GB2312_SP : /* 8x16 gb2312 special */
1670 {
1671 if (len != 16) /* check length */
1672 {
1673 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1674
1675 return 4; /* return error */
1676 }
1677 for (i = 0; i < 16; i++) /* 16 */
1678 {
1679 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1680 for (j = 0; j < 8; j++) /* 8 */
1681 {
1682 point = i * 8 + j; /* get point */
1683 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1684 {
1685 str_buf[j * 3 + 0] = '#'; /* # */
1686 str_buf[j * 3 + 1] = '#'; /* # */
1687 str_buf[j * 3 + 2] = '#'; /* # */
1688 }
1689 else
1690 {
1691 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1692 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1693 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1694 }
1695 }
1696 handle->debug_print("%s\n", str_buf); /* print buffer */
1697 }
1698
1699 break; /* break */
1700 }
1701 case GT30L32S4W_TYPE_12X24_GB2312_EX : /* 12x24 gb2312 extend */
1702 {
1703 if (len != 48) /* check length */
1704 {
1705 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1706
1707 return 4; /* return error */
1708 }
1709 for (i = 0; i < 24; i++) /* 24 */
1710 {
1711 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1712 for (j = 0; j < 12; j++) /* 12 */
1713 {
1714 point = i * 16 + j; /* get point */
1715 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1716 {
1717 str_buf[j * 3 + 0] = '#'; /* # */
1718 str_buf[j * 3 + 1] = '#'; /* # */
1719 str_buf[j * 3 + 2] = '#'; /* # */
1720 }
1721 else
1722 {
1723 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1724 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1725 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1726 }
1727 }
1728 handle->debug_print("%s\n", str_buf); /* print buffer */
1729 }
1730
1731 break; /* break */
1732 }
1733 case GT30L32S4W_TYPE_16X32_GB2312_EX : /* 16x32 gb2312 extend */
1734 {
1735 if (len != 64) /* check length */
1736 {
1737 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1738
1739 return 4; /* return error */
1740 }
1741 for (i = 0; i < 32; i++) /* 32 */
1742 {
1743 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1744 for (j = 0; j < 16; j++) /* 16 */
1745 {
1746 point = i * 16 + j; /* get point */
1747 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1748 {
1749 str_buf[j * 3 + 0] = '#'; /* # */
1750 str_buf[j * 3 + 1] = '#'; /* # */
1751 str_buf[j * 3 + 2] = '#'; /* # */
1752 }
1753 else
1754 {
1755 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1756 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1757 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1758 }
1759 }
1760 handle->debug_print("%s\n", str_buf); /* print buffer */
1761 }
1762
1763 break; /* break */
1764 }
1765 case GT30L32S4W_TYPE_5X7_ASCII : /* 5x7 ascii */
1766 {
1767 if (len != 8) /* check length */
1768 {
1769 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1770
1771 return 4; /* return error */
1772 }
1773 for (i = 0; i < 7; i++) /* 7 */
1774 {
1775 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1776 for (j = 0; j < 5; j++) /* 5 */
1777 {
1778 point = i * 8 + j; /* get point */
1779 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1780 {
1781 str_buf[j * 3 + 0] = '#'; /* # */
1782 str_buf[j * 3 + 1] = '#'; /* # */
1783 str_buf[j * 3 + 2] = '#'; /* # */
1784 }
1785 else
1786 {
1787 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1788 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1789 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1790 }
1791 }
1792 handle->debug_print("%s\n", str_buf); /* print buffer */
1793 }
1794
1795 break; /* break */
1796 }
1797 case GT30L32S4W_TYPE_7X8_ASCII : /* 7x8 ascii */
1798 {
1799 if (len != 8) /* check length */
1800 {
1801 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1802
1803 return 4; /* return error */
1804 }
1805 for (i = 0; i < 8; i++) /* 8 */
1806 {
1807 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1808 for (j = 0; j < 7; j++) /* 7 */
1809 {
1810 point = i * 8 + j; /* get point */
1811 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1812 {
1813 str_buf[j * 3 + 0] = '#'; /* # */
1814 str_buf[j * 3 + 1] = '#'; /* # */
1815 str_buf[j * 3 + 2] = '#'; /* # */
1816 }
1817 else
1818 {
1819 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1820 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1821 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1822 }
1823 }
1824 handle->debug_print("%s\n", str_buf); /* print buffer */
1825 }
1826
1827 break; /* break */
1828 }
1829 case GT30L32S4W_TYPE_6X12_ASCII : /* 6x12 ascii */
1830 {
1831 if (len != 12) /* check length */
1832 {
1833 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1834
1835 return 4; /* return error */
1836 }
1837 for (i = 0; i < 12; i++) /* 12 */
1838 {
1839 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1840 for (j = 0; j < 6; j++) /* 6 */
1841 {
1842 point = i * 8 + j; /* get point */
1843 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1844 {
1845 str_buf[j * 3 + 0] = '#'; /* # */
1846 str_buf[j * 3 + 1] = '#'; /* # */
1847 str_buf[j * 3 + 2] = '#'; /* # */
1848 }
1849 else
1850 {
1851 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1852 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1853 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1854 }
1855 }
1856 handle->debug_print("%s\n", str_buf); /* print buffer */
1857 }
1858
1859 break; /* break */
1860 }
1861 case GT30L32S4W_TYPE_8X16_ASCII : /* 8x16 ascii */
1862 {
1863 if (len != 16) /* check length */
1864 {
1865 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1866
1867 return 4; /* return error */
1868 }
1869 for (i = 0; i < 16; i++) /* 16 */
1870 {
1871 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1872 for (j = 0; j < 8; j++) /* 8 */
1873 {
1874 point = i * 8 + j; /* get point */
1875 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1876 {
1877 str_buf[j * 3 + 0] = '#'; /* # */
1878 str_buf[j * 3 + 1] = '#'; /* # */
1879 str_buf[j * 3 + 2] = '#'; /* # */
1880 }
1881 else
1882 {
1883 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1884 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1885 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1886 }
1887 }
1888 handle->debug_print("%s\n", str_buf); /* print buffer */
1889 }
1890
1891 break; /* break */
1892 }
1893 case GT30L32S4W_TYPE_12X24_ASCII : /* 12x24 ascii */
1894 {
1895 if (len != 48) /* check length */
1896 {
1897 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1898
1899 return 4; /* return error */
1900 }
1901 for (i = 0; i < 24; i++) /* 24 */
1902 {
1903 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1904 for (j = 0; j < 12; j++) /* 12 */
1905 {
1906 point = i * 16 + j; /* get point */
1907 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1908 {
1909 str_buf[j * 3 + 0] = '#'; /* # */
1910 str_buf[j * 3 + 1] = '#'; /* # */
1911 str_buf[j * 3 + 2] = '#'; /* # */
1912 }
1913 else
1914 {
1915 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1916 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1917 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1918 }
1919 }
1920 handle->debug_print("%s\n", str_buf); /* print buffer */
1921 }
1922
1923 break; /* break */
1924 }
1925 case GT30L32S4W_TYPE_16X32_ASCII : /* 16x32 ascii */
1926 {
1927 if (len != 64) /* check length */
1928 {
1929 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1930
1931 return 4; /* return error */
1932 }
1933 for (i = 0; i < 32; i++) /* 32 */
1934 {
1935 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1936 for (j = 0; j < 16; j++) /* 16 */
1937 {
1938 point = i * 16 + j; /* get point */
1939 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1940 {
1941 str_buf[j * 3 + 0] = '#'; /* # */
1942 str_buf[j * 3 + 1] = '#'; /* # */
1943 str_buf[j * 3 + 2] = '#'; /* # */
1944 }
1945 else
1946 {
1947 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1948 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1949 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1950 }
1951 }
1952 handle->debug_print("%s\n", str_buf); /* print buffer */
1953 }
1954
1955 break; /* break */
1956 }
1957 case GT30L32S4W_TYPE_12_ARIAL_ASCII : /* 12 arial ascii */
1958 {
1959 uint16_t l;
1960
1961 if (len != 26) /* check length */
1962 {
1963 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
1964
1965 return 4; /* return error */
1966 }
1967 l = (uint16_t)buf[0] << 8 | buf[1]; /* get length */
1968 buf += 2; /* set to data part */
1969 for (i = 0; i < 12; i++) /* 12 */
1970 {
1971 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
1972 for (j = 0; j < l; j++) /* l */
1973 {
1974 point = i * 16 + j; /* get point */
1975 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
1976 {
1977 str_buf[j * 3 + 0] = '#'; /* # */
1978 str_buf[j * 3 + 1] = '#'; /* # */
1979 str_buf[j * 3 + 2] = '#'; /* # */
1980 }
1981 else
1982 {
1983 str_buf[j * 3 + 0] = ' '; /* 0x20 */
1984 str_buf[j * 3 + 1] = ' '; /* 0x20 */
1985 str_buf[j * 3 + 2] = ' '; /* 0x20 */
1986 }
1987 }
1988 handle->debug_print("%s\n", str_buf); /* print buffer */
1989 }
1990
1991 break; /* break */
1992 }
1993 case GT30L32S4W_TYPE_12_TIMES_ASCII : /* 12 times ascii */
1994 {
1995 uint16_t l;
1996
1997 if (len != 26) /* check length */
1998 {
1999 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
2000
2001 return 4; /* return error */
2002 }
2003 l = (uint16_t)buf[0] << 8 | buf[1]; /* get length */
2004 buf += 2; /* set to data part */
2005 for (i = 0; i < 12; i++) /* 12 */
2006 {
2007 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
2008 for (j = 0; j < l; j++) /* l */
2009 {
2010 point = i * 16 + j; /* get point */
2011 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
2012 {
2013 str_buf[j * 3 + 0] = '#'; /* # */
2014 str_buf[j * 3 + 1] = '#'; /* # */
2015 str_buf[j * 3 + 2] = '#'; /* # */
2016 }
2017 else
2018 {
2019 str_buf[j * 3 + 0] = ' '; /* 0x20 */
2020 str_buf[j * 3 + 1] = ' '; /* 0x20 */
2021 str_buf[j * 3 + 2] = ' '; /* 0x20 */
2022 }
2023 }
2024 handle->debug_print("%s\n", str_buf); /* print buffer */
2025 }
2026
2027 break; /* break */
2028 }
2029 case GT30L32S4W_TYPE_16_ARIAL_ASCII : /* 16 arial ascii */
2030 {
2031 uint16_t l;
2032
2033 if (len != 34) /* check length */
2034 {
2035 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
2036
2037 return 4; /* return error */
2038 }
2039 l = (uint16_t)buf[0] << 8 | buf[1]; /* get length */
2040 buf += 2; /* set to data part */
2041 for (i = 0; i < 16; i++) /* 16 */
2042 {
2043 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
2044 for (j = 0; j < l; j++) /* l */
2045 {
2046 point = i * 16 + j; /* get point */
2047 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
2048 {
2049 str_buf[j * 3 + 0] = '#'; /* # */
2050 str_buf[j * 3 + 1] = '#'; /* # */
2051 str_buf[j * 3 + 2] = '#'; /* # */
2052 }
2053 else
2054 {
2055 str_buf[j * 3 + 0] = ' '; /* 0x20 */
2056 str_buf[j * 3 + 1] = ' '; /* 0x20 */
2057 str_buf[j * 3 + 2] = ' '; /* 0x20 */
2058 }
2059 }
2060 handle->debug_print("%s\n", str_buf); /* print buffer */
2061 }
2062
2063 break; /* break */
2064 }
2065 case GT30L32S4W_TYPE_16_TIMES_ASCII : /* 16 times ascii */
2066 {
2067 uint16_t l;
2068
2069 if (len != 34) /* check length */
2070 {
2071 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
2072
2073 return 4; /* return error */
2074 }
2075 l = (uint16_t)buf[0] << 8 | buf[1]; /* get length */
2076 buf += 2; /* set to data part */
2077 for (i = 0; i < 16; i++) /* 16 */
2078 {
2079 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
2080 for (j = 0; j < l; j++) /* l */
2081 {
2082 point = i * 16 + j; /* get point */
2083 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
2084 {
2085 str_buf[j * 3 + 0] = '#'; /* # */
2086 str_buf[j * 3 + 1] = '#'; /* # */
2087 str_buf[j * 3 + 2] = '#'; /* # */
2088 }
2089 else
2090 {
2091 str_buf[j * 3 + 0] = ' '; /* 0x20 */
2092 str_buf[j * 3 + 1] = ' '; /* 0x20 */
2093 str_buf[j * 3 + 2] = ' '; /* 0x20 */
2094 }
2095 }
2096 handle->debug_print("%s\n", str_buf); /* print buffer */
2097 }
2098
2099 break; /* break */
2100 }
2101 case GT30L32S4W_TYPE_24_ARIAL_ASCII : /* 24 arial ascii */
2102 {
2103 uint16_t l;
2104
2105 if (len != 74) /* check length */
2106 {
2107 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
2108
2109 return 4; /* return error */
2110 }
2111 l = (uint16_t)buf[0] << 8 | buf[1]; /* get length */
2112 buf += 2; /* set to data part */
2113 for (i = 0; i < 24; i++) /* 24 */
2114 {
2115 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
2116 for (j = 0; j < l; j++) /* l */
2117 {
2118 point = i * 24 + j; /* get point */
2119 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
2120 {
2121 str_buf[j * 3 + 0] = '#'; /* # */
2122 str_buf[j * 3 + 1] = '#'; /* # */
2123 str_buf[j * 3 + 2] = '#'; /* # */
2124 }
2125 else
2126 {
2127 str_buf[j * 3 + 0] = ' '; /* 0x20 */
2128 str_buf[j * 3 + 1] = ' '; /* 0x20 */
2129 str_buf[j * 3 + 2] = ' '; /* 0x20 */
2130 }
2131 }
2132 handle->debug_print("%s\n", str_buf); /* print buffer */
2133 }
2134
2135 break; /* break */
2136 }
2137 case GT30L32S4W_TYPE_24_TIMES_ASCII : /* 24 times ascii */
2138 {
2139 uint16_t l;
2140
2141 if (len != 74) /* check length */
2142 {
2143 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
2144
2145 return 4; /* return error */
2146 }
2147 l = (uint16_t)buf[0] << 8 | buf[1]; /* get length */
2148 buf += 2; /* set to data part */
2149 for (i = 0; i < 24; i++) /* 24 */
2150 {
2151 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
2152 for (j = 0; j < l; j++) /* l */
2153 {
2154 point = i * 24 + j; /* get point */
2155 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
2156 {
2157 str_buf[j * 3 + 0] = '#'; /* # */
2158 str_buf[j * 3 + 1] = '#'; /* # */
2159 str_buf[j * 3 + 2] = '#'; /* # */
2160 }
2161 else
2162 {
2163 str_buf[j * 3 + 0] = ' '; /* 0x20 */
2164 str_buf[j * 3 + 1] = ' '; /* 0x20 */
2165 str_buf[j * 3 + 2] = ' '; /* 0x20 */
2166 }
2167 }
2168 handle->debug_print("%s\n", str_buf); /* print buffer */
2169 }
2170
2171 break; /* break */
2172 }
2173 case GT30L32S4W_TYPE_32_ARIAL_ASCII : /* 32 arial ascii */
2174 {
2175 uint16_t l;
2176
2177 if (len != 130) /* check length */
2178 {
2179 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
2180
2181 return 4; /* return error */
2182 }
2183 l = (uint16_t)buf[0] << 8 | buf[1]; /* get length */
2184 buf += 2; /* set to data part */
2185 for (i = 0; i < 32; i++) /* 32 */
2186 {
2187 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
2188 for (j = 0; j < l; j++) /* l */
2189 {
2190 point = i * 32 + j; /* get point */
2191 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
2192 {
2193 str_buf[j * 3 + 0] = '#'; /* # */
2194 str_buf[j * 3 + 1] = '#'; /* # */
2195 str_buf[j * 3 + 2] = '#'; /* # */
2196 }
2197 else
2198 {
2199 str_buf[j * 3 + 0] = ' '; /* 0x20 */
2200 str_buf[j * 3 + 1] = ' '; /* 0x20 */
2201 str_buf[j * 3 + 2] = ' '; /* 0x20 */
2202 }
2203 }
2204 handle->debug_print("%s\n", str_buf); /* print buffer */
2205 }
2206
2207 break; /* break */
2208 }
2209 case GT30L32S4W_TYPE_32_TIMES_ASCII : /* 32 times ascii */
2210 {
2211 uint16_t l;
2212
2213 if (len != 130) /* check length */
2214 {
2215 handle->debug_print("gt30l32s4w: len is invalid.\n"); /* len is invalid */
2216
2217 return 4; /* return error */
2218 }
2219 l = (uint16_t)buf[0] << 8 | buf[1]; /* get length */
2220 buf += 2; /* set to data part */
2221 for (i = 0; i < 32; i++) /* 32 */
2222 {
2223 memset(str_buf, 0, sizeof(char) * 129); /* clear buffer */
2224 for (j = 0; j < l; j++) /* l */
2225 {
2226 point = i * 32 + j; /* get point */
2227 if ((buf[point / 8] >> (7 - (point % 8))) != 0) /* check point */
2228 {
2229 str_buf[j * 3 + 0] = '#'; /* # */
2230 str_buf[j * 3 + 1] = '#'; /* # */
2231 str_buf[j * 3 + 2] = '#'; /* # */
2232 }
2233 else
2234 {
2235 str_buf[j * 3 + 0] = ' '; /* 0x20 */
2236 str_buf[j * 3 + 1] = ' '; /* 0x20 */
2237 str_buf[j * 3 + 2] = ' '; /* 0x20 */
2238 }
2239 }
2240 handle->debug_print("%s\n", str_buf); /* print buffer */
2241 }
2242
2243 break; /* break */
2244 }
2245 default :
2246 {
2247 break; /* break */
2248 }
2249 }
2250
2251 return 0; /* success return 0 */
2252}
2253
2268uint8_t gt30l32s4w_get_reg(gt30l32s4w_handle_t *handle, uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
2269{
2270 if (handle == NULL) /* check handle */
2271 {
2272 return 2; /* return error */
2273 }
2274 if (handle->inited != 1) /* check handle initialization */
2275 {
2276 return 3; /* return error */
2277 }
2278
2279 return handle->spi_write_read(in_buf, in_len, out_buf, out_len); /* write read reg */
2280}
2281
2291{
2292 if (info == NULL) /* check handle */
2293 {
2294 return 2; /* return error */
2295 }
2296
2297 memset(info, 0, sizeof(gt30l32s4w_info_t)); /* initialize gt30l32s4w info structure */
2298 strncpy(info->chip_name, CHIP_NAME, 32); /* copy chip name */
2299 strncpy(info->manufacturer_name, MANUFACTURER_NAME, 32); /* copy manufacturer name */
2300 strncpy(info->interface, "SPI", 8); /* copy interface name */
2301 info->supply_voltage_min_v = SUPPLY_VOLTAGE_MIN; /* set minimal supply voltage */
2302 info->supply_voltage_max_v = SUPPLY_VOLTAGE_MAX; /* set maximum supply voltage */
2303 info->max_current_ma = MAX_CURRENT; /* set maximum current */
2304 info->temperature_max = TEMPERATURE_MAX; /* set minimal temperature */
2305 info->temperature_min = TEMPERATURE_MIN; /* set maximum temperature */
2306 info->driver_version = DRIVER_VERSION; /* set driver version */
2307
2308 return 0; /* success return 0 */
2309}
#define GT30L32S4W_ADDRESS_16_TIMES_ASCII
#define GT30L32S4W_ADDRESS_12_ARIAL_ASCII
#define GT30L32S4W_ADDRESS_32X32_GB2312
#define GT30L32S4W_ADDRESS_24_ARIAL_ASCII
#define GT30L32S4W_ADDRESS_12X12_GB2312
chip address definition
#define MAX_CURRENT
#define GT30L32S4W_ADDRESS_15X16_GB2312
#define GT30L32S4W_ADDRESS_12X24_GB2312
#define GT30L32S4W_ADDRESS_8X16_GB2312_SP
#define GT30L32S4W_ADDRESS_6X12_ASCII
#define GT30L32S4W_ADDRESS_5X7_ASCII
#define GT30L32S4W_ADDRESS_8X16_GB2312
#define GT30L32S4W_ADDRESS_6X12_GB2312
#define SUPPLY_VOLTAGE_MAX
#define GT30L32S4W_ADDRESS_24_TIMES_ASCII
#define GT30L32S4W_ADDRESS_16X32_GB2312
#define GT30L32S4W_ADDRESS_12X24_ASCII
#define TEMPERATURE_MAX
#define GT30L32S4W_ADDRESS_7X8_ASCII
#define MANUFACTURER_NAME
#define TEMPERATURE_MIN
#define SUPPLY_VOLTAGE_MIN
#define GT30L32S4W_ADDRESS_8X16_ASCII
#define GT30L32S4W_ADDRESS_24X24_GB2312
#define GT30L32S4W_ADDRESS_16X32_ASCII
#define GT30L32S4W_ADDRESS_12_TIMES_ASCII
#define GT30L32S4W_ADDRESS_32_TIMES_ASCII
#define CHIP_NAME
chip information definition
#define GT30L32S4W_ADDRESS_16_ARIAL_ASCII
#define DRIVER_VERSION
#define GT30L32S4W_ADDRESS_32_ARIAL_ASCII
driver gt30l32s4w 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
gt30l32s4w_mode_t
gt30l32s4w mode enumeration definition
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
gt30l32s4w_type_t
gt30l32s4w type enumeration definition
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_get_mode(gt30l32s4w_handle_t *handle, gt30l32s4w_mode_t *mode)
get mode
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_get_reg(gt30l32s4w_handle_t *handle, uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
get the chip register
uint8_t(* spi_write_read)(uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
uint8_t(* spi_init)(void)
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* spi_deinit)(void)