Architecture
omnipython is the core product layer, owning portable hardware interfaces, driver abstractions, board wiring contracts, and releases.
Applications build directly on the OmniPython Board Contract and core packages (displaydev, audiodev, appdev, multimer). Downstream showcases like gallery consume this layer as companion sample code.
Component diagram
flowchart TB
subgraph product [OmniPython Core Engine]
BC[board_config.py - Eager UI Hardware]
BP[board_peripherals.py / boarddev - Lazy Extras]
DD[displaydev - Display Abstraction]
AD[audiodev - Audio Abstraction]
EV[events and keys]
MT[multimer - Portable Timers]
ES[appdev - Optional Event Dispatcher]
DR[Hardware & Bus Drivers]
end
subgraph app [Application / GUI Layer]
APP[Custom Application / User GUI]
AR[appdev.App / App Loop]
LR[display_driver - LVGL Coordinator]
end
subgraph showcase [Companion Showcase]
EX[gallery Gallery & Demos]
end
DR --> BC
BC --> DD
BC --> AD
BC -.-> BP
EV --> ES
MT --> ES
BC --> APP
DD --> APP
BP --> APP
BC --> AR
ES --> AR
BC --> LR
MT --> LR
APP --> EX
AR --> EX
LR --> EX
Core Responsibilities
Piece |
Role |
|---|---|
|
Primary Board Contract: initializes eager UI hardware ( |
|
Board Contract extension: provides lazy, on-demand access to extra hardware (sensors, battery monitors, external storage). |
|
Cross-platform display interfaces ( |
|
Cross-platform audio output/input interfaces ( |
|
Neutral event definitions, key codes, modifier keys, and touch gestures. |
|
One |
|
Optional event traffic controller and input queue for applications using native OmniPython dispatch. |
|
LVGL coordinator bridging LVGL widgets to |
Standard Application Boot Sequence
Install
omnipythonor your board’sboard_configvia MIP or pip.Import
display_drvfromboard_config.Draw directly or bind a UI toolkit (
lvgl, orpdwidgets, the pure-Python one), or use raw framebuffers.Run your application event loop.
from board_config import display_drv
# Draw to the display hardware
display_drv.fill_rect(0, 0, 100, 50, 0xF800)
display_drv.show()
Choosing a GUI layer
OmniPython supports several graphical approaches; pick by how much you need and what you can compile:
Approach |
Use it for |
Package |
|---|---|---|
Raw graphics / canvas |
Direct pixel, line, and shape drawing |
|
C-native GUI |
The widget toolkit to reach for: complex vector widgets and a C-accelerated animation engine |
|
Pure-Python GUI |
A demonstration that the core carries a whole UI framework written in Python, with nothing to compile; installed with |
All three sit on the same board contract, so the choice does not change how your hardware is configured.
Where to go next
Board Contract Specification — eager vs lazy board hardware
Board Config Inventory — supported MCU & desktop boards
Display Drivers — display interfaces and backends
multimer — portable timers and async support
Companion Demos — sample applications