jacdac.indexed_screen

Submodules

Package Contents

Classes

IndexedScreenClient

A screen with indexed colors from a palette.

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

Bases: jacdac.bus.Client

A screen with indexed colors from a palette.
  • This is often run over an SPI connection or directly on the MCU, not regular single-wire Jacdac.

Implements a client for the Indexed screen service.

property brightness: float | None

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

property palette: bytes | None

The current palette. The colors are [r,g,b, padding] 32bit color entries. The color entry repeats 1 << bits_per_pixel times. This register may be write-only.,

property bits_per_pixel: int | None

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

property width: int | None

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

property height: int | None

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

property width_major: bool | None

(Optional) 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: int | None

(Optional) 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: int | None

(Optional) 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.