![]() ![]() ![]() ![]() |
|
HiPi::Interface::HD44780 provides an abstract class that acts as a base for common implementations of LCD interfaces driving LCD devices based on the Hitachi HD44780 controller
Currently there are two concrete implementations that derive from HiPi::Interface::HD44780
Classes based on HiPi::Interface::HD44780 inherit the following methods:
Switch the LCD on / off
Set the current cursor position. $lcd->set_cursor_position(0, 0) sets the position to the leftmost column of the top row.
Shift the cursor position 1 to the left
Shift the cursor position 1 to the right
Move the cursor to top left same as $lcd->set_cursor_position(0, 0)
Move the cursor to top left and clear all text
Set the cursor mode. Valid values for $mode are SRX_CURSOR_OFF SRX_CURSOR_BLINK SRX_CURSOR_UNDERLINE You can import these constants into your namespace with use HiPi::Interface::HD44780 qw( :cursor );
Set the backlight light level. Valid value for $percent is a number between 0 and 100
Send $textstring to be 'printed' at the current cursor position.
Send a raw HD44780 command. $command can be one of HD44780_CLEAR_DISPLAY HD44780_HOME_UNSHIFT HD44780_CURSOR_MODE_LEFT HD44780_CURSOR_MODE_LEFT_SHIFT HD44780_CURSOR_MODE_RIGHT HD44780_CURSOR_MODE_RIGHT_SHIFT HD44780_DISPLAY_OFF HD44780_DISPLAY_ON HD44780_CURSOR_OFF HD44780_CURSOR_UNDERLINE HD44780_CURSOR_BLINK HD44780_SHIFT_CURSOR_LEFT HD44780_SHIFT_CURSOR_RIGHT HD44780_SHIFT_DISPLAY_LEFT HD44780_SHIFT_DISPLAY_RIGHT You can import these constants into your namespace with use HiPi::Interface::HD44780 qw( :hd44780 );
Update the baudrate to the new value. Only useful for implementations using a serial protocol. Implementations provide their own constants for baudrate. Some implementations may require a hard reset for the device after this method is called
Update the interface geometry with the 'width' and 'lines' values passed in the $lcd constructor. Some implementations may require a hard reset for the device after this method is called