Contents Up Previous Next

HiPi::Interface::HD44780

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

HiPi::Interface::SerLCD

HiPi::Interface::HTBackpackV2

Classes based on HiPi::Interface::HD44780 inherit the following methods:

Object Methods

$lcd->enable( $bool );
    Switch the LCD on / off
$lcd->set_cursor_position($column, $row);
    Set the current cursor position. 

    $lcd->set_cursor_position(0, 0) sets the position
    to the leftmost column of the top row.
$lcd->move_cursor_left();
    Shift the cursor position 1 to the left
$lcd->move_cursor_right();
    Shift the cursor position 1 to the right
$lcd->home();
     Move the cursor to top left

     same as $lcd->set_cursor_position(0, 0)
$lcd->clear();
     Move the cursor to top left and clear all text
$lcd->set_cursor_mode( $mode );
     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 );
$lcd->$backlight( $percent );
    Set the backlight light level. Valid value for $percent 
    is a number between 0 and 100
$lcd->send_text( $textstring );
    Send $textstring to be 'printed' at the current cursor position.
$lcd->send_command( $command );
    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 );
$lcd->update_baudrate( $brconstant );
     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
$lcd->update_geometry();
     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




Contents Up Previous Next


HiPi Modules Copyright © 2013 Mark Dootson