USB学习总结3—USB gadget设备驱动实现(usb串口功能)

USB串口(CDC ACM)

1 内核配置

Device driver

                   ->[*] usb support

                                    ->USB gadget support(gadgetAPI)

                                                      ->[*]serial gadget(设备控制驱动)

                                    ->[*]USB modem support(gadget驱动)

测试:

fedora 的PC端访问/dev/ttyACM0

开发板访问/dev/ttyGS0


开发板读取ttyGS0文件: cat /dev/ttyGS0

宿主机写入ttyACM0: echo hello >/dev/ttyACM0

总结:从驱动设置过程可以看出,作为gadget设备驱动设置基本遵循 gadget API ->device driver ->gadget driver的顺序基本都可以实现。

例如:作为网卡:

Device driver ->usbsupport->USB gadget support(gadgetAPI)->usb peripheral controller(设备控制驱动)

                                          ->gadget driver

                                          ->ethernet gadget driver(gadget驱动)



你可能感兴趣的:(嵌入式,内核驱动)