]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX200_RX210-RSK_Renesas/RTOSDemo/include/lcd.h
Change version numbers ready for V8.0.0 release candidate 1 tag.
[freertos] / FreeRTOS / Demo / RX200_RX210-RSK_Renesas / RTOSDemo / include / lcd.h
1 #ifndef LCD_H\r
2 #define LCD_H\r
3 /***********************************************************************************\r
4 \r
5 FILE NAME               lcd.h\r
6 \r
7 DESCRIPTION             Driver for KS0066u LCD Module Controller (8 characters by 2 lines )\r
8                                 on the Renesas RSK boards - header file\r
9 \r
10 Copyright   : 2006 Renesas Technology Europe Ltd.\r
11 Copyright   : 2006 Renesas Technology Corporation.\r
12 All Rights Reserved\r
13 ***********************************************************************************/\r
14 \r
15 /***********************************************************************************\r
16 Revision History\r
17 DD.MM.YYYY OSO-UID Description\r
18 26.07.2006 RTE-MBA First Release\r
19 ***********************************************************************************/\r
20 void InitialiseDisplay( void );\r
21 void DisplayString(unsigned char position, char * string);\r
22 void LCD_write(unsigned char data_or_ctrl, unsigned char value);\r
23 void LCD_nibble_write(unsigned char data_or_ctrl, unsigned char value);\r
24 void DisplayDelay(unsigned long int units);\r
25 \r
26 \r
27 #define SET_BIT_HIGH    (1)         \r
28 #define SET_BIT_LOW             (0)         \r
29 #define SET_BYTE_HIGH   (0xFF)        \r
30 #define SET_BYTE_LOW    (0x00)      \r
31 \r
32 struct _LCD_Params {\r
33         unsigned char Line;\r
34         unsigned short Speed;\r
35         char *ptr_str;\r
36 };\r
37 \r
38 /* RS Register Select pin */\r
39 #define RS_PIN                  PORTJ.PODR.BIT.B1\r
40 /* Display Enable pin */  \r
41 #define EN_PIN                  PORTJ.PODR.BIT.B3\r
42 /* Data bus port */\r
43 #define DATA_PORT               PORTH.PODR.BYTE\r
44 /* Bit mask from entire port */   \r
45 #define DATA_PORT_MASK  0x0F\r
46 /* Number of bits data needs to shift */\r
47 #define DATA_PORT_SHIFT 0\r
48 \r
49 \r
50 #define DATA_WR 1\r
51 #define CTRL_WR 0\r
52 \r
53 /* Set to ensure base delay of 1microS minimum */\r
54 //#define DELAY_TIMING  0x2F\r
55 #define DELAY_TIMING    50\r
56 /* number of lines on the LCD display */\r
57 #define NUMB_CHARS_PER_LINE 8\r
58 /* Maximum charactors per line of LCD display. */ \r
59 #define MAXIMUM_LINES   2   \r
60 \r
61 #define LCD_LINE1 0\r
62 #define LCD_LINE2 16\r
63 \r
64 /**********************************************************************************/\r
65 /* LCD commands - use LCD_write function to write these commands to the LCD.      */\r
66 /**********************************************************************************/\r
67 /* Clear LCD display and home cursor */\r
68 #define LCD_CLEAR               0x01\r
69 /* move cursor to line 1 */\r
70 #define LCD_HOME_L1             0x80\r
71 /* move cursor to line 2 */       \r
72 #define LCD_HOME_L2             0xC0\r
73 /* Cursor auto decrement after R/W */  \r
74 #define CURSOR_MODE_DEC 0x04\r
75 /* Cursor auto increment after R/W */\r
76 #define CURSOR_MODE_INC 0x06\r
77 /* Setup, 4 bits,2 lines, 5X7 */\r
78 #define FUNCTION_SET    0x28\r
79 /* Display ON with Cursor */\r
80 #define LCD_CURSOR_ON   0x0E\r
81 /* Display ON with Cursor off */\r
82 #define LCD_CURSOR_OFF  0x0C\r
83 /* Display on with blinking cursor */\r
84 #define LCD_CURSOR_BLINK 0x0D\r
85 /*Move Cursor Left One Position */\r
86 #define LCD_CURSOR_LEFT 0x10\r
87 /* Move Cursor Right One Position */\r
88 #define LCD_CURSOR_RIGHT 0x14\r
89 \r
90 #define LCD_DISPLAY_ON  0x04\r
91 #define LCD_TWO_LINE    0x08\r
92 \r
93 #endif