]> begriffs open source - cmsis-freertos/blob - Demo/RX200_RX210-RSK_Renesas/RTOSDemo/include/lcd.h
Update README.md - branch main is now the base branch
[cmsis-freertos] / Demo / RX200_RX210-RSK_Renesas / RTOSDemo / include / lcd.h
1 #ifndef LCD_H
2 #define LCD_H
3 /***********************************************************************************
4
5 FILE NAME               lcd.h
6
7 DESCRIPTION             Driver for KS0066u LCD Module Controller (8 characters by 2 lines )
8                                 on the Renesas RSK boards - header file
9
10 Copyright   : 2006 Renesas Technology Europe Ltd.
11 Copyright   : 2006 Renesas Technology Corporation.
12 All Rights Reserved
13 ***********************************************************************************/
14
15 /***********************************************************************************
16 Revision History
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);
25
26
27 #define SET_BIT_HIGH    (1)         
28 #define SET_BIT_LOW             (0)         
29 #define SET_BYTE_HIGH   (0xFF)        
30 #define SET_BYTE_LOW    (0x00)      
31
32 struct _LCD_Params {
33         unsigned char Line;
34         unsigned short Speed;
35         char *ptr_str;
36 };
37
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
42 /* Data bus port */
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
48
49
50 #define DATA_WR 1
51 #define CTRL_WR 0
52
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   
60
61 #define LCD_LINE1 0
62 #define LCD_LINE2 16
63
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
89
90 #define LCD_DISPLAY_ON  0x04
91 #define LCD_TWO_LINE    0x08
92
93 #endif