3 /***********************************************************************************
7 DESCRIPTION Driver for KS0066u LCD Module Controller (8 characters by 2 lines )
8 on the Renesas RSK boards - header file
10 Copyright : 2006 Renesas Technology Europe Ltd.
11 Copyright : 2006 Renesas Technology Corporation.
13 ***********************************************************************************/
15 /***********************************************************************************
17 DD.MM.YYYY OSO-UID Description
18 26.07.2006 RTE-MBA First Release
19 ***********************************************************************************/
20 void InitialiseDisplay( void );
21 void DisplayString(unsigned char position, char * string);
22 void LCD_write(unsigned char data_or_ctrl, unsigned char value);
23 void LCD_nibble_write(unsigned char data_or_ctrl, unsigned char value);
24 void DisplayDelay(unsigned long int units);
27 #define SET_BIT_HIGH (1)
28 #define SET_BIT_LOW (0)
29 #define SET_BYTE_HIGH (0xFF)
30 #define SET_BYTE_LOW (0x00)
38 /* RS Register Select pin */
39 #define RS_PIN PORTJ.PODR.BIT.B1
40 /* Display Enable pin */
41 #define EN_PIN PORTJ.PODR.BIT.B3
43 #define DATA_PORT PORTH.PODR.BYTE
44 /* Bit mask from entire port */
45 #define DATA_PORT_MASK 0x0F
46 /* Number of bits data needs to shift */
47 #define DATA_PORT_SHIFT 0
53 /* Set to ensure base delay of 1microS minimum */
54 //#define DELAY_TIMING 0x2F
55 #define DELAY_TIMING 50
56 /* number of lines on the LCD display */
57 #define NUMB_CHARS_PER_LINE 8
58 /* Maximum charactors per line of LCD display. */
59 #define MAXIMUM_LINES 2
64 /**********************************************************************************/
65 /* LCD commands - use LCD_write function to write these commands to the LCD. */
66 /**********************************************************************************/
67 /* Clear LCD display and home cursor */
68 #define LCD_CLEAR 0x01
69 /* move cursor to line 1 */
70 #define LCD_HOME_L1 0x80
71 /* move cursor to line 2 */
72 #define LCD_HOME_L2 0xC0
73 /* Cursor auto decrement after R/W */
74 #define CURSOR_MODE_DEC 0x04
75 /* Cursor auto increment after R/W */
76 #define CURSOR_MODE_INC 0x06
77 /* Setup, 4 bits,2 lines, 5X7 */
78 #define FUNCTION_SET 0x28
79 /* Display ON with Cursor */
80 #define LCD_CURSOR_ON 0x0E
81 /* Display ON with Cursor off */
82 #define LCD_CURSOR_OFF 0x0C
83 /* Display on with blinking cursor */
84 #define LCD_CURSOR_BLINK 0x0D
85 /*Move Cursor Left One Position */
86 #define LCD_CURSOR_LEFT 0x10
87 /* Move Cursor Right One Position */
88 #define LCD_CURSOR_RIGHT 0x14
90 #define LCD_DISPLAY_ON 0x04
91 #define LCD_TWO_LINE 0x08