| 123456789101112131415161718192021222324252627282930313233343536 |
- /* USB HID devices: mouse + keyboard (boot protocol, report protocol and
- * the Logitech Unifying receiver's DJ channel).
- *
- * A single manager owns the scan/hotplug state for every interrupt-IN
- * endpoint: find, configure, put boot devices into boot protocol, arm the
- * endpoint and keep it armed. The mouse reports are handed back to mouse.c;
- * keyboard reports are decoded into PS/2 set-1 scancodes and injected into
- * the regular input queue (io_inject_scancode), so the terminal/WM see them
- * exactly like a PS/2 keyboard. */
- #ifndef USBHID_H
- #define USBHID_H
- /* Bring up the USB subsystem and look for a boot mouse/keyboard. Safe to
- call when no controller or device exists; the hotplug watcher keeps
- running then. */
- void usbhid_init(void);
- /* Service all endpoints (called once per WM loop iteration from
- mouse_poll_update()). Returns 1 when a mouse report is available and
- fills buttons/dx/dy (PS/2 sign convention: dy > 0 = up) plus scroll in
- pixels. A mouse whose report descriptor has a wheel runs in report
- protocol and maps one wheel notch to 48 px; Logitech DJ reports use the
- same scale. */
- int usbhid_poll(unsigned int *buttons, int *dx, int *dy, int *scroll);
- int usbhid_mouse_attached(void);
- int usbhid_keyboard_attached(void);
- /* For `mouseinfo`: controller instance, device address, endpoint number,
- endpoint max packet size, the low-speed flag, the report-protocol mode and
- whether that layout has a wheel. */
- void usbhid_get_info(unsigned int *ctrl, unsigned int *addr,
- unsigned int *ep, unsigned int *mps, int *low,
- int *report_mode, int *wheel);
- #endif
|