Real Time Clock Module with I2C Interface  0.3
⇒ back to Project Page
 All Data Structures Files Functions Variables Typedefs Macros Pages
lcd.h
Go to the documentation of this file.
1 
2 /****************************************************************************/
39 #ifndef LCD_H_INCLUDED
40 #define LCD_H_INCLUDED
41 
42 
43 
44 /******************************************
45  \internal
46  General definitions
47 *******************************************/
48 
49 //values (Do not modify - to be used for mode settings!)
50 #ifndef TRUE
51 #define TRUE 1
52 #endif
53 #ifndef FALSE
54 #define FALSE 0
55 #endif
56 #define HIGH_RES 1
57 #define LOW_RES 0
58 #define CURSOR_ON 1
59 #define CURSOR_OFF 0
60 #define BLINK_ON 1
61 #define BLINK_OFF 0
62 
63 #define USE_LCD_RW_PIN TRUE
64 
65 
66 /******************************************
67  \internal
68  Adapt the following parameters
69  depending on your LCD:
70 *******************************************/
71 
72 //modes
73 #define DISPLAY_RESOLUTION LOW_RES
74 #define DISPLAY_CURSOR CURSOR_OFF
75 #define DISPLAY_CURSOR_BLINK BLINK_OFF
76 
77 //disable tho following two items if text is scrambled on display
78 #define AUTOWRAP_AROUND TRUE
79 #define PROCESS_NEWLINE TRUE
80 
81 //display parameters
82 #define DISPLAY_NUMBER_ROWS 4
83 #define DISPLAY_NUMBER_COLUMNS 20
84 #define DDRAM_OFFSET 0x40
85 
86 //timing
87 #define DISPLAY_ENABLE_TIME_US 1
88 #define DISPLAY_ADDRESS_HOLD_TIME_US 1
89 #define DISPLAY_DATATRANSFER_TIME_US 45
90 #define DISPLAY_COMMANDTRANSFER_TIME_US 45
91 #define DISPLAY_CLEAR_WAIT_TIME_MS 3
92 #define DISPLAY_CURSORHOME_WAIT_TIME_MS 3
93 #define DISPLAY_RESET_WAIT_TIME_MS 50
94 #define DISPLAY_INIT_WAIT_TIME01_MS 5
95 #define DISPLAY_INIT_WAIT_TIME02_MS 2
96 #define DISPLAY_INIT_WAIT_TIME03_MS 2
97 #define DISPLAY_INIT_WAIT_TIME04_MS 2
98 #define DISPLAY_INIT_WAIT_TIME_MS 1
99 
100 
101 
102 
103 /******************************************
104  \internal
105  LCD commands - Do not change!
106 *******************************************/
107 
108 #define CLEAR_DISPLAY 0x01
109 #define CURSOR_HOME 0x02
110 #define SET_DDRAM_ADDRESS 0x80
111 
112 #define LCD_BL_SWITCH_OFF 0
113 #define LCD_BL_SWITCH_ON 1
114 #define LCD_BL_ALTERNATE 2
115 
116 #define LCD_BL_OFF 0
117 #define LCD_BL_ON 1
118 
119 
120 /******************************************
121  \internal
122  Function prototypes
123 *******************************************/
124 
125 void lcd_send_data(unsigned char data);
126 void lcd_send_command(unsigned char command);
127 void lcd_set_cursor(uint8_t column, uint8_t row);
128 void lcd_send_string(const char *data, uint8_t flash_mem);
129 void lcd_enable(void);
130 void lcd_clear(void);
131 void lcd_cursor_home(void);
132 void lcd_init(void);
133 void lcd_pin_init(void);
134 void lcd_blpin_init(void);
135 void lcd_set_backlight(uint8_t);
136 
137 
138 
139 #endif // LCD_H_INCLUDED