Close

Gathering information

A project log for Wii Nunchuk as a USB HID controller

Project in which Wii Nunchuk controller is used as a USB HID controller for computer graphics apps.

michalMichal 02/06/2019 at 17:350 Comments

I've started by ordering 5 Blue pill boards... they are super cheap but it takes awhile for them to get here (I ordered them through AliExpress). In the meantime I started research.

There are 3 topics that I had to go through:

I have started by going through the USB specification... It really is a confusing mess. I can't say I would design a universal standard better. It's not an easy task. I can't say USB is well designed though. I've played around with connecting Playstation 2 game pad and sniffing the USB packets with WireShark. I've also went through libopencm3's USB examples. Combining those different sources of information gave me some idea about USB, but it also made me realize there is way more than what HID USB device can teach you about USB.

When it comes to the firmware I've already decided I want to use libopencm3 library and that the Windows has to be first OS that handles this device. Depending on how it goes I might tackle Linux in the future. Except the libopencm3's examples, the Pill duck project gave me a bit of insight of how firmware like that could look like.

I admire the Handmade Network started by Casey Muratori and his Handmade Hero project. I share the attitude of avoiding third party libraries. I do belive it's possible to do a lot of low level things on your own. Because of that I wanted to write a legit USB device driver. That means I wanted to use direct OS calls.... but...

I researched the topic of writing a USB device driver for Windows and once again... it's a mess. There are multiple ways of doing it and I'm still not sure where are the boundaries between those. After some experimentation i've decided to go with the hidapi library. There are multiple reasons why I ended up using that one, and I will explain it better in next posts.

Discussions