Make a microcontroller appear to a computer as a USB keyboard, mouse, or storage drive
Build a USB host that reads input from keyboards, mice, or MIDI instruments plugged into your board
Add USB audio or MIDI output to an embedded hardware project
Write a custom USB device class driver without modifying the library core
Requires a supported MCU toolchain and a compatible hardware development board.
TinyUSB is an open-source library written in C that lets microcontrollers communicate over USB. It handles both the device side (making your board appear to a computer as a keyboard, storage drive, audio interface, or serial port) and the host side (letting your board read from a USB keyboard, drive, or MIDI instrument plugged into it). It is designed to run on small embedded chips where memory is tight and real-time response matters. Two design goals shape everything about the library. First, it never allocates memory dynamically at runtime, so there are no surprise crashes from running out of memory on a small chip. All buffers are declared upfront. Second, USB interrupt events are never processed directly inside the interrupt handler, instead they are pushed into a queue and handled in ordinary task code. This makes the library safe to use in multitasking environments where multiple pieces of code might try to access the USB hardware at the same time. The device stack supports a wide range of USB device types: serial port emulation (CDC), human interface devices like keyboards and mice (HID), mass storage (MSC, which makes the board show up as a USB drive), audio (UAC1 and UAC2), MIDI, networking, Bluetooth, device firmware update, and more. The host stack lets a board act as the USB controller that reads input from keyboards, mice, storage drives, MIDI devices, and USB serial adapters from common chip makers. You can also write your own device class driver without modifying the library itself. The library supports over 50 different microcontroller families from manufacturers including Raspberry Pi, Nordic Semiconductor, STMicroelectronics, NXP, Espressif, Renesas, and many others. It works with no operating system at all, or alongside FreeRTOS, RT-Thread, or Mynewt. Examples are provided for a range of supported development boards, and the recommended starting point for new users is the combined CDC and mass storage example. The project is funded by Adafruit and is licensed under the MIT license. Documentation lives online, and the community uses GitHub Discussions for questions. The README includes a large compatibility table listing exactly which USB features (device mode, host mode, high-speed) are supported on each chip family.
← hathach on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.