JavaScript API Reference
Comprehensive technical reference for the embedded Duktape JavaScript runtime, hardware peripherals, 3D graphics, and networking in KryonOS.
KryonOS JavaScript API Reference
KryonOS embeds a lightweight, high-efficiency Duktape 2.7 JavaScript Virtual Machine executing natively on ESP32 microcontrollers. User-space applications and background services are written in JavaScript with direct access to hardware-accelerated graphics, file systems, cryptographic engines, peripheral buses, and wireless network sockets.
For complete firmware source code, drivers, and release binaries, visit the official KryonOS GitHub Repository.
Runtime Specifications
| Attribute | Specification | Notes |
|---|---|---|
| Engine Core | Duktape v2.7.0 Embedded Engine | Native C++ stack machine compilation |
| ECMAScript Standard | ES5 / ES5.1 Complete | Partial ES6 (TypedArray, Promise, Proxy) |
| API Level | Level 3 (KryonOS v3.0.0+) | Hardware-accelerated kernel bindings |
| Memory Allocation | ~90 KB usable heap per app | Automatic mark-and-sweep garbage collection |
| Execution Model | Single-threaded event loop | Cooperative multitasking with FreeRTOS kernel |
API Module Index
Explore the specialized API modules categorized below:
Engine Specs & ES5 Compliance
Duktape execution model, memory budget, garbage collection cycles, and ES5 compatibility rules.
System & OS Core
Display bounds, CPU diagnostics, uptime, touch coordinates, virtual keyboard, and reboot utilities.
Unified File System (FS)
Transparent file I/O routed between internal SPIFFS/LittleFS flash (/local/) and SD storage (/sd/).
2D Display & Sprites
16-bit RGB565 color pack, direct-to-glass primitives, BMP streaming, and off-screen double buffers.
Kryon3D Hardware Engine
Hardware-accelerated 3D rasterization, camera matrices, directional lighting, fog, and mesh batching.
GPIO & Analog I/O
Digital pin switching, 12-bit ADC analog conversion, and microsecond pulse measurement.
Hardware PWM & Servos
16-bit hardware pulse-width modulation, 0-180 degree servo control, and frequency tone generation.
I2C TwoWire Bus & Sensors
I2C master bus scanning, byte and buffer register read/write operations for external peripherals.
REST Client & Wi-Fi
Wi-Fi link status, signal RSSI, HTTP/HTTPS GET/POST client, and direct flash file downloaders.
WebSocket Client
Full-duplex real-time communication, automated heartbeats, and binary payload transfer.
Embedded HTTP Web Server
Host local web interfaces, serve static HTML/JS from flash or SD, and process REST JSON endpoints.
FastMath & Matrix Acceleration
Lookup-table trigonometry, hardware TRNG entropy, 3D vector maths, and 4x4 matrix batch processing.
Hardware Cryptography
Hardware-accelerated SHA-256, HMAC authentication, and AES-128/256-CBC encryption routines.
Inter-App IPC & Notifications
Inter-process message broker, intent dispatching, and non-blocking floating system toast alerts.
KryonOS Cloud & AI Engine
Device cloud synchronization, fleet management telemetry, and on-device AI inference assistants.