Output subsystem

Currently ZPUI uses HD44780-compatible screens as output devices. Minimum screen size is 16x2, 20x4 screens are tested and working. Available output drivers:

Screen object

The o variable you have supplied by main.py load_app() in your applications is a Screen instance. It provides you with a set of functions available to HD44780 displays. Most of drivers just provide low-level functions for HD44780 object, which, in turn, provides Screen object users with high-level functions described below:

class output.drivers.hd44780.HD44780(cols=16, rows=2, do_init=True, debug=False, buffering=True, **kwargs)[source]

An object that provides high-level functions for interaction with display. It contains all the high-level logic and exposes an interface for system and applications to use.

__init__(cols=16, rows=2, do_init=True, debug=False, buffering=True, **kwargs)[source]

Sets variables for high-level functions.

Kwargs:

  • rows (default=2): rows of the connected display
  • cols (default=16): columns of the connected display
  • debug (default=False): debug mode which prints out the commands sent to display
  • **kwargs: all the other arguments, get passed further to HD44780.init_display() function
init_display(autoscroll=False, **kwargs)[source]

Initializes HD44780 controller.

Kwargs:

  • autoscroll: Controls whether autoscroll-on-char-print is enabled upon initialization.
display_data(*args)[source]

Displays data on display. This function checks if the display contents can be redrawn faster by buffering them and checking the output, then either changes characters one-by-one or redraws the screen completely.

*args is a list of strings, where each string corresponds to a row of the display, starting with 0.

println(line)[source]

Prints a line on the screen (assumes position is set as intended)

home()[source]

Returns cursor to home position. If the display is being scrolled, reverts scrolled data to initial position..

clear()[source]

Clears the display.

setCursor(row, col)[source]

Set current input cursor to row and column specified

createChar(char_num, char_contents)[source]

Stores a character in the LCD memory so that it can be used later. char_num has to be between 0 and 7 (including) char_contents is a list of 8 bytes (only 5 LSBs are used)

noDisplay()[source]

Turn the display off (quickly)

display()[source]

Turn the display on (quickly)

noCursor()[source]

Turns the underline cursor off

cursor()[source]

Turns the underline cursor on

Turn the blinking cursor off

Turn the blinking cursor on

scrollDisplayLeft()[source]

These commands scroll the display without changing the RAM

scrollDisplayRight()[source]

These commands scroll the display without changing the RAM

leftToRight()[source]

This is for text that flows Left to Right

__weakref__

list of weak references to the object (if defined)

rightToLeft()[source]

This is for text that flows Right to Left

autoscroll()[source]

This will ‘right justify’ text from the cursor

noAutoscroll()[source]

This will ‘left justify’ text from the cursor

Glue logic functions

Warning

Not for user interaction, are called by main.py, which is ZPUI launcher.

output.output.init(output_config)[source]

This function is called by main.py to read the output configuration, pick the corresponding drivers and initialize a Screen object. Returns the screen object created.