Real Time Clock Module with I2C Interface  0.3
⇒ back to Project Page
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions
lcd.h File Reference

4 Bit Interface to LCD displays with up to 4 rows and a single Controller (e.g. ST7066U or HD44780). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TRUE   1
 
#define FALSE   0
 
#define HIGH_RES   1
 5x11 dots
 
#define LOW_RES   0
 5x8 dots
 
#define CURSOR_ON   1
 cursor on
 
#define CURSOR_OFF   0
 cursor off
 
#define BLINK_ON   1
 cursor blinking on
 
#define BLINK_OFF   0
 cursor blinking off
 
#define USE_LCD_RW_PIN   TRUE
 R/W Pin connected [TRUE] or not [FALSE].
 
#define DISPLAY_RESOLUTION   LOW_RES
 1 line and 5x11 dots [HIGH_RES] or 2 lines and 5x8 dots [LOW_RES]
 
#define DISPLAY_CURSOR   CURSOR_OFF
 switches cursor on [CURSOR_ON] or off [CURSOR_OFF]
 
#define DISPLAY_CURSOR_BLINK   BLINK_OFF
 cursor blinking on [BLINK_ON] or off [BLINK_ON]
 
#define AUTOWRAP_AROUND   TRUE
 automatically wrap to next (or back to first) line if string exceeds current line
 
#define PROCESS_NEWLINE   TRUE
 go to next line if newline character in string was detected
 
#define DISPLAY_NUMBER_ROWS   4
 number of display rows (valid only for 5x8 dots!)
 
#define DISPLAY_NUMBER_COLUMNS   20
 number of display columns
 
#define DDRAM_OFFSET   0x40
 address offset for 2. line (for 2-line-mode)
 
#define DISPLAY_ENABLE_TIME_US   1
 width of enable pulse [us]
 
#define DISPLAY_ADDRESS_HOLD_TIME_US   1
 address hold time (after enable pulse) [us]
 
#define DISPLAY_DATATRANSFER_TIME_US   45
 wait time after data transfer [us]
 
#define DISPLAY_COMMANDTRANSFER_TIME_US   45
 wait time after command transfer [us]
 
#define DISPLAY_CLEAR_WAIT_TIME_MS   3
 wait time after clear command [ms]
 
#define DISPLAY_CURSORHOME_WAIT_TIME_MS   3
 wait time after cursor home command [ms]
 
#define DISPLAY_RESET_WAIT_TIME_MS   50
 wait time after reset [ms]
 
#define DISPLAY_INIT_WAIT_TIME01_MS   5
 wait time after 1. init message (function set 8 Bit) [ms]
 
#define DISPLAY_INIT_WAIT_TIME02_MS   2
 wait time after 2. init messages (function set 8 Bit) [ms]
 
#define DISPLAY_INIT_WAIT_TIME03_MS   2
 wait time after 3. init messages (function set 8 Bit) [ms]
 
#define DISPLAY_INIT_WAIT_TIME04_MS   2
 wait time after 4. init message (function set 4 Bit) [ms]
 
#define DISPLAY_INIT_WAIT_TIME_MS   1
 standard wait time after 4 Bit init message [ms]
 
#define CLEAR_DISPLAY   0x01
 Clear Display and DDRAM.
 
#define CURSOR_HOME   0x02
 move Cursor to Home position
 
#define SET_DDRAM_ADDRESS   0x80
 set DDRAM Address (DB0...DB6 transport address)
 
#define LCD_BL_SWITCH_OFF   0
 switch off backlight
 
#define LCD_BL_SWITCH_ON   1
 switch on backlight
 
#define LCD_BL_ALTERNATE   2
 alternate backlight
 
#define LCD_BL_OFF   0
 LCD backlight state "off".
 
#define LCD_BL_ON   1
 LCD backlight state "on".
 

Functions

void lcd_send_data (unsigned char data)
 
void lcd_send_command (unsigned char command)
 
void lcd_set_cursor (uint8_t column, uint8_t row)
 
void lcd_send_string (const char *data, uint8_t flash_mem)
 
void lcd_enable (void)
 
void lcd_clear (void)
 
void lcd_cursor_home (void)
 
void lcd_init (void)
 
void lcd_pin_init (void)
 
void lcd_blpin_init (void)
 
void lcd_set_backlight (uint8_t)
 

Detailed Description

4 Bit Interface to LCD displays with up to 4 rows and a single Controller (e.g. ST7066U or HD44780).

Author
Michael Skutek
Date
11.09.2011
Version
0.9

Platform: AVR ATmega (tested on ATmega16)

Include Files:

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file lcd.h.