| LibDriver GT30L32S4W 1.0.0 GT30L32S4W full function driver

driver_gt30l32s4w.h
Go to the documentation of this file.
1
37 #ifndef DRIVER_GT30L32S4W_H
38 #define DRIVER_GT30L32S4W_H
39
40 #include <stdio.h>
41 #include <stdint.h>
42 #include <string.h>
43
44 #ifdef __cplusplus
45 extern "C"{
46 #endif
47
62 typedef enum
63 {
64 GT30L32S4W_MODE_READ = 0x03,
65 GT30L32S4W_MODE_FAST_MODE = 0x0B,
66 } gt30l32s4w_mode_t;
67
71 typedef enum
72 {
73 GT30L32S4W_TYPE_12X12_GB2312 = 0x01,
74 GT30L32S4W_TYPE_15X16_GB2312 = 0x02,
75 GT30L32S4W_TYPE_24X24_GB2312 = 0x03,
76 GT30L32S4W_TYPE_32X32_GB2312 = 0x04,
77 GT30L32S4W_TYPE_6X12_GB2312_EX = 0x05,
78 GT30L32S4W_TYPE_6X12_ASCII = 0x06,
79 GT30L32S4W_TYPE_12_ARIAL_ASCII = 0x07,
80 GT30L32S4W_TYPE_12_TIMES_ASCII = 0x08,
81 GT30L32S4W_TYPE_8X16_GB2312_EX = 0x09,
82 GT30L32S4W_TYPE_8X16_ASCII = 0x0A,
83 GT30L32S4W_TYPE_5X7_ASCII = 0x0B,
84 GT30L32S4W_TYPE_7X8_ASCII = 0x0C,
85 GT30L32S4W_TYPE_16_ARIAL_ASCII = 0x0D,
86 GT30L32S4W_TYPE_16_TIMES_ASCII = 0x0E,
87 GT30L32S4W_TYPE_12X24_GB2312_EX = 0x0F,
88 GT30L32S4W_TYPE_12X24_ASCII = 0x10,
89 GT30L32S4W_TYPE_24_ARIAL_ASCII = 0x11,
90 GT30L32S4W_TYPE_24_TIMES_ASCII = 0x12,
91 GT30L32S4W_TYPE_16X32_GB2312_EX = 0x13,
92 GT30L32S4W_TYPE_16X32_ASCII = 0x14,
93 GT30L32S4W_TYPE_32_ARIAL_ASCII = 0x15,
94 GT30L32S4W_TYPE_32_TIMES_ASCII = 0x16,
95 GT30L32S4W_TYPE_8X16_GB2312_SP = 0x17,
96 } gt30l32s4w_type_t;
97
101 typedef struct gt30l32s4w_handle_s
102 {
103 uint8_t (*spi_init)(void);
104 uint8_t (*spi_deinit)(void);
105 uint8_t (*spi_write_read)(uint8_t *in_buf, uint32_t in_len,
106 uint8_t *out_buf, uint32_t out_len);
107 void (*delay_ms)(uint32_t ms);
108 void (*debug_print)(const char *const fmt, ...);
109 uint8_t inited;
110 uint8_t mode;
111 } gt30l32s4w_handle_t;
112
116 typedef struct gt30l32s4w_info_s
117 {
118 char chip_name[32];
119 char manufacturer_name[32];
120 char interface[8];
121 float supply_voltage_min_v;
122 float supply_voltage_max_v;
123 float max_current_ma;
124 float temperature_min;
125 float temperature_max;
126 uint32_t driver_version;
127 } gt30l32s4w_info_t;
128
146 #define DRIVER_GT30L32S4W_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
147
154 #define DRIVER_GT30L32S4W_LINK_SPI_INIT(HANDLE, FUC) (HANDLE)->spi_init = FUC
155
162 #define DRIVER_GT30L32S4W_LINK_SPI_DEINIT(HANDLE, FUC) (HANDLE)->spi_deinit = FUC
163
170 #define DRIVER_GT30L32S4W_LINK_SPI_WRITE_READ(HANDLE, FUC) (HANDLE)->spi_write_read = FUC
171
178 #define DRIVER_GT30L32S4W_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
179
186 #define DRIVER_GT30L32S4W_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
187
207 uint8_t gt30l32s4w_info(gt30l32s4w_info_t *info);
208
219 uint8_t gt30l32s4w_set_mode(gt30l32s4w_handle_t *handle, gt30l32s4w_mode_t mode);
220
231 uint8_t gt30l32s4w_get_mode(gt30l32s4w_handle_t *handle, gt30l32s4w_mode_t *mode);
232
244 uint8_t gt30l32s4w_init(gt30l32s4w_handle_t *handle);
245
256 uint8_t gt30l32s4w_deinit(gt30l32s4w_handle_t *handle);
257
272 uint8_t gt30l32s4w_print_pattern(gt30l32s4w_handle_t *handle, gt30l32s4w_type_t type, uint8_t *buf, uint8_t len);
273
287 uint8_t gt30l32s4w_read_char_12x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[24]);
288
302 uint8_t gt30l32s4w_read_char_15x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[32]);
303
317 uint8_t gt30l32s4w_read_char_24x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[72]);
318
332 uint8_t gt30l32s4w_read_char_32x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[128]);
333
347 uint8_t gt30l32s4w_read_char_extend_6x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[12]);
348
362 uint8_t gt30l32s4w_read_char_extend_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16]);
363
377 uint8_t gt30l32s4w_read_char_special_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16]);
378
392 uint8_t gt30l32s4w_read_char_extend_12x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[48]);
393
407 uint8_t gt30l32s4w_read_char_extend_16x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[64]);
408
422 uint8_t gt30l32s4w_read_ascii_5x7(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[8]);
423
437 uint8_t gt30l32s4w_read_ascii_7x8(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[8]);
438
452 uint8_t gt30l32s4w_read_ascii_6x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[12]);
453
467 uint8_t gt30l32s4w_read_ascii_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16]);
468
482 uint8_t gt30l32s4w_read_ascii_12x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[48]);
483
497 uint8_t gt30l32s4w_read_ascii_16x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[64]);
498
512 uint8_t gt30l32s4w_read_ascii_arial_12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[26]);
513
527 uint8_t gt30l32s4w_read_ascii_times_12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[26]);
528
542 uint8_t gt30l32s4w_read_ascii_arial_16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[34]);
543
557 uint8_t gt30l32s4w_read_ascii_times_16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[34]);
558
572 uint8_t gt30l32s4w_read_ascii_arial_24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[74]);
573
587 uint8_t gt30l32s4w_read_ascii_times_24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[74]);
588
602 uint8_t gt30l32s4w_read_ascii_arial_32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[130]);
603
617 uint8_t gt30l32s4w_read_ascii_times_32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[130]);
618
644 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);
645
654 #ifdef __cplusplus
655 }
656 #endif
657
658 #endif
gt30l32s4w_read_char_extend_8x16
uint8_t gt30l32s4w_read_char_extend_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
read char extend 8x16
Definition: driver_gt30l32s4w.c:582
gt30l32s4w_read_ascii_5x7
uint8_t gt30l32s4w_read_ascii_5x7(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[8])
read ascii 5x7
Definition: driver_gt30l32s4w.c:786
gt30l32s4w_read_ascii_arial_24
uint8_t gt30l32s4w_read_ascii_arial_24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[74])
read ascii arial 24
Definition: driver_gt30l32s4w.c:1266
gt30l32s4w_read_ascii_times_12
uint8_t gt30l32s4w_read_ascii_times_12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[26])
read ascii times 12
Definition: driver_gt30l32s4w.c:1122
gt30l32s4w_read_ascii_arial_32
uint8_t gt30l32s4w_read_ascii_arial_32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[130])
read ascii arial 32
Definition: driver_gt30l32s4w.c:1362
gt30l32s4w_read_char_12x12
uint8_t gt30l32s4w_read_char_12x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[24])
read char 12x12
Definition: driver_gt30l32s4w.c:306
gt30l32s4w_read_char_24x24
uint8_t gt30l32s4w_read_char_24x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[72])
read char 24x24
Definition: driver_gt30l32s4w.c:418
gt30l32s4w_set_mode
uint8_t gt30l32s4w_set_mode(gt30l32s4w_handle_t *handle, gt30l32s4w_mode_t mode)
set mode
Definition: driver_gt30l32s4w.c:251
gt30l32s4w_mode_t
gt30l32s4w_mode_t
gt30l32s4w mode enumeration definition
Definition: driver_gt30l32s4w.h:63
gt30l32s4w_read_char_extend_12x24
uint8_t gt30l32s4w_read_char_extend_12x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[48])
read char extend 12x24
Definition: driver_gt30l32s4w.c:682
gt30l32s4w_read_ascii_times_32
uint8_t gt30l32s4w_read_ascii_times_32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[130])
read ascii times 32
Definition: driver_gt30l32s4w.c:1410
gt30l32s4w_init
uint8_t gt30l32s4w_init(gt30l32s4w_handle_t *handle)
initialize the chip
Definition: driver_gt30l32s4w.c:141
gt30l32s4w_read_char_extend_6x12
uint8_t gt30l32s4w_read_char_extend_6x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[12])
read char extend 6x12
Definition: driver_gt30l32s4w.c:530
gt30l32s4w_info_t
struct gt30l32s4w_info_s gt30l32s4w_info_t
gt30l32s4w information structure definition
gt30l32s4w_read_ascii_16x32
uint8_t gt30l32s4w_read_ascii_16x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[64])
read ascii 16x32
Definition: driver_gt30l32s4w.c:1026
gt30l32s4w_deinit
uint8_t gt30l32s4w_deinit(gt30l32s4w_handle_t *handle)
close the chip
Definition: driver_gt30l32s4w.c:219
gt30l32s4w_read_char_extend_16x32
uint8_t gt30l32s4w_read_char_extend_16x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[64])
read char extend 16x32
Definition: driver_gt30l32s4w.c:734
gt30l32s4w_read_ascii_times_24
uint8_t gt30l32s4w_read_ascii_times_24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[74])
read ascii times 24
Definition: driver_gt30l32s4w.c:1314
gt30l32s4w_info
uint8_t gt30l32s4w_info(gt30l32s4w_info_t *info)
get chip's information
Definition: driver_gt30l32s4w.c:2290
gt30l32s4w_read_ascii_12x24
uint8_t gt30l32s4w_read_ascii_12x24(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[48])
read ascii 12x24
Definition: driver_gt30l32s4w.c:978
gt30l32s4w_print_pattern
uint8_t gt30l32s4w_print_pattern(gt30l32s4w_handle_t *handle, gt30l32s4w_type_t type, uint8_t *buf, uint8_t len)
print pattern
Definition: driver_gt30l32s4w.c:1459
gt30l32s4w_read_char_15x16
uint8_t gt30l32s4w_read_char_15x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[32])
read char 15x16
Definition: driver_gt30l32s4w.c:362
gt30l32s4w_read_char_special_8x16
uint8_t gt30l32s4w_read_char_special_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
read char special 8x16
Definition: driver_gt30l32s4w.c:634
gt30l32s4w_read_ascii_6x12
uint8_t gt30l32s4w_read_ascii_6x12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[12])
read ascii 6x12
Definition: driver_gt30l32s4w.c:882
gt30l32s4w_read_ascii_arial_16
uint8_t gt30l32s4w_read_ascii_arial_16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[34])
read ascii arial 16
Definition: driver_gt30l32s4w.c:1170
gt30l32s4w_read_ascii_7x8
uint8_t gt30l32s4w_read_ascii_7x8(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[8])
read ascii 7x8
Definition: driver_gt30l32s4w.c:834
gt30l32s4w_type_t
gt30l32s4w_type_t
gt30l32s4w type enumeration definition
Definition: driver_gt30l32s4w.h:72
gt30l32s4w_handle_t
struct gt30l32s4w_handle_s gt30l32s4w_handle_t
gt30l32s4w handle structure definition
gt30l32s4w_read_ascii_times_16
uint8_t gt30l32s4w_read_ascii_times_16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[34])
read ascii times 16
Definition: driver_gt30l32s4w.c:1218
gt30l32s4w_read_ascii_arial_12
uint8_t gt30l32s4w_read_ascii_arial_12(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[26])
read ascii arial 12
Definition: driver_gt30l32s4w.c:1074
gt30l32s4w_read_ascii_8x16
uint8_t gt30l32s4w_read_ascii_8x16(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[16])
read ascii 8x16
Definition: driver_gt30l32s4w.c:930
gt30l32s4w_get_mode
uint8_t gt30l32s4w_get_mode(gt30l32s4w_handle_t *handle, gt30l32s4w_mode_t *mode)
get mode
Definition: driver_gt30l32s4w.c:277
gt30l32s4w_read_char_32x32
uint8_t gt30l32s4w_read_char_32x32(gt30l32s4w_handle_t *handle, uint16_t ch, uint8_t buf[128])
read char 32x32
Definition: driver_gt30l32s4w.c:474
GT30L32S4W_MODE_READ
@ GT30L32S4W_MODE_READ
Definition: driver_gt30l32s4w.h:64
GT30L32S4W_MODE_FAST_MODE
@ GT30L32S4W_MODE_FAST_MODE
Definition: driver_gt30l32s4w.h:65
GT30L32S4W_TYPE_24X24_GB2312
@ GT30L32S4W_TYPE_24X24_GB2312
Definition: driver_gt30l32s4w.h:75
GT30L32S4W_TYPE_6X12_ASCII
@ GT30L32S4W_TYPE_6X12_ASCII
Definition: driver_gt30l32s4w.h:78
GT30L32S4W_TYPE_12_TIMES_ASCII
@ GT30L32S4W_TYPE_12_TIMES_ASCII
Definition: driver_gt30l32s4w.h:80
GT30L32S4W_TYPE_12X12_GB2312
@ GT30L32S4W_TYPE_12X12_GB2312
Definition: driver_gt30l32s4w.h:73
GT30L32S4W_TYPE_12_ARIAL_ASCII
@ GT30L32S4W_TYPE_12_ARIAL_ASCII
Definition: driver_gt30l32s4w.h:79
GT30L32S4W_TYPE_32_ARIAL_ASCII
@ GT30L32S4W_TYPE_32_ARIAL_ASCII
Definition: driver_gt30l32s4w.h:93
GT30L32S4W_TYPE_8X16_GB2312_EX
@ GT30L32S4W_TYPE_8X16_GB2312_EX
Definition: driver_gt30l32s4w.h:81
GT30L32S4W_TYPE_32_TIMES_ASCII
@ GT30L32S4W_TYPE_32_TIMES_ASCII
Definition: driver_gt30l32s4w.h:94
GT30L32S4W_TYPE_16X32_ASCII
@ GT30L32S4W_TYPE_16X32_ASCII
Definition: driver_gt30l32s4w.h:92
GT30L32S4W_TYPE_7X8_ASCII
@ GT30L32S4W_TYPE_7X8_ASCII
Definition: driver_gt30l32s4w.h:84
GT30L32S4W_TYPE_16_TIMES_ASCII
@ GT30L32S4W_TYPE_16_TIMES_ASCII
Definition: driver_gt30l32s4w.h:86
GT30L32S4W_TYPE_12X24_ASCII
@ GT30L32S4W_TYPE_12X24_ASCII
Definition: driver_gt30l32s4w.h:88
GT30L32S4W_TYPE_16X32_GB2312_EX
@ GT30L32S4W_TYPE_16X32_GB2312_EX
Definition: driver_gt30l32s4w.h:91
GT30L32S4W_TYPE_24_TIMES_ASCII
@ GT30L32S4W_TYPE_24_TIMES_ASCII
Definition: driver_gt30l32s4w.h:90
GT30L32S4W_TYPE_8X16_ASCII
@ GT30L32S4W_TYPE_8X16_ASCII
Definition: driver_gt30l32s4w.h:82
GT30L32S4W_TYPE_16_ARIAL_ASCII
@ GT30L32S4W_TYPE_16_ARIAL_ASCII
Definition: driver_gt30l32s4w.h:85
GT30L32S4W_TYPE_24_ARIAL_ASCII
@ GT30L32S4W_TYPE_24_ARIAL_ASCII
Definition: driver_gt30l32s4w.h:89
GT30L32S4W_TYPE_12X24_GB2312_EX
@ GT30L32S4W_TYPE_12X24_GB2312_EX
Definition: driver_gt30l32s4w.h:87
GT30L32S4W_TYPE_8X16_GB2312_SP
@ GT30L32S4W_TYPE_8X16_GB2312_SP
Definition: driver_gt30l32s4w.h:95
GT30L32S4W_TYPE_15X16_GB2312
@ GT30L32S4W_TYPE_15X16_GB2312
Definition: driver_gt30l32s4w.h:74
GT30L32S4W_TYPE_32X32_GB2312
@ GT30L32S4W_TYPE_32X32_GB2312
Definition: driver_gt30l32s4w.h:76
GT30L32S4W_TYPE_6X12_GB2312_EX
@ GT30L32S4W_TYPE_6X12_GB2312_EX
Definition: driver_gt30l32s4w.h:77
GT30L32S4W_TYPE_5X7_ASCII
@ GT30L32S4W_TYPE_5X7_ASCII
Definition: driver_gt30l32s4w.h:83
gt30l32s4w_get_reg
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
Definition: driver_gt30l32s4w.c:2268
gt30l32s4w_handle_s
gt30l32s4w handle structure definition
Definition: driver_gt30l32s4w.h:102
gt30l32s4w_handle_s::spi_write_read
uint8_t(* spi_write_read)(uint8_t *in_buf, uint32_t in_len, uint8_t *out_buf, uint32_t out_len)
Definition: driver_gt30l32s4w.h:105
gt30l32s4w_handle_s::inited
uint8_t inited
Definition: driver_gt30l32s4w.h:109
gt30l32s4w_handle_s::spi_init
uint8_t(* spi_init)(void)
Definition: driver_gt30l32s4w.h:103
gt30l32s4w_handle_s::mode
uint8_t mode
Definition: driver_gt30l32s4w.h:110
gt30l32s4w_handle_s::delay_ms
void(* delay_ms)(uint32_t ms)
Definition: driver_gt30l32s4w.h:107
gt30l32s4w_handle_s::debug_print
void(* debug_print)(const char *const fmt,...)
Definition: driver_gt30l32s4w.h:108
gt30l32s4w_handle_s::spi_deinit
uint8_t(* spi_deinit)(void)
Definition: driver_gt30l32s4w.h:104
gt30l32s4w_info_s
gt30l32s4w information structure definition
Definition: driver_gt30l32s4w.h:117
gt30l32s4w_info_s::temperature_max
float temperature_max
Definition: driver_gt30l32s4w.h:125
gt30l32s4w_info_s::supply_voltage_max_v
float supply_voltage_max_v
Definition: driver_gt30l32s4w.h:122
gt30l32s4w_info_s::driver_version
uint32_t driver_version
Definition: driver_gt30l32s4w.h:126
gt30l32s4w_info_s::temperature_min
float temperature_min
Definition: driver_gt30l32s4w.h:124
gt30l32s4w_info_s::max_current_ma
float max_current_ma
Definition: driver_gt30l32s4w.h:123
gt30l32s4w_info_s::manufacturer_name
char manufacturer_name[32]
Definition: driver_gt30l32s4w.h:119
gt30l32s4w_info_s::supply_voltage_min_v
float supply_voltage_min_v
Definition: driver_gt30l32s4w.h:121
gt30l32s4w_info_s::interface
char interface[8]
Definition: driver_gt30l32s4w.h:120
gt30l32s4w_info_s::chip_name
char chip_name[32]
Definition: driver_gt30l32s4w.h:118