displaydev.wasmdisplay
Direct MicroPython WebAssembly RGB565 display and browser input backend.
- class displaydev.wasmdisplay.WasmDevices(canvas_id)[source]
Bases:
objectTranslate neutral bridge records into the project-wide
eventscontract.
- class displaydev.wasmdisplay.WasmDisplay(width=320, height=240, canvas_id='display_canvas', *, quiet=False)[source]
Bases:
DesktopDisplay,FBDisplayA Python-owned RGB565 framebuffer scanned live by the browser.
Apps draw into
_framebufferthrough the inheritedFBDisplayprimitives._displayedstarts out as_framebuffer(the same object) – the browser’srequestAnimationFrameloop reads straight off WASM linear memory at the registered pointer every frame regardless of whether Python ever callsshow, so a single shared buffer is already correct andshow()needs to do nothing.A second, real
_displayedbuffer is only allocated the first time an app actually engages the classic hardware vertical-scroll registers (vscrdef/vscsad/vscroll– emulating a real SPI panel’s scan address, the wayPSDisplaydoes withdrawImage). LVGL apps never touch that API; they scroll entirely at the widget level, so they stay single-buffered and never pay for a full-frame copy on every flush._compositeis where that promotion happens, and where the row- shifted copy runs once it has.- needs_refresh
True —
appdev.Appdrives periodicshow(), so draws that never callshow()explicitly (e.g. a scroll timer) still reach the composited front buffer once double- buffered.- Type: