webusb_config.h 737 B

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