1 / 24

輸出入裝置與驅動程式 設計之 USB Device Driver

輸出入裝置與驅動程式 設計之 USB Device Driver. 指導老師:蔡國煇老師 學生:陳臣瑩、歐柏宏. Outline. USB 發展與介紹 USB 架構 USB Device Driver 說明 Demo 遭遇的問題. USB 發展與介紹 . USB(Universal Serial Bus, USB) 是電腦與週邊裝置的連線。 目的取代多種慢速的匯流排,朝統一規格方向 RS232(115Kbps) 並列 埠 (360Kbps) PS/2 USB 速度理論上可達 5Gbps(usb3.0) USB 已經成為所有外接置的第一選擇

hamal
Download Presentation

輸出入裝置與驅動程式 設計之 USB Device Driver

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 輸出入裝置與驅動程式設計之USB Device Driver 指導老師:蔡國煇老師 學生:陳臣瑩、歐柏宏

  2. Outline • USB發展與介紹 • USB架構 • USB Device Driver說明 • Demo • 遭遇的問題

  3. USB發展與介紹 • USB(Universal Serial Bus, USB)是電腦與週邊裝置的連線。 • 目的取代多種慢速的匯流排,朝統一規格方向 • RS232(115Kbps) • 並列埠(360Kbps) • PS/2 • USB速度理論上可達5Gbps(usb3.0) • USB已經成為所有外接置的第一選擇 • USB最大特點支援熱插拔

  4. USB發展與介紹

  5. USB發展與介紹 • Human Interface Devices • Mice • Joysticks • Image Devices • Communications Devices • Faxes • Audio Devices • Printer Devices • Storage Devices • USB Hubs

  6. USB 架構 • USB SPEC • USB host and device • Interface • Endpoint • Configuration

  7. Device- Represent the devices connected to the USB bus. Example: USB speaker with volume control buttons. • Configurations- Represent the state of the device. Examples: Active, Standby, Initialization • Interfaces –Logical devices. Example (USB webcam): video stream, audio stream, keyboard (control buttons). • Endpoints- Unidirectional communication pipes. Either IN (device to computer) or OUT (computer to device).

  8. Control endpoints • Used to configure the device, get information about it, send commands to it, retrieve status information. • Simple, small data transfers. • Every device has a control endpoint (endpoint 0),used to configure the device at insertion time. • The USB protocol guarantees that the corresponding data transfers will always have enough (reserved) bandwidth.

  9. Interrupt endpoints • Transfer small amounts of data at a fixed rate each time the hosts asks the device for data. • Guaranteed, reserved bandwidth. • For devices requiring guaranteed response time, such as USB mice and keyboards. • Note: different than hardware interrupts. Require constant polling from the host.

  10. Bulk endpoints • Large sporadic data transfers using all remaining available bandwidth. • No guarantee on bandwidth or latency. • Guarantee that no data is lost. • Typically used for printers, storage or network devices.

  11. Isochronous endpoints • Also for large amounts of data. • Guaranteed speed(often but not necessarily as fast as possible). • No guarantee that all data makes it through. • Used by real-time data transfers (typically audio and video).

  12. Linux USB communication:USB Request Blocks • Any communication between the host and device is done asynchronously using USB Request Blocks (urbs). • They are similar to packets in network communications. • Every endpoint can handle a queue of urbs. • A driver may allocate many urbs for a single endpoint, or reuse the same urb for different endpoints.

  13. The lifecycle of an urb

  14. USB架構

  15. USB架構

  16. USB Device Driver說明

  17. USB Device Driver說明

  18. DEMO • Use LDD3 CH13 USB’s usb-skeleton • 需要USB設備或開發板作實際測試 • 為求簡單方便故採用軟體模擬的方式作測試USB Gadget • Emulator modules • Dummy_hcd( USB host and device emulator) • G_zero(USB device) • Goal: write to emulator USB device.

  19. DEMO • Step1: continuing monitor kernel log • Step2: remove usbtest module.

  20. DEMO • Step2: insert dummy_hcd module (Emulator)

  21. DEMO • Step3: insert g_zero module(gadget)

  22. DEMO • Step4: insert usb-skeleton

  23. DEMO • Step5: check device status

  24. DEMO • Step6: check device status • Step7: remove modules

More Related