Author | Richard Zengerink, Copyright (c) 2008..2009, all rights reserved. |
Adapted-by | Joep Suijs, |
Compiler | >=2.4j |
Common API for HD44780 based LCD . Procedures which can be used by application program: . * lcd_write_char( byte in value ): writes 'value' to lcd example: lcd_write_char( "E" ) or lcd_write_char( 69 ) . * lcd = value: writes 'value' to lcd example: lcd = "E" or lcd = 69 . * lcd_cursor_position(byte in line, byte in pos): places the cursor on position (pos) in line (line) (zero based!) example: lcd_new_line_cursor_position (1, 8) . * lcd_shift_left(byte in value): shifts the display [value] times to the left without changing DDRAM data. example: lcd_shift_left(4) or lcd_shift_left(variable) . * lcd_shift_right(byte in value): shifts the display [value] times to the right without changing DDRAM data. example: lcd_shift_right(12) or lcd_shift_right(variable) . * lcd_cursor_shift_left(byte in value): shifts the cursor [value] times to the left without changing display contents and DDRAM data. example: lcd_cursor_shift_left(8) or lcd_cursor_shift_left(variable) . * lcd_cursor_shift_right(byte in value): shifts the cursor [value] times to the right without changing display contents and DDRAM data. example: lcd_cursor_shift_right(3) or lcd_cursor_shift_right(variable) . * lcd_clear: Write "20H" to DDRAM and set DDRAM address to "00H" from AC This will clear the display. . * lcd_home: Set DDRAM address to "00H" from AC and return cursor to its original position if shifted. The contents of DDRAM are not changed. . * lcd_cursor_blink_display(bit in cursor,bit in blink,bit in display): sets the underline cursor on/off, let the block-cursor blinking/off and puts the display on/off example: lcd_cursor_blink_display(on,off,on) . * lcd_clear_line ( byte in line ) clears the line [line] of the lcd including DDRAM data of that line example: lcd_clear_line(1) . * lcd_progress(byte in line, byte in amount) create a progress bar on line [line] with a lenght of [amout] example: lcd_progress(2,12)
No dependency found
const LCD_DISPLAY_SHIFT_RIGHT = 0b_0001_1100
const LCD_CURSOR_SHIFT_R_VAL = 0b_0001_0100
const LCD_DISPLAY_SHIFT_LEFT = 0b_0001_1000
const LCD_CLEAR_DISPLAY = 0b_0000_0001
const LCD_RETURN_HOME = 0b_0000_0010
const LCD_SET_DDRAM_ADDRESS = 0b_1000_0000
const LCD_SET_CGRAM_ADDRESS = 0b_0100_0000
const LCD_DISPLAY_ONOFF = 0b_0000_1000
var volatile byte lcd_pos = 0
const LCD_CURSOR_SHIFT_L_VAL = 0b_0001_0000
lcd_clear_screen()
lcd_clear_line(byte in line)
lcd_shift_right(byte in nr)
lcd_writechar(byte in data)
lcd_cursor_blink_display(bit in cursor, bit in blink, bit in display)
lcd_cursor_shift_right(byte in nr)
lcd_shift_left(byte in nr)
lcd_clearscreen()
lcd_home()
lcd_write_char(byte in data)
lcd_cursor_position(byte in line, byte in pos)
lcd'put(byte in data)
lcd_cursor_shift_left(byte in nr)
lcd_progress(byte in line, byte in amount, byte in pattern)
const LCD_DISPLAY_SHIFT_RIGHT = 0b_0001_1100
No documentation found
const LCD_CURSOR_SHIFT_R_VAL = 0b_0001_0100
No documentation found
const LCD_DISPLAY_SHIFT_LEFT = 0b_0001_1000
No documentation found
const LCD_CLEAR_DISPLAY = 0b_0000_0001
some constants to control the lcd
const LCD_RETURN_HOME = 0b_0000_0010
No documentation found
const LCD_SET_DDRAM_ADDRESS = 0b_1000_0000
No documentation found
const LCD_SET_CGRAM_ADDRESS = 0b_0100_0000
No documentation found
const LCD_DISPLAY_ONOFF = 0b_0000_1000
No documentation found
var volatile byte lcd_pos = 0
No documentation found
const LCD_CURSOR_SHIFT_L_VAL = 0b_0001_0000
No documentation found
lcd_clear_screen()
lcd_clear_screen - clears the LCD
lcd_clear_line(byte in line)
lcd_clear_line - clears the line "line" of the LCD
lcd_shift_right(byte in nr)
lcd_shift_right - shifts the complete display one position to the right
lcd_writechar(byte in data)
Deprecated
lcd_cursor_blink_display(bit in cursor, bit in blink, bit in display)
lcd_cursor_blink_display - (re)sets cursor blink and puts display on/off . params: cursor: enable or disable the fixed underline cursor blink: enable or disable blinking of the block-cursor (so block blinking or off) display: enable or disable the whole display
lcd_cursor_shift_right(byte in nr)
lcd_cursor_shift_right - shifts cursor one position to the right
lcd_shift_left(byte in nr)
lcd_shift_left - shifts the complete display one position to the left
lcd_clearscreen()
Deprecated
lcd_home()
lcd_home - cursor returns home(line 0, position 0)
lcd_write_char(byte in data)
lcd_write_char - write one char to LCD
lcd_cursor_position(byte in line, byte in pos)
lcd_cursor_position - Specify row and column (0-based) . About cursor positions: the LCDs are internally 2x40 char devices. The first line starts at offset 0, the second line at offset 64 (0x40). With 4 line devices the third and fourth line are addressed as extensions of the first and second line by adding an offset. For a 4x20 line device the offset is 20, for a 4x16 line display the offset is 16 or 20. Declare the constant LCD_CHARS as appropriate for your screen (you may have to specify 20 even if your display has only 16 chars!). Note: Some 1x16 LCDs are implemented as 2x8 line LCDs, which means that the second half of the line has to be handled as a second line.
lcd'put(byte in data)
lcd'put - write one char to screen (pseudo var, enables streams)
lcd_cursor_shift_left(byte in nr)
lcd_cursor_shift_left - shifts cursor one position to the left
lcd_progress(byte in line, byte in amount, byte in pattern)
lcd_progress- Displays a progress bar The progress bar starts at position 0 of a line. line: line on which progress bar is displayed amount: number of bar chars that are displayed (0xFF is a common pattern)
_lcd_restore_cursor()
_lcd_restore_cursor - sets the cursor to the position in the shadow register (this routine is only used inside this file)
_hd44780_init()
_hd44780_init - Initialise display (not realy internal, but not for users) This procedure is called from lcd_init of the interface used. lcd_init brings up the interface and powers up the display. This procedure sets the display in the pre-defined startposition (clear screen, no cursor etc).
_lcd_line2index(byte in line) return byte
_lcd_line2index - internal function - calculate index from line number