Developer knowledge network · moderated exchange

مجتمع الكود غير الموثوق به

أبحاث المطورين، مجتمع الهندسة العكسية والترميز

Knowledge indexيعيش
4Categories
919Threads
2.8Kدعامات
Guide

Hardware USB mouse delta packet emulation with Raspberry Pi Pico

colorbot_crafter
Hardware Modder
MEMBER
مندوب: 126
تاريخ الانضمام: Mar 2021
دعامات: 14
شكرًا: 78
1 months ago · Jun 29, 2026 8:39 PM
#1

Why Raspberry Pi Pico (RP2040) is replacing Arduino Leonardo for hardware mouse control:

  1. Dual Cortex-M0+ cores running at 133MHz (5x faster than 16MHz ATmega32U4).
  2. Hardware USB Controller supports custom TinyUSB HID descriptors.
  3. UART / Serial baud rate supports up to 921,600 baud, reducing serial packet latency from 4ms down to 0.1ms.

Code snippet in C with TinyUSB:

C
#include "tusb.h"
void send_mouse_delta(int8_t dx, int8_t dy, uint8_t buttons) {
    if (tud_hid_ready()) {
        tud_hid_mouse_report(0, buttons, dx, dy, 0, 0);
    }
}
dma_ghost
DMA Guru
MEMBER
مندوب: 115
تاريخ الانضمام: Jan 2020
دعامات: 12
شكرًا: 83
1 months ago · Jun 30, 2026 12:52 AM
#2

RP2040 is awesome. You can also spoof the USB string descriptors (Manufacturer, Product, Serial) in flash memory.

val_driver_guy
Driver Dev
MEMBER
مندوب: 42
تاريخ الانضمام: May 2019
دعامات: 24
شكرًا: 37
1 months ago · Jun 30, 2026 11:03 AM
#3

0.1ms transfer latency is huge. Completely eliminates input delay on fast flicks.