M0 (docs/FEASIBILITY.md, verified against esp-emulator wasm v0.51.0): - GPIO outputs observable via gpio_state(); gpio_set_input() drives pads and raises guest interrupts (button-class peripherals work) - LEDC PWM and RMT waveforms are NOT visible in the pad registers; duty is readable from LEDC registers and WS2812 frames decode from RMT channel RAM (per-chip MMIO map in peris/mmio/) - Node probe + ESP-IDF test firmware (gpio/ledc/rmt three-phase loop) M1 peripherals framework: - esp-emu-peris.html entry (stock layout + Peripherals/Debug tabs), peris/worker.js (stock worker clone + per-batch pin sampling hooks) - device plugin API v1 (docs/DEVICE-API.md) with manifest registry: add a peripheral = one module + one manifest line - devices: led, button, touch-button, toggle-switch; wiring config import/export + localStorage autosave; pin-conflict reporting - serve.py merged dev server, sync_www.py publisher (www only gains files, stock ones untouched), xterm vendored locally (no CDN) - tests/m1_smoke.mjs integration smoke (config/LED state/button ISR/ toggle/conflict/unknown-type) - all green
22 lines
761 B
JavaScript
22 lines
761 B
JavaScript
/*
|
|
* Message protocol between the page and the peris worker (v1).
|
|
* These ride on the same postMessage channel as the stock worker protocol.
|
|
*/
|
|
export const PERIS_API_VERSION = 1;
|
|
|
|
// page -> worker
|
|
export const PERIS_CONFIG = 'peris_config'; // { config } apply a full config
|
|
export const PERIS_COMMAND = 'peris_command'; // { id, cmd, params } view -> device
|
|
|
|
// worker -> page
|
|
export const PERIS_READY = 'peris_ready'; // { ok, errors, devices }
|
|
export const PERIS_STATE = 'peris_state'; // { id, state } device state update
|
|
export const PERIS_LOG = 'peris_log'; // { level, text }
|
|
|
|
// Config file shape (also the localStorage shape):
|
|
// {
|
|
// perisVersion: 1,
|
|
// chip: 'esp32c3',
|
|
// devices: [ { id, type, ...deviceConfig } ]
|
|
// }
|