Skip to content

drivers: add USB HID mouse support for ESP32-S3#101

Merged
zevorn merged 2 commits intomainfrom
claude/esp32-usb-mouse-qjxQe
Mar 20, 2026
Merged

drivers: add USB HID mouse support for ESP32-S3#101
zevorn merged 2 commits intomainfrom
claude/esp32-usb-mouse-qjxQe

Conversation

@zevorn
Copy link
Copy Markdown
Owner

@zevorn zevorn commented Mar 20, 2026

Add USB HID mouse emulation via ESP32-S3 native USB OTG + TinyUSB:

  • drivers/input/espressif/usb_hid_mouse.c: TinyUSB HID mouse driver
    with standard 3-button + scroll wheel report descriptor, registered
    as claw_driver (probe initializes TinyUSB)
  • claw/tools/tool_mouse.c: AI-callable tools (mouse_move, mouse_click,
    mouse_scroll) with JSON schema, conditional on CONFIG_RTCLAW_TOOL_MOUSE
  • Kconfig: CONFIG_RTCLAW_USB_HID_MOUSE (depends on ESP32-S3) and
    CONFIG_RTCLAW_TOOL_MOUSE options
  • ESP32-S3 default board: enabled by default with TinyUSB HID
  • Swarm: add SWARM_CAP_MOUSE capability bit
  • Meson: add tool_mouse option and source file
  • idf_component.yml: add esp_tinyusb dependency

Note: USB OTG and USB-JTAG share GPIO 19/20 on ESP32-S3. When HID
mouse is enabled, debug console must use UART instead.

https://claude.ai/code/session_01ME8VuJJjmv4L2X8M9nFcMf
Signed-off-by: Claude noreply@anthropic.com

claude added 2 commits March 20, 2026 05:13
Add USB HID mouse emulation via ESP32-S3 native USB OTG + TinyUSB:

- drivers/input/espressif/usb_hid_mouse.c: TinyUSB HID mouse driver
  with standard 3-button + scroll wheel report descriptor, registered
  as claw_driver (probe initializes TinyUSB)
- claw/tools/tool_mouse.c: AI-callable tools (mouse_move, mouse_click,
  mouse_scroll) with JSON schema, conditional on CONFIG_RTCLAW_TOOL_MOUSE
- Kconfig: CONFIG_RTCLAW_USB_HID_MOUSE (depends on ESP32-S3) and
  CONFIG_RTCLAW_TOOL_MOUSE options
- ESP32-S3 default board: enabled by default with TinyUSB HID
- Swarm: add SWARM_CAP_MOUSE capability bit
- Meson: add tool_mouse option and source file
- idf_component.yml: add esp_tinyusb dependency

Note: USB OTG and USB-JTAG share GPIO 19/20 on ESP32-S3. When HID
mouse is enabled, debug console must use UART instead.

https://claude.ai/code/session_01ME8VuJJjmv4L2X8M9nFcMf
Signed-off-by: Claude <noreply@anthropic.com>
- Add missing #include <stdio.h> for snprintf in tool_mouse.c
- Replace undefined CLAW_ERROR with CLAW_ERR_GENERIC (claw_errno.h)
- Replace undefined CLAW_ERR_NOT_SUPPORTED with CLAW_ERR_INVALID
- Fix CMakeLists.txt: move stub source init before conditional USB HID
  append so list(APPEND) is not overwritten by set()

https://claude.ai/code/session_01ME8VuJJjmv4L2X8M9nFcMf
Signed-off-by: Claude <noreply@anthropic.com>
@zevorn zevorn merged commit 2cf25fb into main Mar 20, 2026
16 of 17 checks passed
@zevorn zevorn deleted the claude/esp32-usb-mouse-qjxQe branch March 20, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants