{"id":1648,"date":"2011-04-11T08:35:10","date_gmt":"2011-04-11T07:35:10","guid":{"rendered":"https:\/\/blogs.mentor.com\/colinwalls\/?p=1648"},"modified":"2026-03-26T16:34:25","modified_gmt":"2026-03-26T20:34:25","slug":"usb-class-drivers","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/embedded-software\/2011\/04\/11\/usb-class-drivers\/","title":{"rendered":"USB &#8211; class drivers"},"content":{"rendered":"<p>I have written about various aspects of USB <a href=\"https:\/\/blogs.mentor.com\/colinwalls\/blog\/2010\/11\/01\/usb-even-more\/\" target=\"_blank\" rel=\"noopener noreferrer\">before<\/a> and presented many seminar and conference sessions on the topic. I find it interesting that, considering that USB is such a straightforward technology for most users to utilize, its deployment in devices can be quite challenging.<\/p>\n<p>A particular area of confusion is USB Class Drivers. The word &#8220;class&#8221; is very overloaded in the software world &#8211; it has numerous meanings. And the term &#8220;driver&#8221; is far from precise. So, it is unsurprising that the subject provokes discussion &#8230;<!--more--><\/p>\n<p>In the world of USB we talk about &#8220;hosts&#8221;, which sit at one end of the bus and are in control &#8211; a PC is a typical host. We also talk about &#8220;functions&#8221;, which are peripheral devices at the other end of the bus; mice, keyboards, storage devices, scanners and printers are all common examples of USB functions.<\/p>\n<p>Both the USB host and function need USB support software &#8211; a USB stack. On a Windows PC, the [host] USB stack is provided by Microsoft as part of the operating system. For a function, the USB stack is part of the embedded software that controls the device and would be typically supplied by a vendor of embedded software IP, such as <a href=\"http:\/\/www.mentor.com\/embedded-software\/nucleus\/usb\" target=\"_blank\" rel=\"noopener noreferrer\">Mentor Graphics<\/a>. Incidentally, although a peripheral typically needs a USB function stack, an embedded device might be required to function as a host, in which case a USB host stack is required [as well as a function stack, perhaps]. Again, this is likely to be available from a company like Mentor.<\/p>\n<p>Part of a USB stack [on both ends of the bus] characterizes what kind of device is being interfaced &#8211; this is the USB Class Driver. A number of standard class drivers have been defined and may be expected to be available with any USB stack. These include: audio, communications, human interface, mass storage, still image and video. Some others are more specialized and less widely implemented, such as personal healthcare and device firmware upgrade.<\/p>\n<p>If you are designing a device with a USB interface, it needs to be associated with a class driver on both ends of the bus. Although you can create a custom class driver for the function stack, it is generally much less work to make your device look as much like a standard as possible and, hence, make use of a supplied class driver. A strong incentive to follow this path is the requirement for a matching class driver at the host end. If you create a custom class driver for the function, you might need to also need to do more work for the host, which could include PC, Mac, Linux etc.<\/p>\n<p>I have an example of a USB device where the designers clearly took this approach: a wireless remote control device for PowerPoint on my PC. I can hold this tiny device in my hand and advance slides during a presentation without having to approach my computer. It transmits signals to a tiny receiver which is plugged into a USB port. When this is connected to the PC, it &#8220;pretends&#8221; to be a keyboard, so the standard human interface class driver in the Windows USB stack is used. The device only generates three possible keystrokes: right-arrow, left-arrow and ESC. This is a good example of how to economically deploy USB and result in a device which is simplicity itself for the user.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have written about various aspects of USB before and presented many seminar and conference sessions on the topic. I&#8230;<\/p>\n","protected":false},"author":71677,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1],"tags":[300,326],"industry":[],"product":[],"coauthors":[],"class_list":["post-1648","post","type-post","status-publish","format-standard","hentry","category-news","tag-embedded-software","tag-usb"],"_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/1648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/users\/71677"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/comments?post=1648"}],"version-history":[{"count":1,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/1648\/revisions"}],"predecessor-version":[{"id":9948,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/1648\/revisions\/9948"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/media?parent=1648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/categories?post=1648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/tags?post=1648"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/industry?post=1648"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/product?post=1648"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/coauthors?post=1648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}