This is the documentation for the latest development branch of MicroPython and may refer to features that are not available in released versions.

If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

class Display – access to Zephyr Displays

Uses the Zephyr Display API.

This class allows access to Zephyr-provided Displays (zephyr,display chosen Node and zephyr,displays Node) via an API reproducing the Zephyr one.

Constructors

class zephyr.Display(id)

Gets an object for accessing a Display identified by id.

id can be an integer (0, 1…) or a string ("ssd1306@3c") identifying a display node by its position or by its node identifiers.

Methods

Display.write(buf[, x[, y[, size_x[, size_y]]]])

Write a buffer-protocol object in the Display’s Pixel Format to the display.

Optionally x and y position, x size, and y size can be specified.

Display.rgb(r, g, b)

Convert a RGB color to the Display’s Pixel Format.

Display.capabilities()

Retrieve a tuple describing the display in the format:

(X Size, Y Size, Supported PFs, Current PF, Current Orientation, Misc Characteristics, Current PF as framebuf format)

Display.format([format])

Get and set the Pixel Format of the Display.

Display.blanking(value)

Enable or disable blanking.

Display.clear()

Clear the Display.

Display.set_brightness(value)

Set the Display’s brightness from 0 to 255.

Display.set_contrast(value)

Set the Display’s contrast from 0 to 255.

Display.orientation([orientation])

Get and set the Orientation of the Display.

Display.as_framebuf()

If framebuf is enabled, generate a framebuf.FrameBuffer instance augmented with a show() function that directly maps to the display with the currently configured settings.