tinyusb/0.4/std__request_8h_source.html
2014-03-27 17:27:26 +07:00

128 lines
10 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.6"/>
<title>tinyusb: tinyusb/common/std_request.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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.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">tinyusb
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<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="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></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>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('std__request_8h_source.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">std_request.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="std__request_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">/**************************************************************************/</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment">/**************************************************************************/</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="preprocessor">#ifndef _TUSB_STD_REQUEST_H_</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define _TUSB_STD_REQUEST_H_</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor"></span> <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structtusb__control__request__t.html"> 49</a></span>&#160;<span class="keyword">typedef</span> ATTR_PACKED_STRUCT(<span class="keyword">struct</span>){</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keyword">union </span>{</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; ATTR_PACKED_STRUCT(<span class="keyword">struct</span>) {</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structtusb__control__request__t.html#a6aaa87d23467ef27759c75bdbc3c5ba6"> 52</a></span>&#160; uint8_t recipient : 5; </div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="structtusb__control__request__t.html#a1d127017fb298b889f4ba24752d08b8e"> 53</a></span>&#160; uint8_t type : 2; </div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="structtusb__control__request__t.html#ac6116d5235e13e059e591879c46d7174"> 54</a></span>&#160; uint8_t direction : 1; </div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; } bmRequestType_bit;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; uint8_t bmRequestType;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; };</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; uint8_t bRequest;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; uint16_t wValue;</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; uint16_t wIndex;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; uint16_t wLength;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;} <a class="code" href="structtusb__control__request__t.html">tusb_control_request_t</a>;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;STATIC_ASSERT( <span class="keyword">sizeof</span>(<a class="code" href="structtusb__control__request__t.html">tusb_control_request_t</a>) == 8, <span class="stringliteral">&quot;mostly compiler option issue&quot;</span>);</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="comment">// TODO move to somewhere suitable</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient) <a class="code" href="group___group___func_attr.html#gaa3a9548137fc3ca0ad1367d204891bd9">ATTR_CONST</a> <a class="code" href="group___group___func_attr.html#ga18a61fcb06b815274b12b7f626993ac6">ATTR_ALWAYS_INLINE</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient)</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;{</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordflow">return</span> ((uint8_t) (direction &lt;&lt; 7)) | ((uint8_t) (type &lt;&lt; 5)) | (recipient);</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;}</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;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* _TUSB_STD_REQUEST_H_ */</span><span class="preprocessor"></span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="preprocessor"></span></div>
<div class="ttc" id="structtusb__control__request__t_html"><div class="ttname"><a href="structtusb__control__request__t.html">tusb_control_request_t</a></div><div class="ttdef"><b>Definition:</b> std_request.h:49</div></div>
<div class="ttc" id="group___group___func_attr_html_ga18a61fcb06b815274b12b7f626993ac6"><div class="ttname"><a href="group___group___func_attr.html#ga18a61fcb06b815274b12b7f626993ac6">ATTR_ALWAYS_INLINE</a></div><div class="ttdeci">#define ATTR_ALWAYS_INLINE</div><div class="ttdoc">Generally, functions are not inlined unless optimization is specified. For functions declared inline...</div><div class="ttdef"><b>Definition:</b> compiler_gcc.h:89</div></div>
<div class="ttc" id="group___group___func_attr_html_gaa3a9548137fc3ca0ad1367d204891bd9"><div class="ttname"><a href="group___group___func_attr.html#gaa3a9548137fc3ca0ad1367d204891bd9">ATTR_CONST</a></div><div class="ttdeci">#define ATTR_CONST</div><div class="ttdoc">Many functions do not examine any values except their arguments, and have no effects except the retur...</div><div class="ttdef"><b>Definition:</b> compiler_gcc.h:100</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_f44c0f1c8d3a85cc1de1e7f4648a56e6.html">tinyusb</a></li><li class="navelem"><a class="el" href="dir_2cf369265cdb233771cbf8cc15e70526.html">common</a></li><li class="navelem"><a class="el" href="std__request_8h.html">std_request.h</a></li>
<li class="footer">Generated on Wed Mar 26 2014 16:23:16 for tinyusb by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
</ul>
</div>
</body>
</html>