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
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
89static uint8_t a_gt30l32s4w_spi_read(
gt30l32s4w_handle_t *handle, uint32_t addr, uint8_t *out_buf, uint32_t out_len)
96 reg[1] = (addr >> 16) & 0xFF;
97 reg[2] = (addr >> 8) & 0xFF;
98 reg[3] = (addr >> 0) & 0xFF;
110 reg[1] = (addr >> 16) & 0xFF;
111 reg[2] = (addr >> 8) & 0xFF;
112 reg[3] = (addr >> 0) & 0xFF;
124 handle->
debug_print(
"gt30l32s4w: mode is invalid.\n");
143 const char buf_check[] = {0x00, 0x10, 0x28, 0x28, 0x28, 0x44, 0x44, 0x7C,
144 0x82, 0x82, 0x82, 0x82, 0x00, 0x00, 0x00, 0x00};
157 handle->
debug_print(
"gt30l32s4w: spi_init is null.\n");
163 handle->
debug_print(
"gt30l32s4w: spi_deinit is null.\n");
169 handle->
debug_print(
"gt30l32s4w: spi_write_read is null.\n");
175 handle->
debug_print(
"gt30l32s4w: delay_ms is null.\n");
182 handle->
debug_print(
"gt30l32s4w: spi init failed.\n");
187 if (a_gt30l32s4w_spi_read(handle,
189 ((uint8_t)(
'A') - 0x20) * 16,
192 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
197 if (strncmp((
const char *)buf, buf_check, 16) != 0)
199 handle->
debug_print(
"gt30l32s4w: spi check error.\n");
232 handle->
debug_print(
"gt30l32s4w: spi deinit failed.\n");
321 msb = (ch >> 8) & 0xFF;
322 lsb = (ch >> 0) & 0xFF;
324 if ((msb >= 0xA1) && (msb <= 0xA9) && (lsb >= 0xA1))
326 addr =((msb - 0xA1) * 94 + (lsb - 0xA1)) * 24 + addr;
328 else if ((msb >= 0xB0) && (msb <= 0xF7) && (lsb >= 0xA1))
330 addr = ((msb - 0xB0) * 94 + (lsb - 0xA1) + 846) * 24 + addr;
334 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
339 if (a_gt30l32s4w_spi_read(handle, addr, buf, 24) != 0)
341 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
377 msb = (ch >> 8) & 0xFF;
378 lsb = (ch >> 0) & 0xFF;
380 if ((msb >= 0xA1) && (msb <= 0xA9) && (lsb >= 0xA1))
382 addr =((msb - 0xA1) * 94 + (lsb - 0xA1)) * 32 + addr;
384 else if ((msb >= 0xB0) && (msb <= 0xF7) && (lsb >= 0xA1))
386 addr = ((msb - 0xB0) * 94 + (lsb - 0xA1) + 846) * 32 + addr;
390 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
395 if (a_gt30l32s4w_spi_read(handle, addr, buf, 32) != 0)
397 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
433 msb = (ch >> 8) & 0xFF;
434 lsb = (ch >> 0) & 0xFF;
436 if ((msb >= 0xA1) && (msb <= 0xA9) && (lsb >= 0xA1))
438 addr =((msb - 0xA1) * 94 + (lsb - 0xA1)) * 72 + addr;
440 else if ((msb >= 0xB0) && (msb <= 0xF7) && (lsb >= 0xA1))
442 addr = ((msb - 0xB0) * 94 + (lsb - 0xA1) + 846) * 72 + addr;
446 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
451 if (a_gt30l32s4w_spi_read(handle, addr, buf, 72) != 0)
453 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
489 msb = (ch >> 8) & 0xFF;
490 lsb = (ch >> 0) & 0xFF;
492 if ((msb >= 0xA1) && (msb <= 0xA9) && (lsb >= 0xA1))
494 addr =((msb - 0xA1) * 94 + (lsb - 0xA1)) * 128 + addr;
496 else if ((msb >= 0xB0) && (msb <= 0xF7) && (lsb >= 0xA1))
498 addr = ((msb - 0xB0) * 94 + (lsb - 0xA1) + 846) * 128 + addr;
502 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
507 if (a_gt30l32s4w_spi_read(handle, addr, buf, 128) != 0)
509 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
544 if ((ch >= 0xAAA1U) && (ch <= 0xAAFEU))
546 addr =(ch - 0xAAA1U) * 12 + addr;
548 else if ((ch >= 0xABA1U) && (ch <= 0xABC0U))
550 addr = (ch - 0xABA1U + 95) * 12 + addr;
554 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
559 if (a_gt30l32s4w_spi_read(handle, addr, buf, 12) != 0)
561 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
596 if ((ch >= 0xAAA1U) && (ch <= 0xAAFEU))
598 addr =(ch - 0xAAA1U) * 16 + addr;
600 else if ((ch >= 0xABA1U) && (ch <= 0xABC0U))
602 addr = (ch - 0xABA1U + 95) * 16 + addr;
606 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
611 if (a_gt30l32s4w_spi_read(handle, addr, buf, 16) != 0)
613 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
648 if ((ch >= 0xACA1U) && (ch <= 0xACDFU))
650 addr = (ch - 0xACA1U) * 16 + addr;
654 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
659 if (a_gt30l32s4w_spi_read(handle, addr, buf, 16) != 0)
661 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
696 if ((ch >= 0xAAA1U) && (ch <= 0xAAFEU))
698 addr =(ch - 0xAAA1U) * 48 + addr;
700 else if ((ch >= 0xABA1U) && (ch <= 0xABC0U))
702 addr = (ch - 0xABA1U + 95) * 48 + addr;
706 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
711 if (a_gt30l32s4w_spi_read(handle, addr, buf, 48) != 0)
713 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
748 if ((ch >= 0xAAA1U) && (ch <= 0xAAFEU))
750 addr =(ch - 0xAAA1U) * 64 + addr;
752 else if ((ch >= 0xABA1U) && (ch <= 0xABC0U))
754 addr = (ch - 0xABA1U + 95) * 64 + addr;
758 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
763 if (a_gt30l32s4w_spi_read(handle, addr, buf, 64) != 0)
765 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
800 if ((ch >= 0x20) && (ch <= 0x7E))
802 addr = (ch - 0x20) * 8 + addr;
806 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
811 if (a_gt30l32s4w_spi_read(handle, addr, buf, 8) != 0)
813 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
848 if ((ch >= 0x20) && (ch <= 0x7E))
850 addr = (ch - 0x20) * 8 + addr;
854 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
859 if (a_gt30l32s4w_spi_read(handle, addr, buf, 8) != 0)
861 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
896 if ((ch >= 0x20) && (ch <= 0x7E))
898 addr = (ch - 0x20) * 12 + addr;
902 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
907 if (a_gt30l32s4w_spi_read(handle, addr, buf, 12) != 0)
909 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
944 if ((ch >= 0x20) && (ch <= 0x7E))
946 addr = (ch - 0x20) * 16 + addr;
950 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
955 if (a_gt30l32s4w_spi_read(handle, addr, buf, 16) != 0)
957 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
992 if ((ch >= 0x20) && (ch <= 0x7E))
994 addr = (ch - 0x20) * 48 + addr;
998 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1003 if (a_gt30l32s4w_spi_read(handle, addr, buf, 48) != 0)
1005 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1040 if ((ch >= 0x20) && (ch <= 0x7E))
1042 addr = (ch - 0x20) * 64 + addr;
1046 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1051 if (a_gt30l32s4w_spi_read(handle, addr, buf, 64) != 0)
1053 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1088 if ((ch >= 0x20) && (ch <= 0x7E))
1090 addr = (ch - 0x20) * 26 + addr;
1094 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1099 if (a_gt30l32s4w_spi_read(handle, addr, buf, 26) != 0)
1101 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1136 if ((ch >= 0x20) && (ch <= 0x7E))
1138 addr = (ch - 0x20) * 26 + addr;
1142 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1147 if (a_gt30l32s4w_spi_read(handle, addr, buf, 26) != 0)
1149 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1184 if ((ch >= 0x20) && (ch <= 0x7E))
1186 addr = (ch - 0x20) * 34 + addr;
1190 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1195 if (a_gt30l32s4w_spi_read(handle, addr, buf, 34) != 0)
1197 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1232 if ((ch >= 0x20) && (ch <= 0x7E))
1234 addr = (ch - 0x20) * 34 + addr;
1238 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1243 if (a_gt30l32s4w_spi_read(handle, addr, buf, 34) != 0)
1245 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1280 if ((ch >= 0x20) && (ch <= 0x7E))
1282 addr = (ch - 0x20) * 74 + addr;
1286 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1291 if (a_gt30l32s4w_spi_read(handle, addr, buf, 74) != 0)
1293 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1328 if ((ch >= 0x20) && (ch <= 0x7E))
1330 addr = (ch - 0x20) * 74 + addr;
1334 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1339 if (a_gt30l32s4w_spi_read(handle, addr, buf, 74) != 0)
1341 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1376 if ((ch >= 0x20) && (ch <= 0x7E))
1378 addr = (ch - 0x20) * 130 + addr;
1382 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1387 if (a_gt30l32s4w_spi_read(handle, addr, buf, 130) != 0)
1389 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1424 if ((ch >= 0x20) && (ch <= 0x7E))
1426 addr = (ch - 0x20) * 130 + addr;
1430 handle->
debug_print(
"gt30l32s4w: char is invalid.\n");
1435 if (a_gt30l32s4w_spi_read(handle, addr, buf, 130) != 0)
1437 handle->
debug_print(
"gt30l32s4w: spi read failed.\n");
1481 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1485 for (i = 0; i < 12; i++)
1487 memset(str_buf, 0,
sizeof(
char) * 129);
1488 for (j = 0; j < 12; j++)
1491 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1493 str_buf[j * 3 + 0] =
'#';
1494 str_buf[j * 3 + 1] =
'#';
1495 str_buf[j * 3 + 2] =
'#';
1499 str_buf[j * 3 + 0] =
' ';
1500 str_buf[j * 3 + 1] =
' ';
1501 str_buf[j * 3 + 2] =
' ';
1513 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1517 for (i = 0; i < 16; i++)
1519 memset(str_buf, 0,
sizeof(
char) * 129);
1520 for (j = 0; j < 15; j++)
1523 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1525 str_buf[j * 3 + 0] =
'#';
1526 str_buf[j * 3 + 1] =
'#';
1527 str_buf[j * 3 + 2] =
'#';
1531 str_buf[j * 3 + 0] =
' ';
1532 str_buf[j * 3 + 1] =
' ';
1533 str_buf[j * 3 + 2] =
' ';
1545 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1549 for (i = 0; i < 24; i++)
1551 memset(str_buf, 0,
sizeof(
char) * 129);
1552 for (j = 0; j < 24; j++)
1555 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1557 str_buf[j * 3 + 0] =
'#';
1558 str_buf[j * 3 + 1] =
'#';
1559 str_buf[j * 3 + 2] =
'#';
1563 str_buf[j * 3 + 0] =
' ';
1564 str_buf[j * 3 + 1] =
' ';
1565 str_buf[j * 3 + 2] =
' ';
1577 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1581 for (i = 0; i < 32; i++)
1583 memset(str_buf, 0,
sizeof(
char) * 129);
1584 for (j = 0; j < 32; j++)
1587 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1589 str_buf[j * 3 + 0] =
'#';
1590 str_buf[j * 3 + 1] =
'#';
1591 str_buf[j * 3 + 2] =
'#';
1595 str_buf[j * 3 + 0] =
' ';
1596 str_buf[j * 3 + 1] =
' ';
1597 str_buf[j * 3 + 2] =
' ';
1609 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1613 for (i = 0; i < 12; i++)
1615 memset(str_buf, 0,
sizeof(
char) * 129);
1616 for (j = 0; j < 6; j++)
1619 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1621 str_buf[j * 3 + 0] =
'#';
1622 str_buf[j * 3 + 1] =
'#';
1623 str_buf[j * 3 + 2] =
'#';
1627 str_buf[j * 3 + 0] =
' ';
1628 str_buf[j * 3 + 1] =
' ';
1629 str_buf[j * 3 + 2] =
' ';
1641 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1645 for (i = 0; i < 16; i++)
1647 memset(str_buf, 0,
sizeof(
char) * 129);
1648 for (j = 0; j < 8; j++)
1651 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1653 str_buf[j * 3 + 0] =
'#';
1654 str_buf[j * 3 + 1] =
'#';
1655 str_buf[j * 3 + 2] =
'#';
1659 str_buf[j * 3 + 0] =
' ';
1660 str_buf[j * 3 + 1] =
' ';
1661 str_buf[j * 3 + 2] =
' ';
1673 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1677 for (i = 0; i < 16; i++)
1679 memset(str_buf, 0,
sizeof(
char) * 129);
1680 for (j = 0; j < 8; j++)
1683 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1685 str_buf[j * 3 + 0] =
'#';
1686 str_buf[j * 3 + 1] =
'#';
1687 str_buf[j * 3 + 2] =
'#';
1691 str_buf[j * 3 + 0] =
' ';
1692 str_buf[j * 3 + 1] =
' ';
1693 str_buf[j * 3 + 2] =
' ';
1705 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1709 for (i = 0; i < 24; i++)
1711 memset(str_buf, 0,
sizeof(
char) * 129);
1712 for (j = 0; j < 12; j++)
1715 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1717 str_buf[j * 3 + 0] =
'#';
1718 str_buf[j * 3 + 1] =
'#';
1719 str_buf[j * 3 + 2] =
'#';
1723 str_buf[j * 3 + 0] =
' ';
1724 str_buf[j * 3 + 1] =
' ';
1725 str_buf[j * 3 + 2] =
' ';
1737 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1741 for (i = 0; i < 32; i++)
1743 memset(str_buf, 0,
sizeof(
char) * 129);
1744 for (j = 0; j < 16; j++)
1747 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1749 str_buf[j * 3 + 0] =
'#';
1750 str_buf[j * 3 + 1] =
'#';
1751 str_buf[j * 3 + 2] =
'#';
1755 str_buf[j * 3 + 0] =
' ';
1756 str_buf[j * 3 + 1] =
' ';
1757 str_buf[j * 3 + 2] =
' ';
1769 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1773 for (i = 0; i < 7; i++)
1775 memset(str_buf, 0,
sizeof(
char) * 129);
1776 for (j = 0; j < 5; j++)
1779 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1781 str_buf[j * 3 + 0] =
'#';
1782 str_buf[j * 3 + 1] =
'#';
1783 str_buf[j * 3 + 2] =
'#';
1787 str_buf[j * 3 + 0] =
' ';
1788 str_buf[j * 3 + 1] =
' ';
1789 str_buf[j * 3 + 2] =
' ';
1801 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1805 for (i = 0; i < 8; i++)
1807 memset(str_buf, 0,
sizeof(
char) * 129);
1808 for (j = 0; j < 7; j++)
1811 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1813 str_buf[j * 3 + 0] =
'#';
1814 str_buf[j * 3 + 1] =
'#';
1815 str_buf[j * 3 + 2] =
'#';
1819 str_buf[j * 3 + 0] =
' ';
1820 str_buf[j * 3 + 1] =
' ';
1821 str_buf[j * 3 + 2] =
' ';
1833 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1837 for (i = 0; i < 12; i++)
1839 memset(str_buf, 0,
sizeof(
char) * 129);
1840 for (j = 0; j < 6; j++)
1843 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1845 str_buf[j * 3 + 0] =
'#';
1846 str_buf[j * 3 + 1] =
'#';
1847 str_buf[j * 3 + 2] =
'#';
1851 str_buf[j * 3 + 0] =
' ';
1852 str_buf[j * 3 + 1] =
' ';
1853 str_buf[j * 3 + 2] =
' ';
1865 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1869 for (i = 0; i < 16; i++)
1871 memset(str_buf, 0,
sizeof(
char) * 129);
1872 for (j = 0; j < 8; j++)
1875 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1877 str_buf[j * 3 + 0] =
'#';
1878 str_buf[j * 3 + 1] =
'#';
1879 str_buf[j * 3 + 2] =
'#';
1883 str_buf[j * 3 + 0] =
' ';
1884 str_buf[j * 3 + 1] =
' ';
1885 str_buf[j * 3 + 2] =
' ';
1897 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1901 for (i = 0; i < 24; i++)
1903 memset(str_buf, 0,
sizeof(
char) * 129);
1904 for (j = 0; j < 12; j++)
1907 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1909 str_buf[j * 3 + 0] =
'#';
1910 str_buf[j * 3 + 1] =
'#';
1911 str_buf[j * 3 + 2] =
'#';
1915 str_buf[j * 3 + 0] =
' ';
1916 str_buf[j * 3 + 1] =
' ';
1917 str_buf[j * 3 + 2] =
' ';
1929 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1933 for (i = 0; i < 32; i++)
1935 memset(str_buf, 0,
sizeof(
char) * 129);
1936 for (j = 0; j < 16; j++)
1939 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1941 str_buf[j * 3 + 0] =
'#';
1942 str_buf[j * 3 + 1] =
'#';
1943 str_buf[j * 3 + 2] =
'#';
1947 str_buf[j * 3 + 0] =
' ';
1948 str_buf[j * 3 + 1] =
' ';
1949 str_buf[j * 3 + 2] =
' ';
1963 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
1967 l = (uint16_t)buf[0] << 8 | buf[1];
1969 for (i = 0; i < 12; i++)
1971 memset(str_buf, 0,
sizeof(
char) * 129);
1972 for (j = 0; j < l; j++)
1975 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
1977 str_buf[j * 3 + 0] =
'#';
1978 str_buf[j * 3 + 1] =
'#';
1979 str_buf[j * 3 + 2] =
'#';
1983 str_buf[j * 3 + 0] =
' ';
1984 str_buf[j * 3 + 1] =
' ';
1985 str_buf[j * 3 + 2] =
' ';
1999 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
2003 l = (uint16_t)buf[0] << 8 | buf[1];
2005 for (i = 0; i < 12; i++)
2007 memset(str_buf, 0,
sizeof(
char) * 129);
2008 for (j = 0; j < l; j++)
2011 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
2013 str_buf[j * 3 + 0] =
'#';
2014 str_buf[j * 3 + 1] =
'#';
2015 str_buf[j * 3 + 2] =
'#';
2019 str_buf[j * 3 + 0] =
' ';
2020 str_buf[j * 3 + 1] =
' ';
2021 str_buf[j * 3 + 2] =
' ';
2035 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
2039 l = (uint16_t)buf[0] << 8 | buf[1];
2041 for (i = 0; i < 16; i++)
2043 memset(str_buf, 0,
sizeof(
char) * 129);
2044 for (j = 0; j < l; j++)
2047 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
2049 str_buf[j * 3 + 0] =
'#';
2050 str_buf[j * 3 + 1] =
'#';
2051 str_buf[j * 3 + 2] =
'#';
2055 str_buf[j * 3 + 0] =
' ';
2056 str_buf[j * 3 + 1] =
' ';
2057 str_buf[j * 3 + 2] =
' ';
2071 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
2075 l = (uint16_t)buf[0] << 8 | buf[1];
2077 for (i = 0; i < 16; i++)
2079 memset(str_buf, 0,
sizeof(
char) * 129);
2080 for (j = 0; j < l; j++)
2083 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
2085 str_buf[j * 3 + 0] =
'#';
2086 str_buf[j * 3 + 1] =
'#';
2087 str_buf[j * 3 + 2] =
'#';
2091 str_buf[j * 3 + 0] =
' ';
2092 str_buf[j * 3 + 1] =
' ';
2093 str_buf[j * 3 + 2] =
' ';
2107 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
2111 l = (uint16_t)buf[0] << 8 | buf[1];
2113 for (i = 0; i < 24; i++)
2115 memset(str_buf, 0,
sizeof(
char) * 129);
2116 for (j = 0; j < l; j++)
2119 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
2121 str_buf[j * 3 + 0] =
'#';
2122 str_buf[j * 3 + 1] =
'#';
2123 str_buf[j * 3 + 2] =
'#';
2127 str_buf[j * 3 + 0] =
' ';
2128 str_buf[j * 3 + 1] =
' ';
2129 str_buf[j * 3 + 2] =
' ';
2143 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
2147 l = (uint16_t)buf[0] << 8 | buf[1];
2149 for (i = 0; i < 24; i++)
2151 memset(str_buf, 0,
sizeof(
char) * 129);
2152 for (j = 0; j < l; j++)
2155 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
2157 str_buf[j * 3 + 0] =
'#';
2158 str_buf[j * 3 + 1] =
'#';
2159 str_buf[j * 3 + 2] =
'#';
2163 str_buf[j * 3 + 0] =
' ';
2164 str_buf[j * 3 + 1] =
' ';
2165 str_buf[j * 3 + 2] =
' ';
2179 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
2183 l = (uint16_t)buf[0] << 8 | buf[1];
2185 for (i = 0; i < 32; i++)
2187 memset(str_buf, 0,
sizeof(
char) * 129);
2188 for (j = 0; j < l; j++)
2191 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
2193 str_buf[j * 3 + 0] =
'#';
2194 str_buf[j * 3 + 1] =
'#';
2195 str_buf[j * 3 + 2] =
'#';
2199 str_buf[j * 3 + 0] =
' ';
2200 str_buf[j * 3 + 1] =
' ';
2201 str_buf[j * 3 + 2] =
' ';
2215 handle->
debug_print(
"gt30l32s4w: len is invalid.\n");
2219 l = (uint16_t)buf[0] << 8 | buf[1];
2221 for (i = 0; i < 32; i++)
2223 memset(str_buf, 0,
sizeof(
char) * 129);
2224 for (j = 0; j < l; j++)
2227 if ((buf[point / 8] >> (7 - (point % 8))) != 0)
2229 str_buf[j * 3 + 0] =
'#';
2230 str_buf[j * 3 + 1] =
'#';
2231 str_buf[j * 3 + 2] =
'#';
2235 str_buf[j * 3 + 0] =
' ';
2236 str_buf[j * 3 + 1] =
' ';
2237 str_buf[j * 3 + 2] =
' ';
#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 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 GT30L32S4W_ADDRESS_7X8_ASCII
#define MANUFACTURER_NAME
#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 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_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)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v