/[H8]/trunk/PIC/Torbens/mylcd.h
ViewVC logotype

Contents of /trunk/PIC/Torbens/mylcd.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 101 - (show annotations) (download)
Fri May 25 14:20:54 2007 UTC (17 years ago) by torben
File MIME type: text/plain
File size: 1202 byte(s)
Trying to implement this !"#ยค%&/()= LCD module
1 #ifndef MYLCD_H
2 #define MYLCD_H
3
4 #define LCD_IC 0x74
5 #define LCD_WAIT DelayMs(8)
6
7
8 #define LCD_RS0 RA2
9 #define LCD_EN0 RA0
10 #define LCD_RW0 RA1
11 #define LCD_RS0_TRIS TRISA2
12 #define LCD_EN0_TRIS TRISA0
13 #define LCD_RW0_TRIS TRISA1
14
15 #define LCD_RS1 RA5
16 #define LCD_EN1 RA3
17 #define LCD_RW1 RA4
18 #define LCD_RS1_TRIS TRISA5
19 #define LCD_EN1_TRIS TRISA3
20 #define LCD_RW1_TRIS TRISA4
21
22
23
24 #define OUTPUT_PIN 0x0
25 #define INPUT_PIN 0x1
26 #define OUTPUT_DATA 0x0
27 #define INPUT_DATA 0x0F
28
29
30 #define mylcd_cursor(x) mylcd_cmd(((x)&0x7F)|0x80)
31 #define mylcd_clear() mylcd_cmd(0x1)
32 #define mylcd_putch(x) mylcd_data(x)
33 #define mylcd_goto(x) mylcd_cmd(0x80+(x));
34 #define mylcd_cursor_right() mylcd_cmd(0x14)
35 #define mylcd_cursor_left() mylcd_cmd(0x10)
36 #define mylcd_display_shift() mylcd_cmd(0x1C)
37 #define mylcd_home() mylcd_cmd(0x2)
38
39
40
41 void mylcd_strobe(void);
42 void mylcd_cmd(unsigned char);
43 void mylcd_data(unsigned char);
44 void mylcd_puts(const char * s);
45 void mylcd_init(void);
46
47 void mylcd_enable_lcd0(unsigned char enable);
48 void mylcd_enable_lcd1(unsigned char enable);
49
50 void mylcd_write_byte(unsigned char data);
51
52
53
54 #endif //MYLCD_H

  ViewVC Help
Powered by ViewVC 1.1.20