SciTech-ICEE-Embeded-Automation-Simulation-HID-STM32系列MCU的自动化交互: USB+OTG+HID模拟 & STM32 USB Tutorials
SciTech-ICEE-Embeded-Automation-Simulation-HID-
STM32系列MCU的自动化交互: USB+OTG+HID模拟
- STM32 USB Tutorials
https://controllerstech.com/stm32-hal/peripherals/usb-tutorials/
STM32 USB Series
The STM32 USB series covers how to use the built-in USB peripheral on STM32 microcontrollers.
Starting from basic USB device configuration, the series works through common use cases like CDC virtual COM port for serial communication over USB, HID for keyboard and mouse emulation, and mass storage for reading and writing files.
USB is a widely used interface and having it working directly on the STM32 removes the need for an external USB to UART converter in many projects. - STM32 USB CDC: Virtual COM Port Setup, Transmit & Receive Data
https://controllerstech.com/stm32-usb-cdc-virtual-com-port/ - STM32 USB HID Gamepad: Configure STM32 as a Game Controller
https://controllerstech.com/stm32-usb-hid-gamepad/ - STM32 as USB Mouse and Keyboard — HID Device Implementation
https://controllerstech.com/stm32-usb-hid-mouse-keyboard/ - STM32 USB Mass Storage Class: Use SD Card as External Drive
https://controllerstech.com/stm32-usb-mass-storage-class-sd-card/ - STM32 USB Mass Storage Class with W25Q NOR Flash: External Drive over SPI
https://controllerstech.com/stm32-usb-mass-storage-class-w25q-nor-flash/ - STM32 USB Composite Class: CDC + HID Gamepad on One USB Port
https://controllerstech.com/stm32-usb-composite-class-cdc-hid/ - STM32 USB HID Device: Combine Mouse and Keyboard on One Port
https://controllerstech.com/stm32-usb-hid-mouse-and-keyboard-combined/ - STM32 USB Host MSC: Read & Write USB Flash Drive with FatFs and FreeRTOS
https://controllerstech.com/stm32-usb-host-mass-storage-fatfs/ - STM32 USB Host HID: Read Keyboard and Mouse Data with STM32
https://controllerstech.com/stm32-usb-host-hid-keyboard-mouse/ - STM32 USB Host Audio Class: Play WAV Files from SD Card
https://controllerstech.com/stm32-usb-host-audio-class-sd-card/ - STM32 USB DFU Bootloader: Flash Firmware Over USB Without ST-Link
https://controllerstech.com/stm32-usb-dfu-bootloader/
STM32 USB HID: Emulate a Mouse and Keyboard with STM32
https://controllerstech.com/stm32-usb-hid-mouse-keyboard/
Home ▸ STM32 Tutorials ▸ USB Tutorials ▸ STM32 as USB Mouse and Keyboard
Updated On: August 5, 2026
STM32 USB HID: Emulate a Mouse and Keyboard with STM32
This is Part 3 of the STM32 USB series.
In Part 2, we configured the STM32 as a USB HID gamepad.
We connected a joystick via ADC, wrote a custom HID report descriptor, and made Windows and macOS recognize the STM32 as a game controller without using any drivers for the same.
This time, we go further.
We will use the same HID class to make the STM32 behave as a USB mouse and, separately, as a USB keyboard.
Both projects are covered in this post.
The mouse uses the same joystick from Part 2, and the keyboard uses a 4×4 membrane keypad.

浙公网安备 33010602011771号