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 displaycols
(default=16): columns of the connected displaydebug
(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.
-
home
()[source]¶ Returns cursor to home position. If the display is being scrolled, reverts scrolled data to initial position..
-
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)
-
__weakref__
¶ list of weak references to the object (if defined)
-
Glue logic functions
Warning
Not for user interaction, are called by main.py
, which is ZPUI launcher.