USB Gadget API
LinuxのAPI。これを使うと Linux マシンが USB Gadget になれる。
とはいえ普通にUSBポートが複数あるPCじゃだめ
お手軽で知名度が高いのは
Raspberry Pi Zero W(H)
Raspberry Pi 4
電源供給用の Type-C ポートのみ
1ポートしかUSBがない Raspberry Pi でもできるけど A to A が必要なのであんまり…
公式ドキュメント
USB support — The Linux Kernel documentation https://www.kernel.org/doc/html/v5.3/usb/index.html
Linux USB gadget configured through configfs — The Linux Kernel documentation https://www.kernel.org/doc/html/v5.3/usb/gadget_configfs.html
configfsでの USB gadget の設定のしかた
https://github.com/torvalds/linux/tree/v4.19/Documentation/ABI/testing
gadgetの中身別の説明
ABI が testing なのでまだ安定していない?
日本語文献
スマホでNintendo Switchを操作する 〜 USB GadgetでPro Controllerをシミュレート 〜 | 犬アイコンのみっきー https://mzyy94.com/blog/2020/03/20/nintendo-switch-pro-controller-usb-gadget/#usb-gadget-api
exampleもある