Device::Chip::NoritakeGU_D - chip driver for Noritake GU-D display modules
Device::Chip::NoritakeGU_D
use Device::Chip::NoritakeGU_D; use Future::AsyncAwait; my $chip = Device::Chip::NoritakeGU_D->new( interface => "UART" ); await $chip->mount( Device::Chip::Adapter::...->new ); await $chip->text( "Hello, world!" );
This Device::Chip subclass provides communication to a display module in the GU-D family by Noritake.
The reader is presumed to be familiar with the general operation of this chip; the documentation here will not attempt to explain or define chip-specific concepts or features, only the use of this module to access them.
$chip = Device::Chip::NoritakeGU_D->new( interface => $iface, ... )
Constructs a new driver instance for the given interface type. The type must be one of UART, I2C or SPI.
UART
I2C
SPI
The following methods documented in an await expression return Future instances.
await
await $chip->text( $str );
Draw text at the cursor position.
await $chip->cursor_left; await $chip->cursor_right; await $chip->cursor_linehome; await $chip->cursor_home;
Move the cursor left or right one character position, to the beginning of the line, or to the home position (top left corner).
await $chip->cursor_goto( $x, $y );
Moves the cursor to the $x'th column of the $y'th line (zero-indexed).
$x
$y
await $chip->linefeed;
Move the cursor down to the next line.
$chip->clear
Clear the display.
await $chip->select_window( $win );
Select the main window (when $win is 0), or one of the four numbered sub-windows.
$win
$chip->initialise
Reset all settings to their default values.
await $chip->set_cursor_visible( $bool );
Set whether the cursor is visible.
await $chip->set_brightness( $val );
Set the display brightness, from 1 to 8.
await $chip->set_reverse( $bool );
Sets whether subsequent text will be rendered in "reverse video" (clear pixels on a set background) effect.
await $chip->set_write_mixture_display_mode( $mode );
Set the combining mode for newly-added display content. $mode must be one of
$mode
set or and xor
await $chip->set_font_size( $size );
Set the font size. $size must be one of
$size
5x7 8x16
await $chip->set_font_width( $width );
Set the font width. $width must be one of
$width
fixed fixed2 prop prop2
await $chip->set_font_magnification( $xscale, $yscale );
Set the font scaling factor. $xscale must be between 1 to 4, and $yscale must be 1 or 2.
$xscale
$yscale
await $chip->realtime_image_display_columns( @columns );
Sends a bitmapped image to the display, at the cursor position. The cursor is not moved.
@columns should be a list of strings of equal length, containing bytes of pixel data to represent each vertical column of the image content.
@columns
await $chip->set_gpio_direction( $dir );
Configure the GPIO pins for input or output. $dir is bitmask of four bits. Low bits correspond to input, high bits to output.
$dir
await $chip->set_gpio_output( $value );
Write the value to the GPIO pins.
$value = await $chip->read_gpio;
Returns the current state of the GPIO pins.
$switches = await $chip->read_touchswitches;
Reads the status of the panel touch switches. Returns a hash reference whose keys are the names of the touch areas (SW1, SW2, ...) and values are booleans indicating whether that area currently detects a touch.
SW1
SW2
Paul Evans <leonerd@leonerd.org.uk>
To install Device::Chip::NoritakeGU_D, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::Chip::NoritakeGU_D
CPAN shell
perl -MCPAN -e shell install Device::Chip::NoritakeGU_D
For more information on module installation, please visit the detailed CPAN module installation guide.