webusb_config.h 802 B

123456789101112131415
  1. // webusb_config.h -- WebUSB configuration channel.
  2. //
  3. // A dedicated vendor interface present in EVERY mode so the browser panel (the GitHub-Pages config UI) can
  4. // read/set the runtime tunables. Binary framed protocol:
  5. // host->dev: 0x01 GET -> reply status blob
  6. // 0x02 <field> <value> SET one byte field (see the switch in webusb_config.cpp)
  7. // 0x03 <mode> switch USB mode (0..6): persist + reboot
  8. // dev->host: 0xA5 <len> <payload> status blob (mode/tunables/link state/rates)
  9. // No setLandingPage() on purpose -- that would pop a Chrome "open <url>?" notification on every plug-in.
  10. #pragma once
  11. #include <Adafruit_TinyUSB.h>
  12. extern Adafruit_USBD_WebUSB usb_web;
  13. void webusbPoll(); // drain host commands + reply; call every loop()