Developer knowledge network · moderated exchange

Zajednica UnreliableCode

Zajednica za istraživanje, obrnuti inženjering i programiranje programera

Knowledge indexŽivjeti
4Categories
919Threads
2.8KPostovi
Guide

Hardware USB mouse delta packet emulation with Raspberry Pi Pico

colorbot_crafter
Hardware Modder
MEMBER
Rep: 126
Datum pridruživanja: Mar 2021
Postovi: 14
Hvala: 78
prije 1 mjeseci · 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
Rep: 115
Datum pridruživanja: Jan 2020
Postovi: 12
Hvala: 83
prije 1 mjeseci · 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
Rep: 42
Datum pridruživanja: May 2019
Postovi: 24
Hvala: 37
prije 1 mjeseci · Jun 30, 2026 11:03 AM
#3

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