jacdac.indexed_screen

Submodules

Package Contents

Classes

IndexedScreenClient

A screen with indexed colors.

class jacdac.indexed_screen.IndexedScreenClient(bus: jacdac.bus.Bus, role: str)

Bases: jacdac.bus.Client

A screen with indexed colors.
  • This is often run over an SPI connection, not regular single-wire Jacdac.

Implements a client for the Indexed screen service.

property brightness Optional[float]

Set backlight brightness. If set to 0 the display may go to sleep., _: /

property bits_per_pixel Optional[int]

Determines the number of palette entries. Typical values are 1, 2, 4, or 8., _: bit

property width Optional[int]

Screen width in “natural” orientation., _: px

property height Optional[int]

Screen height in “natural” orientation., _: px

property width_major Optional[bool]

If true, consecutive pixels in the “width” direction are sent next to each other (this is typical for graphics cards). If false, consecutive pixels in the “height” direction are sent next to each other. For embedded screen controllers, this is typically true iff width < height (in other words, it’s only true for portrait orientation screens). Some controllers may allow the user to change this (though the refresh order may not be optimal then). This is independent of the rotation register.,

property up_sampling Optional[int]

Every pixel sent over wire is represented by up_sampling x up_sampling square of physical pixels. Some displays may allow changing this (which will also result in changes to width and height). Typical values are 1 and 2., _: px

property rotation Optional[int]

Possible values are 0, 90, 180 and 270 only. Write to this register do not affect width and height registers, and may be ignored by some screens., _: °

start_update(x: int, y: int, width: int, height: int) None

Sets the update window for subsequent set_pixels commands.

set_pixels(pixels: bytes) None

Set pixels in current window, according to current palette. Each “line” of data is aligned to a byte.