Driver For ST7565P LCD

研究了一下 ST7565P 液晶显示芯片,现把研究心得贴出来,希望对有需求的朋友有所帮助!
该芯片支持,并口和串口两种方式,并口方式又分为6800时序和8080时序。
本程序实现8080时序并口方式。
显示的时候,需要程序自己提供字模数据。
1页为8行象素。
具体的硬件连接,参看原代码。
原代码:
-----

 1#ifndef _LCM_ST7565P_H
 2#define _LCM_ST7565P_H
 3
 4
 5#include <iom8v.h>
 6#include <macros.h>
 7
 8/***********************************************************************
 9CPU  = ATmega8L
10晶振 = 4MHz
11
128080时序连接
13-----------
14PORTC_5    - CS1
15PORTC_0    - BL_K
16
17PORTD_7 - _RD_E
18PORTD_6 - _WR_RW
19PORTD_5 - A0
20PORTD_4 - RES
21
22PORTB   - DB
23************************************************************************/

24
25// Type define
26typedef unsigned char BYTE;
27typedef unsigned int UINT;
28typedef unsigned char BOOL;
29
30#define TRUE    0x01
31#define FALSE    0x00
32
33// Macros define
34#define DB_PORT            (PORTB)
35#define DB_PIN            (PINB)
36#define DB_SET_OUT        (DDRB = 0xFF)
37#define DB_SET_IN        (DDRB = 0x00)
38#define A0_SET            (PORTD |= (1 << 5))    // Data
39#define A0_CLR            (PORTD &= ~(1 << 5))    // Command
40#define _WR_RW_SET        (PORTD |= (1 << 6))    // Read Enable
41#define _WR_RW_CLR        (PORTD &= ~(1 << 6))    // Write Enable
42#define _RD_E_SET        (PORTD |= (1 << 7))
43#define _RD_E_CLR        (PORTD &= ~(1 << 7))
44#define CS1_SET            (PORTC |= (1 << 5))
45#define CS1_CLR            (PORTC &= ~(1 << 5))
46#define RESET_SET_OUT    (DDRD |= (1 << 4))
47#define RESET_SET        (PORTD |= (1 << 4))
48#define RESET_CLR        (PORTD &= ~(1 << 4))
49#define BACK_LIGHT_SET    (PORTC |= (1 << 0))
50#define BACK_LIGHT_CLR    (PORTC &= (1 << 0))
51
52// Commands
53#define CMD_DISPLAY_ON                0xAF
54#define CMD_POWER_CONTROL_SET        0x2F
55#define CMD_V0                        0x20
56#define CMD_DISPLAY_ALL_POINTS_ON    0xA5
57#define CMD_DISPLAY_ALL_POINTS_OFF    0xA4
58#define CMD_COM_OUTPUT_MODE_SET        0xC8    // reverse direction
59#define CMD_PAGE                    0xB0
60#define CMD_COLUMN_HI                0x10
61#define CMD_COLUMN_LO                0x00
62
63// Screen Size 32(rows) * 128(columns)
64#define MAX_PAGES    32/8
65#define MAX_COLUMN    128
66
67#define Delay_1us() { asm("nop"); asm("nop"); asm("nop"); asm("nop"); }
68
69// 内部辅助函式
70void CheckBusy(void);
71void WriteCommand(BYTE byCommand);
72void WriteData(BYTE byData);
73
74// 16 *16, Chinese
75// 每个汉字占 2 Pages, 16 Columns
76void Display_CHS(BYTE byPage, BYTE byCol, BYTE* pbyChar, UINT nLen);
77
78// 8(H) * 16(V), English
79// 每个字母(数字)占 2 Pages, 8 Columns
80void Display_En(BYTE byPage, BYTE byCol, BYTE* pbyChar, UINT nLen);
81void Display_Text(BOOL bEn, BYTE byPage, BYTE byCol, BYTE* pbyChar, UINT nLen);
82
83
84// 外部接口函式
85void LCM_Delay_us(UINT nTime);
86void LCM_InitPort(void);
87void LCM_Init(void);
88// Clear Screen
89void LCM_Clear(void);
90// Display String
91void LCM_Display(BYTE byPage, BYTE byCol, char* pstrText);
92
93#endif
94

 

  1#include "LCM_ST7565P.h"
  2
  3const BYTE g_byASCII[];
  4
  5void LCM_Delay_us(UINT nTime)
  6{
  7    do 
  8    {
  9        Delay_1us();
 10    }
 while (nTime--);
 11
 12    return;
 13}

 14
 15void LCM_InitPort(void)
 16{
 17    PORTD = 0x00;
 18    DDRD = 0xFF;
 19    PORTB = 0x00;
 20    DDRB = 0xFF;        
 21    PORTC = 0x00;
 22    DDRC = 0xFF;
 23
 24    CS1_SET;
 25    A0_SET;
 26    _WR_RW_SET;
 27    _RD_E_SET;
 28    RESET_SET;
 29    BACK_LIGHT_CLR;
 30
 31    return;
 32}

 33
 34void CheckBusy(void)
 35{
 36    CS1_CLR;
 37    A0_CLR;
 38    _WR_RW_SET;
 39    asm("nop");
 40    asm("nop");
 41    _RD_E_CLR;
 42    asm("nop");
 43    asm("nop");
 44    DB_SET_IN;    
 45    while (DB_PIN & 0x80)
 46    {
 47        ;
 48    }

 49
 50    _RD_E_SET;
 51    CS1_SET;
 52
 53    return;
 54}

 55
 56void WriteCommand(BYTE byCommand)
 57{
 58    CheckBusy();
 59
 60    CS1_CLR;
 61    A0_CLR;    
 62    _RD_E_SET;
 63    asm("nop");
 64    asm("nop");
 65    _WR_RW_CLR;
 66    DB_SET_OUT;
 67    DB_PORT = byCommand;
 68    asm("nop");
 69    asm("nop");
 70    _WR_RW_SET;
 71    CS1_SET;
 72
 73    return;
 74}

 75
 76void WriteData(BYTE byData)
 77{
 78    CheckBusy();
 79
 80    CS1_CLR;
 81    A0_SET;
 82    _RD_E_SET;
 83    _WR_RW_CLR;
 84    asm("nop");
 85    asm("nop");
 86    DB_SET_OUT;
 87    DB_PORT = byData;
 88    asm("nop");
 89    asm("nop");
 90    _WR_RW_SET;
 91    CS1_SET;
 92
 93    return;
 94}

 95
 96void LCM_Init(void)
 97{    
 98    WriteCommand(CMD_DISPLAY_ON);
 99    WriteCommand(CMD_POWER_CONTROL_SET);
100    WriteCommand(CMD_V0);
101    WriteCommand(CMD_DISPLAY_ALL_POINTS_OFF);
102    WriteCommand(CMD_COM_OUTPUT_MODE_SET);
103
104    return;
105}

