HG1286416
' z, ?# W8 K. P128×64点阵;. G5 j) j$ q% Z# [% h
模块尺寸: 54.0×50.0mm;
4 `' ^9 i0 v" Y5 l3 a显示尺寸:43.5×29.0mm;2 |# f( ^' j8 j+ z( P! f7 X
3.3V工作;控制器为SBN0064G 兼容KS0108(不带字库)) c' ` j* w/ J' L' A, x% S3 \, l5 Z4 S0 I
http://www.chinalcdmodule.com/3.3v-lcd-module---hg1286416.html
) y8 o( C# k U7 \$ L2 mhttp://www.chinalcdmodule.com/upfiles/HG1286416.pdf) m# @4 M" L+ \: m; \
1.12*16字体未开发9 O' y$ Z' f ]
2.24*14字体未开发( H, M# A( y; a
- static u8 *FindGBChar(u8 *str)
# ~/ M" i! ?1 a% L/ D - {9 N& r3 [8 B5 ^5 B* N
- u16 i;
5 ^# P8 _' t/ h5 F6 E - u16 gbcharNum=25; //动态结构体数组中汉字的个数
) O1 @% }9 q7 d; o8 S) w - //求结构体数组元素个数的方法:(sizeof(GBCHR_16))/(sizeof(GBCHR)),但编译器报错
- k. y) @2 [6 M. I* O# J4 e2 E, @ - for(i=1; i<gbcharNum; i++)
$ o6 r. i5 q! [. G1 F - {
, N/ K* Z& Z% W0 ~ - if(*str==GBCHR_16[i].chr[0] && *(str+1)==GBCHR_16[i].chr[1]). B/ v, @9 x. P& E5 [
- return (u8 *)GBCHR_16[i].dataTab;; c; t0 v) S" n5 }( D7 N
- }
6 C2 b+ i7 x1 o3 x - return (u8 *)GBCHR_16[0].dataTab; //字库中没有要找的字,则返回第一个字模
" O2 D/ D# V0 u6 v - }6 W& S4 i" E+ _: w$ n
- 8 g- [+ X0 d8 ^$ ?, I* k" m
- 1 \# O& G0 s$ u% N
- /*******************************************************************************3 B$ d& d) i1 }# \# F
- * 函数名:LCD_print_1632Num
- i+ F( j& L' I - * 说明:液晶字符输出字符(16*32字体)
6 P, J# l# g" Z) s - row: 0,1,2,3,4(5 lines cross)
$ [/ V2 b+ e/ ], N - column: 0~127(列) column=iner_column*16
- }. H. H' [# P- V - * 输入参数:reverse=0:common display reverse=1: reverse disp' V; h2 o8 B! S+ D, c3 S; ^, X+ r/ d
- * 输出参数:
l+ \9 w, E% ? - *******************************************************************************/
g* U. j+ L% j5 |4 n - void LCD_print_1632Num(unsigned char row, unsigned char column, u8 num,u8 reverse)& m/ e* b& Z& m1 h
- {
0 {; e5 }& z+ \! V M - DispScreen(16,32,row,column,digitalTab1_16x32[num], reverse);
$ t( u* o4 y) k: A5 J: N" i - }
9 d3 u9 i3 _3 A; a$ Z8 n* x - ( a" v5 f! A. A6 [
0 ]# Q1 \' z B o$ [- y# F7 y8 |: S- /*******************************************************************************
9 d8 G- X0 D8 Z/ _1 n - * 函数名:LCD_print_1616CNChar
+ i% y4 x! \9 j; ^1 W - * 说明:液晶字符输出汉字(16*16)
9 V4 U5 x: [- W& y @$ B" A - row: 0,2,4,6(4 lines) row*2=page(0~7),) @8 |9 \- `2 T8 H$ a
- column: 0~127(列) column=iner_column*16 每行最多显示8个1616汉字 0 N2 V! O- v, w, h4 |
- * 输入参数:reverse=0:common display reverse=1: reverse disp8 X# G+ L9 j3 Y5 v
- * 输出参数:
' O! C1 I' \: D t) i P9 a - *******************************************************************************/3 j* Y+ O. q, \: |9 v
- void LCD_print_1616CNChar(unsigned char row, unsigned char column, u8 *str,u8 reverse)# X4 g' Z, I0 u. P; |# `
- {
8 y$ V8 W) {/ K- O8 J6 s - while(*str!='\0')
: R* g! ^& j+ a0 k& h" Q - {
: J0 M5 c5 @1 L' f: z* d4 T5 D - DispScreen(16,16,row,column,FindGBChar(str), reverse);
- T0 }6 c, F9 |/ C0 j - str+=2;
( \% N3 D. [3 X% I7 k - column+=16; * i: q; B* P7 m) z/ l0 I
- }
+ i/ W, B& Y- w8 B) O! I -
) X, [4 F; K& E% q; t) A% u - }7 S7 f* F$ G! l1 w
- " s3 G' A+ o, ]7 T$ d- }
- //结构体数组+ k: C9 ?( A9 p! ~4 u( |
- //取码规则:PCtoLCD2002,(逆向)低位在前, 列行扫描, 阴码(1-亮, 0-灭)
/ _% E& B" T7 @$ g4 B - //LcmZimo.exe:从左到右从上到下,纵向8点下高位* q7 s* V. j8 t! v8 @
- const GBCHR GBCHR_16[] =3 \5 b/ M% S7 l: p! X( z
- {
) G1 C! D5 Y6 I9 U0 c4 J" D
8 s/ B/ i# `/ {# P) `; h- Q" {- 0x00,0x00, /*每个汉字内码占用2字节,备用,移植时无需改动*/
. r( x) U8 m6 Q0 k; `: {5 V* | - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
& \: f! Z1 J: T0 H" k: O1 d8 g - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 y2 v2 L! l Y: P" _
- 0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,
" a: @8 J% {$ _2 z - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/ T+ E, {8 ^& U! N -
- ]" G6 z+ g6 O O- h9 D( B - "自", 0x00,0x00,0x00,0xF8,0x48,0x4C,0x4A,0x49,0x48,0x48,0x48,0xFC,0x08,0x00,0x00,0x00,
: z$ _& z+ f9 Y7 Z# t5 {1 L - 0x00,0x00,0x00,0xFF,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0xFF,0x00,0x00,0x00,0x00,
* e8 Y' |; Y2 p2 I - * E( F$ g: G6 K6 |
- "手", 0x00,0x04,0x24,0x24,0x24,0x24,0x24,0xFC,0x22,0x22,0x22,0x33,0x22,0x00,0x00,0x00,
7 d: @; B7 y2 L' |' i. v3 N, y - 0x02,0x02,0x02,0x02,0x02,0x42,0x82,0x7F,0x02,0x02,0x02,0x02,0x02,0x03,0x02,0x00,
7 Q+ D' q5 t2 a - 2 y" E& S0 m5 ?2 {) p" u1 b
- "动", 0x20,0x24,0x24,0xE4,0x26,0x34,0x20,0x10,0x10,0xFF,0x10,0x10,0x10,0xF8,0x10,0x00,
& X0 B+ r# P' L! b' y - 0x08,0x1C,0x0B,0x08,0x08,0x8A,0x4C,0x30,0x0C,0x03,0x40,0x80,0x40,0x3F,0x00,0x00,/ `8 e/ Y3 F [4 i' u
- & m8 o/ _% Y. g
- "模", 0x10,0x10,0xD0,0xFF,0x94,0x14,0xE4,0xBF,0xA4,0xA4,0xA4,0xBF,0xF4,0x26,0x04,0x00,1 k/ H* [: l0 Y6 D: G, p; V( y
- 0x04,0x03,0x00,0xFF,0x08,0x89,0x8B,0x4A,0x2A,0x1E,0x2A,0x2A,0x4B,0xC8,0x48,0x00,5 V; c! h& P& z1 C0 Z' w
; I$ Y% v8 \2 j- "式", 0x10,0x10,0x90,0x90,0x90,0x90,0x90,0x10,0xFF,0x10,0x12,0x14,0x10,0x18,0x10,0x00,
9 F0 M4 S1 E3 M2 w% a) k2 C - 0x00,0x20,0x60,0x20,0x1F,0x10,0x10,0x08,0x01,0x06,0x18,0x20,0x40,0x80,0x70,0x00,
$ L. [) P+ ^. l R
& G8 Z' f* k; r' O# Z" l/ M6 Z- "开", 0x80,0x82,0x82,0x82,0xFE,0x82,0x82,0x82,0x82,0x82,0xFE,0x82,0x83,0xC2,0x80,0x00,$ U" g$ J7 S( _" b
- 0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,
* `4 M- Z( G. B+ b) t$ Z
7 F+ U* u$ x, h. o) q- "启", 0x00,0x00,0x00,0xFC,0x44,0x44,0x44,0x45,0x46,0x44,0x44,0x44,0x44,0x7E,0x04,0x00,% j; _4 c4 k% t+ f
- 0x40,0x20,0x18,0x07,0xFE,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xFF,0x02,0x00,
5 Y' D* e0 X) f: f/ N4 p0 z7 f0 Z! W
/ R4 |3 O3 N$ C0 J- "关", 0x00,0x10,0x10,0x11,0x12,0x1C,0x10,0xF0,0x10,0x18,0x14,0x13,0x1A,0x90,0x00,0x00,# }' r9 T: a3 J) \: O
- 0x81,0x81,0x41,0x41,0x21,0x11,0x0D,0x03,0x0D,0x11,0x21,0x21,0x41,0xC1,0x41,0x00,
/ @0 Y% a9 J ~+ Z8 s! V: w& F0 i - ' {- _ p; Z( ~8 q6 G
- "闭", 0x00,0xF8,0x01,0x22,0x26,0x20,0x22,0xA2,0xFA,0x22,0x32,0x22,0x02,0xFF,0x02,0x00,
/ x, v9 C. [% n# ~ - 0x00,0xFF,0x00,0x08,0x04,0x02,0x21,0x40,0x3F,0x00,0x00,0x40,0x80,0x7F,0x00,0x00% o4 h; m5 g T1 u2 q: G+ l
- //<- end # w, R( } e+ A$ d
- };
& F) I. D* q: q
复制代码
) E9 Y! L+ O- n( j
3 X+ P- ~! @. N* y$ I3 V1 V) c8 g. t0 ~1 x. b" G8 Y" Y
|
bsp_lcd12864.c! @: v, }( Y( f# N
bsp_lcd12864.h: N6 x: R2 F& G& ~ l0 y; E9 t) i- N
font.c/ D; A# v, S* q: K8 [1 d
阅读权限: 10
LCD12864,工厂里的机器上用的较多~