0

I'm trying to learn USB linux device drivers to implement a project idea I have:

Primary device is a Rasp Pi with USB port

Secondary device is a custom USB stick that I'm going to design with some LEDs and buttons. It will have some kind of either Microcontroller, another Rasp Pi, or a USB controller IC based on how I need to implement the USB gadget driver.

How should the USB host and gadget drivers be implemented? The gadget driver needs to be implemented on the USB stick or can it also be implemented in the primary device, such that I can drive the LED output and read the buttons input from USB stick on the primary device?

5
  • 1
    You are probably looking for HID protocol over U\SB (en.wikipedia.org/wiki/Human_interface_device). In this case the both ends need the respective drivers. And I believe there are already examples for that. Commented Mar 12 at 19:38
  • @0andriy Thank you. Can you provide link(s) to examples? Commented Mar 12 at 19:40
  • Your use of terminology is suspect. You seem to use "primary device" when you probably mean the USB host, and "USB stick" and/or "secondary device" instead of USB gadget. "The gadget driver ... or can it also be implemented in the primary device ..." - No, the USB gadget driver (software) interfaces with the USB gadget/device controller (hardware) on the SBC that is your "gadget". Your long, last assertion/question makes no sense at all. FYI the "B" in USB stands for "Bus", i.e. an addressable pathway for control and data. Commented Mar 12 at 23:20
  • 1
    docs.kernel.org/usb/gadget_hid.html, github.com/mad-ady/linux-gadget-hid and so on, please do your homework. Commented Mar 13 at 20:12
  • See also: electronics.stackexchange.com/q/49140 Commented Mar 14 at 17:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.