106
107// Clear Screen
108void LCM_Clear(void)
109{
110    UINT nPage, nColumn;
111
112    for (nPage = 0; nPage < MAX_PAGES; nPage++)
113    {
114        // Set Page Address
115        WriteCommand(CMD_PAGE | nPage);
116
117        // Set Column Address = 0
118        WriteCommand(CMD_COLUMN_HI | 0x00);
119        WriteCommand(CMD_COLUMN_LO | 0x00);    
120
121        for (nColumn = 0; nColumn < MAX_COLUMN; nColumn++)
122        {
123            WriteData(0x00);
124        }

125    }

126
127    return;
128}

129
130
131// 16 *16, Chinese
132// 每个汉字占 2 Pages, 16 Columns
133void Display_CHS(BYTE byPage, BYTE byCol, BYTE* pbyChar, UINT nLen)
134{
135    BYTE i = 0;
136    BYTE j = 0;
137    BYTE k = 0;
138    BYTE* pData = pbyChar;
139    BYTE byCount = nLen / 32;    // Chinese Count
140
141    for (k = 0; k < byCount; k++)
142    {
143
144        for (i = 0; i < 2; i++)
145        {
146            // Position
147            WriteCommand(CMD_PAGE | (byPage+i));
148            WriteCommand(CMD_COLUMN_HI | (((byCol+16*k) >> 4& 0x0F));
149            WriteCommand(CMD_COLUMN_LO | ((byCol+16*k) & 0x0F));
150
151            // Data
152            for (j = 0; j < 16; j++)
153            {
154                WriteData(*pData++);
155            }

156        }

157    }

158
159    return;
160}

161
162
163// 8(H) * 16(V), English
164// 每个字母(数字)占 2 Pages, 8 Columns
165void Display_En(BYTE byPage, BYTE byCol, BYTE* pbyChar, UINT nLen)
166{
167    BYTE i = 0;
168    BYTE j = 0;
169    BYTE k = 0;
170    BYTE* pData = pbyChar;
171    BYTE byCount = nLen / 16;    // English Count
172
173    for (k = 0; k < byCount; k++)
174    {
175        for (i = 0; i < 2; i++)
176        {
177            // Position
178            WriteCommand(CMD_PAGE | (byPage+i));
179            WriteCommand(CMD_COLUMN_HI | (((byCol+8*k) >> 4& 0x0F));
180            WriteCommand(CMD_COLUMN_LO | ((byCol+8*k) & 0x0F));
181
182            // Data
183            for (j = 0; j < 8; j++)
184            {
185                WriteData(*pData++);
186            }

187        }

188    }

189
190    return;
191}

192
193void Display_Text(BOOL bEn, BYTE byPage, BYTE byCol, BYTE* pbyChar, UINT nLen)
194{
195    if (bEn)
196    {
197        // English
198        Display_En(byPage, byCol, pbyChar, nLen);
199    }
 
200    else
201    {
202        // Chinese
203        Display_CHS(byPage, byCol, pbyChar, nLen);
204    }
        
205
206    return;
207}

208
209
210
211// Display String
212void LCM_Display(BYTE byPage, BYTE byCol, char* pstrText)
213{
214    // First Organize Data
215    BYTE i = 0;
216    BYTE j = 0;
217    BYTE byData[16];
218    char* pData = pstrText;
219    
220    while (*pData != '\0')
221    {
222        char cElem = *pData;
223        BYTE byIndex = 0;
224
225        if (cElem >= '0' && cElem <= '9')
226        {
227            byIndex = cElem - 0x20 - 14;
228        }

229        else if (cElem >= 'A' && cElem <= 'Z')
230        {
231            byIndex = cElem - 0x20 - 14 - 0x07;
232        }
 
233        else if (cElem == 0x20)
234        {
235            byIndex = cElem - 0x20;
236        }

237        else if (cElem == '.')
238        {
239            byIndex = 0x01;
240        }

241        else
242        {
243            // Error
244            return;
245        }
    
246        
247        for (i = 0; i < 16; i++)
248        {
249            byData[i] = g_byASCII[byIndex*16+i];
250        }

251        BACK_LIGHT_SET;
252        Display_Text(TRUE, byPage, byCol+8*j, byData, 16); // 一个字符一个字符的显示
253        
254        j++;
255        pData++;
256    }

257
258    // Display
259    //Display_Text(TRUE, byPage, byCol, g_byData, g_byCount);        
260
261    return;
262}

263
264// 宽 * 高 = 8 * 16
265const BYTE g_byASCII[] = 
266{
267    /*     */
268    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
269
270    ///*!    */
271    //0x00,0x00,0x38,0xFC,0xFC,0x38,0x00,0x00,0x00,0x00,0x00,0x0D,0x0D,0x00,0x00,0x00,
272
273    ///*"    */
274    //0x00,0x0E,0x1E,0x00,0x00,0x1E,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
275
276    ///*#    */
277    //0x20,0xF8,0xF8,0x20,0xF8,0xF8,0x20,0x00,0x02,0x0F,0x0F,0x02,0x0F,0x0F,0x02,0x00,
278
279    ///*$    */
280    //0x38,0x7C,0x44,0x47,0x47,0xCC,0x98,0x00,0x03,0x06,0x04,0x1C,0x1C,0x07,0x03,0x00,
281
282    ///*%    */
283    //0x30,0x30,0x00,0x80,0xC0,0x60,0x30,0x00,0x0C,0x06,0x03,0x01,0x00,0x0C,0x0C,0x00,
284
285    ///*&    */
286    //0x80,0xD8,0x7C,0xE4,0xBC,0xD8,0x40,0x00,0x07,0x0F,0x08,0x08,0x07,0x0F,0x08,0x00,
287
288    ///*'    */
289    //0x00,0x10,0x1E,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
290
291    ///*(    */
292    //0x00,0x00,0xF0,0xF8,0x0C,0x04,0x00,0x00,0x00,0x00,0x03,0x07,0x0C,0x08,0x00,0x00,
293
294    ///*)    */
295    //0x00,0x00,0x04,0x0C,0xF8,0xF0,0x00,0x00,0x00,0x00,0x08,0x0C,0x07,0x03,0x00,0x00,
296
297    ///**    */
298    //0x80,0xA0,0xE0,0xC0,0xC0,0xE0,0xA0,0x80,0x00,0x02,0x03,0x01,0x01,0x03,0x02,0x00,
299
300    ///*+    */
301    //0x00,0x80,0x80,0xE0,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x03,0x03,0x00,0x00,0x00,
302
303    ///*,    */
304    //0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x1E,0x0E,0x00,0x00,0x00,
305
306    ///*-    */
307    //0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
308
309    /*. point  */
310    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x0C,0x00,0x00,0x00,
311
312    ///*/    */
313    //0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x00,0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,
314
315    /*0    */
316    0xF8,0xFC,0x04,0xC4,0x24,0xFC,0xF8,0x00,0x07,0x0F,0x09,0x08,0x08,0x0F,0x07,0x00,
317
318    /*1    */
319    0x00,0x10,0x18,0xFC,0xFC,0x00,0x00,0x00,0x00,0x08,0x08,0x0F,0x0F,0x08,0x08,0x00,
320
321    /*2    */
322    0x08,0x0C,0x84,0xC4,0x64,0x3C,0x18,0x00,0x0E,0x0F,0x09,0x08,0x08,0x0C,0x0C,0x00,
323
324    /*3    */
325    0x08,0x0C,0x44,0x44,0x44,0xFC,0xB8,0x00,0x04,0x0C,0x08,0x08,0x08,0x0F,0x07,0x00,
326
327    /*4    */
328    0xC0,0xE0,0xB0,0x98,0xFC,0xFC,0x80,0x00,0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,
329
330    /*5    */
331    0x7C,0x7C,0x44,0x44,0xC4,0xC4,0x84,0x00,0x04,0x0C,0x08,0x08,0x08,0x0F,0x07,0x00,
332
333    /*6    */
334    0xF0,0xF8,0x4C,0x44,0x44,0xC0,0x80,0x00,0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,
335
336    /*7    */
337    0x0C,0x0C,0x04,0x84,0xC4,0x7C,0x3C,0x00,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,0x00,
338
339    /*8    */
340    0xB8,0xFC,0x44,0x44,0x44,0xFC,0xB8,0x00,0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,
341
342    /*9    */
343    0x38,0x7C,0x44,0x44,0x44,0xFC,0xF8,0x00,0x00,0x08,0x08,0x08,0x0C,0x07,0x03,0x00,
344
345    ///*:    */
346    //0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x00,0x00,0x00,
347
348    ///*;    */
349    //0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x08,0x0E,0x06,0x00,0x00,0x00,
350
351    ///*<    */
352    //0x00,0x80,0xC0,0x60,0x30,0x18,0x08,0x00,0x00,0x00,0x01,0x03,0x06,0x0C,0x08,0x00,
353
354    ///*=    */

355    //0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,
356
357    ///*>    */
358    //0x00,0x08,0x18,0x30,0x60,0xC0,0x80,0x00,0x00,0x08,0x0C,0x06,0x03,0x01,0x00,0x00,
359
360    ///*?    */
361    //0x18,0x1C,0x04,0xC4,0xE4,0x3C,0x18,0x00,0x00,0x00,0x00,0x0D,0x0D,0x00,0x00,0x00,
362
363    ///*@    */
364    //0xF0,0xF8,0x08,0xC8,0xC8,0xF8,0xF0,0x00,0x07,0x0F,0x08,0x0B,0x0B,0x0B,0x01,0x00,
365
366    /*A    */
367    0xE0,0xF0,0x98,0x8C,0x98,0xF0,0xE0,0x00,0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,
368
369    /*B    */
370    0x04,0xFC,0xFC,0x44,0x44,0xFC,0xB8,0x00,0x08,0x0F,0x0F,0x08,0x08,0x0F,0x07,0x00,
371
372    /*C    */
373    0xF0,0xF8,0x0C,0x04,0x04,0x0C,0x18,0x00,0x03,0x07,0x0C,0x08,0x08,0x0C,0x06,0x00,
374
375    /*D    */
376    0x04,0xFC,0xFC,0x04,0x0C,0xF8,0xF0,0x00,0x08,0x0F,0x0F,0x08,0x0C,0x07,0x03,0x00,
377
378    /*E    */
379    0x04,0xFC,0xFC,0x44,0xE4,0x0C,0x1C,0x00,0x08,0x0F,0x0F,0x08,0x08,0x0C,0x0E,0x00,
380
381    /*F    */
382    0x04,0xFC,0xFC,0x44,0xE4,0x0C,0x1C,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,0x00,0x00,
383
384    /*G    */
385    0xF0,0xF8,0x0C,0x84,0x84,0x8C,0x98,0x00,0x03,0x07,0x0C,0x08,0x08,0x07,0x0F,0x00,
386
387    /*H    */
388    0xFC,0xFC,0x40,0x40,0x40,0xFC,0xFC,0x00,0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,
389
390    /*I    */
391    0x00,0x00,0x04,0xFC,0xFC,0x04,0x00,0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,
392
393    /*J    */
394    0x00,0x00,0x00,0x04,0xFC,0xFC,0x04,0x00,0x07,0x0F,0x08,0x08,0x0F,0x07,0x00,0x00,
395
396    /*K    */
397    0x04,0xFC,0xFC,0xC0,0xF0,0x3C,0x0C,0x00,0x08,0x0F,0x0F,0x00,0x01,0x0F,0x0E,0x00,
398
399    /*L    */
400    0x04,0xFC,0xFC,0x04,0x00,0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x08,0x0C,0x0E,0x00,
401
402    /*M    */
403    0xFC,0xFC,0x38,0x70,0x38,0xFC,0xFC,0x00,0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,
404
405    /*N    */
406    0xFC,0xFC,0x38,0x70,0xE0,0xFC,0xFC,0x00,0x0F,0x0F,0x00,0x00,0x00,0x0F,0x0F,0x00,
407
408    /*O    */
409    0xF0,0xF8,0x0C,0x04,0x0C,0xF8,0xF0,0x00,0x03,0x07,0x0C,0x08,0x0C,0x07,0x03,0x00,
410
411    /*P    */
412    0x04,0xFC,0xFC,0x44,0x44,0x7C,0x38,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,0x00,0x00,
413
414    /*Q    */
415    0xF8,0xFC,0x04,0x04,0x04,0xFC,0xF8,0x00,0x07,0x0F,0x08,0x0E,0x3C,0x3F,0x27,0x00,
416
417    /*R    */
418    0x04,0xFC,0xFC,0x44,0xC4,0xFC,0x38,0x00,0x08,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00,
419
420    /*S    */
421    0x18,0x3C,0x64,0x44,0xC4,0x9C,0x18,0x00,0x06,0x0E,0x08,0x08,0x08,0x0F,0x07,0x00,
422
423    /*T    */
424    0x00,0x1C,0x0C,0xFC,0xFC,0x0C,0x1C,0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,
425
426    /*U    */
427    0xFC,0xFC,0x00,0x00,0x00,0xFC,0xFC,0x00,0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,
428
429    /*V    */
430    0xFC,0xFC,0x00,0x00,0x00,0xFC,0xFC,0x00,0x01,0x03,0x06,0x0C,0x06,0x03,0x01,0x00,
431
432    /*W    */
433    0xFC,0xFC,0x00,0x80,0x00,0xFC,0xFC,0x00,0x03,0x0F,0x0E,0x03,0x0E,0x0F,0x03,0x00,
434
435    /*X    */
436    0x0C,0x3C,0xF0,0xC0,0xF0,0x3C,0x0C,0x00,0x0C,0x0F,0x03,0x00,0x03,0x0F,0x0C,0x00,
437
438    /*Y    */
439    0x00,0x3C,0x7C,0xC0,0xC0,0x7C,0x3C,0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,
440
441    /*Z    */
442    0x1C,0x0C,0x84,0xC4,0x64,0x3C,0x1C,0x00,0x0E,0x0F,0x09,0x08,0x08,0x0C,0x0E,0x00
443
444    ///*[    */
445    //0x00,0x00,0xFC,0xFC,0x04,0x04,0x00,0x00,0x00,0x00,0x0F,0x0F,0x08,0x08,0x00,0x00,
446
447    ///*\    */
448    //0x38,0x70,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0E,0x00,
449
450    ///*]    */
451    //0x00,0x00,0x04,0x04,0xFC,0xFC,0x00,0x00,0x00,0x00,0x08,0x08,0x0F,0x0F,0x00,0x00,
452
453    ///*^    */
454    //0x08,0x0C,0x06,0x03,0x06,0x0C,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
455
456    ///*_    */
457    //0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
458
459    ///*`    */
460    //0x00,0x00,0x03,0x07,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
461
462    ///*a    */
463    //0x00,0xA0,0xA0,0xA0,0xE0,0xC0,0x00,0x00,0x07,0x0F,0x08,0x08,0x07,0x0F,0x08,0x00,
464
465    ///*b    */
466    //0x04,0xFC,0xFC,0x20,0x60,0xC0,0x80,0x00,0x08,0x0F,0x07,0x08,0x08,0x0F,0x07,0x00,
467
468    ///*c    */
469    //0xC0,0xE0,0x20,0x20,0x20,0x60,0x40,0x00,0x07,0x0F,0x08,0x08,0x08,0x0C,0x04,0x00,
470
471    ///*d    */
472    //0x80,0xC0,0x60,0x24,0xFC,0xFC,0x00,0x00,0x07,0x0F,0x08,0x08,0x07,0x0F,0x08,0x00,
473
474    ///*e    */
475    //0xC0,0xE0,0xA0,0xA0,0xA0,0xE0,0xC0,0x00,0x07,0x0F,0x08,0x08,0x08,0x0C,0x04,0x00,
476
477    ///*f    */
478    //0x40,0xF8,0xFC,0x44,0x0C,0x18,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,0x00,0x00,
479
480    ///*g    */
481    //0xC0,0xE0,0x20,0x20,0xC0,0xE0,0x20,0x00,0x27,0x6F,0x48,0x48,0x7F,0x3F,0x00,0x00,
482
483    ///*h    */
484    //0x04,0xFC,0xFC,0x40,0x20,0xE0,0xC0,0x00,0x08,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00,
485
486    ///*i    */
487    //0x00,0x00,0x20,0xEC,0xEC,0x00,0x00,0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,
488
489    ///*j    */
490    //0x00,0x00,0x00,0x00,0x20,0xEC,0xEC,0x00,0x00,0x30,0x70,0x40,0x40,0x7F,0x3F,0x00,
491
492    ///*k    */
493    //0x04,0xFC,0xFC,0x80,0xC0,0x60,0x20,0x00,0x08,0x0F,0x0F,0x01,0x03,0x0E,0x0C,0x00,
494
495    ///*l    */
496    //0x00,0x00,0x04,0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,0x08,0x0F,0x0F,0x08,0x00,0x00,
497
498    ///*m    */
499    //0xE0,0xE0,0x60,0xC0,0x60,0xE0,0xC0,0x00,0x0F,0x0F,0x00,0x0F,0x00,0x0F,0x0F,0x00,
500
501    ///*n    */
502    //0x20,0xE0,0xC0,0x20,0x20,0xE0,0xC0,0x00,0x00,0x0F,0x0F,0x00,0x00,0x0F,0x0F,0x00,
503
504    ///*o    */
505    //0xC0,0xE0,0x20,0x20,0x20,0xE0,0xC0,0x00,0x07,0x0F,0x08,0x08,0x08,0x0F,0x07,0x00,
506
507    ///*p    */
508    //0x20,0xE0,0xC0,0x20,0x20,0xE0,0xC0,0x00,0x40,0x7F,0x7F,0x48,0x08,0x0F,0x07,0x00,
509
510    ///*q    */
511    //0xC0,0xE0,0x20,0x20,0xC0,0xE0,0x20,0x00,0x07,0x0F,0x08,0x48,0x7F,0x7F,0x40,0x00,
512
513    ///*s    */
514    //0x40,0xE0,0xA0,0x20,0x20,0x60,0x40,0x00,0x04,0x0C,0x09,0x09,0x0B,0x0E,0x04,0x00,
515
516    ///*t    */
517    //0x20,0x20,0xF8,0xFC,0x20,0x20,0x00,0x00,0x00,0x00,0x07,0x0F,0x08,0x0C,0x04,0x00,
518
519    ///*u    */
520    //0xE0,0xE0,0x00,0x00,0xE0,0xE0,0x00,0x00,0x07,0x0F,0x08,0x08,0x07,0x0F,0x08,0x00,
521
522    ///*v    */
523    //0x00,0xE0,0xE0,0x00,0x00,0xE0,0xE0,0x00,0x00,0x03,0x07,0x0C,0x0C,0x07,0x03,0x00,
524
525    ///*w    */
526    //0xE0,0xE0,0x00,0x00,0x00,0xE0,0xE0,0x00,0x07,0x0F,0x0C,0x07,0x0C,0x0F,0x07,0x00,
527
528    ///*x    */
529    //0x20,0x60,0xC0,0x80,0xC0,0x60,0x20,0x00,0x08,0x0C,0x07,0x03,0x07,0x0C,0x08,0x00,
530
531    ///*y    */
532    //0xE0,0xE0,0x00,0x00,0x00,0xE0,0xE0,0x00,0x47,0x4F,0x48,0x48,0x68,0x3F,0x1F,0x00,
533
534    ///*z    */
535    //0x60,0x60,0x20,0xA0,0xE0,0x60,0x20,0x00,0x0C,0x0E,0x0B,0x09,0x08,0x0C,0x0C,0x00,
536
537    ///*{    */
538    //0x00,0x40,0x40,0xF8,0xBC,0x04,0x04,0x00,0x00,0x00,0x00,0x07,0x0F,0x08,0x08,0x00,
539
540    ///*|    */
541    //0x00,0x00,0x00,0xBC,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,
542
543    ///*}    */
544    //0x00,0x04,0x04,0xBC,0xF8,0x40,0x40,0x00,0x00,0x08,0x08,0x0F,0x07,0x00,0x00,0x00,
545
546    ///*~    */
547    //0x08,0x0C,0x04,0x0C,0x08,0x0C,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
548
549}
;
550
551

 

 1#include "LCM_ST7565P.h"
 2
 3
 4// Main Entry
 5void main(void)
 6{    
 7    LCM_InitPort();
 8    RESET_CLR;
 9    LCM_Delay_us(800);
10    RESET_SET;
11    
12    LCM_Init();
13    LCM_Clear();    
14    LCM_Display(14"TEL 13888888888");
15
16    while (1)
17    {            
18        ;
19    }

20
21    return;
22}

23


 

posted @ 2008-06-21 15:55  vsignsoft  阅读(3543)  评论(1)    收藏  举报