Erik Wasser > Device-Serdisp-0.06 > Device::Serdisp

Download:
Device-Serdisp-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Device::Serdisp - Perl extension for talking to the serdisplib

SYNOPSIS ^

    use Device::Serdisp;

    my $d = Device::Serdisp->new('USB:7c0/1501', 'ctinclud');
    $d->init();
    $d->clear();

    # reserves a color-indexed picture
    my $image = GD::Image->new(128,64);
    my $black = $image->colorAllocate(0,0,0);
    my $white = $image->colorAllocate(255,255,255);

    $image->transparent($black);
    $image->arc(10,10,10,10,0,270, $white);
    $d->copyGD($image);

DESCRIPTION ^

This library is a quick interface to serdisplib.

PUBLIC INTERFACE ^

$d = Device::Serdisp->new(connection,displaytype)

This will open the serdisp library for you. The first string is connector string that describes the kind of interface your are using to talk to your display:

Examples:

   /dev/parport0 - parallel port
   0x378 - direct IO
   USB:7c0/1501 - USB device with the given product id
   ...

The second is the type of the display.

Examples:

   ctinclud
   PCD8544
   ...
$d->init()

This will init the display and turn it on. The the display can't found with your specified parameter the method will croak.

$d->width()

Returns the width of the display in pixel.

$d->copyGD(GD)

This will copy your given GD object into the buffer of the serdisp library. After that the display will be updated to display the content of the internal buffer. All non-black pixels (red >0 || green > 0 || blue > 0) will be translated to a set pixel on the display. No dithering at all!

If you GD area is bigger than your display the rest of the GD area will be ignored.

If you GD area is lesser than your display the rest of the display area will be untouched.

$d->clear()

Will clear the internal buffer of the serdisp library and force an update of the display.

$d->set_option(OPTION, VALUE)

Will set an option for the display. Valid values for OPTION depends on the type of your display and may vary.

Example:

   $d->set_option("INVERT","1");
$d->get_option(OPTION)

This will return the current value of the display.

EXPORT

None by default.

SEE ALSO ^

   GD - http://www.boutell.com/gd/
   GD - perldoc GD
   Serdisplib - http://serdisplib.sourceforge.net/

AUTHOR ^

Erik Wasser, <erik.wasser@iquer.net>

COPYRIGHT AND LICENSE ^

Copyright (C) 2006 by Erik Wasser

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: