USB_Host_Shield_2.0/usb__ch9_8h_source.html
Kristian Sloth Lauszus 32e9b6197f Update after formatting
2013-04-01 22:52:24 +02:00

265 lines
49 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>USB Host Shield 2.0: usb_ch9.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="imageStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">USB Host Shield 2.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_e5fbe6d2783ccd4c93c7856d92d7be6e.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_397a095372f04465e811d0ee219bbf8f.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">usb_ch9.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="usb__ch9_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">This software may be distributed and modified under the terms of the GNU</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">General Public License version 2 (GPL2) as published by the Free Software</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">Foundation and appearing in the file GPL2.TXT included in the packaging of</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">this file. Please note that GPL2 Section 2[b] requires that all works based</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">on this software must also be made publicly available under the terms of</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">the GPL2 (&quot;Copyleft&quot;).</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">Contact information</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">-------------------</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment">Circuits At Home, LTD</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">Web : http://www.circuitsathome.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">e-mail : support@circuitsathome.com</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">/* USB chapter 9 structures */</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#ifndef _ch9_h_</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define _ch9_h_</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &lt;inttypes.h&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment">/* Misc.USB constants */</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ab7e334b0d473aca9604a2522c0702e78"> 24</a></span>&#160;<span class="preprocessor">#define DEV_DESCR_LEN 18 //device descriptor length</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a7256578391c91b980eec63daa6e87b6b"> 25</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define CONF_DESCR_LEN 9 //configuration descriptor length</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a4922a4b2d56a973f3704ce1775cf9d37"> 26</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define INTR_DESCR_LEN 9 //interface descriptor length</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a83547c94285cfb215336a3c44aeea1b9"> 27</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define EP_DESCR_LEN 7 //endpoint descriptor length</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="comment">/* Standard Device Requests */</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a062f3147a1bae954b642b915827b3f3f"> 31</a></span>&#160;<span class="preprocessor">#define USB_REQUEST_GET_STATUS 0 // Standard Device Request - GET STATUS</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ab9fe860caa1f21c9410984a24bf57c7c"> 32</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_CLEAR_FEATURE 1 // Standard Device Request - CLEAR FEATURE</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#aa2b4d305dcd185cc1242e94ee78eea25"> 33</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_SET_FEATURE 3 // Standard Device Request - SET FEATURE</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ac87659819bfd6491120c819fae2d46bc"> 34</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_SET_ADDRESS 5 // Standard Device Request - SET ADDRESS</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f"> 35</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_GET_DESCRIPTOR 6 // Standard Device Request - GET DESCRIPTOR</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a3c80fdedd69586ccf2894f5bd4638252"> 36</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_SET_DESCRIPTOR 7 // Standard Device Request - SET DESCRIPTOR</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a341ed4aff1f0d5a1a4a4f17cb606d08d"> 37</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_GET_CONFIGURATION 8 // Standard Device Request - GET CONFIGURATION</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#aadef005acc40340955d34d9767ef297c"> 38</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_SET_CONFIGURATION 9 // Standard Device Request - SET CONFIGURATION</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a25550f44898d9c9a3bf0a7814af7fe96"> 39</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_GET_INTERFACE 10 // Standard Device Request - GET INTERFACE</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#af8d2ea632916bfc2a7628f63d3f643aa"> 40</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_SET_INTERFACE 11 // Standard Device Request - SET INTERFACE</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a7497da1d974b456583b64889a2b5dd04"> 41</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_REQUEST_SYNCH_FRAME 12 // Standard Device Request - SYNCH FRAME</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a0a75e9871273bf2c40d1d9aa1641c8ce"> 43</a></span>&#160;<span class="preprocessor">#define USB_FEATURE_ENDPOINT_HALT 0 // CLEAR/SET FEATURE - Endpoint Halt</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // CLEAR/SET FEATURE - Device remote wake-up</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_FEATURE_TEST_MODE 2 // CLEAR/SET FEATURE - Test mode</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="comment">/* Setup Data Constants */</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a610dad02930a3061c746f84885e1e11e"> 49</a></span>&#160;<span class="preprocessor">#define USB_SETUP_HOST_TO_DEVICE 0x00 // Device Request bmRequestType transfer direction - host to device transfer</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a35c2a529dc87a274b2eb6f9e33682449"> 50</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETUP_DEVICE_TO_HOST 0x80 // Device Request bmRequestType transfer direction - device to host transfer</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a3b51a35acaa76cafbb987c07186a7868"> 51</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETUP_TYPE_STANDARD 0x00 // Device Request bmRequestType type - standard</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#acf3fd30992e9fe01f1bac9aaa7fea61b"> 52</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETUP_TYPE_CLASS 0x20 // Device Request bmRequestType type - class</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a876bdd74d8bfb072121b9643556271ba"> 53</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETUP_TYPE_VENDOR 0x40 // Device Request bmRequestType type - vendor</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ad48131dc5ca47b4b2def65e7bbc8442f"> 54</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETUP_RECIPIENT_DEVICE 0x00 // Device Request bmRequestType recipient - device</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a59754621c21db801e11513ba06a3a02e"> 55</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETUP_RECIPIENT_INTERFACE 0x01 // Device Request bmRequestType recipient - interface</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ac6ef27ac78140749f3607246f21c1471"> 56</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETUP_RECIPIENT_ENDPOINT 0x02 // Device Request bmRequestType recipient - endpoint</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#aa1a71b2e05ba5682c956d8dfdf01d40b"> 57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETUP_RECIPIENT_OTHER 0x03 // Device Request bmRequestType recipient - other</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="comment">/* USB descriptors */</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ac6d0566773ed4549fe1a7a932e6c46de"> 61</a></span>&#160;<span class="preprocessor">#define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor.</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7"> 62</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor.</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#abbad38caa1ca9c52f47adccd3a850aed"> 63</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DESCRIPTOR_STRING 0x03 // bDescriptorType for a String Descriptor.</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a5856eef11136823c671407f77cc5d254"> 64</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DESCRIPTOR_INTERFACE 0x04 // bDescriptorType for an Interface Descriptor.</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ac3f574f82929eedc3386195f9a941203"> 65</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DESCRIPTOR_ENDPOINT 0x05 // bDescriptorType for an Endpoint Descriptor.</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#afd341d3128818c2db68a3523118e0820"> 66</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DESCRIPTOR_DEVICE_QUALIFIER 0x06 // bDescriptorType for a Device Qualifier.</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a23e9c1e9645156958e80e9aa2ee77ef7"> 67</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DESCRIPTOR_OTHER_SPEED 0x07 // bDescriptorType for a Other Speed Configuration.</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ab02fac418606f02b4681c3302fbbce07"> 68</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DESCRIPTOR_INTERFACE_POWER 0x08 // bDescriptorType for Interface Power.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ac75fbfa446e248951836d6b6bfad44d0"> 69</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DESCRIPTOR_OTG 0x09 // bDescriptorType for an OTG Descriptor.</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a90140ca7ead37fd62faeb395f0942a67"> 71</a></span>&#160;<span class="preprocessor">#define HID_DESCRIPTOR_HID 0x21</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="comment">/* OTG SET FEATURE Constants */</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ab1eb008c2545555250224ffdd22e6ef7"> 76</a></span>&#160;<span class="preprocessor">#define OTG_FEATURE_B_HNP_ENABLE 3 // SET FEATURE OTG - Enable B device to perform HNP</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ac95e8be488ed9ca8ebf9541306fe070b"> 77</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define OTG_FEATURE_A_HNP_SUPPORT 4 // SET FEATURE OTG - A device supports HNP</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a4c05deae742762f3110366a7bb8bffc2"> 78</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define OTG_FEATURE_A_ALT_HNP_SUPPORT 5 // SET FEATURE OTG - Another port on the A device supports HNP</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="comment">/* USB Endpoint Transfer Types */</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#aca5ae035469fa5e3d238eea0942bba88"> 81</a></span>&#160;<span class="preprocessor">#define USB_TRANSFER_TYPE_CONTROL 0x00 // Endpoint is a control endpoint.</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ae0865fa52b39929c055e59559e138392"> 82</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_TRANSFER_TYPE_ISOCHRONOUS 0x01 // Endpoint is an isochronous endpoint.</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a54c90d3ca8c3f7911d9d8cb17f59d939"> 83</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_TRANSFER_TYPE_BULK 0x02 // Endpoint is a bulk endpoint.</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ac80ae240a4a703b554aa8edee201495f"> 84</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_TRANSFER_TYPE_INTERRUPT 0x03 // Endpoint is an interrupt endpoint.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ac1b1bcdd6bd4e8c5a65052e914e028d5"> 85</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define bmUSB_TRANSFER_TYPE 0x03 // bit mask to separate transfer type from ISO attributes</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="comment">/* Standard Feature Selectors for CLEAR_FEATURE Requests */</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a3ff0518fb298c9c9b556f59c0468ec0d"> 89</a></span>&#160;<span class="preprocessor">#define USB_FEATURE_ENDPOINT_STALL 0 // Endpoint recipient</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#ab75da7fec6dd00924f1d9f4e3c587a6f"> 90</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // Device recipient</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="usb__ch9_8h.html#a90a1a76a81c04849dc897dacf6c3a213"> 91</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_FEATURE_TEST_MODE 2 // Device recipient</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;<span class="comment">/* descriptor data structures */</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="comment">/* Device descriptor structure */</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html"> 96</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#a951dd86a1fee895f356a0be0fc8c0d8f"> 97</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#a951dd86a1fee895f356a0be0fc8c0d8f">bLength</a>; <span class="comment">// Length of this descriptor.</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#aad465b71adef34630171e88b0a3664a3"> 98</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#aad465b71adef34630171e88b0a3664a3">bDescriptorType</a>; <span class="comment">// DEVICE descriptor type (USB_DESCRIPTOR_DEVICE).</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#a621148cd71148fb15e136010480a34ac"> 99</a></span>&#160; uint16_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#a621148cd71148fb15e136010480a34ac">bcdUSB</a>; <span class="comment">// USB Spec Release Number (BCD).</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#afa7047f0318ab6df92a12291511cc1ce"> 100</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#afa7047f0318ab6df92a12291511cc1ce">bDeviceClass</a>; <span class="comment">// Class code (assigned by the USB-IF). 0xFF-Vendor specific.</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#af01535d145805f4bfae66e21f1fc652d"> 101</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#af01535d145805f4bfae66e21f1fc652d">bDeviceSubClass</a>; <span class="comment">// Subclass code (assigned by the USB-IF).</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#af205ea8c5729e0ddbf4dcbdf1636fe57"> 102</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#af205ea8c5729e0ddbf4dcbdf1636fe57">bDeviceProtocol</a>; <span class="comment">// Protocol code (assigned by the USB-IF). 0xFF-Vendor specific.</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#a92d96e9016c96043dccf56872d13a628"> 103</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#a92d96e9016c96043dccf56872d13a628">bMaxPacketSize0</a>; <span class="comment">// Maximum packet size for endpoint 0.</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#ae3c7088fe6f7b521132d8f2b95f958bc"> 104</a></span>&#160; uint16_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#ae3c7088fe6f7b521132d8f2b95f958bc">idVendor</a>; <span class="comment">// Vendor ID (assigned by the USB-IF).</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#adaec05748124a104c3d49008433719ba"> 105</a></span>&#160; uint16_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#adaec05748124a104c3d49008433719ba">idProduct</a>; <span class="comment">// Product ID (assigned by the manufacturer).</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#aa4e565c598b6605cbcfe8cab66f99e65"> 106</a></span>&#160; uint16_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#aa4e565c598b6605cbcfe8cab66f99e65">bcdDevice</a>; <span class="comment">// Device release number (BCD).</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#ad16528e2a4018962f8d7d97036386eac"> 107</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#ad16528e2a4018962f8d7d97036386eac">iManufacturer</a>; <span class="comment">// Index of String Descriptor describing the manufacturer.</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#a63e19361f9fe25a6a2553f7d10569174"> 108</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#a63e19361f9fe25a6a2553f7d10569174">iProduct</a>; <span class="comment">// Index of String Descriptor describing the product.</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#ac9d321b21797ac7a6190ae9a2ffa1e3e"> 109</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#ac9d321b21797ac7a6190ae9a2ffa1e3e">iSerialNumber</a>; <span class="comment">// Index of String Descriptor with the device&#39;s serial number.</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#ab1b8db3992e0dceb2ba86f3bab1e5bca"> 110</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html#ab1b8db3992e0dceb2ba86f3bab1e5bca">bNumConfigurations</a>; <span class="comment">// Number of possible configurations.</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;} __attribute__((packed)) <a class="code" href="struct_u_s_b___d_e_v_i_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_DEVICE_DESCRIPTOR</a>;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="comment">/* Configuration descriptor structure */</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html"> 114</a></span>&#160;typedef struct {</div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a2ba304d3cb0f6b506c190ca8391fd1a6"> 115</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a2ba304d3cb0f6b506c190ca8391fd1a6">bLength</a>; <span class="comment">// Length of this descriptor.</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a28bd3308c28df6445b4b63bdaade83c8"> 116</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a28bd3308c28df6445b4b63bdaade83c8">bDescriptorType</a>; <span class="comment">// CONFIGURATION descriptor type (USB_DESCRIPTOR_CONFIGURATION).</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a39499f3dd4e3f1ef1d8a2c9b430bc11b"> 117</a></span>&#160; uint16_t <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a39499f3dd4e3f1ef1d8a2c9b430bc11b">wTotalLength</a>; <span class="comment">// Total length of all descriptors for this configuration.</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#abd647927a872ac856c9f5aaf624bb99f"> 118</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#abd647927a872ac856c9f5aaf624bb99f">bNumInterfaces</a>; <span class="comment">// Number of interfaces in this configuration.</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a568d08f2ae98670a707489645a67746b"> 119</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a568d08f2ae98670a707489645a67746b">bConfigurationValue</a>; <span class="comment">// Value of this configuration (1 based).</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a488103d763db8744459d2c94995458b0"> 120</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a488103d763db8744459d2c94995458b0">iConfiguration</a>; <span class="comment">// Index of String Descriptor describing the configuration.</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#ac2f4c62d572fe371be5680962e42a8d3"> 121</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#ac2f4c62d572fe371be5680962e42a8d3">bmAttributes</a>; <span class="comment">// Configuration characteristics.</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a3d6088be2999c1189f2a3eb56be51832"> 122</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html#a3d6088be2999c1189f2a3eb56be51832">bMaxPower</a>; <span class="comment">// Maximum power consumed by this configuration.</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;} __attribute__((packed)) <a class="code" href="struct_u_s_b___c_o_n_f_i_g_u_r_a_t_i_o_n___d_e_s_c_r_i_p_t_o_r.html">USB_CONFIGURATION_DESCRIPTOR</a>;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="comment">/* Interface descriptor structure */</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html"> 126</a></span>&#160;typedef struct {</div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#ad1a0f98931b5e094d33c8c31d4e29ad6"> 127</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#ad1a0f98931b5e094d33c8c31d4e29ad6">bLength</a>; <span class="comment">// Length of this descriptor.</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a2515bf5c49f849965030c94f50dea285"> 128</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a2515bf5c49f849965030c94f50dea285">bDescriptorType</a>; <span class="comment">// INTERFACE descriptor type (USB_DESCRIPTOR_INTERFACE).</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a3ae5da44842f99bbde5cca9b20c6911a"> 129</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a3ae5da44842f99bbde5cca9b20c6911a">bInterfaceNumber</a>; <span class="comment">// Number of this interface (0 based).</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a0ddcf6c9bc46ed757e9e15086746b5a1"> 130</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a0ddcf6c9bc46ed757e9e15086746b5a1">bAlternateSetting</a>; <span class="comment">// Value of this alternate interface setting.</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a3268bc05bb0147e19f97e50e702fc141"> 131</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a3268bc05bb0147e19f97e50e702fc141">bNumEndpoints</a>; <span class="comment">// Number of endpoints in this interface.</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a4d352604355f617fef9509951d573356"> 132</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a4d352604355f617fef9509951d573356">bInterfaceClass</a>; <span class="comment">// Class code (assigned by the USB-IF). 0xFF-Vendor specific.</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#ad5b51ed2e6540dd58085f10a2440970e"> 133</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#ad5b51ed2e6540dd58085f10a2440970e">bInterfaceSubClass</a>; <span class="comment">// Subclass code (assigned by the USB-IF).</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#afcce1d75b7b110cc0d11e3328d9c7204"> 134</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#afcce1d75b7b110cc0d11e3328d9c7204">bInterfaceProtocol</a>; <span class="comment">// Protocol code (assigned by the USB-IF). 0xFF-Vendor specific.</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a391ad3184a29ddbe1e02ff1feca8f64a"> 135</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html#a391ad3184a29ddbe1e02ff1feca8f64a">iInterface</a>; <span class="comment">// Index of String Descriptor describing the interface.</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;} __attribute__((packed)) <a class="code" href="struct_u_s_b___i_n_t_e_r_f_a_c_e___d_e_s_c_r_i_p_t_o_r.html">USB_INTERFACE_DESCRIPTOR</a>;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="comment">/* Endpoint descriptor structure */</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html"> 139</a></span>&#160;typedef struct {</div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#a55263a9cc9dc17abc37226ac8a471ad0"> 140</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#a55263a9cc9dc17abc37226ac8a471ad0">bLength</a>; <span class="comment">// Length of this descriptor.</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#af39d036ab903a96b9d4d56b879555d6c"> 141</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#af39d036ab903a96b9d4d56b879555d6c">bDescriptorType</a>; <span class="comment">// ENDPOINT descriptor type (USB_DESCRIPTOR_ENDPOINT).</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#a23fbb539d72d10a6cb12efedf7d3457c"> 142</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#a23fbb539d72d10a6cb12efedf7d3457c">bEndpointAddress</a>; <span class="comment">// Endpoint address. Bit 7 indicates direction (0=OUT, 1=IN).</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#a8ee7f1bafac335258c6e742969387f57"> 143</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#a8ee7f1bafac335258c6e742969387f57">bmAttributes</a>; <span class="comment">// Endpoint transfer type.</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#af34105fa6bd0029d9c6b73d85f7853c6"> 144</a></span>&#160; uint16_t <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#af34105fa6bd0029d9c6b73d85f7853c6">wMaxPacketSize</a>; <span class="comment">// Maximum packet size.</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#a95cd9669dee9cab375a7c5e62284a01b"> 145</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html#a95cd9669dee9cab375a7c5e62284a01b">bInterval</a>; <span class="comment">// Polling interval in frames.</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;} __attribute__((packed)) <a class="code" href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html">USB_ENDPOINT_DESCRIPTOR</a>;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="comment">/* HID descriptor */</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html"> 149</a></span>&#160;typedef struct {</div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a8b525ca82d81716c699e1d1f9c6d2de2"> 150</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a8b525ca82d81716c699e1d1f9c6d2de2">bLength</a>;</div>
<div class="line"><a name="l00151"></a><span class="lineno"><a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a46451809c473f8e4605017fb87362f7c"> 151</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a46451809c473f8e4605017fb87362f7c">bDescriptorType</a>;</div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a5af9915c06d97e5fb38d5f8f968420e5"> 152</a></span>&#160; uint16_t <a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a5af9915c06d97e5fb38d5f8f968420e5">bcdHID</a>; <span class="comment">// HID class specification release</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a340e5f812dbf7fe8caa13a1541a51f42"> 153</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a340e5f812dbf7fe8caa13a1541a51f42">bCountryCode</a>;</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a05f827473d2eb4e67d1f99bc317b1eba"> 154</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a05f827473d2eb4e67d1f99bc317b1eba">bNumDescriptors</a>; <span class="comment">// Number of additional class specific descriptors</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a58fcf1ecefd15c5e796ce8798b1dfce5"> 155</a></span>&#160; uint8_t <a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a58fcf1ecefd15c5e796ce8798b1dfce5">bDescrType</a>; <span class="comment">// Type of class descriptor</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a0b160c43f6a6132c0debabd6ef171950"> 156</a></span>&#160; uint16_t <a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html#a0b160c43f6a6132c0debabd6ef171950">wDescriptorLength</a>; <span class="comment">// Total size of the Report descriptor</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;} __attribute__((packed)) <a class="code" href="struct_u_s_b___h_i_d___d_e_s_c_r_i_p_t_o_r.html">USB_HID_DESCRIPTOR</a>;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;</div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="code" href="struct_h_i_d___c_l_a_s_s___d_e_s_c_r_i_p_t_o_r___l_e_n___a_n_d___t_y_p_e.html"> 159</a></span>&#160;typedef struct {</div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="code" href="struct_h_i_d___c_l_a_s_s___d_e_s_c_r_i_p_t_o_r___l_e_n___a_n_d___t_y_p_e.html#ade7d2a40026445cd10544b30bf1a4964"> 160</a></span>&#160; uint8_t <a class="code" href="struct_h_i_d___c_l_a_s_s___d_e_s_c_r_i_p_t_o_r___l_e_n___a_n_d___t_y_p_e.html#ade7d2a40026445cd10544b30bf1a4964">bDescrType</a>; <span class="comment">// Type of class descriptor</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="struct_h_i_d___c_l_a_s_s___d_e_s_c_r_i_p_t_o_r___l_e_n___a_n_d___t_y_p_e.html#a98251c1867caf1651f6e926952189201"> 161</a></span>&#160; uint16_t <a class="code" href="struct_h_i_d___c_l_a_s_s___d_e_s_c_r_i_p_t_o_r___l_e_n___a_n_d___t_y_p_e.html#a98251c1867caf1651f6e926952189201">wDescriptorLength</a>; <span class="comment">// Total size of the Report descriptor</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;} __attribute__((packed)) <a class="code" href="struct_h_i_d___c_l_a_s_s___d_e_s_c_r_i_p_t_o_r___l_e_n___a_n_d___t_y_p_e.html">HID_CLASS_DESCRIPTOR_LEN_AND_TYPE</a>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<span class="preprocessor">#endif // _ch9_h_</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.3.1
</small></address>
</body>
</html>