Complete SDK & C HAL API Reference

Quick-lookup reference for every module shipped in pylotos-sdk and exposed by the PylotOS C HAL (ESP-IDF v5.5.6 + MicroPython v1.29.0).


1. pylotos.ui — Adaptive UI, Themes, Fonts & Notifications

SymbolSignature / Usage
ui.State(**initial)Reactive key-value store; st.bind("key") creates a two-way Binding.
ui.App(title, screens, state=None, poll_ms=25)Main application shell (await app.run_async(cv), @app.every(ms), app.notify(...), app.toast(...), app.confirm(...), app.set_screen(...)).
Layout ContainersScreen(title, children, icon=""), Grid(children, cols=2, gap=4), Card(title, children), Row(children), Col(children), Divider().
Data WidgetsMetric(label, value, unit="", accent="cyan"), Gauge(label, value, min, max, unit=""), Sparkline(label, values, unit=""), ProgressBar(label, value, max=100), StatusBadge(label, value, tone="ok"), KeyValue(key, value), ListView(items), CanvasBox(height=48, draw=fn, label="").
Interactive ControlsButton(label, on_click, shortcut=""), Switch(label, binding), Slider(label, binding, min, max, step=1, unit=""), Select(label, binding, options, on_change=None), TextField(label, binding, password=False), NumberField(label, binding, min, max, step=1).
ui.theme_managerset_theme("dark" | "light" | "high_contrast"), palette_for(mono=False), web_tokens(), subscribe(fn).
ui.NotificationManagerpush(msg, level="info", duration_ms=2500, icon=None, title=""), active(), history(), mark_all_read(), unread_count.
ui.fontsdraw_text(cv, text, x, y, col=None, font="sm"|"md"|"lg"|"xl", max_width=0), measure_text(text, font="sm"), encode_rle_bitmap(width, height, rows), register_font(name, height, glyphs, spacing=1).
ui.iconsdraw_icon(cv, name, x, y, col=None, size=16) — 20 built-in icons (home, wifi, ble, battery, bolt, cpu, temp, settings, apps, terminal, shield, bell, cloud, sd, play, check, warn, error, chart, lock).

2. pylotos.wireless — Async Zero-Copy, NDEF & Crypto Framing

FunctionSignature & Behavior
recv_rf_intoawait recv_rf_into(buf, meta=None, poll_ms=10, timeout_ms=0) -> int — Zero-copy hal.rf packet await.
recv_espnow_intoawait recv_espnow_into(buf, meta=None, poll_ms=10, timeout_ms=0) -> int — Zero-copy hal.espnow packet await.
poll_nfc_intoawait poll_nfc_into(uid_buf, poll_ms=50, timeout_ms=0) -> int — Cooperative ISO14443A UID scan.
decode_ndef_recorddecode_ndef_record(raw: bytes | bytearray) -> dict — Decodes NDEF Short-Record URI (U) and Text (T) payloads.
pack_framepack_frame(key: bytes, seq: int, payload: bytes) -> bytes — Prepends u32 sequence and appends 64-bit SHA-256 keyed MIC tag.
unpack_frameunpack_frame(key: bytes, frame: bytes | memoryview, min_seq: int = 0) -> tuple[int, bytes] — Verifies MIC & monotonic replay window.

3. hal — Pure-C Hardware Abstraction Layer

Core Board, Display, Power, Storage & Diagnostics

Phase 4 Wireless & Wired C HAL Submodules (hal.<subsys>)

Phase 4 Audio, ULP, USB & Legacy CAN Helpers


4. OS Services, OTA & Simulator Modules