cavearr / usb_hid_host

A compact USB HID host FPGA core supporting keyboards, mice and gamepads.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compact USB HID host FPGA core

nand2mario, 8/2023

Usb_hid_host is a compact FPGA core designed to support USB keyboards, mice and gamepads. It is designed mainly for FPGA retro gaming and computing projects. The most significant advantage is its all-in-one design. It does not require a CPU to work. And it is quite small (<300 LUTs, <250 registers and 1 BRAM block).

To use usb_hid_host, simply add usb_hid_host.v, usb_hid_host_rom.v and usb_hid_host_rom.hex to your project. The module interface in usb_hid_host.v should be sufficiently documented to get you started.

Please refer to usb_hid_host.md for a more comprehensive introduction to the design of the core.

Sample projects

Sample projects are available for the following boards to demonstrate the usage of usb_hid_host.

  • Tang Nano 20K (Gowin GW2A FPGA). Gowin IDE project file usb_hid_proj.gprj is provided. Simply open it in Gowin IDE and build the project.
  • IceSugar-Pro and Machdyne Schoko (Lattice ECP5). These come with Makefiles for the open source Yosys/nextpnr toolchain.
  • iCEBreaker and Machdyne Riegel (Lattice iCE40), also building with Yosys/nextpnr.

Connect your USB devices and expect results similar to the following.

Usb_hid_host does not rely on vendor-specific primitives, making it compatible with most FPGAs and boards. If you encounter any problems, please submit an issue.

For a larger project using usb_hid_host, see NESTang.

Future Improvements

  • Handling multiple devices on a single port (USB hubs).
  • Support for full-speed devices.
  • Testing compatibility with more devices.

Credit

About

A compact USB HID host FPGA core supporting keyboards, mice and gamepads.

License:Apache License 2.0


Languages

Language:Verilog 67.3%Language:SystemVerilog 11.6%Language:Assembly 7.7%Language:Perl 5.5%Language:Makefile 3.9%Language:Python 2.4%Language:Tcl 1.6%