Update Doxygen

This commit is contained in:
Kristian Sloth Lauszus 2013-02-05 20:02:12 +01:00
parent 8b5b24771e
commit ef798ed661
532 changed files with 23206 additions and 5343 deletions

View file

@ -52,7 +52,7 @@ PROJECT_LOGO =
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = /Users/Lauszus/Desktop/DOC/docs
OUTPUT_DIRECTORY =
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
@ -303,7 +303,7 @@ IDL_PROPERTY_SUPPORT = YES
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
DISTRIBUTE_GROUP_DOC = YES
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
@ -756,7 +756,7 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS = XBOXUSB.*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@ -841,7 +841,7 @@ USE_MDFILE_AS_MAINPAGE = README.md
# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
SOURCE_BROWSER = NO
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
@ -1330,7 +1330,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = YES
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
@ -1621,7 +1621,7 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED =
PREDEFINED = WIICAMERA
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.

View file

@ -98,7 +98,9 @@ Include dependency graph for BTD.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_b_t_d_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_b_t_d_8cpp">
<area shape="rect" id="node2" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="549,93,594,115"/><area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="342,163,385,184"/><area shape="rect" id="node18" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="708,163,791,184"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="251,301,305,323"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="159,301,226,323"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="175,232,231,253"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="349,301,407,323"/><area shape="rect" id="node11" href="address_8h.html" title="address.h" alt="" coords="41,232,98,253"/><area shape="rect" id="node14" href="printhex_8h.html" title="printhex.h" alt="" coords="721,371,778,392"/><area shape="rect" id="node15" href="hexdump_8h.html" title="hexdump.h" alt="" coords="634,301,695,323"/><area shape="rect" id="node17" href="message_8h.html" title="message.h" alt="" coords="719,301,781,323"/><area shape="rect" id="node19" href="parsetools_8h.html" title="parsetools.h" alt="" coords="788,232,853,253"/></map>
</div>
</div><table class="memberdecls">
</div>
<p><a href="_b_t_d_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad72dbcf6d0153db1b8d8a58001feed83"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_b_t_d_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a></td></tr>
@ -115,12 +117,14 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00019">19</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

1282
_b_t_d_8cpp_source.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -285,8 +285,6 @@ Macros</h2></td></tr>
<tr class="separator:aee41c4878894db24e7ad8cd6246595cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2222709eed4c8af293e881ea36f599b0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>&#160;&#160;&#160;4</td></tr>
<tr class="separator:a2222709eed4c8af293e881ea36f599b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2a4d083435c0a67a9430de8a04146ce"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_b_t_d_8h.html#ac2a4d083435c0a67a9430de8a04146ce">BTD_CONTROL_PIPE</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ac2a4d083435c0a67a9430de8a04146ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ad70df063f83bf7000558b1d73aa009e5"></a>
@ -299,6 +297,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00034">34</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5bd4ea095da29635414952894bd527f5"></a>
@ -311,17 +311,7 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ac2a4d083435c0a67a9430de8a04146ce"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define BTD_CONTROL_PIPE&#160;&#160;&#160;0</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00036">36</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -335,6 +325,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00130">130</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2222709eed4c8af293e881ea36f599b0"></a>
@ -347,6 +339,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00131">131</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a32d591ef5742a99963130616ef146787"></a>
@ -359,6 +353,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00031">31</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a68b8f78a0e0da80434afb1e6d40eacf4"></a>
@ -371,6 +367,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00087">87</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3e107e9d07793ca5cfaeea8b2181d4a4"></a>
@ -383,6 +381,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00090">90</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a81b71e0ba648260143529b04ae84e528"></a>
@ -395,6 +395,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00100">100</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a090ee10cc1a1c1c3bbb29a93c330d2d4"></a>
@ -407,6 +409,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00101">101</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad4bce42e1ef20447655f8916f23d07a7"></a>
@ -419,6 +423,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00084">84</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6f8b4cf8546d9928a34c9c681dc5a6d5"></a>
@ -431,6 +437,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00096">96</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1cf7e4d4426dcabed8976b65beee0d99"></a>
@ -443,6 +451,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00086">86</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa0bf5ac66c412d3415dbb753630d0e58"></a>
@ -455,6 +465,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00089">89</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="af6c5584636f8958689f5cd67290254e1"></a>
@ -467,6 +479,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00085">85</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4c6ca5696adeab36258b3b0c58d804e0"></a>
@ -479,6 +493,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00082">82</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a335df6d48c8cac828d62196eeaff360b"></a>
@ -491,6 +507,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00083">83</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8c662496af1164370e5fdf7149ecd842"></a>
@ -503,6 +521,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00095">95</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8c77c922bb61301760ebf5af5f1cc7f0"></a>
@ -515,6 +535,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00094">94</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="acd5f65703cc34b112a1f656d9a49551b"></a>
@ -527,6 +549,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00102">102</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2ad6543cdfe06cbf0924c287c08f36d7"></a>
@ -539,6 +563,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00097">97</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0987119cfc40f3011a2cec69686034df"></a>
@ -551,6 +577,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00092">92</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad8481acc0b144d97017f8a06d63ff47c"></a>
@ -563,6 +591,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00103">103</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a935633384e87daa14b60549134014ec4"></a>
@ -575,6 +605,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00093">93</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1b58792b76e0f216df8160bf055032c3"></a>
@ -587,6 +619,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00099">99</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a830b2a3bcb09c4802910e8b05531d317"></a>
@ -599,6 +633,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00098">98</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a29c1744f72f3cd85865c8173eace5a36"></a>
@ -611,6 +647,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00088">88</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac61db50de3007a22e19e660bd7e68e69"></a>
@ -623,6 +661,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00091">91</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a86fd72d2518d27c02c15af635b55fc8f"></a>
@ -635,6 +675,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00042">42</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a36daee23c5d0f4276e6eb32f3fd79124"></a>
@ -647,6 +689,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00045">45</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9cc765dd92016efe6eaeff535a5193c1"></a>
@ -659,6 +703,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00071">71</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae43eba7b19fa5c92de5344819b99ec61"></a>
@ -671,6 +717,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00072">72</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a11ae66a6caad9105b8e7658189dcfa7b"></a>
@ -683,6 +731,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00079">79</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8bfcf6e1a0a044aba26d728fb0c6a17a"></a>
@ -695,6 +745,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00052">52</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2733141c8dae8cd14f78b11b21d58ebb"></a>
@ -707,6 +759,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00048">48</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae0a16d1cc0142186a20379b5c68bd1e0"></a>
@ -719,6 +773,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00054">54</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad497b58476b921e620f05791fa864f04"></a>
@ -731,6 +787,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00049">49</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad3500c7116f1bb564011dac09a387a5c"></a>
@ -743,6 +801,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00055">55</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae67c9cc739a52a8f4a3c28871a07bf1b"></a>
@ -755,6 +815,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00073">73</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a31398eae2e433d1b7b39ea3d6d07cdd0"></a>
@ -767,6 +829,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00057">57</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a20fc1ebfc3da8e048f6afe53330e6b8f"></a>
@ -779,6 +843,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00056">56</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a14087b750ea2da7f0cef4daaa7683d01"></a>
@ -791,6 +857,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00060">60</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa05458d2a47122cd62cd0748c7e1e313"></a>
@ -803,6 +871,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00061">61</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad14762241e9195fc9a3b0a69ef1ab7f3"></a>
@ -815,6 +885,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00068">68</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aec17e7d699b1023a0b6f675feddd7d58"></a>
@ -827,6 +899,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00062">62</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0e8a8ce5838e265c1732795bf8822043"></a>
@ -839,6 +913,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00064">64</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aabbf8a2ed694a2dc4d4e60fd389c44dd"></a>
@ -851,6 +927,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00065">65</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab3b1f616c1e885e697806f0167b73e8e"></a>
@ -863,6 +941,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00066">66</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a400af4b61f6e94ab821fa368d8bf2b07"></a>
@ -875,6 +955,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00063">63</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa991873698787cf45d26efaa370f34e2"></a>
@ -887,6 +969,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00067">67</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aeb3a24db49f8158f85b928385e28d83a"></a>
@ -899,6 +983,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00075">75</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac2b910cd6cc87c7bac09617815a1ee9a"></a>
@ -911,6 +997,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00040">40</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a09fa39bcefd3255f8ef762034e45679e"></a>
@ -923,6 +1011,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00047">47</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8f1d666addd0c2bba7602fbd7a692228"></a>
@ -935,6 +1025,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00043">43</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="afc5a7e103eb1301c12aa35af25cc8293"></a>
@ -947,6 +1039,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00076">76</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad205c180970335a666dfe5081b55ade4"></a>
@ -959,6 +1053,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00077">77</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8f97f22fe3bc827916b8adb724b64a7f"></a>
@ -971,6 +1067,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00074">74</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4bad48092981dffe97edb052f5ae08bd"></a>
@ -983,6 +1081,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00053">53</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="af3a7567dba1a0a7ed4272324d7684440"></a>
@ -995,6 +1095,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00041">41</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="acc9b6954b4bb6c19a9d25242869d5ddf"></a>
@ -1007,6 +1109,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00051">51</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1939cc2e06b3185be07a93c1ac7a10e1"></a>
@ -1019,6 +1123,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00044">44</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa12b77df715652f4735cb6620cd595a4"></a>
@ -1031,6 +1137,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00078">78</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1465673868452307bcdab8e201430c27"></a>
@ -1043,6 +1151,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00123">123</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4c5ac96db74d61d4a5a5d945a400e7da"></a>
@ -1055,6 +1165,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00124">124</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aee05d40a014750b24a7e9967f6f389f4"></a>
@ -1067,6 +1179,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00037">37</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6ffcd72787c86f248192eb06a3fe18cb"></a>
@ -1079,6 +1193,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00106">106</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a48bcd73461d736d0ef889e1fe6e36f69"></a>
@ -1091,6 +1207,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00109">109</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8151b1fe5d940a5a7a34f43a8b8ce434"></a>
@ -1103,6 +1221,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00110">110</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac4bae0c65fd00ed849cb226302d19c85"></a>
@ -1115,6 +1235,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00107">107</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="aef7b306479de265d725dbe5816a8227b"></a>
@ -1127,6 +1249,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00108">108</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a398676a2e9a2351a5a52afdddf4b660b"></a>
@ -1139,6 +1263,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00111">111</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4c64a41200714e457b397496183dc0e4"></a>
@ -1151,6 +1277,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00112">112</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a200eb6c7c905ec74a9daf0f262af0448"></a>
@ -1163,6 +1291,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00113">113</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="af32d4c53927d596a8727ff232310dec1"></a>
@ -1175,6 +1305,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00114">114</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9960d0d5ae92fc92c70bbb84c2a5c0cc"></a>
@ -1187,6 +1319,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00117">117</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0ae276efa5e73a4da658c714e70402c0"></a>
@ -1199,6 +1333,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00026">26</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5bb06f989db583d290ba79642d37c514"></a>
@ -1211,6 +1347,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00025">25</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="afc242b8a1b867f79c49ad78e3a47b37f"></a>
@ -1223,6 +1361,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00028">28</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a54903b410722a45f8246653cd4d00632"></a>
@ -1235,6 +1375,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00027">27</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2924020f2e7e82fe956574538e2bc3eb"></a>
@ -1247,6 +1389,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00122">122</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a25ce859d7ee2730e1d22d11c051ed60d"></a>
@ -1259,6 +1403,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00121">121</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1be7a56cdddcdb7dedf16d4dee381e93"></a>
@ -1271,6 +1417,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00118">118</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a05903a9351c5ced6b8be27b2869e62af"></a>
@ -1283,6 +1431,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00128">128</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a177fe269ddb7979d99b76d52bc281551"></a>
@ -1295,12 +1445,14 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00127">127</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -220,139 +220,130 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#aee41c4878894db24e7ad8cd6246595cd"> 130</a></span>&#160;<span class="preprocessor">#define BTD_MAX_ENDPOINTS 4</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0"> 131</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define BTD_NUMSERVICES 4 // Max number of Bluetooth services</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="class_bluetooth_service.html"> 133</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bluetooth_service.html">BluetoothService</a> { <span class="comment">// All services should include this class</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a8dc98310fe481357eaa86c53e49af113">ACLData</a>(uint8_t* <a class="code" href="class_bluetooth_service.html#a8dc98310fe481357eaa86c53e49af113">ACLData</a>); <span class="comment">// Used to pass acldata to the services</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a680692ff13cb37eb81ddbb74bc9e0383">Run</a>(); <span class="comment">// Used to run the different state machines</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a1dff7caf251f1d8a5f358b368445cb48">Reset</a>(); <span class="comment">// Used to reset the services</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</a>(); <span class="comment">// Used to disconnect both the L2CAP Channel and the HCI Connection</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;};</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="class_b_t_d.html"> 141</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_b_t_d.html">BTD</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a>, <span class="keyword">public</span> <a class="code" href="class_usb_config_xtracter.html">UsbConfigXtracter</a> {</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <a class="code" href="class_b_t_d.html#a5f07597fe15a2b917cce405fe87f2981">BTD</a>(<a class="code" href="class_u_s_b.html">USB</a> *p); <span class="comment">// Constructor</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="comment">// USBDeviceConfig implementation</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#a48608619d8253972dd132edbb3001c5f">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#aa87c23bce56a20f2db47c6a40c8eda87">Release</a>();</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#a76e201c5b561e3a6d0405894ba5c2e41">Poll</a>();</div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3"> 149</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3">GetAddress</a>() { <span class="keywordflow">return</span> <a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c">bAddress</a>; };</div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8"> 150</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8">isReady</a>() { <span class="keywordflow">return</span> bPollEnable; };</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; </div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="comment">// UsbConfigXtracter implementation, used to extract endpoint information</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a23928cd0e5711a2433aec763cfa55773">EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, <span class="keyword">const</span> <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> *ep); </div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; </div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737"> 155</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737">watingForConnection</a>; <span class="comment">// Use this to see if it is waiting for a incoming connection </span></div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da"> 156</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da">disconnect</a>() { <span class="comment">// Used this void to disconnect all services</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>; i++)</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordflow">if</span> (btService[i])</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; btService[i]-&gt;<a class="code" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</a>(); <span class="comment">// Disconnect both the L2CAP Channel and the HCI Connection</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; };</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; </div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="comment">/* Register bluetooth dongle members/services */</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73"> 163</a></span>&#160; int8_t <a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a>(<a class="code" href="class_bluetooth_service.html">BluetoothService</a> *pService) {</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>; i++) {</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordflow">if</span> (!btService[i]) {</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; btService[i] = pService;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">return</span> i; <span class="comment">// Return ID</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; }</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; }</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keywordflow">return</span> -1; <span class="comment">// ErrorregisterServiceClass</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594"> 171</a></span>&#160; }; </div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; </div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a>; <span class="comment">// This is used by the service to know when to store the device information</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9"> 175</a></span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9">btdName</a>; <span class="comment">// These are set by the SPP library</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c"> 176</a></span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c">btdPin</a>;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; </div>
<div class="line"><a name="l00178"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a"> 178</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[6]; <span class="comment">// The bluetooth dongles Bluetooth address</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98"> 179</a></span>&#160; uint16_t <a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98">hci_handle</a>; <span class="comment">// HCI handle for the last connection</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="code" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182"> 180</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182">disc_bdaddr</a>[6]; <span class="comment">// Last incoming devices Bluetooth address</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e"> 181</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e">remote_name</a>[30]; <span class="comment">// First 30 chars of last remote name</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea"> 182</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a>;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e"> 184</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e">connectToWii</a>; <span class="comment">// Used to only send the ACL data to the wiimote</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee"> 185</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee">incomingWii</a>;</div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c"> 186</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a>;</div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc"> 187</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc">motionPlusInside</a>; <span class="comment">// True if it&#39;s the new Wiimote with the Motion Plus Inside</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; </div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">/* HCI Commands */</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#af11ad71d20783d46fe42dd405d10dfda">HCI_Command</a>(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae6f942eabd29257bc4896e5f263275b6">hci_reset</a>();</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#acb94a629477d85cebd16a9c5ecd4a8b3">hci_read_bdaddr</a>();</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae2ba215b6942f4131e4c5fdef2771e22">hci_read_local_version_information</a>();</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a9a6747d58951f53389922d80e25b886c">hci_set_local_name</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name);</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7dd7faaec1d3d9a1d8159cc2a4190977">hci_write_scan_enable</a>();</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a8767529bd203c549348a38ac9c6682b3">hci_remote_name</a>();</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a1cb07a155c69bb1fcf45ae030b8947ec">hci_accept_connection</a>();</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aff59ab45d917406141ae0c9c79047f08">hci_write_scan_disable</a>();</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(uint16_t handle);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a70047b0f624c3f0ef29f8b76b8a34938">hci_pin_code_request_reply</a>();</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7114d2cb62aa413e5ecb25c45c76832b">hci_pin_code_negative_request_reply</a>();</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#af4d28b9c1a3b9688a1871610caee2cfc">hci_link_key_request_negative_reply</a>();</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#addd07c18c725a324a05792a83026d36d">hci_authentication_request</a>();</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a678f2c995553ce6a9f48f9b59f2f1555">hci_inquiry</a>();</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a45ffbc7a40bbb763b0ece907c3dfc9ff">hci_inquiry_cancel</a>();</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae7066ea743f8907708db945ebef3ad76">hci_connect</a>();</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; </div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="comment">/* L2CAP Commands */</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow = 0x01, uint8_t channelHigh = 0x00); <span class="comment">// Standard L2CAP header: Channel ID (0x01) for ACL-U</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a55cf412a2053972a353b1ab964ca9d3e">l2cap_connection_request</a>(uint16_t handle, uint8_t rxid, uint8_t* scid, uint16_t psm);</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid, uint8_t result);</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ab646a59311344966f139bb3b78f30233">l2cap_config_request</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid);</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(uint16_t handle, uint8_t rxid, uint8_t* scid);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a91f61915c503fe7b861c88f5b3e6733c">l2cap_information_response</a>(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh);</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; </div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="comment">/* Mandatory USB members */</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1"> 220</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1">pUsb</a>;</div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c"> 221</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c">bAddress</a>; <span class="comment">// Device address</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e"> 222</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e">epInfo</a>[<a class="code" href="_b_t_d_8h.html#aee41c4878894db24e7ad8cd6246595cd">BTD_MAX_ENDPOINTS</a>]; <span class="comment">// Endpoint info structure</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2"> 224</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2">bConfNum</a>; <span class="comment">// Configuration number</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66"> 225</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66">bNumEP</a>; <span class="comment">// Total number of endpoints in the configuration</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079"> 226</a></span>&#160; uint32_t <a class="code" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079">qNextPollTime</a>; <span class="comment">// Next poll time</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; </div>
<div class="line"><a name="l00228"></a><span class="lineno"><a class="code" href="_b_t_d_8h.html#ac2a4d083435c0a67a9430de8a04146ce"> 228</a></span>&#160;<span class="preprocessor"> #define BTD_CONTROL_PIPE 0 // Bluetooth dongles control endpoint</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec"> 229</a></span>&#160;<span class="preprocessor"></span> <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec">BTD_EVENT_PIPE</a>; <span class="comment">// HCI event endpoint index</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c"> 230</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c">BTD_DATAIN_PIPE</a>; <span class="comment">// ACL In endpoint index</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd"> 231</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd">BTD_DATAOUT_PIPE</a>; <span class="comment">// ACL Out endpoint index</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aa5976eead215a58553aee683d42405a0">PrintEndpointDescriptor</a>(<span class="keyword">const</span> <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>* ep_ptr); </div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <a class="code" href="class_bluetooth_service.html">BluetoothService</a>* btService[<a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>];</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; </div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; uint8_t pollInterval;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="comment">/* variables used by high level HCI task */</span> </div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; uint8_t hci_state; <span class="comment">//current state of bluetooth hci connection</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; uint16_t hci_counter; <span class="comment">// counter used for bluetooth hci reset loops</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; uint8_t hci_num_reset_loops; <span class="comment">// this value indicate how many times it should read before trying to reset</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; uint16_t hci_event_flag; <span class="comment">// hci flags of received bluetooth events</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; uint8_t inquiry_counter;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; </div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; uint8_t hcibuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>];<span class="comment">//General purpose buffer for hci data</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; uint8_t l2capinbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>];<span class="comment">//General purpose buffer for l2cap in data</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; uint8_t l2capoutbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>];<span class="comment">//General purpose buffer for l2cap out data</span></div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="comment">/* State machines */</span></div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <span class="keywordtype">void</span> HCI_event_task(); <span class="comment">// Poll the HCI event pipe</span></div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="keywordtype">void</span> HCI_task(); <span class="comment">// HCI state machine</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="keywordtype">void</span> ACL_event_task(); <span class="comment">// ACL input pipe</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; </div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="comment">/* Used to set the Bluetooth Address internally to the PS3 Controllers */</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordtype">void</span> setBdaddr(uint8_t* BDADDR);</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <span class="keywordtype">void</span> setMoveBdaddr(uint8_t* BDADDR);</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;};</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="class_bluetooth_service.html"> 134</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a8dc98310fe481357eaa86c53e49af113">ACLData</a>(uint8_t* <a class="code" href="class_bluetooth_service.html#a8dc98310fe481357eaa86c53e49af113">ACLData</a>);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a680692ff13cb37eb81ddbb74bc9e0383">Run</a>();</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a1dff7caf251f1d8a5f358b368445cb48">Reset</a>();</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</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;</div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="code" href="class_b_t_d.html"> 153</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_b_t_d.html">BTD</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a>, <span class="keyword">public</span> <a class="code" href="class_usb_config_xtracter.html">UsbConfigXtracter</a> {</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="code" href="class_b_t_d.html#a5f07597fe15a2b917cce405fe87f2981">BTD</a>(<a class="code" href="class_u_s_b.html">USB</a> *p);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#a48608619d8253972dd132edbb3001c5f">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#aa87c23bce56a20f2db47c6a40c8eda87">Release</a>();</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#a76e201c5b561e3a6d0405894ba5c2e41">Poll</a>();</div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3"> 184</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3">GetAddress</a>() { <span class="keywordflow">return</span> <a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c">bAddress</a>; };</div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8"> 189</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8">isReady</a>() { <span class="keywordflow">return</span> bPollEnable; };</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a23928cd0e5711a2433aec763cfa55773">EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, <span class="keyword">const</span> <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> *ep);</div>
<div class="line"><a name="l00205"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da"> 205</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da">disconnect</a>() {</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>; i++)</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="keywordflow">if</span> (btService[i])</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; btService[i]-&gt;<a class="code" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</a>();</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; };</div>
<div class="line"><a name="l00215"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73"> 215</a></span>&#160; int8_t <a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a>(<a class="code" href="class_bluetooth_service.html">BluetoothService</a> *pService) {</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>; i++) {</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordflow">if</span> (!btService[i]) {</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; btService[i] = pService;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordflow">return</span> i; <span class="comment">// Return ID</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; }</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; }</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keywordflow">return</span> -1; <span class="comment">// ErrorregisterServiceClass</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; };</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; </div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#af11ad71d20783d46fe42dd405d10dfda">HCI_Command</a>(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae6f942eabd29257bc4896e5f263275b6">hci_reset</a>();</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#acb94a629477d85cebd16a9c5ecd4a8b3">hci_read_bdaddr</a>();</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae2ba215b6942f4131e4c5fdef2771e22">hci_read_local_version_information</a>();</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a9a6747d58951f53389922d80e25b886c">hci_set_local_name</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name);</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7dd7faaec1d3d9a1d8159cc2a4190977">hci_write_scan_enable</a>();</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aff59ab45d917406141ae0c9c79047f08">hci_write_scan_disable</a>();</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a8767529bd203c549348a38ac9c6682b3">hci_remote_name</a>();</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a1cb07a155c69bb1fcf45ae030b8947ec">hci_accept_connection</a>();</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(uint16_t handle);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a70047b0f624c3f0ef29f8b76b8a34938">hci_pin_code_request_reply</a>();</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7114d2cb62aa413e5ecb25c45c76832b">hci_pin_code_negative_request_reply</a>();</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#af4d28b9c1a3b9688a1871610caee2cfc">hci_link_key_request_negative_reply</a>();</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#addd07c18c725a324a05792a83026d36d">hci_authentication_request</a>();</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a678f2c995553ce6a9f48f9b59f2f1555">hci_inquiry</a>();</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a45ffbc7a40bbb763b0ece907c3dfc9ff">hci_inquiry_cancel</a>();</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ae7066ea743f8907708db945ebef3ad76">hci_connect</a>();</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(uint16_t handle, uint8_t* data, uint8_t nbytes, uint8_t channelLow = 0x01, uint8_t channelHigh = 0x00);</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a55cf412a2053972a353b1ab964ca9d3e">l2cap_connection_request</a>(uint16_t handle, uint8_t rxid, uint8_t* scid, uint16_t psm);</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid, uint8_t result);</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ab646a59311344966f139bb3b78f30233">l2cap_config_request</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(uint16_t handle, uint8_t rxid, uint8_t* scid);</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(uint16_t handle, uint8_t rxid, uint8_t* dcid, uint8_t* scid);</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#a91f61915c503fe7b861c88f5b3e6733c">l2cap_information_response</a>(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh);</div>
<div class="line"><a name="l00346"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737"> 346</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737">watingForConnection</a>;</div>
<div class="line"><a name="l00348"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594"> 348</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a>;</div>
<div class="line"><a name="l00350"></a><span class="lineno"><a class="code" href="class_b_t_d.html#af5e5b085cec1da5c83c75e80e95b3590"> 350</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#af5e5b085cec1da5c83c75e80e95b3590">sdpConnectionClaimed</a>;</div>
<div class="line"><a name="l00352"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a9e5a34242007b64cd6a226cfd1901e74"> 352</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a9e5a34242007b64cd6a226cfd1901e74">rfcommConnectionClaimed</a>;</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; </div>
<div class="line"><a name="l00355"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9"> 355</a></span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9">btdName</a>;</div>
<div class="line"><a name="l00357"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c"> 357</a></span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c">btdPin</a>;</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; </div>
<div class="line"><a name="l00360"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a"> 360</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[6];</div>
<div class="line"><a name="l00362"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98"> 362</a></span>&#160; uint16_t <a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98">hci_handle</a>;</div>
<div class="line"><a name="l00364"></a><span class="lineno"><a class="code" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182"> 364</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182">disc_bdaddr</a>[6];</div>
<div class="line"><a name="l00366"></a><span class="lineno"><a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e"> 366</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e">remote_name</a>[30];</div>
<div class="line"><a name="l00372"></a><span class="lineno"><a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea"> 372</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a>;</div>
<div class="line"><a name="l00374"></a><span class="lineno"><a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e"> 374</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e">connectToWii</a>;</div>
<div class="line"><a name="l00376"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee"> 376</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee">incomingWii</a>;</div>
<div class="line"><a name="l00378"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c"> 378</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a>;</div>
<div class="line"><a name="l00380"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc"> 380</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc">motionPlusInside</a>;</div>
<div class="line"><a name="l00382"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a962a5714c225dcb633434f02e3657583"> 382</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_b_t_d.html#a962a5714c225dcb633434f02e3657583">wiiUProController</a>;</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; </div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00386"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1"> 386</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1">pUsb</a>;</div>
<div class="line"><a name="l00388"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c"> 388</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a58f78a9a28db81858dcc34a32a2ec82c">bAddress</a>;</div>
<div class="line"><a name="l00390"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e"> 390</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e">epInfo</a>[<a class="code" href="_b_t_d_8h.html#aee41c4878894db24e7ad8cd6246595cd">BTD_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; </div>
<div class="line"><a name="l00393"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2"> 393</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2">bConfNum</a>;</div>
<div class="line"><a name="l00395"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66"> 395</a></span>&#160; uint8_t <a class="code" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66">bNumEP</a>;</div>
<div class="line"><a name="l00397"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079"> 397</a></span>&#160; uint32_t <a class="code" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079">qNextPollTime</a>;</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; </div>
<div class="line"><a name="l00400"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a49f433ab824f259c3815e180c73bb0ad"> 400</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a49f433ab824f259c3815e180c73bb0ad">BTD_CONTROL_PIPE</a>;</div>
<div class="line"><a name="l00402"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec"> 402</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec">BTD_EVENT_PIPE</a>;</div>
<div class="line"><a name="l00404"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c"> 404</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c">BTD_DATAIN_PIPE</a>;</div>
<div class="line"><a name="l00406"></a><span class="lineno"><a class="code" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd"> 406</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd">BTD_DATAOUT_PIPE</a>;</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; </div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_b_t_d.html#aa5976eead215a58553aee683d42405a0">PrintEndpointDescriptor</a>(<span class="keyword">const</span> <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>* ep_ptr); </div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; </div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; <a class="code" href="class_bluetooth_service.html">BluetoothService</a>* btService[<a class="code" href="_b_t_d_8h.html#a2222709eed4c8af293e881ea36f599b0">BTD_NUMSERVICES</a>];</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; </div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; uint8_t pollInterval;</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160; </div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160; <span class="comment">/* Variables used by high level HCI task */</span> </div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; uint8_t hci_state; <span class="comment">//current state of bluetooth hci connection</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; uint16_t hci_counter; <span class="comment">// counter used for bluetooth hci reset loops</span></div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; uint8_t hci_num_reset_loops; <span class="comment">// this value indicate how many times it should read before trying to reset</span></div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160; uint16_t hci_event_flag; <span class="comment">// hci flags of received bluetooth events</span></div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; uint8_t inquiry_counter;</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; </div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; uint8_t hcibuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>];<span class="comment">//General purpose buffer for hci data</span></div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; uint8_t l2capinbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>];<span class="comment">//General purpose buffer for l2cap in data</span></div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160; uint8_t l2capoutbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>];<span class="comment">//General purpose buffer for l2cap out data</span></div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; </div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; <span class="comment">/* State machines */</span></div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; <span class="keywordtype">void</span> HCI_event_task(); <span class="comment">// Poll the HCI event pipe</span></div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; <span class="keywordtype">void</span> HCI_task(); <span class="comment">// HCI state machine</span></div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160; <span class="keywordtype">void</span> ACL_event_task(); <span class="comment">// ACL input pipe</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; </div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; <span class="comment">/* Used to set the Bluetooth Address internally to the PS3 Controllers */</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; <span class="keywordtype">void</span> setBdaddr(uint8_t* BDADDR);</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; <span class="keywordtype">void</span> setMoveBdaddr(uint8_t* BDADDR);</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160;};</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -119,6 +119,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_h_i_d_2_u_s_b_h_i_d__desc_2pgmstrings_8h_source.html#l00006">6</a> of file <a class="el" href="_h_i_d_2_u_s_b_h_i_d__desc_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa1ba73e45dd29eeb526a52d9a3336f35"></a>
@ -135,6 +137,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_h_i_d_2_u_s_b_h_i_d__desc_2pgmstrings_8h_source.html#l00005">5</a> of file <a class="el" href="_h_i_d_2_u_s_b_h_i_d__desc_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<a class="anchor" id="a373c90214222e94d07424e7a8d41b92b"></a>
@ -151,6 +155,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_h_i_d_2_u_s_b_h_i_d__desc_2pgmstrings_8h_source.html#l00004">4</a> of file <a class="el" href="_h_i_d_2_u_s_b_h_i_d__desc_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
@ -164,12 +170,14 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_h_i_d_2_u_s_b_h_i_d__desc_2pgmstrings_8h_source.html#l00010">10</a> of file <a class="el" href="_h_i_d_2_u_s_b_h_i_d__desc_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -143,7 +143,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -99,7 +99,9 @@ Include dependency graph for PS3BT.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_p_s3_b_t_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_p_s3_b_t_8cpp">
<area shape="rect" id="node2" href="_p_s3_b_t_8h.html" title="PS3BT.h" alt="" coords="613,93,667,115"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="575,163,621,184"/><area shape="rect" id="node21" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="649,163,718,184"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="577,232,619,253"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="140,232,223,253"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="832,371,886,392"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="649,371,715,392"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="736,301,793,323"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="739,371,798,392"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="477,301,534,323"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="187,440,243,461"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="99,371,161,392"/><area shape="rect" id="node18" href="message_8h.html" title="message.h" alt="" coords="185,371,246,392"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="28,301,93,323"/><area shape="rect" id="node22" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="644,232,730,253"/></map>
</div>
</div><table class="memberdecls">
</div>
<p><a href="_p_s3_b_t_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad72dbcf6d0153db1b8d8a58001feed83"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_p_s3_b_t_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a></td></tr>
@ -122,6 +124,8 @@ OUTPUT_REPORT_BUFFER[]&#160;</td><td class="memItemRight" valign="bottom"><a cla
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8cpp_source.html#l00019">19</a> of file <a class="el" href="_p_s3_b_t_8cpp_source.html">PS3BT.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
@ -146,12 +150,14 @@ OUTPUT_REPORT_BUFFER[]&#160;</td><td class="memItemRight" valign="bottom"><a cla
<div class="line"> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 </div>
<div class="line">}</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="_p_s3_b_t_8cpp_source.html#l00023">23</a> of file <a class="el" href="_p_s3_b_t_8cpp_source.html">PS3BT.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

756
_p_s3_b_t_8cpp_source.html Normal file
View file

@ -0,0 +1,756 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/PS3BT.cpp 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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">PS3BT.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="_p_s3_b_t_8cpp.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) 2012 Kristian Lauszus, TKJ Electronics. 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"> Kristian Lauszus, TKJ Electronics</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> Web : http://www.tkjelectronics.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> e-mail : kristianl@tkjelectronics.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;</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_p_s3_b_t_8h.html">PS3BT.h</a>&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="code" href="_p_s3_b_t_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83"> 19</a></span>&#160;<span class="preprocessor">#define DEBUG // Uncomment to print data for debugging</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor"></span><span class="comment">//#define EXTRADEBUG // Uncomment to get even more debugging data</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment">//#define PRINTREPORT // Uncomment to print the report send by the PS3 Controllers</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"><a class="code" href="_p_s3_b_t_8cpp.html#a554d83ee81af8e8083760b8a8ff9b9ea"> 23</a></span>&#160;<span class="keyword">const</span> uint8_t OUTPUT_REPORT_BUFFER[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00, </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00, </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; 0xff, 0x27, 0x10, 0x00, 0x32, </div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; 0xff, 0x27, 0x10, 0x00, 0x32, </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; 0xff, 0x27, 0x10, 0x00, 0x32, </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; 0xff, 0x27, 0x10, 0x00, 0x32, </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00, </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00,</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;};</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#aab14832f7844f07e6287eb443019b6e7"> 35</a></span>&#160;<a class="code" href="class_p_s3_b_t.html#aab14832f7844f07e6287eb443019b6e7">PS3BT::PS3BT</a>(<a class="code" href="class_b_t_d.html">BTD</a> *p, uint8_t btadr5, uint8_t btadr4, uint8_t btadr3, uint8_t btadr2, uint8_t btadr1, uint8_t btadr0):</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;pBtd(p) <span class="comment">// pointer to USB class instance - mandatory</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;{</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keywordflow">if</span> (pBtd)</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a>(<span class="keyword">this</span>); <span class="comment">// Register it as a Bluetooth service</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[5] = btadr5; <span class="comment">// Change to your dongle&#39;s Bluetooth address instead</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[4] = btadr4;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[3] = btadr3;</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[2] = btadr2;</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[1] = btadr1;</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a>[0] = btadr0;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; HIDBuffer[0] = 0x52;<span class="comment">// HID BT Set_report (0x50) | Report Type (Output 0x02)</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; HIDBuffer[1] = 0x01;<span class="comment">// Report ID</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="comment">//Needed for PS3 Move Controller commands to work via bluetooth</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; HIDMoveBuffer[0] = 0xA2;<span class="comment">// HID BT DATA_request (0xA0) | Report Type (Output 0x02)</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; HIDMoveBuffer[1] = 0x02;<span class="comment">// Report ID</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; </div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">/* Set device cid for the control and intterrupt channelse - LSB */</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; control_dcid[0] = 0x40;<span class="comment">//0x0040</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; control_dcid[1] = 0x00;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; interrupt_dcid[0] = 0x41;<span class="comment">//0x0041</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; interrupt_dcid[1] = 0x00;</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"> 61</span>&#160; <a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">Reset</a>();</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;}</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a9b8726849cf6fbaf4e98a9652cb53b61"> 63</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a9b8726849cf6fbaf4e98a9652cb53b61">PS3BT::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">return</span> (ButtonState &amp; pgm_read_dword(&amp;BUTTONS[(uint8_t)b]));</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;}</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a92c617e1d00860dc560af7cfe20938d9"> 66</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a92c617e1d00860dc560af7cfe20938d9">PS3BT::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; uint32_t button = pgm_read_dword(&amp;BUTTONS[(uint8_t)b]);</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState &amp; button);</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; ButtonClickState &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;}</div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a8c04e0e821dcbfb8825d4b31ab270f00"> 72</a></span>&#160;uint8_t <a class="code" href="class_p_s3_b_t.html#a8c04e0e821dcbfb8825d4b31ab270f00">PS3BT::getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a) {</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">if</span> (l2capinbuf == NULL)</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">return</span> (uint8_t)(l2capinbuf[pgm_read_byte(&amp;ANALOGBUTTONS[(uint8_t)a])]);</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;}</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a9da5c045fafc3436dc2d2820cb234384"> 77</a></span>&#160;uint8_t <a class="code" href="class_p_s3_b_t.html#a9da5c045fafc3436dc2d2820cb234384">PS3BT::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a) {</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">if</span> (l2capinbuf == NULL)</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">return</span> 0; </div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">return</span> (uint8_t)(l2capinbuf[(uint8_t)a+15]);</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;}</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a"> 82</a></span>&#160;int16_t <a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">PS3BT::getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a) {</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">if</span> (l2capinbuf == NULL)</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a>) {</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb">aX</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd">aY</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc">aZ</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa644a4a198e3cf90bfe918a147cd5d675">gZ</a>)</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordflow">return</span> ((l2capinbuf[(uint16_t)a] &lt;&lt; 8) | l2capinbuf[(uint16_t)a + 1]);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>) {</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9d1f82ecbf55d931c3f49858d86d4d68">mXmove</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaee1254b85fe360243299d2041323aa78">mYmove</a>) <span class="comment">// These are all 12-bits long</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">return</span> (((l2capinbuf[(uint16_t)a] &amp; 0x0F) &lt;&lt; 8) | (l2capinbuf[(uint16_t)a + 1]));</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b4c8ce0561fd9c003a6389d7c6fb503">mZmove</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa43025202f119b0f193cbc14c6a3cf59f">tempMove</a>) <span class="comment">// The tempearature is also 12 bits long</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">return</span> ((l2capinbuf[(uint16_t)a] &lt;&lt; 4) | ((l2capinbuf[(uint16_t)a + 1] &amp; 0xF0) &gt;&gt; 4));</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">else</span> <span class="comment">// aXmove, aYmove, aZmove, gXmove, gYmove and gZmove</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">return</span> (l2capinbuf[(uint16_t)a] | (l2capinbuf[(uint16_t)a + 1] &lt;&lt; 8)); </div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;}</div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a5f4d7fd35927694ae815091b487dcd60"> 100</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_p_s3_b_t.html#a5f4d7fd35927694ae815091b487dcd60">PS3BT::getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a) {</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordtype">double</span> accXval;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordtype">double</span> accYval;</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordtype">double</span> accZval;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a>) {</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="comment">// Data for the Kionix KXPC4 used in the DualShock 3</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keyword">const</span> <span class="keywordtype">double</span> zeroG = 511.5; <span class="comment">// 1.65/3.3*1023 (1,65V)</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; accXval = -((double)<a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb">aX</a>)-zeroG);</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; accYval = -((double)<a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd">aY</a>)-zeroG);</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; accZval = -((double)<a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc">aZ</a>)-zeroG);</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>) {</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="comment">// It&#39;s a Kionix KXSC4 inside the Motion controller</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keyword">const</span> uint16_t zeroG = 0x8000;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; accXval = -(int16_t)(<a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa832ceb5090692e95e93982849f740de7">aXmove</a>)-zeroG);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; accYval = (int16_t)(<a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa5c436ac329e20e6b7661152c74e82199">aYmove</a>)-zeroG);</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; accZval = (int16_t)(<a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa077e283d0c3f06568c20adf90ced0a3f">aZmove</a>)-zeroG);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; }</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// Convert to 360 degrees resolution</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="comment">// atan2 outputs the value of -π to π (radians)</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="comment">// We are then converting it to 0 to 2π and then to degrees</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a>) {</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordtype">double</span> angle = (atan2(accYval,accZval)+PI)*RAD_TO_DEG;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordflow">return</span> angle;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordtype">double</span> angle = (atan2(accXval,accZval)+PI)*RAD_TO_DEG;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordflow">return</span> angle;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; }</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;}</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#af9386c460169ea8f07e79c86a8938965"> 130</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_p_s3_b_t.html#af9386c460169ea8f07e79c86a8938965">PS3BT::get9DOFValues</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a) { <span class="comment">// Thanks to Manfred Piendl</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordflow">if</span>(!<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>)</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; int16_t value = <a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(a);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9d1f82ecbf55d931c3f49858d86d4d68">mXmove</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaee1254b85fe360243299d2041323aa78">mYmove</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b4c8ce0561fd9c003a6389d7c6fb503">mZmove</a>) {</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">if</span> (value &gt; 2047)</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; value -= 0x1000;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">return</span> (<span class="keywordtype">double</span>)value/3.2; <span class="comment">// unit: muT = 10^(-6) Tesla</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa832ceb5090692e95e93982849f740de7">aXmove</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa5c436ac329e20e6b7661152c74e82199">aYmove</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa077e283d0c3f06568c20adf90ced0a3f">aZmove</a>) {</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="keywordflow">if</span> (value &lt; 0)</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; value += 0x8000;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; value -= 0x8000;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">return</span> (<span class="keywordtype">double</span>)value/442.0; <span class="comment">// unit: m/(s^2)</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1851ce90f7a3f6acb062de46e78ca731">gXmove</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9c538a78bbc03fb258e1141acdc69a91">gYmove</a> || a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9ea1d99ce7ddecd65fcb39f30c77037d">gZmove</a>) {</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keywordflow">if</span> (value &lt; 0)</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; value += 0x8000;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; value -= 0x8000;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1851ce90f7a3f6acb062de46e78ca731">gXmove</a>)</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keywordflow">return</span> (<span class="keywordtype">double</span>)value/11.6; <span class="comment">// unit: deg/s</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9c538a78bbc03fb258e1141acdc69a91">gYmove</a>)</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="keywordflow">return</span> (<span class="keywordtype">double</span>)value/11.2; <span class="comment">// unit: deg/s</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">else</span> <span class="comment">// gZmove</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">return</span> (<span class="keywordtype">double</span>)value/9.6; <span class="comment">// unit: deg/s</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;}</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ab4f49b61167df001d13b68c7699651b4"> 158</a></span>&#160;String <a class="code" href="class_p_s3_b_t.html#ab4f49b61167df001d13b68c7699651b4">PS3BT::getTemperature</a>() {</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>) {</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; int16_t input = <a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa43025202f119b0f193cbc14c6a3cf59f">tempMove</a>); </div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; </div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; String output = String(input/100);</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; output += <span class="stringliteral">&quot;.&quot;</span>;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordflow">if</span>(input%100 &lt; 10)</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; output += <span class="stringliteral">&quot;0&quot;</span>;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; output += String(input%100);</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordflow">return</span> output; </div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; }</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;}</div>
<div class="line"><a name="l00171"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6"> 171</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">PS3BT::getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c) {</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordflow">if</span> (l2capinbuf == NULL)</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[(uint16_t)c &gt;&gt; 8] == ((uint8_t)c &amp; 0xff))</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;}</div>
<div class="line"><a name="l00178"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ac31b6d24710711a9d460367b6aae308f"> 178</a></span>&#160;String <a class="code" href="class_p_s3_b_t.html#ac31b6d24710711a9d460367b6aae308f">PS3BT::getStatusString</a>() {</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a> || <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a>) {</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordtype">char</span> statusOutput[100];</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; strcpy(statusOutput,<span class="stringliteral">&quot;ConnectionStatus: &quot;</span>);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baff01ce39b42bec30132b0fc53c882387">Plugged</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Plugged&quot;</span>);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bae37160f3a65bb54a91fb5efb4f971924">Unplugged</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Unplugged&quot;</span>);</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput,<span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; </div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; strcat(statusOutput,<span class="stringliteral">&quot; - PowerRating: &quot;</span>);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba5a86ae1482947377a116685c168d1773">Charging</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Charging&quot;</span>);</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bac138cecbd4ef1ba0f9e0ab12440a6df6">NotCharging</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Not Charging&quot;</span>);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba82084136e62c38642986b05419b4e734">Shutdown</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Shutdown&quot;</span>);</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba96cc2a0090ada376561406d48d1f2089">Dying</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Dying&quot;</span>);</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7a352a3dd2accc1dd65a4538c3754ee8">Low</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Low&quot;</span>);</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba24c57acd029e3f96fede49402ea01e6f">High</a>)) strcat(statusOutput,<span class="stringliteral">&quot;High&quot;</span>);</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679">Full</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Full&quot;</span>);</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput,<span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; </div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; strcat(statusOutput,<span class="stringliteral">&quot; - WirelessStatus: &quot;</span>);</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; </div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba71c14aef95c9953673a880e2633fa209">CableRumble</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Cable - Rumble is on&quot;</span>);</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a36ca9a60a5e244f3404ec0db7b44a1">Cable</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Cable - Rumble is off&quot;</span>);</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba27912f9ea05a45aada21fc375817342c">BluetoothRumble</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Bluetooth - Rumble is on&quot;</span>);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Bluetooth - Rumble is off&quot;</span>);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput,<span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; </div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="keywordflow">return</span> statusOutput;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; }</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>) {</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordtype">char</span> statusOutput[50];</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; </div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; strcpy(statusOutput,<span class="stringliteral">&quot;PowerRating: &quot;</span>);</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; </div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a18b1e66913bf3103ec5f81a124d030">MoveCharging</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Charging&quot;</span>);</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baa66a4c4924065859bcee07c677554e2a">MoveNotCharging</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Not Charging&quot;</span>);</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba90b649581a499e75735f153a32dfd71c">MoveShutdown</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Shutdown&quot;</span>);</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba74ec9082d76bf71ae74ad5d948c311f8">MoveDying</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Dying&quot;</span>);</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba429562e406bab9f30a0290306c6abdbf">MoveLow</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Low&quot;</span>);</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7719066bf7a360dfe51ccbf81a148bcb">MoveHigh</a>)) strcat(statusOutput,<span class="stringliteral">&quot;High&quot;</span>);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baccd6c38d1a97db0feafc9f88909ce943">MoveFull</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Full&quot;</span>);</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput,<span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">return</span> statusOutput;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; }</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;}</div>
<div class="line"><a name="l00227"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f"> 227</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">PS3BT::Reset</a>() {</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; activeConnection = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; l2cap_event_flag = 0; <span class="comment">// Reset flags</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>;</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="comment">// Needed for PS3 Dualshock Controller commands to work via bluetooth</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_b_t_8h.html#a8e1b40b58f50a692cda94418934e9ba6">OUTPUT_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; HIDBuffer[i + 2] = pgm_read_byte(&amp;OUTPUT_REPORT_BUFFER[i]); <span class="comment">// First two bytes reserved for report type and ID </span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;}</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;</div>
<div class="line"><a name="l00240"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a39ad8810c67e85eddc68c8a16d38a985"> 240</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a39ad8810c67e85eddc68c8a16d38a985">PS3BT::disconnect</a>() { <span class="comment">// Use this void to disconnect any of the controllers</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="comment">//First the HID interrupt channel has to be disconencted, then the HID control channel and finally the HCI connection</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(hci_handle,0x0A, interrupt_scid, interrupt_dcid);</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">Reset</a>();</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ab569b2085ad29f41d1da9c0ed352bd65">L2CAP_INTERRUPT_DISCONNECT</a>;</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;}</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#aa310ede24b68b1b03cfc49c4308c66b7"> 247</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#aa310ede24b68b1b03cfc49c4308c66b7">PS3BT::ACLData</a>(uint8_t* ACLData) {</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="keywordflow">if</span>(!pBtd-&gt;<a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a> &amp;&amp; !<a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a> &amp;&amp; !<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a> &amp;&amp; !<a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a> &amp;&amp; !activeConnection &amp;&amp; !pBtd-&gt;<a class="code" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e">connectToWii</a> &amp;&amp; !pBtd-&gt;<a class="code" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee">incomingWii</a> &amp;&amp; !pBtd-&gt;<a class="code" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a>) {</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <span class="keywordflow">if</span> (ACLData[8] == <a class="code" href="_b_t_d_8h.html#ac4bae0c65fd00ed849cb226302d19c85">L2CAP_CMD_CONNECTION_REQUEST</a>) {</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordflow">if</span>((ACLData[12] | (ACLData[13] &lt;&lt; 8)) == <a class="code" href="_b_t_d_8h.html#a1465673868452307bcdab8e201430c27">HID_CTRL_PSM</a>) {</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a> = <span class="keyword">true</span>; <span class="comment">// Claim that the incoming connection belongs to this service</span></div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; activeConnection = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; hci_handle = pBtd-&gt;<a class="code" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98">hci_handle</a>; <span class="comment">// Store the HCI Handle for the connection</span></div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>;</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="keywordflow">for</span>(uint8_t i = 0; i &lt; 30; i++)</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; remote_name[i] = pBtd-&gt;<a class="code" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e">remote_name</a>[i]; <span class="comment">// Store the remote name for the connection</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;#ifdef <a class="code" href="_p_s3_b_t_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordflow">if</span>(pBtd-&gt;<a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a> &lt; 3) { <span class="comment">// Check the HCI Version of the Bluetooth dongle</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nYour dongle may not support reading the analog buttons, sensors and status\r\nYour HCI Version is: &quot;</span>));</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; Serial.print(pBtd-&gt;<a class="code" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a>);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nBut should be at least 3\r\nThis means that it doesn&#39;t support Bluetooth Version 2.0+EDR&quot;</span>));</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; }</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; }</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; }</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="keywordflow">if</span> (((ACLData[0] | (ACLData[1] &lt;&lt; 8)) == (hci_handle | 0x2000))) { <span class="comment">//acl_handle_ok</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordflow">for</span>(uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>; i++)</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; l2capinbuf[i] = ACLData[i];</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordflow">if</span> ((l2capinbuf[6] | (l2capinbuf[7] &lt;&lt; 8)) == 0x0001) { <span class="comment">//l2cap_control - Channel ID for ACL-U</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a6ffcd72787c86f248192eb06a3fe18cb">L2CAP_CMD_COMMAND_REJECT</a>) {</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Command Rejected - Reason: &quot;</span>));</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[13]);</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; Serial.print(<span class="stringliteral">&quot; &quot;</span>);</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[12]);</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; Serial.print(<span class="stringliteral">&quot; Data: &quot;</span>);</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[17]);</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; Serial.print(<span class="stringliteral">&quot; &quot;</span>);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[16]);</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; Serial.print(<span class="stringliteral">&quot; &quot;</span>); </div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[15]);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; Serial.print(<span class="stringliteral">&quot; &quot;</span>);</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[14]); </div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#ac4bae0c65fd00ed849cb226302d19c85">L2CAP_CMD_CONNECTION_REQUEST</a>) { </div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Connection Request - PSM: &quot;</span>));</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[13]);</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>));</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[12]);</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot; SCID: &quot;</span>));</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[15]);</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot; &quot;</span>));</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[14]);</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot; Identifier: &quot;</span>));</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[9]);</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> ((l2capinbuf[12] | (l2capinbuf[13] &lt;&lt; 8)) == <a class="code" href="_b_t_d_8h.html#a1465673868452307bcdab8e201430c27">HID_CTRL_PSM</a>) { </div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; control_scid[0] = l2capinbuf[14];</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; control_scid[1] = l2capinbuf[15];</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; l2cap_event_flag |= <a class="code" href="_p_s3_b_t_8h.html#a969a1ee84797f3ee5006c41f67373f96">L2CAP_FLAG_CONNECTION_CONTROL_REQUEST</a>;</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; }</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((l2capinbuf[12] | (l2capinbuf[13] &lt;&lt; 8)) == <a class="code" href="_b_t_d_8h.html#a4c5ac96db74d61d4a5a5d945a400e7da">HID_INTR_PSM</a>) {</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; interrupt_scid[0] = l2capinbuf[14];</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; interrupt_scid[1] = l2capinbuf[15];</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; l2cap_event_flag |= <a class="code" href="_p_s3_b_t_8h.html#a015f3b25bd7a2908c84b973dec453f45">L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST</a>;</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; }</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; }</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a8151b1fe5d940a5a7a34f43a8b8ce434">L2CAP_CMD_CONFIG_RESPONSE</a>) {</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keywordflow">if</span> ((l2capinbuf[16] | (l2capinbuf[17] &lt;&lt; 8)) == 0x0000) { <span class="comment">// Success</span></div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[12] == control_dcid[0] &amp;&amp; l2capinbuf[13] == control_dcid[1]) {</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <span class="comment">//Serial.print(&quot;\r\nHID Control Configuration Complete&quot;);</span></div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; l2cap_event_flag |= <a class="code" href="_p_s3_b_t_8h.html#a0c444d5d06ec604820d426556c2f38d7">L2CAP_FLAG_CONFIG_CONTROL_SUCCESS</a>;</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; }</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[12] == interrupt_dcid[0] &amp;&amp; l2capinbuf[13] == interrupt_dcid[1]) {</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <span class="comment">//Serial.print(&quot;\r\nHID Interrupt Configuration Complete&quot;);</span></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; l2cap_event_flag |= <a class="code" href="_p_s3_b_t_8h.html#a2b3cdcd3124251a40ce825da0d8dcb6f">L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS</a>;</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; }</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; }</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; }</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a48bcd73461d736d0ef889e1fe6e36f69">L2CAP_CMD_CONFIG_REQUEST</a>) {</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[12] == control_dcid[0] &amp;&amp; l2capinbuf[13] == control_dcid[1]) {</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <span class="comment">//Serial.print(&quot;\r\nHID Control Configuration Request&quot;);</span></div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; identifier = l2capinbuf[9]; </div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; l2cap_event_flag |= <a class="code" href="_p_s3_b_t_8h.html#af693a78d3df21b24430347b804076b8e">L2CAP_FLAG_CONFIG_CONTROL_REQUEST</a>;</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; }</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[12] == interrupt_dcid[0] &amp;&amp; l2capinbuf[13] == interrupt_dcid[1]) {</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <span class="comment">//Serial.print(&quot;\r\nHID Interrupt Configuration Request&quot;);</span></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; l2cap_event_flag |= <a class="code" href="_p_s3_b_t_8h.html#ab8ff96117ba9c8f6a53c2ebbac0da33f">L2CAP_FLAG_CONFIG_INTERRUPT_REQUEST</a>;</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; }</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; } </div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a398676a2e9a2351a5a52afdddf4b660b">L2CAP_CMD_DISCONNECT_REQUEST</a>) {</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[12] == control_dcid[0] &amp;&amp; l2capinbuf[13] == control_dcid[1]) {</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnect Request: Control Channel&quot;</span>));</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160;<span class="preprocessor"></span> identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(hci_handle,identifier,control_dcid,control_scid);</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">Reset</a>();</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; }</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[12] == interrupt_dcid[0] &amp;&amp; l2capinbuf[13] == interrupt_dcid[1]) {</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnect Request: Interrupt Channel&quot;</span>)); </div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160;<span class="preprocessor"></span> identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(hci_handle,identifier,interrupt_dcid,interrupt_scid);</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; <a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">Reset</a>();</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; }</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; }</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[8] == <a class="code" href="_b_t_d_8h.html#a4c64a41200714e457b397496183dc0e4">L2CAP_CMD_DISCONNECT_RESPONSE</a>) {</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; <span class="keywordflow">if</span> (l2capinbuf[12] == control_scid[0] &amp;&amp; l2capinbuf[13] == control_scid[1]) { </div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; <span class="comment">//Serial.print(&quot;\r\nDisconnect Response: Control Channel&quot;);</span></div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; l2cap_event_flag |= <a class="code" href="_p_s3_b_t_8h.html#a27057737ae0b2246442511c01eeed192">L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE</a>;</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; }</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[12] == interrupt_scid[0] &amp;&amp; l2capinbuf[13] == interrupt_scid[1]) { </div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; <span class="comment">//Serial.print(&quot;\r\nDisconnect Response: Interrupt Channel&quot;);</span></div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; identifier = l2capinbuf[9];</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; l2cap_event_flag |= <a class="code" href="_p_s3_b_t_8h.html#acc096a05301f3cbdece4ad372cc149c3">L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE</a>;</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; }</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; }</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nL2CAP Unknown Signaling Command: &quot;</span>));</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[8]);</div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; }</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160;<span class="preprocessor"></span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (l2capinbuf[6] == interrupt_dcid[0] &amp;&amp; l2capinbuf[7] == interrupt_dcid[1]) { <span class="comment">// l2cap_interrupt</span></div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <span class="comment">//Serial.print(&quot;\r\nL2CAP Interrupt&quot;);</span></div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a> || <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a> || <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a>) {</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160; <span class="comment">/* Read Report */</span></div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; <span class="keywordflow">if</span>(l2capinbuf[8] == 0xA1) { <span class="comment">// HID_THDR_DATA_INPUT</span></div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a> || <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a>)</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; ButtonState = (uint32_t)(l2capinbuf[11] | ((uint16_t)l2capinbuf[12] &lt;&lt; 8) | ((uint32_t)l2capinbuf[13] &lt;&lt; 16));</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>)</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160; ButtonState = (uint32_t)(l2capinbuf[10] | ((uint16_t)l2capinbuf[11] &lt;&lt; 8) | ((uint32_t)l2capinbuf[12] &lt;&lt; 16));</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; </div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState&quot;);</span></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState);</span></div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; </div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; <span class="keywordflow">if</span>(ButtonState != OldButtonState) {</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; ButtonClickState = ButtonState &amp; ~OldButtonState; <span class="comment">// Update click state variable</span></div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; OldButtonState = ButtonState;</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; }</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; </div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT // Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the PS3 Controllers</span></div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">for</span>(uint8_t i = 10; i &lt; 58;i++) {</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; PrintHex&lt;uint8_t&gt;(l2capinbuf[i]);</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; Serial.print(<span class="stringliteral">&quot; &quot;</span>);</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; }</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; Serial.println();</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; }</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; }</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; L2CAP_task();</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; }</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160;}</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160;<span class="keywordtype">void</span> PS3BT::L2CAP_task() {</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; <span class="keywordflow">switch</span> (l2cap_state) {</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>:</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a728c7d92dd341dcc1b8f4bf95bb4826d">l2cap_connection_request_control_flag</a>) {</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Incoming Connection Request&quot;</span>));</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(hci_handle,identifier, control_dcid, control_scid, <a class="code" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc">PENDING</a>);</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; delay(1);</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(hci_handle,identifier, control_dcid, control_scid, <a class="code" href="_b_t_d_8h.html#a1be7a56cdddcdb7dedf16d4dee381e93">SUCCESSFUL</a>);</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; identifier++;</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; delay(1);</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#ab646a59311344966f139bb3b78f30233">l2cap_config_request</a>(hci_handle,identifier, control_scid);</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ad98e60fcc8acca70e545ba7c248af65a">L2CAP_CONTROL_REQUEST</a>;</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; }</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ad98e60fcc8acca70e545ba7c248af65a">L2CAP_CONTROL_REQUEST</a>:</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a48b27c08aa64a339eb1d358707927d3e">l2cap_config_request_control_flag</a>) {</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Configuration Request&quot;</span>));</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(hci_handle,identifier, control_scid);</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b">L2CAP_CONTROL_SUCCESS</a>;</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; }</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160; </div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b">L2CAP_CONTROL_SUCCESS</a>:</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a39a58b19fb4ef26cf503ed57a43570a4">l2cap_config_success_control_flag</a>) {</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Control Successfully Configured&quot;</span>));</div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160;<span class="preprocessor"></span> l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ac7aa7fd7a8a34a6c9e420e3cb114737b">L2CAP_INTERRUPT_SETUP</a>;</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; }</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ac7aa7fd7a8a34a6c9e420e3cb114737b">L2CAP_INTERRUPT_SETUP</a>:</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a9fa7bceb44bbdff3229fd431627b9868">l2cap_connection_request_interrupt_flag</a>) {</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Incoming Connection Request&quot;</span>));</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(hci_handle,identifier, interrupt_dcid, interrupt_scid, <a class="code" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc">PENDING</a>);</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160; delay(1);</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(hci_handle,identifier, interrupt_dcid, interrupt_scid, <a class="code" href="_b_t_d_8h.html#a1be7a56cdddcdb7dedf16d4dee381e93">SUCCESSFUL</a>);</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; identifier++;</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; delay(1);</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#ab646a59311344966f139bb3b78f30233">l2cap_config_request</a>(hci_handle,identifier, interrupt_scid);</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; </div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a0c004c746b90f2c8025bb1ddd20d811a">L2CAP_INTERRUPT_REQUEST</a>;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; }</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a0c004c746b90f2c8025bb1ddd20d811a">L2CAP_INTERRUPT_REQUEST</a>:</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#ad5c6ab585a398e53f2ee5616fe0d4346">l2cap_config_request_interrupt_flag</a>) {</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Configuration Request&quot;</span>));</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(hci_handle,identifier, interrupt_scid);</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ac2fdeba844d7f2021e0aed9616aad5e4">L2CAP_INTERRUPT_SUCCESS</a>;</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; }</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ac2fdeba844d7f2021e0aed9616aad5e4">L2CAP_INTERRUPT_SUCCESS</a>:</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a9b3e87e1f460bc011e69f5e53e79c104">l2cap_config_success_interrupt_flag</a>) {</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nHID Interrupt Successfully Configured&quot;</span>));</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span>(remote_name[0] == <span class="charliteral">&#39;M&#39;</span>) { <span class="comment">// First letter in Motion Controller (&#39;M&#39;)</span></div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>; i++) <span class="comment">// Reset l2cap in buffer as it sometimes read it as a button has been pressed</span></div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; l2capinbuf[i] = 0;</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160; ButtonState = 0;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160; OldButtonState = 0;</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; </div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>;</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a8463be04d86ddc1d58f6388d5be501ad">L2CAP_HID_ENABLE_SIXAXIS</a>;</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; timer = millis();</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; }</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160;</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <span class="comment">/* These states are handled in Run() */</span></div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; </div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ab569b2085ad29f41d1da9c0ed352bd65">L2CAP_INTERRUPT_DISCONNECT</a>:</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a667178a4486c4dee88e052b3562362cd">l2cap_disconnect_response_interrupt_flag</a>) {</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected Interrupt Channel&quot;</span>));</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160;<span class="preprocessor"></span> identifier++;</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(hci_handle, identifier, control_scid, control_dcid); </div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a9b5140e7ca5941e5535c575255ffc1cc">L2CAP_CONTROL_DISCONNECT</a>;</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; }</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; </div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a9b5140e7ca5941e5535c575255ffc1cc">L2CAP_CONTROL_DISCONNECT</a>:</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="_p_s3_b_t_8h.html#a7f0cab74308e812106252c53b18c0391">l2cap_disconnect_response_control_flag</a>) {</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDisconnected Control Channel&quot;</span>));</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160;<span class="preprocessor"></span> pBtd-&gt;<a class="code" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(hci_handle);</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; hci_handle = -1; <span class="comment">// Reset handle</span></div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; l2cap_event_flag = 0; <span class="comment">// Reset flags</span></div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>;</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; }</div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; } </div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160;}</div>
<div class="line"><a name="l00506"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086"> 506</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086">PS3BT::Run</a>() {</div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160; <span class="keywordflow">switch</span> (l2cap_state) {</div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a8463be04d86ddc1d58f6388d5be501ad">L2CAP_HID_ENABLE_SIXAXIS</a>:</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; <span class="keywordflow">if</span>(millis() - timer &gt; 1000) { <span class="comment">// loop 1 second before sending the command</span></div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>; i++) <span class="comment">// Reset l2cap in buffer as it sometimes read it as a button has been pressed</span></div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; l2capinbuf[i] = 0;</div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; ButtonState = 0;</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; OldButtonState = 0;</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; </div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; enable_sixaxis();</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 15; i &lt; 19; i++)</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; l2capinbuf[i] = 0x7F; <span class="comment">// Set the analog joystick values to center position</span></div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>;</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160; timer = millis();</div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160; }</div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160; </div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#a7e385f71ba4406d372f8210b48f5e133">L2CAP_HID_PS3_LED</a>:</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160; <span class="keywordflow">if</span>(millis() - timer &gt; 1000) { <span class="comment">// loop 1 second before sending the command</span></div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;P&#39;</span>) { <span class="comment">// First letter in PLAYSTATION(R)3 Controller (&#39;P&#39;)</span></div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>);</div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDualshock 3 Controller Enabled\r\n&quot;</span>));</div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (remote_name[0] == <span class="charliteral">&#39;N&#39;</span>) { <span class="comment">// First letter in Navigation Controller (&#39;N&#39;)</span></div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>); <span class="comment">// This just turns LED constantly on, on the Navigation controller</span></div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nNavigation Controller Enabled\r\n&quot;</span>));</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160; } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(remote_name[0] == <span class="charliteral">&#39;M&#39;</span>) { <span class="comment">// First letter in Motion Controller (&#39;M&#39;)</span></div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743">Red</a>);</div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; timerBulbRumble = millis();</div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMotion Controller Enabled\r\n&quot;</span>));</div>
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160; }</div>
<div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160; l2cap_state = <a class="code" href="_p_s3_b_t_8h.html#ae4da52ca67e1f8b977199b24e8f3a400">L2CAP_DONE</a>;</div>
<div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; }</div>
<div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160; </div>
<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_p_s3_b_t_8h.html#ae4da52ca67e1f8b977199b24e8f3a400">L2CAP_DONE</a>:</div>
<div class="line"><a name="l00550"></a><span class="lineno"> 550</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>) { <span class="comment">//The Bulb and rumble values, has to be send at aproximatly every 5th second for it to stay on</span></div>
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160; <span class="keywordflow">if</span> (millis() - timerBulbRumble &gt; 4000) { <span class="comment">//Send at least every 4th second</span></div>
<div class="line"><a name="l00552"></a><span class="lineno"> 552</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);<span class="comment">//The Bulb and rumble values, has to be written again and again, for it to stay turned on</span></div>
<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>&#160; timerBulbRumble = millis();</div>
<div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160; }</div>
<div class="line"><a name="l00555"></a><span class="lineno"> 555</span>&#160; }</div>
<div class="line"><a name="l00556"></a><span class="lineno"> 556</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00557"></a><span class="lineno"> 557</span>&#160; }</div>
<div class="line"><a name="l00558"></a><span class="lineno"> 558</span>&#160;}</div>
<div class="line"><a name="l00559"></a><span class="lineno"> 559</span>&#160;</div>
<div class="line"><a name="l00560"></a><span class="lineno"> 560</span>&#160;<span class="comment">/************************************************************/</span></div>
<div class="line"><a name="l00561"></a><span class="lineno"> 561</span>&#160;<span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00562"></a><span class="lineno"> 562</span>&#160;<span class="comment">/************************************************************/</span></div>
<div class="line"><a name="l00563"></a><span class="lineno"> 563</span>&#160;</div>
<div class="line"><a name="l00564"></a><span class="lineno"> 564</span>&#160;<span class="comment">//Playstation Sixaxis Dualshock and Navigation Controller commands</span></div>
<div class="line"><a name="l00565"></a><span class="lineno"> 565</span>&#160;<span class="keywordtype">void</span> PS3BT::HID_Command(uint8_t* data, uint8_t nbytes) { </div>
<div class="line"><a name="l00566"></a><span class="lineno"> 566</span>&#160; <span class="keywordflow">if</span> (millis() - timerHID &lt;= 250)<span class="comment">// Check if is has been more than 250ms since last command </span></div>
<div class="line"><a name="l00567"></a><span class="lineno"> 567</span>&#160; delay((uint32_t)(250 - (millis() - timerHID)));<span class="comment">//There have to be a delay between commands</span></div>
<div class="line"><a name="l00568"></a><span class="lineno"> 568</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(hci_handle,data,nbytes,control_scid[0],control_scid[1]); <span class="comment">// Both the Navigation and Dualshock controller sends data via the control channel</span></div>
<div class="line"><a name="l00569"></a><span class="lineno"> 569</span>&#160; timerHID = millis();</div>
<div class="line"><a name="l00570"></a><span class="lineno"> 570</span>&#160;}</div>
<div class="line"><a name="l00571"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a6ee74242b0c1644496ff04b457f39cd2"> 571</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a6ee74242b0c1644496ff04b457f39cd2">PS3BT::setAllOff</a>() {</div>
<div class="line"><a name="l00572"></a><span class="lineno"> 572</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_b_t_8h.html#a8e1b40b58f50a692cda94418934e9ba6">OUTPUT_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00573"></a><span class="lineno"> 573</span>&#160; HIDBuffer[i + 2] = pgm_read_byte(&amp;OUTPUT_REPORT_BUFFER[i]);<span class="comment">//First two bytes reserved for report type and ID</span></div>
<div class="line"><a name="l00574"></a><span class="lineno"> 574</span>&#160; </div>
<div class="line"><a name="l00575"></a><span class="lineno"> 575</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00576"></a><span class="lineno"> 576</span>&#160;}</div>
<div class="line"><a name="l00577"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a5c87e7db5311a5d56f78c994b5545e4e"> 577</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a5c87e7db5311a5d56f78c994b5545e4e">PS3BT::setRumbleOff</a>() {</div>
<div class="line"><a name="l00578"></a><span class="lineno"> 578</span>&#160; HIDBuffer[3] = 0x00;</div>
<div class="line"><a name="l00579"></a><span class="lineno"> 579</span>&#160; HIDBuffer[4] = 0x00;<span class="comment">//low mode off</span></div>
<div class="line"><a name="l00580"></a><span class="lineno"> 580</span>&#160; HIDBuffer[5] = 0x00;</div>
<div class="line"><a name="l00581"></a><span class="lineno"> 581</span>&#160; HIDBuffer[6] = 0x00;<span class="comment">//high mode off</span></div>
<div class="line"><a name="l00582"></a><span class="lineno"> 582</span>&#160; </div>
<div class="line"><a name="l00583"></a><span class="lineno"> 583</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00584"></a><span class="lineno"> 584</span>&#160;}</div>
<div class="line"><a name="l00585"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4"> 585</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">PS3BT::setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode) {</div>
<div class="line"><a name="l00586"></a><span class="lineno"> 586</span>&#160; <span class="comment">/* Still not totally sure how it works, maybe something like this instead?</span></div>
<div class="line"><a name="l00587"></a><span class="lineno"> 587</span>&#160;<span class="comment"> * 3 - duration_right</span></div>
<div class="line"><a name="l00588"></a><span class="lineno"> 588</span>&#160;<span class="comment"> * 4 - power_right</span></div>
<div class="line"><a name="l00589"></a><span class="lineno"> 589</span>&#160;<span class="comment"> * 5 - duration_left</span></div>
<div class="line"><a name="l00590"></a><span class="lineno"> 590</span>&#160;<span class="comment"> * 6 - power_left</span></div>
<div class="line"><a name="l00591"></a><span class="lineno"> 591</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00592"></a><span class="lineno"> 592</span>&#160; <span class="keywordflow">if</span> ((mode &amp; 0x30) &gt; 0) {</div>
<div class="line"><a name="l00593"></a><span class="lineno"> 593</span>&#160; HIDBuffer[3] = 0xfe;</div>
<div class="line"><a name="l00594"></a><span class="lineno"> 594</span>&#160; HIDBuffer[5] = 0xfe; </div>
<div class="line"><a name="l00595"></a><span class="lineno"> 595</span>&#160; <span class="keywordflow">if</span> (mode == <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a>) {</div>
<div class="line"><a name="l00596"></a><span class="lineno"> 596</span>&#160; HIDBuffer[4] = 0;<span class="comment">//low mode off</span></div>
<div class="line"><a name="l00597"></a><span class="lineno"> 597</span>&#160; HIDBuffer[6] = 0xff;<span class="comment">//high mode on</span></div>
<div class="line"><a name="l00598"></a><span class="lineno"> 598</span>&#160; }</div>
<div class="line"><a name="l00599"></a><span class="lineno"> 599</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00600"></a><span class="lineno"> 600</span>&#160; HIDBuffer[4] = 0xff;<span class="comment">//low mode on</span></div>
<div class="line"><a name="l00601"></a><span class="lineno"> 601</span>&#160; HIDBuffer[6] = 0;<span class="comment">//high mode off</span></div>
<div class="line"><a name="l00602"></a><span class="lineno"> 602</span>&#160; } </div>
<div class="line"><a name="l00603"></a><span class="lineno"> 603</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00604"></a><span class="lineno"> 604</span>&#160; }</div>
<div class="line"><a name="l00605"></a><span class="lineno"> 605</span>&#160;}</div>
<div class="line"><a name="l00606"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#aa84e4cb30f827c8d8d981c1de82c53ad"> 606</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#aa84e4cb30f827c8d8d981c1de82c53ad">PS3BT::setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00607"></a><span class="lineno"> 607</span>&#160; HIDBuffer[11] &amp;= ~((uint8_t)((pgm_read_byte(&amp;LEDS[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1));</div>
<div class="line"><a name="l00608"></a><span class="lineno"> 608</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00609"></a><span class="lineno"> 609</span>&#160;}</div>
<div class="line"><a name="l00610"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42"> 610</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">PS3BT::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00611"></a><span class="lineno"> 611</span>&#160; HIDBuffer[11] |= (uint8_t)((pgm_read_byte(&amp;LEDS[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00612"></a><span class="lineno"> 612</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00613"></a><span class="lineno"> 613</span>&#160;}</div>
<div class="line"><a name="l00614"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a313d4c962273fc7daccb0319d80c5f61"> 614</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a313d4c962273fc7daccb0319d80c5f61">PS3BT::setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00615"></a><span class="lineno"> 615</span>&#160; HIDBuffer[11] ^= (uint8_t)((pgm_read_byte(&amp;LEDS[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00616"></a><span class="lineno"> 616</span>&#160; HID_Command(HIDBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>);</div>
<div class="line"><a name="l00617"></a><span class="lineno"> 617</span>&#160;}</div>
<div class="line"><a name="l00618"></a><span class="lineno"> 618</span>&#160;<span class="keywordtype">void</span> PS3BT::enable_sixaxis() { <span class="comment">//Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00619"></a><span class="lineno"> 619</span>&#160; uint8_t cmd_buf[6];</div>
<div class="line"><a name="l00620"></a><span class="lineno"> 620</span>&#160; cmd_buf[0] = 0x53;<span class="comment">// HID BT Set_report (0x50) | Report Type (Feature 0x03)</span></div>
<div class="line"><a name="l00621"></a><span class="lineno"> 621</span>&#160; cmd_buf[1] = 0xF4;<span class="comment">// Report ID</span></div>
<div class="line"><a name="l00622"></a><span class="lineno"> 622</span>&#160; cmd_buf[2] = 0x42;<span class="comment">// Special PS3 Controller enable commands</span></div>
<div class="line"><a name="l00623"></a><span class="lineno"> 623</span>&#160; cmd_buf[3] = 0x03;</div>
<div class="line"><a name="l00624"></a><span class="lineno"> 624</span>&#160; cmd_buf[4] = 0x00;</div>
<div class="line"><a name="l00625"></a><span class="lineno"> 625</span>&#160; cmd_buf[5] = 0x00;</div>
<div class="line"><a name="l00626"></a><span class="lineno"> 626</span>&#160; </div>
<div class="line"><a name="l00627"></a><span class="lineno"> 627</span>&#160; HID_Command(cmd_buf, 6);</div>
<div class="line"><a name="l00628"></a><span class="lineno"> 628</span>&#160;}</div>
<div class="line"><a name="l00629"></a><span class="lineno"> 629</span>&#160;</div>
<div class="line"><a name="l00630"></a><span class="lineno"> 630</span>&#160;<span class="comment">//Playstation Move Controller commands</span></div>
<div class="line"><a name="l00631"></a><span class="lineno"> 631</span>&#160;<span class="keywordtype">void</span> PS3BT::HIDMove_Command(uint8_t* data,uint8_t nbytes) {</div>
<div class="line"><a name="l00632"></a><span class="lineno"> 632</span>&#160; <span class="keywordflow">if</span> (millis() - timerHID &lt;= 250)<span class="comment">// Check if is has been less than 200ms since last command</span></div>
<div class="line"><a name="l00633"></a><span class="lineno"> 633</span>&#160; delay((uint32_t)(250 - (millis() - timerHID)));<span class="comment">//There have to be a delay between commands</span></div>
<div class="line"><a name="l00634"></a><span class="lineno"> 634</span>&#160; pBtd-&gt;<a class="code" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(hci_handle,data,nbytes,interrupt_scid[0],interrupt_scid[1]); <span class="comment">// The Move controller sends it&#39;s data via the intterrupt channel</span></div>
<div class="line"><a name="l00635"></a><span class="lineno"> 635</span>&#160; timerHID = millis();</div>
<div class="line"><a name="l00636"></a><span class="lineno"> 636</span>&#160;}</div>
<div class="line"><a name="l00637"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782"> 637</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">PS3BT::moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b) { <span class="comment">//Use this to set the Color using RGB values</span></div>
<div class="line"><a name="l00638"></a><span class="lineno"> 638</span>&#160; <span class="comment">//set the Bulb&#39;s values into the write buffer </span></div>
<div class="line"><a name="l00639"></a><span class="lineno"> 639</span>&#160; HIDMoveBuffer[3] = r;</div>
<div class="line"><a name="l00640"></a><span class="lineno"> 640</span>&#160; HIDMoveBuffer[4] = g;</div>
<div class="line"><a name="l00641"></a><span class="lineno"> 641</span>&#160; HIDMoveBuffer[5] = b;</div>
<div class="line"><a name="l00642"></a><span class="lineno"> 642</span>&#160; </div>
<div class="line"><a name="l00643"></a><span class="lineno"> 643</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>); </div>
<div class="line"><a name="l00644"></a><span class="lineno"> 644</span>&#160;}</div>
<div class="line"><a name="l00645"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ae544ca1d76217d058c63d339d0701264"> 645</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">PS3BT::moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color) { <span class="comment">//Use this to set the Color using the predefined colors in enum</span></div>
<div class="line"><a name="l00646"></a><span class="lineno"> 646</span>&#160; <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>((uint8_t)(color &gt;&gt; 16),(uint8_t)(color &gt;&gt; 8),(uint8_t)(color));</div>
<div class="line"><a name="l00647"></a><span class="lineno"> 647</span>&#160;}</div>
<div class="line"><a name="l00648"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689"> 648</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689">PS3BT::moveSetRumble</a>(uint8_t rumble) {</div>
<div class="line"><a name="l00649"></a><span class="lineno"> 649</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00650"></a><span class="lineno"> 650</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span>(rumble &lt; 64 &amp;&amp; rumble != 0) <span class="comment">// The rumble value has to at least 64, or approximately 25% (64/255*100)</span></div>
<div class="line"><a name="l00651"></a><span class="lineno"> 651</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nThe rumble value has to at least 64, or approximately 25%&quot;</span>));</div>
<div class="line"><a name="l00652"></a><span class="lineno"> 652</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00653"></a><span class="lineno"> 653</span>&#160;<span class="preprocessor"></span> <span class="comment">//set the rumble value into the write buffer</span></div>
<div class="line"><a name="l00654"></a><span class="lineno"> 654</span>&#160; HIDMoveBuffer[7] = rumble;</div>
<div class="line"><a name="l00655"></a><span class="lineno"> 655</span>&#160; </div>
<div class="line"><a name="l00656"></a><span class="lineno"> 656</span>&#160; HIDMove_Command(HIDMoveBuffer, <a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>); </div>
<div class="line"><a name="l00657"></a><span class="lineno"> 657</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -187,6 +187,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00024">24</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a48b27c08aa64a339eb1d358707927d3e"></a>
@ -199,6 +201,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00052">52</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad5c6ab585a398e53f2ee5616fe0d4346"></a>
@ -211,6 +215,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00055">55</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a39a58b19fb4ef26cf503ed57a43570a4"></a>
@ -223,6 +229,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00053">53</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9b3e87e1f460bc011e69f5e53e79c104"></a>
@ -235,6 +243,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00056">56</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a728c7d92dd341dcc1b8f4bf95bb4826d"></a>
@ -247,6 +257,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00051">51</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9fa7bceb44bbdff3229fd431627b9868"></a>
@ -259,6 +271,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00054">54</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9b5140e7ca5941e5535c575255ffc1cc"></a>
@ -271,6 +285,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00038">38</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad98e60fcc8acca70e545ba7c248af65a"></a>
@ -283,6 +299,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00029">29</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="abac08b5b24a1cd2b12517cd9aa6c616b"></a>
@ -295,6 +313,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00030">30</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7f0cab74308e812106252c53b18c0391"></a>
@ -307,6 +327,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00057">57</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a667178a4486c4dee88e052b3562362cd"></a>
@ -319,6 +341,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00058">58</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae4da52ca67e1f8b977199b24e8f3a400"></a>
@ -331,6 +355,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00036">36</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="af693a78d3df21b24430347b804076b8e"></a>
@ -343,6 +369,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00042">42</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0c444d5d06ec604820d426556c2f38d7"></a>
@ -355,6 +383,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00043">43</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab8ff96117ba9c8f6a53c2ebbac0da33f"></a>
@ -367,6 +397,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00045">45</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2b3cdcd3124251a40ce825da0d8dcb6f"></a>
@ -379,6 +411,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00046">46</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a969a1ee84797f3ee5006c41f67373f96"></a>
@ -391,6 +425,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00041">41</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a015f3b25bd7a2908c84b973dec453f45"></a>
@ -403,6 +439,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00044">44</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a27057737ae0b2246442511c01eeed192"></a>
@ -415,6 +453,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00047">47</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="acc096a05301f3cbdece4ad372cc149c3"></a>
@ -427,6 +467,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00048">48</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8463be04d86ddc1d58f6388d5be501ad"></a>
@ -439,6 +481,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00034">34</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7e385f71ba4406d372f8210b48f5e133"></a>
@ -451,6 +495,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00035">35</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab569b2085ad29f41d1da9c0ed352bd65"></a>
@ -463,6 +509,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00037">37</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0c004c746b90f2c8025bb1ddd20d811a"></a>
@ -475,6 +523,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00032">32</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac7aa7fd7a8a34a6c9e420e3cb114737b"></a>
@ -487,6 +537,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00031">31</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac2fdeba844d7f2021e0aed9616aad5e4"></a>
@ -499,6 +551,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00033">33</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a15cc1db556ad9a4ec6144ca8a42f8919"></a>
@ -511,6 +565,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00028">28</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8e1b40b58f50a692cda94418934e9ba6"></a>
@ -523,12 +579,14 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_b_t_8h_source.html#l00025">25</a> of file <a class="el" href="_p_s3_b_t_8h_source.html">PS3BT.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -147,98 +147,84 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_p_s3_b_t_8h.html#a7f0cab74308e812106252c53b18c0391"> 57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_p_s3_b_t_8h.html#a667178a4486c4dee88e052b3562362cd"> 58</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html"> 60</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_p_s3_b_t.html">PS3BT</a> : <span class="keyword">public</span> <a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <a class="code" href="class_p_s3_b_t.html#aab14832f7844f07e6287eb443019b6e7">PS3BT</a>(<a class="code" href="class_b_t_d.html">BTD</a> *pBtd, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0);</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="comment">// BluetoothService implementation</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#aa310ede24b68b1b03cfc49c4308c66b7">ACLData</a>(uint8_t* <a class="code" href="class_p_s3_b_t.html#aa310ede24b68b1b03cfc49c4308c66b7">ACLData</a>); <span class="comment">// Used to pass acldata to the services</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086">Run</a>(); <span class="comment">// Used to run part of the state maschine</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">Reset</a>(); <span class="comment">// Use this to reset the service</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a39ad8810c67e85eddc68c8a16d38a985">disconnect</a>(); <span class="comment">// Use this void to disconnect any of the controllers</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="comment">/* PS3 Controller Commands */</span> </div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="comment">/* </span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="comment"> getButtonPress will return true as long as the button is held down</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="comment"> While getButtonClick will only return it once</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="comment"> So you instance if you need to increase a variable once you would use getButtonClick, </span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="comment"> but if you need to drive a robot forward you would use getButtonPress </span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a9b8726849cf6fbaf4e98a9652cb53b61">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a92c617e1d00860dc560af7cfe20938d9">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; </div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; uint8_t <a class="code" href="class_p_s3_b_t.html#a8c04e0e821dcbfb8825d4b31ab270f00">getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a);</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; uint8_t <a class="code" href="class_p_s3_b_t.html#a9da5c045fafc3436dc2d2820cb234384">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; int16_t <a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a);</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_p_s3_b_t.html#a5f4d7fd35927694ae815091b487dcd60">getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a);</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_p_s3_b_t.html#af9386c460169ea8f07e79c86a8938965">get9DOFValues</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a);</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c); </div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; String <a class="code" href="class_p_s3_b_t.html#ac31b6d24710711a9d460367b6aae308f">getStatusString</a>(); </div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; String <a class="code" href="class_p_s3_b_t.html#ab4f49b61167df001d13b68c7699651b4">getTemperature</a>();</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="comment">/* Commands for Dualshock 3 and Navigation controller */</span> </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a6ee74242b0c1644496ff04b457f39cd2">setAllOff</a>();</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a5c87e7db5311a5d56f78c994b5545e4e">setRumbleOff</a>();</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode);</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#aa84e4cb30f827c8d8d981c1de82c53ad">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a); </div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a313d4c962273fc7daccb0319d80c5f61">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; </div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">/* Commands for Motion controller only */</span> </div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b); <span class="comment">// Use this to set the Color using RGB values</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color); <span class="comment">// Use this to set the Color using the predefined colors in &quot;enum Colors&quot;</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689">moveSetRumble</a>(uint8_t rumble);</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9"> 103</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a>; <span class="comment">// Variable used to indicate if the normal playstation controller is successfully connected</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a"> 104</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>; <span class="comment">// Variable used to indicate if the move controller is successfully connected</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430"> 105</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a>; <span class="comment">// Variable used to indicate if the navigation controller is successfully connected</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; </div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">/* mandatory members */</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordtype">void</span> L2CAP_task(); <span class="comment">// L2CAP state machine</span></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">/* Variables filled from HCI event management */</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; int16_t hci_handle;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; uint8_t remote_name[30]; <span class="comment">// First 30 chars of remote name</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it&#39;s already has established a connection</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="comment">/* variables used by high level L2CAP task */</span> </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; uint8_t l2cap_state;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; uint16_t l2cap_event_flag; <span class="comment">// L2CAP flags of received bluetooth events</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; uint32_t timerHID; <span class="comment">// Timer used see if there has to be a delay before a new HID command</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; uint32_t timerBulbRumble;<span class="comment">// used to continuously set PS3 Move controller Bulb and rumble values</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; </div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; uint8_t l2capinbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for L2CAP in data</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; uint8_t HIDBuffer[<a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>]; <span class="comment">// Used to store HID commands</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; uint8_t HIDMoveBuffer[<a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>]; <span class="comment">// Used to store HID commands for the Move controller </span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; uint8_t control_scid[2]; <span class="comment">// L2CAP source CID for HID_Control </span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; uint8_t control_dcid[2]; <span class="comment">// 0x0040</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; uint8_t interrupt_scid[2]; <span class="comment">// L2CAP source CID for HID_Interrupt </span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; uint8_t interrupt_dcid[2]; <span class="comment">// 0x0041</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; uint8_t identifier; <span class="comment">// Identifier for connection </span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; </div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordtype">void</span> HID_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordtype">void</span> HIDMove_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keywordtype">void</span> enable_sixaxis(); <span class="comment">// Command used to enable the Dualshock 3 and Navigation controller to send data via Bluetooth</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;};</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html"> 66</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_p_s3_b_t.html">PS3BT</a> : <span class="keyword">public</span> <a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <a class="code" href="class_p_s3_b_t.html#aab14832f7844f07e6287eb443019b6e7">PS3BT</a>(<a class="code" href="class_b_t_d.html">BTD</a> *pBtd, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0);</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#aa310ede24b68b1b03cfc49c4308c66b7">ACLData</a>(uint8_t* <a class="code" href="class_p_s3_b_t.html#aa310ede24b68b1b03cfc49c4308c66b7">ACLData</a>);</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086">Run</a>();</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">Reset</a>();</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a39ad8810c67e85eddc68c8a16d38a985">disconnect</a>();</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a9b8726849cf6fbaf4e98a9652cb53b61">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a92c617e1d00860dc560af7cfe20938d9">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; uint8_t <a class="code" href="class_p_s3_b_t.html#a8c04e0e821dcbfb8825d4b31ab270f00">getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a);</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; uint8_t <a class="code" href="class_p_s3_b_t.html#a9da5c045fafc3436dc2d2820cb234384">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; int16_t <a class="code" href="class_p_s3_b_t.html#a99be7c63e7cb91a26110e0e44b180a0a">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a);</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_p_s3_b_t.html#a5f4d7fd35927694ae815091b487dcd60">getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_p_s3_b_t.html#af9386c460169ea8f07e79c86a8938965">get9DOFValues</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a88106bc19e763a191a3fe04f4641f4c6">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; String <a class="code" href="class_p_s3_b_t.html#ac31b6d24710711a9d460367b6aae308f">getStatusString</a>();</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; String <a class="code" href="class_p_s3_b_t.html#ab4f49b61167df001d13b68c7699651b4">getTemperature</a>();</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a6ee74242b0c1644496ff04b457f39cd2">setAllOff</a>();</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a5c87e7db5311a5d56f78c994b5545e4e">setRumbleOff</a>();</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad18e284705a4899d72937b97e27cb0a4">setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#aa84e4cb30f827c8d8d981c1de82c53ad">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad400e1ce37c2dadd48938187b5021d42">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#a313d4c962273fc7daccb0319d80c5f61">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ad0926b75edcbb12ddf76f78e66728782">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color);</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_b_t.html#ac14d338ddb573d1c06f70749f9205689">moveSetRumble</a>(uint8_t rumble);</div>
<div class="line"><a name="l00198"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9"> 198</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a2804535e3164eafca80a6f6c6bd9a4f9">PS3Connected</a>;</div>
<div class="line"><a name="l00200"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a"> 200</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#a9273b6796948b83772117b3805421b4a">PS3MoveConnected</a>;</div>
<div class="line"><a name="l00202"></a><span class="lineno"><a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430"> 202</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_b_t.html#ab35277632083d43f8750d130bea6d430">PS3NavigationConnected</a>;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; </div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="comment">/* mandatory members */</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; </div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keywordtype">void</span> L2CAP_task(); <span class="comment">// L2CAP state machine</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; </div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="comment">/* Variables filled from HCI event management */</span></div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; int16_t hci_handle;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; uint8_t remote_name[30]; <span class="comment">// First 30 chars of remote name</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it&#39;s already has established a connection</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; </div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="comment">/* variables used by high level L2CAP task */</span> </div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; uint8_t l2cap_state;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; uint16_t l2cap_event_flag; <span class="comment">// L2CAP flags of received bluetooth events</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; </div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; </div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; </div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; uint32_t timerHID; <span class="comment">// Timer used see if there has to be a delay before a new HID command</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; uint32_t timerBulbRumble;<span class="comment">// used to continuously set PS3 Move controller Bulb and rumble values</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; </div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; uint8_t l2capinbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for L2CAP in data</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; uint8_t HIDBuffer[<a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>]; <span class="comment">// Used to store HID commands</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; uint8_t HIDMoveBuffer[<a class="code" href="_p_s3_b_t_8h.html#a465c4c33eae0fd5f934ae12bc8d6ca7e">HID_BUFFERSIZE</a>]; <span class="comment">// Used to store HID commands for the Move controller </span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; uint8_t control_scid[2]; <span class="comment">// L2CAP source CID for HID_Control </span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; uint8_t control_dcid[2]; <span class="comment">// 0x0040</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; uint8_t interrupt_scid[2]; <span class="comment">// L2CAP source CID for HID_Interrupt </span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; uint8_t interrupt_dcid[2]; <span class="comment">// 0x0041</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; uint8_t identifier; <span class="comment">// Identifier for connection </span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; </div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordtype">void</span> HID_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordtype">void</span> HIDMove_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordtype">void</span> enable_sixaxis(); <span class="comment">// Command used to enable the Dualshock 3 and Navigation controller to send data via Bluetooth</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;};</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -197,6 +197,7 @@ Variables</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to get the angle calculated using the accelerometer. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47"></a>Pitch</em>&nbsp;</td><td class="fielddoc">
</td></tr>
@ -204,6 +205,8 @@ Variables</h2></td></tr>
</td></tr>
</table>
<p>Definition at line <a class="el" href="_p_s3_enums_8h_source.html#l00157">157</a> of file <a class="el" href="_p_s3_enums_8h_source.html">PS3Enums.h</a>.</p>
</div>
</div>
<a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967"></a>
@ -215,25 +218,36 @@ Variables</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to set the colors of the move controller. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743"></a>Red</em>&nbsp;</td><td class="fielddoc">
<p>r = 255, g = 0, b = 0 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad0784a3f969fe736e8b271a5a161d106"></a>Green</em>&nbsp;</td><td class="fielddoc">
<p>r = 0, g = 255, b = 0 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967af5e09dd1da4088464f264b7a3118bff8"></a>Blue</em>&nbsp;</td><td class="fielddoc">
<p>r = 0, g = 0, b = 255 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967abf28513245738599d13e3ce36bd16c82"></a>Yellow</em>&nbsp;</td><td class="fielddoc">
<p>r = 255, g = 235, b = 4 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967a7ff0cc1f92da1e4577a4bf08d0ffbd5a"></a>Lightblue</em>&nbsp;</td><td class="fielddoc">
<p>r = 0, g = 255, b = 255 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967a627dded106da5a64dd127381890c2f7c"></a>Purble</em>&nbsp;</td><td class="fielddoc">
<p>r = 255, g = 0, b = 255 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967ab548046646b36c12aa6ba841de500094"></a>White</em>&nbsp;</td><td class="fielddoc">
<p>r = 255, g = 255, b = 255 </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad8a892b94d3a94ea861543c085ae782b"></a>Off</em>&nbsp;</td><td class="fielddoc">
<p>r = 0, g = 0, b = 0 </p>
</td></tr>
</table>
<p>Definition at line <a class="el" href="_p_s3_enums_8h_source.html#l00096">96</a> of file <a class="el" href="_p_s3_enums_8h_source.html">PS3Enums.h</a>.</p>
</div>
</div>
<a class="anchor" id="aff4be38428d075a117a5bb7f6209a231"></a>
@ -252,6 +266,8 @@ Variables</h2></td></tr>
</td></tr>
</table>
<p>Definition at line <a class="el" href="_p_s3_enums_8h_source.html#l00188">188</a> of file <a class="el" href="_p_s3_enums_8h_source.html">PS3Enums.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9628766e5f200cc84b296b071b09ff4a"></a>
@ -263,37 +279,55 @@ Variables</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Sensors inside the Sixaxis Dualshock 3 and Move controller.</p>
<p><b>Note:</b> that the location is shiftet 9 when it's connected via <a class="el" href="class_u_s_b.html">USB</a>. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb"></a>aX</em>&nbsp;</td><td class="fielddoc">
<p>Accelerometer x-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd"></a>aY</em>&nbsp;</td><td class="fielddoc">
<p>Accelerometer y-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc"></a>aZ</em>&nbsp;</td><td class="fielddoc">
<p>Accelerometer z-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa644a4a198e3cf90bfe918a147cd5d675"></a>gZ</em>&nbsp;</td><td class="fielddoc">
<p>Gyro z-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa832ceb5090692e95e93982849f740de7"></a>aXmove</em>&nbsp;</td><td class="fielddoc">
<p>Accelerometer x-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa077e283d0c3f06568c20adf90ced0a3f"></a>aZmove</em>&nbsp;</td><td class="fielddoc">
<p>Accelerometer z-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa5c436ac329e20e6b7661152c74e82199"></a>aYmove</em>&nbsp;</td><td class="fielddoc">
<p>Accelerometer y-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa1851ce90f7a3f6acb062de46e78ca731"></a>gXmove</em>&nbsp;</td><td class="fielddoc">
<p>Gyro x-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa9ea1d99ce7ddecd65fcb39f30c77037d"></a>gZmove</em>&nbsp;</td><td class="fielddoc">
<p>Gyro z-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa9c538a78bbc03fb258e1141acdc69a91"></a>gYmove</em>&nbsp;</td><td class="fielddoc">
<p>Gyro y-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa43025202f119b0f193cbc14c6a3cf59f"></a>tempMove</em>&nbsp;</td><td class="fielddoc">
<p>Temperature sensor </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa9d1f82ecbf55d931c3f49858d86d4d68"></a>mXmove</em>&nbsp;</td><td class="fielddoc">
<p>Magnetometer x-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aa1b4c8ce0561fd9c003a6389d7c6fb503"></a>mZmove</em>&nbsp;</td><td class="fielddoc">
<p>Magnetometer z-axis </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a9628766e5f200cc84b296b071b09ff4aaee1254b85fe360243299d2041323aa78"></a>mYmove</em>&nbsp;</td><td class="fielddoc">
<p>Magnetometer y-axis </p>
</td></tr>
</table>
<p>Definition at line <a class="el" href="_p_s3_enums_8h_source.html#l00122">122</a> of file <a class="el" href="_p_s3_enums_8h_source.html">PS3Enums.h</a>.</p>
</div>
</div>
<a class="anchor" id="a67a0db04d321a74b7e7fcfd3f1a3f70b"></a>
@ -348,6 +382,8 @@ Variables</h2></td></tr>
</td></tr>
</table>
<p>Definition at line <a class="el" href="_p_s3_enums_8h_source.html#l00161">161</a> of file <a class="el" href="_p_s3_enums_8h_source.html">PS3Enums.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
@ -373,13 +409,20 @@ Variables</h2></td></tr>
<div class="line"> 0x0E, </div>
<div class="line"> 0x0F </div>
<div class="line">}</div>
</div><!-- fragment -->
</div><!-- fragment --><p>Used to set the LEDs on the controllers</p>
<p>Buttons on the controllers</p>
<p><b>Note:</b> that the location is shiftet 9 when it's connected via <a class="el" href="class_u_s_b.html">USB</a>.</p>
<p>Analog buttons on the controllers</p>
<p><b>Note:</b> that the location is shiftet 9 when it's connected via <a class="el" href="class_u_s_b.html">USB</a>. </p>
<p>Definition at line <a class="el" href="_p_s3_enums_8h_source.html#l00024">24</a> of file <a class="el" href="_p_s3_enums_8h_source.html">PS3Enums.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -110,146 +110,141 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<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 &quot;<a class="code" href="controller_enums_8h.html">controllerEnums.h</a>&quot;</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"><a class="code" href="_p_s3_enums_8h.html#aefe67abcaf27811cfe8d010add39ae4e"> 23</a></span>&#160;<span class="keyword">const</span> uint8_t LEDS[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; 0x01, <span class="comment">// LED1</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; 0x02, <span class="comment">// LED2</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; 0x04, <span class="comment">// LED3</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; 0x08, <span class="comment">// LED4</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; 0x09, <span class="comment">// LED5</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; 0x0A, <span class="comment">// LED6</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; 0x0C, <span class="comment">// LED7</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; 0x0D, <span class="comment">// LED8</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; 0x0E, <span class="comment">// LED9</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; 0x0F <span class="comment">// LED10</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;};</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">const</span> uint32_t BUTTONS[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; 0x10, <span class="comment">// UP</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; 0x20, <span class="comment">// RIGHT</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; 0x40, <span class="comment">// DOWN</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; 0x80, <span class="comment">// LEFT</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; 0x01, <span class="comment">// SELECT</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; 0x02, <span class="comment">// L3</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; 0x04, <span class="comment">// R3</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; 0x08, <span class="comment">// START</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; 0x0100, <span class="comment">// L2</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; 0x0200, <span class="comment">// R2</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; 0x0400, <span class="comment">// L1</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; 0x0800, <span class="comment">// R1</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; 0x1000, <span class="comment">// TRIANGLE</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; 0x2000, <span class="comment">// CIRCLE</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; 0x4000, <span class="comment">// CROSS</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; 0x8000, <span class="comment">// SQUARE</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; 0x010000, <span class="comment">// PS </span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; 0x080000, <span class="comment">// MOVE - covers 12 bits - we only need to read the top 8</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; 0x100000 <span class="comment">// T - covers 12 bits - we only need to read the top 8</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"> 61</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="keyword">const</span> uint8_t ANALOGBUTTONS[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="comment">// Note that the location is shiftet 9 when it&#39;s connected via USB </span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="comment">// Sixaxis Dualshcock 3 &amp; Navigation controller</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; 23, <span class="comment">// UP_ANALOG</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; 24, <span class="comment">// RIGHT_ANALOG</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; 25, <span class="comment">// DOWN_ANALOG</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; 26, <span class="comment">// LEFT_ANALOG</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; 0,0,0,0, <span class="comment">// Skip SELECT, L3, R3 and START</span></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; 27, <span class="comment">// L2_ANALOG</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; 28, <span class="comment">// R2_ANALOG</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; 29, <span class="comment">// L1_ANALOG</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; 30, <span class="comment">// R1_ANALOG</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; 31, <span class="comment">// TRIANGLE_ANALOG</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; 32, <span class="comment">// CIRCLE_ANALOG</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; 33, <span class="comment">// CROSS_ANALOG</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; 34, <span class="comment">// SQUARE_ANALOG</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; 0,0, <span class="comment">// Skip PS and MOVE</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#aefe67abcaf27811cfe8d010add39ae4e"> 24</a></span>&#160;<span class="keyword">const</span> uint8_t LEDS[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; 0x01, <span class="comment">// LED1</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; 0x02, <span class="comment">// LED2</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; 0x04, <span class="comment">// LED3</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; 0x08, <span class="comment">// LED4</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; 0x09, <span class="comment">// LED5</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; 0x0A, <span class="comment">// LED6</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; 0x0C, <span class="comment">// LED7</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; 0x0D, <span class="comment">// LED8</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; 0x0E, <span class="comment">// LED9</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; 0x0F <span class="comment">// LED10</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;};</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="keyword">const</span> uint32_t BUTTONS[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; 0x10, <span class="comment">// UP</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; 0x20, <span class="comment">// RIGHT</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; 0x40, <span class="comment">// DOWN</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; 0x80, <span class="comment">// LEFT</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"> 49</span>&#160; 0x01, <span class="comment">// SELECT</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; 0x08, <span class="comment">// START</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; 0x02, <span class="comment">// L3</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; 0x04, <span class="comment">// R3</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; 0x0100, <span class="comment">// L2</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; 0x0200, <span class="comment">// R2</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; 0x0400, <span class="comment">// L1</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; 0x0800, <span class="comment">// R1</span></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; 0x1000, <span class="comment">// TRIANGLE</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; 0x2000, <span class="comment">// CIRCLE</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; 0x4000, <span class="comment">// CROSS</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; 0x8000, <span class="comment">// SQUARE</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; 0x010000, <span class="comment">// PS </span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; 0x080000, <span class="comment">// MOVE - covers 12 bits - we only need to read the top 8</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; 0x100000 <span class="comment">// T - covers 12 bits - we only need to read the top 8</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;};</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="keyword">const</span> uint8_t ANALOGBUTTONS[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; 23, <span class="comment">// UP_ANALOG</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; 24, <span class="comment">// RIGHT_ANALOG</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; 25, <span class="comment">// DOWN_ANALOG</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; 26, <span class="comment">// LEFT_ANALOG</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; 0,0,0,0, <span class="comment">// Skip SELECT, L3, R3 and START</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="comment">// Playstation Move Controller</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; 15 <span class="comment">// T_ANALOG - Both at byte 14 (last reading) and byte 15 (current reading)</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;};</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967"> 85</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> {</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="comment">// Used to set the colors of the move controller</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743"> 87</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743">Red</a> = 0xFF0000, <span class="comment">// r = 255, g = 0, b = 0</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad0784a3f969fe736e8b271a5a161d106"> 88</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad0784a3f969fe736e8b271a5a161d106">Green</a> = 0xFF00, <span class="comment">// r = 0, g = 255, b = 0</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967af5e09dd1da4088464f264b7a3118bff8"> 89</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967af5e09dd1da4088464f264b7a3118bff8">Blue</a> = 0xFF, <span class="comment">// r = 0, g = 0, b = 255</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; 27, <span class="comment">// L2_ANALOG</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; 28, <span class="comment">// R2_ANALOG</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; 29, <span class="comment">// L1_ANALOG</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; 30, <span class="comment">// R1_ANALOG</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; 31, <span class="comment">// TRIANGLE_ANALOG</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; 32, <span class="comment">// CIRCLE_ANALOG</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; 33, <span class="comment">// CROSS_ANALOG</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; 34, <span class="comment">// SQUARE_ANALOG</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; 0,0, <span class="comment">// Skip PS and MOVE</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967abf28513245738599d13e3ce36bd16c82"> 91</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967abf28513245738599d13e3ce36bd16c82">Yellow</a> = 0xFFEB04, <span class="comment">// r = 255, g = 235, b = 4</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967a7ff0cc1f92da1e4577a4bf08d0ffbd5a"> 92</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967a7ff0cc1f92da1e4577a4bf08d0ffbd5a">Lightblue</a> = 0xFFFF, <span class="comment">// r = 0, g = 255, b = 255</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967a627dded106da5a64dd127381890c2f7c"> 93</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967a627dded106da5a64dd127381890c2f7c">Purble</a> = 0xFF00FF, <span class="comment">// r = 255, g = 0, b = 255</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"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ab548046646b36c12aa6ba841de500094"> 95</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ab548046646b36c12aa6ba841de500094">White</a> = 0xFFFFFF, <span class="comment">// r = 255, g = 255, b = 255</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad8a892b94d3a94ea861543c085ae782b"> 96</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad8a892b94d3a94ea861543c085ae782b">Off</a> = 0x00, <span class="comment">// r = 0, g = 0, b = 0</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;};</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a"> 98</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> {</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="comment">// Note that the location is shiftet 9 when it&#39;s connected via USB</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">// Sensors inside the Sixaxis Dualshock 3 controller</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb"> 101</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb">aX</a> = 50,</div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd"> 102</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd">aY</a> = 52,</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc"> 103</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc">aZ</a> = 54,</div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa644a4a198e3cf90bfe918a147cd5d675"> 104</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa644a4a198e3cf90bfe918a147cd5d675">gZ</a> = 56,</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="comment">// Sensors inside the Move Motion controller</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa832ceb5090692e95e93982849f740de7"> 107</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa832ceb5090692e95e93982849f740de7">aXmove</a> = 28,</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa077e283d0c3f06568c20adf90ced0a3f"> 108</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa077e283d0c3f06568c20adf90ced0a3f">aZmove</a> = 30,</div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa5c436ac329e20e6b7661152c74e82199"> 109</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa5c436ac329e20e6b7661152c74e82199">aYmove</a> = 32,</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="comment">// Playstation Move Controller</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; 15 <span class="comment">// T_ANALOG - Both at byte 14 (last reading) and byte 15 (current reading)</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;};</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967"> 96</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> {</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743"> 98</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743">Red</a> = 0xFF0000,</div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad0784a3f969fe736e8b271a5a161d106"> 100</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad0784a3f969fe736e8b271a5a161d106">Green</a> = 0xFF00,</div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967af5e09dd1da4088464f264b7a3118bff8"> 102</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967af5e09dd1da4088464f264b7a3118bff8">Blue</a> = 0xFF,</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967abf28513245738599d13e3ce36bd16c82"> 105</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967abf28513245738599d13e3ce36bd16c82">Yellow</a> = 0xFFEB04,</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967a7ff0cc1f92da1e4577a4bf08d0ffbd5a"> 107</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967a7ff0cc1f92da1e4577a4bf08d0ffbd5a">Lightblue</a> = 0xFFFF,</div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967a627dded106da5a64dd127381890c2f7c"> 109</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967a627dded106da5a64dd127381890c2f7c">Purble</a> = 0xFF00FF,</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1851ce90f7a3f6acb062de46e78ca731"> 111</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1851ce90f7a3f6acb062de46e78ca731">gXmove</a> = 40,</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9ea1d99ce7ddecd65fcb39f30c77037d"> 112</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9ea1d99ce7ddecd65fcb39f30c77037d">gZmove</a> = 42,</div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9c538a78bbc03fb258e1141acdc69a91"> 113</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9c538a78bbc03fb258e1141acdc69a91">gYmove</a> = 44,</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa43025202f119b0f193cbc14c6a3cf59f"> 115</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa43025202f119b0f193cbc14c6a3cf59f">tempMove</a> = 46,</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9d1f82ecbf55d931c3f49858d86d4d68"> 117</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9d1f82ecbf55d931c3f49858d86d4d68">mXmove</a> = 47,</div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b4c8ce0561fd9c003a6389d7c6fb503"> 118</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b4c8ce0561fd9c003a6389d7c6fb503">mZmove</a> = 49,</div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaee1254b85fe360243299d2041323aa78"> 119</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaee1254b85fe360243299d2041323aa78">mYmove</a> = 50,</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;};</div>
<div class="line"><a name="l00121"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1"> 121</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> {</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="comment">// Used to get the angle calculated using atan2</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47"> 123</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a> = 0x01,</div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1a9d80e5f030503ccac779c6491826a173"> 124</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1a9d80e5f030503ccac779c6491826a173">Roll</a> = 0x02,</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;};</div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b"> 126</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> {</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="comment">// Note that the location is shiftet 9 when it&#39;s connected via USB</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">// Byte location | bit location</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baff01ce39b42bec30132b0fc53c882387"> 129</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baff01ce39b42bec30132b0fc53c882387">Plugged</a> = (38 &lt;&lt; 8) | 0x02,</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bae37160f3a65bb54a91fb5efb4f971924"> 130</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bae37160f3a65bb54a91fb5efb4f971924">Unplugged</a> = (38 &lt;&lt; 8) | 0x03,</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba5a86ae1482947377a116685c168d1773"> 132</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba5a86ae1482947377a116685c168d1773">Charging</a> = (39 &lt;&lt; 8) | 0xEE,</div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bac138cecbd4ef1ba0f9e0ab12440a6df6"> 133</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bac138cecbd4ef1ba0f9e0ab12440a6df6">NotCharging</a> = (39 &lt;&lt; 8) | 0xF1,</div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba82084136e62c38642986b05419b4e734"> 134</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba82084136e62c38642986b05419b4e734">Shutdown</a> = (39 &lt;&lt; 8) | 0x01,</div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba96cc2a0090ada376561406d48d1f2089"> 135</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba96cc2a0090ada376561406d48d1f2089">Dying</a> = (39 &lt;&lt; 8) | 0x02,</div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7a352a3dd2accc1dd65a4538c3754ee8"> 136</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7a352a3dd2accc1dd65a4538c3754ee8">Low</a> = (39 &lt;&lt; 8) | 0x03,</div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba24c57acd029e3f96fede49402ea01e6f"> 137</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba24c57acd029e3f96fede49402ea01e6f">High</a> = (39 &lt;&lt; 8) | 0x04,</div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679"> 138</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679">Full</a> = (39 &lt;&lt; 8) | 0x05,</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; </div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a18b1e66913bf3103ec5f81a124d030"> 140</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a18b1e66913bf3103ec5f81a124d030">MoveCharging</a> = (21 &lt;&lt; 8) | 0xEE,</div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baa66a4c4924065859bcee07c677554e2a"> 141</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baa66a4c4924065859bcee07c677554e2a">MoveNotCharging</a> = (21 &lt;&lt; 8) | 0xF1,</div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba90b649581a499e75735f153a32dfd71c"> 142</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba90b649581a499e75735f153a32dfd71c">MoveShutdown</a> = (21 &lt;&lt; 8) | 0x01,</div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba74ec9082d76bf71ae74ad5d948c311f8"> 143</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba74ec9082d76bf71ae74ad5d948c311f8">MoveDying</a> = (21 &lt;&lt; 8) | 0x02,</div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba429562e406bab9f30a0290306c6abdbf"> 144</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba429562e406bab9f30a0290306c6abdbf">MoveLow</a> = (21 &lt;&lt; 8) | 0x03,</div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7719066bf7a360dfe51ccbf81a148bcb"> 145</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7719066bf7a360dfe51ccbf81a148bcb">MoveHigh</a> = (21 &lt;&lt; 8) | 0x04,</div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baccd6c38d1a97db0feafc9f88909ce943"> 146</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baccd6c38d1a97db0feafc9f88909ce943">MoveFull</a> = (21 &lt;&lt; 8) | 0x05,</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"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba71c14aef95c9953673a880e2633fa209"> 148</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba71c14aef95c9953673a880e2633fa209">CableRumble</a> = (40 &lt;&lt; 8) | 0x10,<span class="comment">//Opperating by USB and rumble is turned on</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a36ca9a60a5e244f3404ec0db7b44a1"> 149</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a36ca9a60a5e244f3404ec0db7b44a1">Cable</a> = (40 &lt;&lt; 8) | 0x12,<span class="comment">//Opperating by USB and rumble is turned off</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba27912f9ea05a45aada21fc375817342c"> 150</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba27912f9ea05a45aada21fc375817342c">BluetoothRumble</a> = (40 &lt;&lt; 8) | 0x14,<span class="comment">//Opperating by bluetooth and rumble is turned on</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb"> 151</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a> = (40 &lt;&lt; 8) | 0x16,<span class="comment">//Opperating by bluetooth and rumble is turned off</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;};</div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231"> 153</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> { </div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b"> 154</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a> = 0x10,</div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a080b52389e532b79b9e48f43ae6086ac"> 155</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a080b52389e532b79b9e48f43ae6086ac">RumbleLow</a> = 0x20,</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;};</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ab548046646b36c12aa6ba841de500094"> 112</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ab548046646b36c12aa6ba841de500094">White</a> = 0xFFFFFF,</div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad8a892b94d3a94ea861543c085ae782b"> 114</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad8a892b94d3a94ea861543c085ae782b">Off</a> = 0x00,</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;};</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a"> 122</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> {</div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb"> 124</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb">aX</a> = 50,</div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd"> 126</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd">aY</a> = 52,</div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc"> 128</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc">aZ</a> = 54,</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa644a4a198e3cf90bfe918a147cd5d675"> 130</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa644a4a198e3cf90bfe918a147cd5d675">gZ</a> = 56,</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa832ceb5090692e95e93982849f740de7"> 133</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa832ceb5090692e95e93982849f740de7">aXmove</a> = 28,</div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa077e283d0c3f06568c20adf90ced0a3f"> 135</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa077e283d0c3f06568c20adf90ced0a3f">aZmove</a> = 30,</div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa5c436ac329e20e6b7661152c74e82199"> 137</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa5c436ac329e20e6b7661152c74e82199">aYmove</a> = 32,</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; </div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1851ce90f7a3f6acb062de46e78ca731"> 140</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1851ce90f7a3f6acb062de46e78ca731">gXmove</a> = 40,</div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9ea1d99ce7ddecd65fcb39f30c77037d"> 142</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9ea1d99ce7ddecd65fcb39f30c77037d">gZmove</a> = 42,</div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9c538a78bbc03fb258e1141acdc69a91"> 144</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9c538a78bbc03fb258e1141acdc69a91">gYmove</a> = 44,</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; </div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa43025202f119b0f193cbc14c6a3cf59f"> 147</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa43025202f119b0f193cbc14c6a3cf59f">tempMove</a> = 46,</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9d1f82ecbf55d931c3f49858d86d4d68"> 150</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa9d1f82ecbf55d931c3f49858d86d4d68">mXmove</a> = 47,</div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b4c8ce0561fd9c003a6389d7c6fb503"> 152</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b4c8ce0561fd9c003a6389d7c6fb503">mZmove</a> = 49,</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaee1254b85fe360243299d2041323aa78"> 154</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaee1254b85fe360243299d2041323aa78">mYmove</a> = 50,</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;};</div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1"> 157</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> {</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47"> 158</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a> = 0x01,</div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1a9d80e5f030503ccac779c6491826a173"> 159</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1a9d80e5f030503ccac779c6491826a173">Roll</a> = 0x02,</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;};</div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b"> 161</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> {</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="comment">// Note that the location is shiftet 9 when it&#39;s connected via USB</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="comment">// Byte location | bit location</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baff01ce39b42bec30132b0fc53c882387"> 164</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baff01ce39b42bec30132b0fc53c882387">Plugged</a> = (38 &lt;&lt; 8) | 0x02,</div>
<div class="line"><a name="l00165"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bae37160f3a65bb54a91fb5efb4f971924"> 165</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bae37160f3a65bb54a91fb5efb4f971924">Unplugged</a> = (38 &lt;&lt; 8) | 0x03,</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; </div>
<div class="line"><a name="l00167"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba5a86ae1482947377a116685c168d1773"> 167</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba5a86ae1482947377a116685c168d1773">Charging</a> = (39 &lt;&lt; 8) | 0xEE,</div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bac138cecbd4ef1ba0f9e0ab12440a6df6"> 168</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bac138cecbd4ef1ba0f9e0ab12440a6df6">NotCharging</a> = (39 &lt;&lt; 8) | 0xF1,</div>
<div class="line"><a name="l00169"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba82084136e62c38642986b05419b4e734"> 169</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba82084136e62c38642986b05419b4e734">Shutdown</a> = (39 &lt;&lt; 8) | 0x01,</div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba96cc2a0090ada376561406d48d1f2089"> 170</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba96cc2a0090ada376561406d48d1f2089">Dying</a> = (39 &lt;&lt; 8) | 0x02,</div>
<div class="line"><a name="l00171"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7a352a3dd2accc1dd65a4538c3754ee8"> 171</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7a352a3dd2accc1dd65a4538c3754ee8">Low</a> = (39 &lt;&lt; 8) | 0x03,</div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba24c57acd029e3f96fede49402ea01e6f"> 172</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba24c57acd029e3f96fede49402ea01e6f">High</a> = (39 &lt;&lt; 8) | 0x04,</div>
<div class="line"><a name="l00173"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679"> 173</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679">Full</a> = (39 &lt;&lt; 8) | 0x05,</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a18b1e66913bf3103ec5f81a124d030"> 175</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a18b1e66913bf3103ec5f81a124d030">MoveCharging</a> = (21 &lt;&lt; 8) | 0xEE,</div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baa66a4c4924065859bcee07c677554e2a"> 176</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baa66a4c4924065859bcee07c677554e2a">MoveNotCharging</a> = (21 &lt;&lt; 8) | 0xF1,</div>
<div class="line"><a name="l00177"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba90b649581a499e75735f153a32dfd71c"> 177</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba90b649581a499e75735f153a32dfd71c">MoveShutdown</a> = (21 &lt;&lt; 8) | 0x01,</div>
<div class="line"><a name="l00178"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba74ec9082d76bf71ae74ad5d948c311f8"> 178</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba74ec9082d76bf71ae74ad5d948c311f8">MoveDying</a> = (21 &lt;&lt; 8) | 0x02,</div>
<div class="line"><a name="l00179"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba429562e406bab9f30a0290306c6abdbf"> 179</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba429562e406bab9f30a0290306c6abdbf">MoveLow</a> = (21 &lt;&lt; 8) | 0x03,</div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7719066bf7a360dfe51ccbf81a148bcb"> 180</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7719066bf7a360dfe51ccbf81a148bcb">MoveHigh</a> = (21 &lt;&lt; 8) | 0x04,</div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baccd6c38d1a97db0feafc9f88909ce943"> 181</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baccd6c38d1a97db0feafc9f88909ce943">MoveFull</a> = (21 &lt;&lt; 8) | 0x05,</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; </div>
<div class="line"><a name="l00183"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba71c14aef95c9953673a880e2633fa209"> 183</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba71c14aef95c9953673a880e2633fa209">CableRumble</a> = (40 &lt;&lt; 8) | 0x10,<span class="comment">//Opperating by USB and rumble is turned on</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a36ca9a60a5e244f3404ec0db7b44a1"> 184</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a36ca9a60a5e244f3404ec0db7b44a1">Cable</a> = (40 &lt;&lt; 8) | 0x12,<span class="comment">//Opperating by USB and rumble is turned off</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba27912f9ea05a45aada21fc375817342c"> 185</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba27912f9ea05a45aada21fc375817342c">BluetoothRumble</a> = (40 &lt;&lt; 8) | 0x14,<span class="comment">//Opperating by bluetooth and rumble is turned on</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb"> 186</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a> = (40 &lt;&lt; 8) | 0x16,<span class="comment">//Opperating by bluetooth and rumble is turned off</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;};</div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231"> 188</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> { </div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b"> 189</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a> = 0x10,</div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a080b52389e532b79b9e48f43ae6086ac"> 190</a></span>&#160; <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a080b52389e532b79b9e48f43ae6086ac">RumbleLow</a> = 0x20,</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;};</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -99,7 +99,9 @@ Include dependency graph for PS3USB.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_p_s3_u_s_b_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_p_s3_u_s_b_8cpp">
<area shape="rect" id="node2" href="_p_s3_u_s_b_8h.html" title="PS3USB.h" alt="" coords="726,93,785,115"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="397,163,440,184"/><area shape="rect" id="node18" href="_p_s3_enums_8h.html" title="PS3Enums.h" alt="" coords="797,163,866,184"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="528,301,582,323"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="146,301,213,323"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="212,232,269,253"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="237,301,296,323"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="79,232,136,253"/><area shape="rect" id="node14" href="printhex_8h.html" title="printhex.h" alt="" coords="608,301,665,323"/><area shape="rect" id="node15" href="hexdump_8h.html" title="hexdump.h" alt="" coords="430,232,492,253"/><area shape="rect" id="node17" href="message_8h.html" title="message.h" alt="" coords="345,232,406,253"/><area shape="rect" id="node19" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="794,232,880,253"/></map>
</div>
</div><table class="memberdecls">
</div>
<p><a href="_p_s3_u_s_b_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad72dbcf6d0153db1b8d8a58001feed83"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_p_s3_u_s_b_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a></td></tr>
@ -121,6 +123,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8cpp_source.html#l00019">19</a> of file <a class="el" href="_p_s3_u_s_b_8cpp_source.html">PS3USB.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
@ -145,12 +149,14 @@ Variables</h2></td></tr>
<div class="line"> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 </div>
<div class="line">}</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8cpp_source.html#l00023">23</a> of file <a class="el" href="_p_s3_u_s_b_8cpp_source.html">PS3USB.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -0,0 +1,650 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/PS3USB.cpp 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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">PS3USB.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="_p_s3_u_s_b_8cpp.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) 2012 Kristian Lauszus, TKJ Electronics. 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"> Kristian Lauszus, TKJ Electronics</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> Web : http://www.tkjelectronics.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> e-mail : kristianl@tkjelectronics.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;</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_p_s3_u_s_b_8h.html">PS3USB.h</a>&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="code" href="_p_s3_u_s_b_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83"> 19</a></span>&#160;<span class="preprocessor">#define DEBUG // Uncomment to print data for debugging</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor"></span><span class="comment">//#define EXTRADEBUG // Uncomment to get even more debugging data</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment">//#define PRINTREPORT // Uncomment to print the report send by the PS3 Controllers</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"><a class="code" href="_p_s3_u_s_b_8cpp.html#a5442183aed6e48d11b22eb790351a5cd"> 23</a></span>&#160;<span class="keyword">const</span> uint8_t PS3_REPORT_BUFFER[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00, </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00, </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; 0xff, 0x27, 0x10, 0x00, 0x32, </div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; 0xff, 0x27, 0x10, 0x00, 0x32, </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; 0xff, 0x27, 0x10, 0x00, 0x32, </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; 0xff, 0x27, 0x10, 0x00, 0x32, </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00, </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00,</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;};</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="keyword">const</span> uint8_t MOVE_REPORT_BUFFER[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; 0x02, 0x00, <span class="comment">// Always 0x02, 0x00, </span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; 0x00, 0x00, 0x00, <span class="comment">// r, g, b, </span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; 0x00, <span class="comment">// Always 0x00, </span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; 0x00 <span class="comment">// Rumble</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;};</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ac919404d4caf4625467756272f8d5502"> 41</a></span>&#160;<a class="code" href="class_p_s3_u_s_b.html#ac919404d4caf4625467756272f8d5502">PS3USB::PS3USB</a>(<a class="code" href="class_u_s_b.html">USB</a> *p, uint8_t btadr5, uint8_t btadr4, uint8_t btadr3, uint8_t btadr2, uint8_t btadr1, uint8_t btadr0):</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;pUsb(p), <span class="comment">// pointer to USB class instance - mandatory</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;bAddress(0), <span class="comment">// device address - mandatory</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;bPollEnable(false) <span class="comment">// don&#39;t start polling before dongle is connected</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;{</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0; i&lt;<a class="code" href="_p_s3_u_s_b_8h.html#a168ab47b14a95d7cf8066d553a9cb862">PS3_MAX_ENDPOINTS</a>; i++) {</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[i].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (i) ? 0 : 8;</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = 0; </div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = (i) ? <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a> : <a class="code" href="address_8h.html#a517dfa014946e2d087d197312234a1de">USB_NAK_MAX_POWER</a>;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; }</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>) <span class="comment">// register in USB subsystem</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2">RegisterDeviceClass</a>(<span class="keyword">this</span>); <span class="comment">//set devConfig[] entry</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; my_bdaddr[5] = btadr5; <span class="comment">// Change to your dongle&#39;s Bluetooth address instead</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; my_bdaddr[4] = btadr4;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; my_bdaddr[3] = btadr3;</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; my_bdaddr[2] = btadr2;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; my_bdaddr[1] = btadr1;</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; my_bdaddr[0] = btadr0;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;}</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a0083545cb99fb8786e60281fe7a9050d"> 64</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a0083545cb99fb8786e60281fe7a9050d">PS3USB::Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed) {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; uint8_t buf[<span class="keyword">sizeof</span>(<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="l00066"></a><span class="lineno"> 66</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = NULL;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *oldep_ptr = NULL;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; uint16_t PID;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; uint16_t VID;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="comment">// get memory address of USB device address pool</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>(); </div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPS3USB Init&quot;</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> <span class="comment">// check if address has already been assigned to an instance</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>) {</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>));</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; }</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// Get pointer to pseudo device with address 0 assigned</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(0);</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="keywordflow">if</span> (!p) { </div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>));</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; }</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="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>) {</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>));</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; }</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="comment">// Save old pointer to EP_RECORD of address 0</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; oldep_ptr = p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="comment">// Temporary assign new pointer to epInfo to p-&gt;epinfo in order to avoid toggle inconsistence</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="comment">// Get device descriptor</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">getDevDescr</a>(0, 0, <span class="keyword">sizeof</span>(<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>), (uint8_t*)buf);<span class="comment">// Get device descriptor - addr, ep, nbytes, data</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="comment">// Restore p-&gt;epinfo</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = oldep_ptr;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">if</span>(rcode)</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordflow">goto</span> FailGetDevDescr;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; VID = ((<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>*)buf)-&gt;idVendor;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; PID = ((<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>*)buf)-&gt;idProduct;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordflow">if</span>(VID != <a class="code" href="_b_t_d_8h.html#a5bb06f989db583d290ba79642d37c514">PS3_VID</a> || (PID != <a class="code" href="_b_t_d_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a> &amp;&amp; PID != <a class="code" href="_b_t_d_8h.html#a54903b410722a45f8246653cd4d00632">PS3NAVIGATION_PID</a> &amp;&amp; PID != <a class="code" href="_b_t_d_8h.html#afc242b8a1b867f79c49ad78e3a47b37f">PS3MOVE_PID</a>))</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordflow">goto</span> FailUnknownDevice; </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a> = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>)</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">// Extract Max Packet Size from device descriptor</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (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">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0; </div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( 0, 0, <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a> );</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>);</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a> = 0;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>));</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;<span class="preprocessor"></span> PrintHex&lt;uint8_t&gt;(rcode);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; }</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>));</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; PrintHex&lt;uint8_t&gt;(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="preprocessor"></span> p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>);</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">if</span> (!p) </div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed; </div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; </div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, 1, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; </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="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="comment"> memory space. After verifying the PID and VID we will use known values for the</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the PS3 Controllers */</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x02; <span class="comment">// PS3 output endpoint</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// PS3 report endpoint</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, 3, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">if</span>( rcode )</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; delay(200);<span class="comment">//Give time for address change</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; rcode = <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordflow">if</span>( rcode )</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">goto</span> FailSetConf;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; </div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">if</span>(PID == <a class="code" href="_b_t_d_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a> || PID == <a class="code" href="_b_t_d_8h.html#a54903b410722a45f8246653cd4d00632">PS3NAVIGATION_PID</a>) {</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordflow">if</span>(PID == <a class="code" href="_b_t_d_8h.html#a0ae276efa5e73a4da658c714e70402c0">PS3_PID</a>) {</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nDualshock 3 Controller Connected&quot;</span>));</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; } <span class="keywordflow">else</span> { <span class="comment">// must be a navigation controller</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nNavigation Controller Connected&quot;</span>));</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; }</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="comment">/* Set internal bluetooth address and request for data */</span></div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">setBdaddr</a>(my_bdaddr);</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; enable_sixaxis();</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>);</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="comment">// Needed for PS3 Dualshock and Navigation commands to work</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_u_s_b_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; writeBuf[i] = pgm_read_byte(&amp;PS3_REPORT_BUFFER[i]);</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; </div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 6; i &lt; 10; i++)</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; readBuf[i] = 0x7F; <span class="comment">// Set the analog joystick values to center position</span></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; }</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordflow">else</span> { <span class="comment">// must be a Motion controller</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMotion Controller Connected&quot;</span>));</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">setMoveBdaddr</a>(my_bdaddr); <span class="comment">// Set internal bluetooth address</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967ad3163c1fcda01965b692ec2c3122b743">Red</a>);</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="comment">// Needed for Move commands to work</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_u_s_b_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; writeBuf[i] = pgm_read_byte(&amp;MOVE_REPORT_BUFFER[i]);</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; }</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>));</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; timer = millis();</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// successful configuration</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; </div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="comment">/* diagnostic messages */</span> </div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\ngetDevDescr:&quot;</span>));</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail; </div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetDevTblEn:&quot;</span>));</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;FailSetConf:</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetConf:&quot;</span>));</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail; </div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160;FailUnknownDevice:</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUnknown Device Connected - VID: &quot;</span>));</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; PrintHex&lt;uint16_t&gt;(VID);</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot; PID: &quot;</span>));</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; PrintHex&lt;uint16_t&gt;(PID);</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;Fail:</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPS3 Init Failed, error code: &quot;</span>));</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; Serial.print(rcode,HEX);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98">Release</a>();</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;}</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98"> 269</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98">PS3USB::Release</a>() {</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>); </div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a> = 0;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;}</div>
<div class="line"><a name="l00278"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9068e2a036012614c0db163830cbcf00"> 278</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a9068e2a036012614c0db163830cbcf00">PS3USB::Poll</a>() { </div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; </div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> || <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>) {</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; uint16_t BUFFER_SIZE = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#aca3cbaad8732d9185bb9bda1a32cd18d">PS3_INPUT_PIPE</a> ].epAddr, &amp;BUFFER_SIZE, readBuf); <span class="comment">// input on endpoint 1</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="keywordflow">if</span>(millis() - timer &gt; 100) { <span class="comment">// Loop 100ms before processing data</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; readReport();</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;<span class="preprocessor"></span> printReport(); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the PS3 Controllers</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; }</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>) { <span class="comment">// One can only set the color of the bulb, set the rumble, set and get the bluetooth address and calibrate the magnetometer via USB </span></div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="keywordflow">if</span> (millis() - timer &gt; 4000) <span class="comment">// Send at least every 4th second</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; {</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_u_s_b_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>); <span class="comment">// The Bulb and rumble values, has to be written again and again, for it to stay turned on</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; timer = millis();</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; } </div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; } </div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160;}</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160;<span class="keywordtype">void</span> PS3USB::readReport() { </div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="keywordflow">return</span>; </div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160;</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; ButtonState = (uint32_t)(readBuf[2] | ((uint16_t)readBuf[3] &lt;&lt; 8) | ((uint32_t)readBuf[4] &lt;&lt; 16));</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; </div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState&quot;);</span></div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState);</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; </div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <span class="keywordflow">if</span>(ButtonState != OldButtonState) {</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; ButtonClickState = ButtonState &amp; ~OldButtonState; <span class="comment">// Update click state variable</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; OldButtonState = ButtonState;</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; }</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;}</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160;</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;<span class="keywordtype">void</span> PS3USB::printReport() { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the PS3 Controllers</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="keywordflow">for</span>(uint8_t i = 0; i &lt; <a class="code" href="_p_s3_u_s_b_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>;i++) {</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; PrintHex&lt;uint8_t&gt;(readBuf[i]);</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; Serial.print(<span class="stringliteral">&quot; &quot;</span>);</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; } </div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; Serial.println();</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;</div>
<div class="line"><a name="l00329"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141"> 329</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141">PS3USB::getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; <span class="keywordflow">return</span> (ButtonState &amp; pgm_read_dword(&amp;BUTTONS[(uint8_t)b]));</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;}</div>
<div class="line"><a name="l00332"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230"> 332</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230">PS3USB::getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; uint32_t button = pgm_read_dword(&amp;BUTTONS[(uint8_t)b]);</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState &amp; button);</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; ButtonClickState &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160;}</div>
<div class="line"><a name="l00338"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0"> 338</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0">PS3USB::getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a) {</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; <span class="keywordflow">return</span> (uint8_t)(readBuf[(pgm_read_byte(&amp;ANALOGBUTTONS[(uint8_t)a]))-9]);</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160;}</div>
<div class="line"><a name="l00343"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3"> 343</a></span>&#160;uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3">PS3USB::getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a) {</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <span class="keywordflow">return</span> 0; </div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <span class="keywordflow">return</span> (uint8_t)(readBuf[((uint8_t)a+6)]);</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160;}</div>
<div class="line"><a name="l00348"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783"> 348</a></span>&#160;uint16_t <a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">PS3USB::getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a) {</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; <span class="keywordflow">return</span> ((readBuf[((uint16_t)a)-9] &lt;&lt; 8) | readBuf[((uint16_t)a + 1)-9]);</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160;}</div>
<div class="line"><a name="l00353"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777"> 353</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777">PS3USB::getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a) { </div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a>) {</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; <span class="keywordtype">double</span> accXval;</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; <span class="keywordtype">double</span> accYval;</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; <span class="keywordtype">double</span> accZval;</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; </div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; <span class="comment">// Data for the Kionix KXPC4 used in the DualShock 3</span></div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; <span class="keyword">const</span> <span class="keywordtype">double</span> zeroG = 511.5; <span class="comment">// 1.65/3.3*1023 (1,65V)</span></div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; accXval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa1b657addccd19368e17fd15ce396a2eb">aX</a>)-zeroG);</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; accYval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aaba377ea700e0cdf1c61034ef60b259bd">aY</a>)-zeroG);</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; accZval = -((double)<a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4aa4a709497e95c67840807ab9e99af2bbc">aZ</a>)-zeroG);</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; </div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; <span class="comment">// Convert to 360 degrees resolution</span></div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; <span class="comment">// atan2 outputs the value of -π to π (radians)</span></div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160; <span class="comment">// We are then converting it to 0 to 2π and then to degrees </span></div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160; <span class="keywordflow">if</span> (a == <a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1ae3a34b760fa4a6854f28852e91d8bb47">Pitch</a>) { </div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160; <span class="keywordtype">double</span> angle = (atan2(accYval,accZval)+PI)*RAD_TO_DEG;</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; <span class="keywordflow">return</span> angle;</div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; <span class="keywordtype">double</span> angle = (atan2(accXval,accZval)+PI)*RAD_TO_DEG;</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; <span class="keywordflow">return</span> angle;</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; }</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160; <span class="keywordflow">return</span> 0; </div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160;}</div>
<div class="line"><a name="l00378"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448"> 378</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">PS3USB::getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c) {</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160; <span class="keywordflow">if</span> (readBuf[((uint16_t)c &gt;&gt; 8)-9] == ((uint8_t)c &amp; 0xff))</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160;}</div>
<div class="line"><a name="l00385"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae"> 385</a></span>&#160;String <a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae">PS3USB::getStatusString</a>() {</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a> || <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>) {</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; <span class="keywordtype">char</span> statusOutput[100];</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; </div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; strcpy(statusOutput,<span class="stringliteral">&quot;ConnectionStatus: &quot;</span>);</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; </div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70baff01ce39b42bec30132b0fc53c882387">Plugged</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Plugged&quot;</span>);</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bae37160f3a65bb54a91fb5efb4f971924">Unplugged</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Unplugged&quot;</span>);</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput,<span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; </div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; </div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; strcat(statusOutput,<span class="stringliteral">&quot; - PowerRating: &quot;</span>);</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; </div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba5a86ae1482947377a116685c168d1773">Charging</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Charging&quot;</span>);</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70bac138cecbd4ef1ba0f9e0ab12440a6df6">NotCharging</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Not Charging&quot;</span>);</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba82084136e62c38642986b05419b4e734">Shutdown</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Shutdown&quot;</span>);</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba96cc2a0090ada376561406d48d1f2089">Dying</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Dying&quot;</span>);</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba7a352a3dd2accc1dd65a4538c3754ee8">Low</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Low&quot;</span>);</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba24c57acd029e3f96fede49402ea01e6f">High</a>)) strcat(statusOutput,<span class="stringliteral">&quot;High&quot;</span>);</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679">Full</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Full&quot;</span>);</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput,<span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; </div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; strcat(statusOutput,<span class="stringliteral">&quot; - WirelessStatus: &quot;</span>);</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160; </div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba71c14aef95c9953673a880e2633fa209">CableRumble</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Cable - Rumble is on&quot;</span>);</div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba1a36ca9a60a5e244f3404ec0db7b44a1">Cable</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Cable - Rumble is off&quot;</span>);</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba27912f9ea05a45aada21fc375817342c">BluetoothRumble</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Bluetooth - Rumble is on&quot;</span>);</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a>)) strcat(statusOutput,<span class="stringliteral">&quot;Bluetooth - Rumble is off&quot;</span>);</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; <span class="keywordflow">else</span> strcat(statusOutput,<span class="stringliteral">&quot;Error&quot;</span>);</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; </div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; <span class="keywordflow">return</span> statusOutput; </div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; }</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160;}</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160;</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160;<span class="comment">/* Playstation Sixaxis Dualshock and Navigation Controller commands */</span></div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160;<span class="keywordtype">void</span> PS3USB::PS3_Command(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x01), Report Type (Output 0x02), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>,<a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x01, 0x02, 0x00, nbytes, nbytes, data, NULL);</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160;}</div>
<div class="line"><a name="l00424"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498"> 424</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498">PS3USB::setAllOff</a>() {</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; <a class="code" href="_p_s3_u_s_b_8h.html#a4898fccf5d2aa053bc67894aa3627e0f">PS3_REPORT_BUFFER_SIZE</a>; i++)</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; writeBuf[i] = pgm_read_byte(&amp;PS3_REPORT_BUFFER[i]); <span class="comment">// Reset buffer</span></div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; </div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160;}</div>
<div class="line"><a name="l00430"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a"> 430</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a">PS3USB::setRumbleOff</a>() {</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; writeBuf[2] = 0x00;<span class="comment">//low mode off</span></div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; writeBuf[3] = 0x00;</div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160; writeBuf[4] = 0x00;<span class="comment">//high mode off</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; </div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160;}</div>
<div class="line"><a name="l00438"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1"> 438</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">PS3USB::setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode) {</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; <span class="comment">/* Still not totally sure how it works, maybe something like this instead?</span></div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160;<span class="comment"> * 3 - duration_right</span></div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160;<span class="comment"> * 4 - power_right</span></div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160;<span class="comment"> * 5 - duration_left</span></div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160;<span class="comment"> * 6 - power_left</span></div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; <span class="keywordflow">if</span> ((mode &amp; 0x30) &gt; 0) {</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; writeBuf[1] = 0xfe;</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; writeBuf[3] = 0xfe; </div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; <span class="keywordflow">if</span> (mode == <a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231a5819f165165589a8e65b07bf46c7382b">RumbleHigh</a>) {</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; writeBuf[2] = 0;<span class="comment">//low mode off</span></div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; writeBuf[4] = 0xff;<span class="comment">//high mode on</span></div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; }</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; writeBuf[2] = 0xff;<span class="comment">//low mode on</span></div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; writeBuf[4] = 0;<span class="comment">//high mode off</span></div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; }</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; }</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;}</div>
<div class="line"><a name="l00459"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03"> 459</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03">PS3USB::setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; writeBuf[9] &amp;= ~((uint8_t)((pgm_read_byte(&amp;LEDS[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1));</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160;}</div>
<div class="line"><a name="l00463"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b"> 463</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">PS3USB::setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; writeBuf[9] |= (uint8_t)((pgm_read_byte(&amp;LEDS[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160;}</div>
<div class="line"><a name="l00467"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090"> 467</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090">PS3USB::setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a) {</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; writeBuf[9] ^= (uint8_t)((pgm_read_byte(&amp;LEDS[(uint8_t)a]) &amp; 0x0f) &lt;&lt; 1);</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; PS3_Command(writeBuf, PS3_REPORT_BUFFER_SIZE);</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;}</div>
<div class="line"><a name="l00471"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87"> 471</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">PS3USB::setBdaddr</a>(uint8_t* BDADDR) { </div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; <span class="comment">/* Set the internal bluetooth address */</span> </div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; uint8_t buf[8]; </div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; buf[0] = 0x01;</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; buf[1] = 0x00;</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 6; i++)</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; buf[i+2] = BDADDR[5 - i];<span class="comment">//Copy into buffer, has to be written reversed</span></div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; </div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>,<a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0xF5, 0x03, 0x00, 8, 8, buf, NULL); </div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nBluetooth Address was set to: &quot;</span>));</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="keywordflow">for</span>(int8_t i = 5; i &gt; 0; i--) {</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160; PrintHex&lt;uint8_t&gt;(my_bdaddr[i]);</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; Serial.print(<span class="stringliteral">&quot;:&quot;</span>);</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160; }</div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; PrintHex&lt;uint8_t&gt;(my_bdaddr[0]);</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160;}</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160;<span class="keywordtype">void</span> PS3USB::enable_sixaxis() { <span class="comment">//Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; uint8_t cmd_buf[4];</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; cmd_buf[0] = 0x42;<span class="comment">// Special PS3 Controller enable commands</span></div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; cmd_buf[1] = 0x0c;</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; cmd_buf[2] = 0x00;</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; cmd_buf[3] = 0x00;</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160; </div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF4), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>,<a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0xF4, 0x03, 0x00, 4, 4, cmd_buf, NULL);</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160;}</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160;</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160;<span class="comment">/* Playstation Move Controller commands */</span></div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160;<span class="keywordtype">void</span> PS3USB::Move_Command(uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>, <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[ <a class="code" href="_p_s3_u_s_b_8h.html#a0da271fcb10181b3ce15aefe76c259bb">PS3_OUTPUT_PIPE</a> ].epAddr, nbytes, data);</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160;} </div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160;</div>
<div class="line"><a name="l00507"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7"> 507</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">PS3USB::moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b) { <span class="comment">//Use this to set the Color using RGB values</span></div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; <span class="comment">// set the Bulb&#39;s values into the write buffer </span></div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; writeBuf[2] = r;</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; writeBuf[3] = g;</div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; writeBuf[4] = b;</div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; </div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_u_s_b_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>); </div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160;}</div>
<div class="line"><a name="l00515"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a34c83190306752e68c5704eece875d49"> 515</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">PS3USB::moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color) { <span class="comment">//Use this to set the Color using the predefined colors in &quot;enums.h&quot;</span></div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>((uint8_t)(color &gt;&gt; 16),(uint8_t)(color &gt;&gt; 8),(uint8_t)(color));</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160;}</div>
<div class="line"><a name="l00518"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a"> 518</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a">PS3USB::moveSetRumble</a>(uint8_t rumble) {</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span>(rumble &lt; 64 &amp;&amp; rumble != 0) <span class="comment">// The rumble value has to at least 64, or approximately 25% (64/255*100)</span></div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nThe rumble value has to at least 64, or approximately 25%&quot;</span>));</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160;<span class="preprocessor"></span> <span class="comment">//set the rumble value into the write buffer</span></div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160; writeBuf[6] = rumble;</div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; </div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; Move_Command(writeBuf, <a class="code" href="_p_s3_u_s_b_8h.html#a2c6c24a4b63d9a34926fb35d6b49cd17">MOVE_REPORT_BUFFER_SIZE</a>); </div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;}</div>
<div class="line"><a name="l00528"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a"> 528</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">PS3USB::setMoveBdaddr</a>(uint8_t* BDADDR) {</div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160; <span class="comment">/* Set the internal bluetooth address */</span> </div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; uint8_t buf[11];</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; buf[0] = 0x05;</div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; buf[7] = 0x10;</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; buf[8] = 0x01;</div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160; buf[9] = 0x02;</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160; buf[10] = 0x12; </div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; </div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160; <span class="keywordflow">for</span> (uint8_t i = 0; i &lt; 6; i++)</div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; buf[i + 1] = BDADDR[i];</div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; </div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160; <span class="comment">//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)</span></div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>,<a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#ae6276fa555fe14995bee0713be663333">PS3_CONTROL_PIPE</a>].epAddr, <a class="code" href="_b_t_d_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>, <a class="code" href="_b_t_d_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>, 0x05, 0x03, 0x00,11,11, buf, NULL); </div>
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nBluetooth Address was set to: &quot;</span>));</div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160; <span class="keywordflow">for</span>(int8_t i = 5; i &gt; 0; i--) {</div>
<div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160; PrintHex&lt;uint8_t&gt;(my_bdaddr[i]);</div>
<div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; Serial.print(<span class="stringliteral">&quot;:&quot;</span>);</div>
<div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160; }</div>
<div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160; PrintHex&lt;uint8_t&gt;(my_bdaddr[0]); </div>
<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00550"></a><span class="lineno"> 550</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -158,6 +158,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00051">51</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad4d26e1c566064f2259faf65f0858b6e"></a>
@ -170,6 +172,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00034">34</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="abcb805b13bfd36145e252b0633bbcfc0"></a>
@ -182,6 +186,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00031">31</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="aee05d40a014750b24a7e9967f6f389f4"></a>
@ -194,6 +200,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00052">52</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2c6c24a4b63d9a34926fb35d6b49cd17"></a>
@ -206,6 +214,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00048">48</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae6276fa555fe14995bee0713be663333"></a>
@ -218,6 +228,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00037">37</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="aca3cbaad8732d9185bb9bda1a32cd18d"></a>
@ -230,6 +242,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00039">39</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a168ab47b14a95d7cf8066d553a9cb862"></a>
@ -242,6 +256,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00054">54</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0da271fcb10181b3ce15aefe76c259bb"></a>
@ -254,6 +270,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00038">38</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0ae276efa5e73a4da658c714e70402c0"></a>
@ -266,6 +284,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00043">43</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4898fccf5d2aa053bc67894aa3627e0f"></a>
@ -278,6 +298,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00047">47</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5bb06f989db583d290ba79642d37c514"></a>
@ -290,6 +312,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00042">42</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="afc242b8a1b867f79c49ad78e3a47b37f"></a>
@ -302,6 +326,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00045">45</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
<a class="anchor" id="a54903b410722a45f8246653cd4d00632"></a>
@ -314,12 +340,14 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_p_s3_u_s_b_8h_source.html#l00044">44</a> of file <a class="el" href="_p_s3_u_s_b_8h_source.html">PS3USB.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -143,86 +143,72 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_p_s3_u_s_b_8h.html#a168ab47b14a95d7cf8066d553a9cb862"> 54</a></span>&#160;<span class="preprocessor">#define PS3_MAX_ENDPOINTS 3</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html"> 56</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_p_s3_u_s_b.html">PS3USB</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#ac919404d4caf4625467756272f8d5502">PS3USB</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0);</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="comment">// USBDeviceConfig implementation</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_p_s3_u_s_b.html#a0083545cb99fb8786e60281fe7a9050d">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98">Release</a>();</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_p_s3_u_s_b.html#a9068e2a036012614c0db163830cbcf00">Poll</a>();</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a04b79c271ca14e1e095c6e305c672627"> 64</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_p_s3_u_s_b.html#a04b79c271ca14e1e095c6e305c672627">GetAddress</a>() { <span class="keywordflow">return</span> <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>; };</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a02a5b0244665d5a790d1020e51c94479"> 65</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a02a5b0244665d5a790d1020e51c94479">isReady</a>() { <span class="keywordflow">return</span> bPollEnable; }; </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="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">setBdaddr</a>(uint8_t* BDADDR);</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">setMoveBdaddr</a>(uint8_t* BDADDR);</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="comment">/* PS3 Controller Commands */</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="comment">/*</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="comment"> getButtonPress will return true as long as the button is held down</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="comment"> While getButtonClick will only return it once</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="comment"> So you instance if you need to increase a variable once you would use getButtonClick,</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="comment"> but if you need to drive a robot forward you would use getButtonPress</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; </div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0">getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a);</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; uint16_t <a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a);</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777">getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a);</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c); </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; String <a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae">getStatusString</a>();</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">/* Commands for Dualshock 3 and Navigation controller */</span> </div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498">setAllOff</a>();</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a">setRumbleOff</a>();</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode);</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a); </div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</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">/* Commands for Motion controller only */</span> </div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b);<span class="comment">//Use this to set the Color using RGB values</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color);<span class="comment">//Use this to set the Color using the predefined colors in &quot;enum Colors&quot;</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a">moveSetRumble</a>(uint8_t rumble);</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876"> 100</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a>;<span class="comment">// Variable used to indicate if the normal playstation controller is successfully connected</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28"> 101</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>;<span class="comment">// Variable used to indicate if the move controller is successfully connected</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09"> 102</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>;<span class="comment">// Variable used to indicate if the navigation controller is successfully connected */</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="keyword">protected</span>: </div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="comment">/* mandatory members */</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48"> 106</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd"> 107</a></span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>; <span class="comment">// device address</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1"> 108</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#a168ab47b14a95d7cf8066d553a9cb862">PS3_MAX_ENDPOINTS</a>]; <span class="comment">//endpoint info structure</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="keyword">private</span>: </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</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; uint32_t timer; <span class="comment">// used to continuously set PS3 Move controller Bulb and rumble values</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; uint8_t my_bdaddr[6]; <span class="comment">// Change to your dongles Bluetooth address in the constructor</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; uint8_t readBuf[<a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; uint8_t writeBuf[<a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordtype">void</span> readReport(); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordtype">void</span> printReport(); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordtype">void</span> PS3_Command(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordtype">void</span> enable_sixaxis(); <span class="comment">// Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keywordtype">void</span> Move_Command(uint8_t* data, uint16_t nbytes); </div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;};</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html"> 64</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_p_s3_u_s_b.html">PS3USB</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <a class="code" href="class_p_s3_u_s_b.html#ac919404d4caf4625467756272f8d5502">PS3USB</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>, uint8_t btadr5=0, uint8_t btadr4=0, uint8_t btadr3=0, uint8_t btadr2=0, uint8_t btadr1=0, uint8_t btadr0=0);</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_p_s3_u_s_b.html#a0083545cb99fb8786e60281fe7a9050d">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_p_s3_u_s_b.html#a5750c5448bf1ec73a7669ca2e4799c98">Release</a>();</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_p_s3_u_s_b.html#a9068e2a036012614c0db163830cbcf00">Poll</a>();</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a04b79c271ca14e1e095c6e305c672627"> 98</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_p_s3_u_s_b.html#a04b79c271ca14e1e095c6e305c672627">GetAddress</a>() { <span class="keywordflow">return</span> <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>; };</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a02a5b0244665d5a790d1020e51c94479"> 103</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a02a5b0244665d5a790d1020e51c94479">isReady</a>() { <span class="keywordflow">return</span> bPollEnable; };</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#af13993073ab245ece6d3fe9e9f41df87">setBdaddr</a>(uint8_t* BDADDR);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a3be69a3c6e24bf2b53bc06c85829e62a">setMoveBdaddr</a>(uint8_t* BDADDR);</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#ad1de9af6fb34f4cff6c1ed0af21b0141">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a9a50f5ed5b41232336cc6d1870795230">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2d30813a3f5c4729b5c1662832d5a6e0">getAnalogButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> a);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a2b0f391b8ae3e80b18cf9108c3e8f7e3">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; uint16_t <a class="code" href="class_p_s3_u_s_b.html#a4fe61beae6f0e36e4df1ea388bed0783">getSensor</a>(<a class="code" href="_p_s3_enums_8h.html#a9628766e5f200cc84b296b071b09ff4a">Sensor</a> a);</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_p_s3_u_s_b.html#a9b9e5a3a3e80957f47f86f4155fee777">getAngle</a>(<a class="code" href="_p_s3_enums_8h.html#a0200d2d1b3a7930d0be6c50e7c8ae7d1">Angle</a> a);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a09da3bcd33a8dd20d7cb06a70833e448">getStatus</a>(<a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> c);</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; String <a class="code" href="class_p_s3_u_s_b.html#ae3f19089341bb545f31b3b01e77131ae">getStatusString</a>();</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ac7adc7365bb45d15c37e22f26f012498">setAllOff</a>();</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#aaa1e66d7397be6364d4f76749cbaad5a">setRumbleOff</a>();</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a5dc4e5d1ebd5ca24da7cdc9dd08c94e1">setRumbleOn</a>(<a class="code" href="_p_s3_enums_8h.html#aff4be38428d075a117a5bb7f6209a231">Rumble</a> mode);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#adb361fecbe4eb6fc5635dc7135cfff03">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a44c4bff09064a09ef97c7bb6b8c0810b">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#acbab64f537f092e2fb125f9001f46090">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; </div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(uint8_t r, uint8_t g, uint8_t b);</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#ae9cfdaad3e54dbc271519e22082399c7">moveSetBulb</a>(<a class="code" href="_p_s3_enums_8h.html#a55ecd4f2ec2ebfe8d5b0163e4ac2a967">Colors</a> color);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_p_s3_u_s_b.html#a66d542c2cec73cefb3cdda36ff080e1a">moveSetRumble</a>(uint8_t rumble);</div>
<div class="line"><a name="l00211"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876"> 211</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a0dad8754ff18d0c375c2569791d50876">PS3Connected</a>;</div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28"> 213</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a89aa4233f3eeeb99693a099da527ec28">PS3MoveConnected</a>;</div>
<div class="line"><a name="l00215"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09"> 215</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_p_s3_u_s_b.html#a54b2dcaa1e9acef83de2376b50c7ff09">PS3NavigationConnected</a>;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; </div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="keyword">protected</span>: </div>
<div class="line"><a name="l00219"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48"> 219</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_p_s3_u_s_b.html#aa1873f41ae0da7c4568cfb7517560c48">pUsb</a>;</div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd"> 221</a></span>&#160; uint8_t <a class="code" href="class_p_s3_u_s_b.html#a3f43df159277003acdf7dd107bda27fd">bAddress</a>;</div>
<div class="line"><a name="l00223"></a><span class="lineno"><a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1"> 223</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_p_s3_u_s_b.html#a394dbb0a59b587210e5958f08dac48f1">epInfo</a>[<a class="code" href="_p_s3_u_s_b_8h.html#a168ab47b14a95d7cf8066d553a9cb862">PS3_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; </div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;<span class="keyword">private</span>: </div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordtype">bool</span> bPollEnable;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; </div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; uint32_t timer; <span class="comment">// used to continuously set PS3 Move controller Bulb and rumble values</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; </div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; uint8_t my_bdaddr[6]; <span class="comment">// Change to your dongles Bluetooth address in the constructor</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; uint8_t readBuf[<a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; uint8_t writeBuf[<a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; </div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="keywordtype">void</span> readReport(); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keywordtype">void</span> printReport(); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordtype">void</span> PS3_Command(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <span class="keywordtype">void</span> enable_sixaxis(); <span class="comment">// Command used to enable the Dualshock 3 and Navigation controller to send data via USB</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keywordtype">void</span> Move_Command(uint8_t* data, uint16_t nbytes); </div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;};</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -84,10 +84,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">/Users/Lauszus/GitHub/USB_Host_Shield_2.0/README.md File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a href="_r_e_a_d_m_e_8md_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -0,0 +1,241 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/README.md 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" />
</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>
</div><!-- top -->
<!-- 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 class="header">
<div class="headertitle">
<div class="title">/Users/Lauszus/GitHub/USB_Host_Shield_2.0/README.md</div> </div>
</div><!--header-->
<div class="contents">
<a href="_r_e_a_d_m_e_8md.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="preprocessor"># USB Host Library Rev.2.0</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;The code is released under the GNU General Public License.</div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;__________</div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;</div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor"># Summary</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor"></span>This is Revision 2.0 of <a class="code" href="class_m_a_x3421e.html">MAX3421E</a>-based <a class="code" href="class_u_s_b.html">USB</a> Host Shield Library <span class="keywordflow">for</span> AVR<span class="stringliteral">&#39;s.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="stringliteral">Project main web site is: &lt;http://www.circuitsathome.com&gt;.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="stringliteral">Some information can also be found at: &lt;http://blog.tkjelectronics.dk/&gt;.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="stringliteral">The shield can be purchased at the main site: &lt;http://www.circuitsathome.com/products-page/arduino-shields&gt;.</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="stringliteral">[![USB Host Shield](http://www.circuitsathome.com/wp/wp-content/uploads/2012/02/UHS_20_main-288x216.jpg)](http://www.circuitsathome.com/products-page/arduino-shields)</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="stringliteral">For more information about the hardware see the [Hardware Manual](http://www.circuitsathome.com/usb-host-shield-hardware-manual).</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="stringliteral"># Developed By</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="stringliteral">* __Oleg Mazurov, Circuits@Home__ - &lt;mazurov@circuitsathome.com&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="stringliteral"> * Developer of the USB Core, HID, FTDI, ADK, ACM, and PL2303 libraries</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="stringliteral">* __Kristian Lauszus, TKJ Electronics__ - &lt;kristianl@tkjelectronics.com&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="stringliteral"> * Developer of the BTD, SPP, PS3, Wii, and Xbox libraries</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="stringliteral"># How to use the library</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="stringliteral">### Arduino ADK</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="stringliteral">To use this library with the official [Arduino ADK](http://arduino.cc/en/Main/ArduinoBoardADK) uncomment the following line in [avrpins.h](https://github.com/felis/USB_Host_Shield_2.0/blob/master/avrpins.h):</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="stringliteral">&lt;code&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="stringliteral">\#define BOARD\_MEGA_ADK</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="stringliteral">&lt;/code&gt;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="stringliteral">### [Bluetooth libraries](https://github.com/felis/USB_Host_Shield_2.0/blob/master/BTD.cpp)</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="stringliteral">The [BTD library](https://github.com/felis/USB_Host_Shield_2.0/blob/master/BTD.cpp) is a general purpose library for an ordinary Bluetooth dongle.</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="stringliteral">This library make it easy to add support for different Bluetooth services like a PS3 or a Wii controller or SPP which is a virtual serial port via Bluetooth.</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="stringliteral">Some different examples can be found in the [example directory](https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/Bluetooth).</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="stringliteral">The BTD library will also make it possible to use multiple services at once, the following example sketch is an example of this:</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="stringliteral">&lt;https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3SPP/PS3SPP.ino&gt;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="stringliteral">### [SPP library](https://github.com/felis/USB_Host_Shield_2.0/blob/master/SPP.cpp)</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="stringliteral">SPP stands for &quot;Serial Port Profile&quot; and is a Bluetooth protocol that implements a virtual comport which allows you to send data back and forth from your computer/phone to your Arduino via Bluetooth.</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="stringliteral">It has been tested successfully on Windows, Mac OS X, Linux, and Android.</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="stringliteral">Unfortunately Google broke something in Android 4.2, so it&#39;</span>s currently not working in <span class="keyword">this</span> version of Android.</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;More information can be found at these blog posts:</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;* &lt;http:<span class="comment">//www.circuitsathome.com/mcu/bluetooth-rfcommspp-service-support-for-usb-host-2-0-library-released&gt;</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;* &lt;http:<span class="comment">//blog.tkjelectronics.dk/2012/07/rfcommspp-library-for-arduino/&gt;</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;To implement the <a class="code" href="class_s_p_p.html">SPP</a> protocol I used a <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a> sniffing tool called [PacketLogger](http:<span class="comment">//www.tkjelectronics.com/uploads/PacketLogger.zip) developed by Apple. </span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;It enables me to see the <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a> communication between my Mac and any device.</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;### PS3 Library</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;These libraries consist of the [<a class="code" href="class_p_s3_b_t.html">PS3BT</a>](https:<span class="comment">//github.com/felis/USB_Host_Shield_2.0/blob/master/PS3BT.cpp) and [PS3USB](https://github.com/felis/USB_Host_Shield_2.0/blob/master/PS3USB.cpp). These libraries allows you to use a Dualshock 3, Navigation or a Motion controller with the USB Host Shield both via Bluetooth and USB.</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;In order to use your Playstation controller via <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a> you have to <span class="keyword">set</span> the <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a> address of the dongle internally to your PS3 Controller. This can be achieved by plugging the controller in via <a class="code" href="class_u_s_b.html">USB</a> and letting the library <span class="keyword">set</span> it automatically.</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;__Note:__ To obtain the address you have to plug in the <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba730728c9aac83393ac83f96a8125b8bb">Bluetooth</a> dongle before connecting the controller, or alternatively you could <span class="keyword">set</span> it in code like so: &lt;https:<span class="comment">//github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/PS3BT/PS3BT.ino#L12&gt;.</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;For more information about the PS3 protocol see the official wiki: &lt;https:<span class="comment">//github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information&gt;.</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;Also take a look at the blog posts:</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;* &lt;http:<span class="comment">//blog.tkjelectronics.dk/2012/01/ps3-controller-bt-library-for-arduino/&gt;</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;* &lt;http:<span class="comment">//www.circuitsathome.com/mcu/sony-ps3-controller-support-added-to-usb-host-library&gt;</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;* &lt;http:<span class="comment">//www.circuitsathome.com/mcu/arduino/interfacing-ps3-controllers-via-usb&gt;</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;<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f">A</a> special thanks go to the following people:</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;1. _Richard Ibbotson_ who made <span class="keyword">this</span> excellent guide: &lt;http:<span class="comment">//www.circuitsathome.com/mcu/ps3-and-wiimote-game-controllers-on-the-arduino-host-shield-part&gt;</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;2. _Tomoyuki Tanaka_ <span class="keywordflow">for</span> releasing his code <span class="keywordflow">for</span> the Arduino <a class="code" href="class_u_s_b.html">USB</a> Host shield connected to the wiimote: &lt;http:<span class="comment">//www.circuitsathome.com/mcu/rc-car-controlled-by-wii-remote-on-arduino&gt;</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;Also a big thanks all the people behind these sites about the Motion controller:</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;* &lt;http:<span class="comment">//thp.io/2010/psmove/&gt;</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;* &lt;http:<span class="comment">//www.copenhagengamecollective.org/unimove/&gt;</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;* &lt;https:<span class="comment">//github.com/thp/psmoveapi&gt;</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;* &lt;http:<span class="comment">//code.google.com/p/moveonpc/&gt;</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="preprocessor">### Xbox 360 Library</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;The library support one Xbox 360 via <a class="code" href="class_u_s_b.html">USB</a> or up to four Xbox 360 controllers wirelessly by <span class="keyword">using</span> a [Xbox 360 wireless receiver](http:<span class="comment">//blog.tkjelectronics.dk/wp-content/uploads/xbox360-wireless-receiver.jpg).</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;To use it via <a class="code" href="class_u_s_b.html">USB</a> use the [XBOXUSB](https:<span class="comment">//github.com/felis/USB_Host_Shield_2.0/blob/master/XBOXUSB.cpp) library or to use it wirelessly use the [XBOXRECV](https://github.com/felis/USB_Host_Shield_2.0/blob/master/XBOXRECV.cpp) library.</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;__Note that a Wireless controller can NOT be used via <a class="code" href="class_u_s_b.html">USB</a>!__</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;Examples code can be found in the [examples directory](https:<span class="comment">//github.com/felis/USB_Host_Shield_2.0/tree/master/examples/Xbox).</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;Also see the following blog posts:</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;* &lt;http:<span class="comment">//www.circuitsathome.com/mcu/xbox360-controller-support-added-to-usb-host-shield-2-0-library&gt;</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;* &lt;http:<span class="comment">//blog.tkjelectronics.dk/2012/07/xbox-360-controller-support-added-to-the-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;* &lt;http:<span class="comment">//blog.tkjelectronics.dk/2012/12/xbox-360-receiver-added-to-the-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;All the information regarding the Xbox 360 controller protocol are form these sites:</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;* &lt;http:<span class="comment">//tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/UsbInfo&gt;</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;* &lt;http:<span class="comment">//tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/WirelessUsbInfo&gt;</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;* &lt;https:<span class="comment">//github.com/Grumbel/xboxdrv/blob/master/PROTOCOL&gt;</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="preprocessor">### [Wii library](https://github.com/felis/USB_Host_Shield_2.0/blob/master/Wii.cpp)</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;The [Wii](https:<span class="comment">//github.com/felis/USB_Host_Shield_2.0/blob/master/Wii.cpp) library support the Wiimote, but also the Nunchuch and Motion Plus extensions via Bluetooth. The Wii U Pro Controller is also supported via Bluetooth.</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;First you have to pair with the controller, <span class="keyword">this</span> is done automatically by the library <span class="keywordflow">if</span> you create the instance like so:</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;&lt;code&gt;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<a class="code" href="class_w_i_i.html">WII</a> Wii(&amp;Btd,<a class="code" href="_wii_8h.html#a8f0b5b0dedaf5c25c4887f03ebfdd425">PAIR</a>);</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;&lt;/code&gt;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;And then press 1 &amp; 2 at once on the Wiimote or press sync <span class="keywordflow">if</span> you are <span class="keyword">using</span> a Wii U Pro Controller.</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;After that you can simply create the instance like so:</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;&lt;code&gt;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<a class="code" href="class_w_i_i.html">WII</a> Wii(&amp;Btd);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;&lt;/code&gt;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;Then just press any button any button on the Wiimote and it will connect to the dongle.</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;Take a look at the example <span class="keywordflow">for</span> more information: &lt;https:<span class="comment">//github.com/felis/USB_Host_Shield_2.0/blob/master/examples/Bluetooth/Wii/Wii.ino&gt;.</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;Also take a look at the blog post:</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;* &lt;http:<span class="comment">//blog.tkjelectronics.dk/2012/08/wiimote-added-to-usb-host-library/&gt;</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;All the information about the Wii controllers are from these sites:</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;* &lt;http:<span class="comment">//wiibrew.org/wiki/Wiimote&gt;</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;* &lt;http:<span class="comment">//wiibrew.org/wiki/Wiimote/Extension_Controllers&gt;</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;* &lt;http:<span class="comment">//wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck&gt;</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;* &lt;http:<span class="comment">//wiibrew.org/wiki/Wiimote/Extension_Controllers/Wii_Motion_Plus&gt;</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;* The old library created by _Tomoyuki Tanaka_: &lt;https:<span class="comment">//github.com/moyuchin/WiiRemote_on_Arduino&gt; also helped a lot.</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;<span class="preprocessor"># FAQ</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;&gt; When I plug my device into the <a class="code" href="class_u_s_b.html">USB</a> connector nothing happens?</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;Try to connect a external power supply to the Arduino - <span class="keyword">this</span> solves the problem in most cases.</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -99,7 +99,9 @@ Include dependency graph for SPP.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_s_p_p_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_s_p_p_8cpp">
<area shape="rect" id="node2" href="_s_p_p_8h.html" title="SPP.h" alt="" coords="549,93,594,115"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="549,163,594,184"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="342,232,385,253"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="708,232,791,253"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="251,371,305,392"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="159,371,226,392"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="175,301,231,323"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="349,371,407,392"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="41,301,98,323"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="721,440,778,461"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="634,371,695,392"/><area shape="rect" id="node18" href="message_8h.html" title="message.h" alt="" coords="719,371,781,392"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="788,301,853,323"/></map>
</div>
</div><table class="memberdecls">
</div>
<p><a href="_s_p_p_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad72dbcf6d0153db1b8d8a58001feed83"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_s_p_p_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a></td></tr>
@ -121,6 +123,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8cpp_source.html#l00019">19</a> of file <a class="el" href="_s_p_p_8cpp_source.html">SPP.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
@ -152,12 +156,14 @@ Variables</h2></td></tr>
<div class="line"> 0xB4, 0x25, 0x57, 0xC6, 0xB3, 0x22, 0x50, 0xC1, 0xBA, 0x2B, 0x59, 0xC8, 0xBD, 0x2C, 0x5E, 0xCF</div>
<div class="line">}</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="_s_p_p_8cpp_source.html#l00026">26</a> of file <a class="el" href="_s_p_p_8cpp_source.html">SPP.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

1023
_s_p_p_8cpp_source.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -212,6 +212,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00076">76</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab68e7621ab822c3bfb9507c78d0d0550"></a>
@ -224,6 +226,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00077">77</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a11185ec5287f08bf49c2c68d8cd52a16"></a>
@ -236,6 +240,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00074">74</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a17b4a98661e30b6989cbe35ba5da4822"></a>
@ -248,6 +254,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00075">75</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad9b8c11f7f4f8e8d59ac77999b2ec4a3"></a>
@ -260,6 +268,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00078">78</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a336bf1805637fdd66033c9040e606a6b"></a>
@ -272,6 +282,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00079">79</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="af31032289d962bc2408debecc2823b8c"></a>
@ -284,6 +296,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00071">71</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae9459fccc82a24e23dc52ef0e0422273"></a>
@ -296,6 +310,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00051">51</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5f5f1cfcc3f39ee032185cac348cb068"></a>
@ -308,6 +324,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00050">50</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1c5c7dc5782a562f1b91e835f8aebdb4"></a>
@ -320,6 +338,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00053">53</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a37d324cfd5a79f623dcd0fc8fa047447"></a>
@ -332,6 +352,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00052">52</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a28cbb8ce9ab60e04e2e131a87e06d5f0"></a>
@ -344,6 +366,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00049">49</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3b1cbac2f2fc44b393ff3cb96448892a"></a>
@ -356,6 +380,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00048">48</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="af565a91718a79907aece8a5c278aa0bc"></a>
@ -368,6 +394,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00055">55</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a05022c9cce93cccafc32337771c8704a"></a>
@ -380,6 +408,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00054">54</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="adf2585ad5d49cf2df2595d860ad6b258"></a>
@ -392,6 +422,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00028">28</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1412e00ebed70b8d7b41afd769252530"></a>
@ -404,6 +436,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00056">56</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="abaa9eb6a1d27745243ef134ecad34bb2"></a>
@ -416,6 +450,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00040">40</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8af4ce4d4c42d85f0d84a514354fc570"></a>
@ -428,6 +464,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00042">42</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a52cc6e4a2a6d151dd5d0e788b937b2e8"></a>
@ -440,6 +478,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00039">39</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a75ef214ce8a03e8d62a1b24554bc1a05"></a>
@ -452,6 +492,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00041">41</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a61b15e54b1c5f9a28c996ae8e04ca3c0"></a>
@ -464,6 +506,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00038">38</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0d649771ff995585c2bff030b7c1a2d3"></a>
@ -476,6 +520,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00037">37</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae16d9fcc820433592ba171c8b2a9e25d"></a>
@ -488,6 +534,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00045">45</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9da70c702c0b792d99f8e39713ac0ee7"></a>
@ -500,6 +548,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00044">44</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="aac25fa1de5df70a97a6ccc6267d65fea"></a>
@ -512,6 +562,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00043">43</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac3b4f24642f460c347305dedbebc5e63"></a>
@ -524,6 +576,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00034">34</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad7f3cf22bd76c9ccd377d96b4a751fc4"></a>
@ -536,6 +590,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00032">32</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a75321d181cfa3c485bcd96918c1b353e"></a>
@ -548,6 +604,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00033">33</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0b7cbe1aa26664847a48bd4578bc50bd"></a>
@ -560,6 +618,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00031">31</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a25f7af87e6960e2e8ed49006b0b50f3e"></a>
@ -572,6 +632,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00027">27</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae100d60ef94dea996b12fc89d6a339f2"></a>
@ -584,6 +646,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00025">25</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1b8e3e654e4f55e27ca5054aef956edc"></a>
@ -596,6 +660,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00026">26</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a72444116eaac116983a3dec35b1944f0"></a>
@ -608,6 +674,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00024">24</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac202a65fc9bc1a5d837e5d095b1bb9f2"></a>
@ -620,6 +688,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00062">62</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2c8ebc5e78dc22e7ae4e79370fada66f"></a>
@ -632,6 +702,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00069">69</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5747e4c0826eb3341fe2476b5229e0d0"></a>
@ -644,6 +716,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00065">65</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9f534220af893b5ae8c8927564db77c3"></a>
@ -656,6 +730,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00066">66</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae9ffac80725386a879ba956251f64373"></a>
@ -668,6 +744,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00067">67</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="af98e9758e7c66f921d980b280a3f5b4b"></a>
@ -680,6 +758,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00059">59</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a42a6f00a3828a932bae1509c813b5c98"></a>
@ -692,6 +772,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00060">60</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
<a class="anchor" id="a677a1fc4883355f7fad87551cc003c1b"></a>
@ -704,12 +786,14 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_s_p_p_8h_source.html#l00061">61</a> of file <a class="el" href="_s_p_p_8h_source.html">SPP.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -179,112 +179,107 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="comment">#define BT_RFCOMM_NSC_RSP 0x11</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="class_s_p_p.html"> 92</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_s_p_p.html">SPP</a> : <span class="keyword">public</span> <a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <a class="code" href="class_s_p_p.html#ae5cb4167b3ab9c891398f54729c6da81">SPP</a>(<a class="code" href="class_b_t_d.html">BTD</a> *p, <span class="keyword">const</span> <span class="keywordtype">char</span>* name = <span class="stringliteral">&quot;Arduino&quot;</span>, <span class="keyword">const</span> <span class="keywordtype">char</span>* pin = <span class="stringliteral">&quot;1234&quot;</span>);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="comment">// BluetoothService implementation</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#abdfe9453fb82781bec53a191c2e9fb1d">ACLData</a>(uint8_t* <a class="code" href="class_s_p_p.html#abdfe9453fb82781bec53a191c2e9fb1d">ACLData</a>); <span class="comment">// Used to pass acldata to the services</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a2de67ee7ad1be9d2f3daf7dc08dc5f90">Run</a>(); <span class="comment">// Used to establish the connection automatically</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#ae2c661bd46cd2d74bd29c4c771cd2ef0">Reset</a>(); <span class="comment">// Use this to reset the service</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a2b4b1f85f553c6a2fdd523e50c75c7b0">disconnect</a>(); <span class="comment">// Used this void to disconnect the virtual serial port</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="class_s_p_p.html#ade5d4f0ab50ddcad14f75fce4450a028"> 102</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_s_p_p.html#ade5d4f0ab50ddcad14f75fce4450a028">connected</a>;<span class="comment">// Variable used to indicate if the connection is established</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="comment">/* Serial port profile (SPP) commands */</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#adc3e67901972f2f97aba961475a218f5">print</a>(<span class="keyword">const</span> String &amp;); <span class="comment">// Used to send strings</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#adc3e67901972f2f97aba961475a218f5">print</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* data); <span class="comment">// Used to send strings</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#adc3e67901972f2f97aba961475a218f5">print</a>(uint8_t data); <span class="comment">// Used to send single bytes</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#adc3e67901972f2f97aba961475a218f5">print</a>(uint8_t* array, uint8_t length); <span class="comment">// Used to send arrays</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#adc3e67901972f2f97aba961475a218f5">print</a>(<span class="keyword">const</span> __FlashStringHelper *); <span class="comment">// Used to print strings stored in flash </span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(<span class="keyword">const</span> String &amp;); <span class="comment">// Include newline and carriage return</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* data); <span class="comment">// Include newline and carriage return</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(uint8_t data); <span class="comment">// Include newline and carriage return</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(uint8_t* array, uint8_t length); <span class="comment">// Include newline and carriage return</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(<span class="keyword">const</span> __FlashStringHelper *); <span class="comment">// Include newline and carriage return</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(<span class="keywordtype">void</span>); <span class="comment">// Use this to print newline and carriage return</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a1d9d28454b84e334a0560a4b2182716e">printNumber</a>(int16_t n); <span class="comment">// These must be used to print numbers</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a92cde4ff57b4375474c1b5d6b56b4bd2">printNumberln</a>(int16_t n); <span class="comment">// This will include newline and carriage return</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a1d9d28454b84e334a0560a4b2182716e">printNumber</a>(<span class="keywordtype">double</span> n, uint8_t digits = 2); <span class="comment">// These must be used to print floating-point numbers</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a92cde4ff57b4375474c1b5d6b56b4bd2">printNumberln</a>(<span class="keywordtype">double</span> n, uint8_t digits = 2); <span class="comment">// This will include newline and carriage return</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="class_s_p_p.html#a02d17c1f81d1a750aca230decc13c39a">doubleToString</a>(<span class="keywordtype">double</span> input, uint8_t digits); <span class="comment">// Helper function to convert from double to string</span></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"><a class="code" href="class_s_p_p.html#a7de4c895e4056ac2964ce5d020611deb"> 125</a></span>&#160; uint8_t <a class="code" href="class_s_p_p.html#a7de4c895e4056ac2964ce5d020611deb">available</a>() { <span class="keywordflow">return</span> rfcommAvailable; }; <span class="comment">// Get the bytes waiting to be read</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; uint8_t <a class="code" href="class_s_p_p.html#a53980e0d20944454790febe5c9be66af">read</a>(); <span class="comment">// Used to read the buffer</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="class_s_p_p.html#af354c72d54243f891faf4cc60a7b94aa"> 127</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#af354c72d54243f891faf4cc60a7b94aa">flush</a>() { rfcommAvailable = 0; }; <span class="comment">// Discard all the bytes in the buffer</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">/* Bluetooth dongle library pointer */</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">/* Set true when a channel is created */</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordtype">bool</span> SDPConnected;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordtype">bool</span> RFCOMMConnected;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; uint16_t hci_handle; <span class="comment">// The HCI Handle for the connection</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">/* Variables used by L2CAP state maschines */</span> </div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; uint8_t l2cap_sdp_state;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; uint8_t l2cap_rfcomm_state;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; uint16_t l2cap_event_flag; <span class="comment">// l2cap flags of received bluetooth events</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; </div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; uint8_t l2capoutbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for l2cap out data</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; uint8_t rfcommbuf[10]; <span class="comment">// Buffer for RFCOMM Commands</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; </div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; uint8_t sdp_scid[2]; <span class="comment">// L2CAP source CID for SDP </span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; uint8_t sdp_dcid[2]; <span class="comment">// 0x0050</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; uint8_t rfcomm_scid[2]; <span class="comment">// L2CAP source CID for RFCOMM </span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; uint8_t rfcomm_dcid[2]; <span class="comment">// 0x0051</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; uint8_t identifier; <span class="comment">// Identifier for command</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="comment">/* RFCOMM Variables */</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; uint8_t rfcommChannel;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; uint8_t rfcommChannelConnection; <span class="comment">// This is the channel the SPP chanel will be running at</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; uint8_t rfcommDirection;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; uint8_t rfcommCommandResponse; </div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; uint8_t rfcommChannelType;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; uint8_t rfcommPfBit;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; </div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keywordtype">bool</span> waitForLastCommand;</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordtype">bool</span> creditSent; </div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; </div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; uint8_t rfcommDataBuffer[100]; <span class="comment">// Create a 100 sized buffer for incoming data</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; uint8_t rfcommAvailable;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordtype">bool</span> firstMessage; <span class="comment">// Used to see if it&#39;s the first SDP request received </span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; uint8_t bytesRead; <span class="comment">// Counter to see when it&#39;s time to send more credit</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> printTimer; <span class="comment">// Used to set a delay, so it doesn&#39;t try to print too fast</span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; </div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="comment">/* State machines */</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordtype">void</span> SDP_task(); <span class="comment">// SDP state machine</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordtype">void</span> RFCOMM_task(); <span class="comment">// RFCOMM state machine</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; </div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="comment">/* SDP Commands */</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordtype">void</span> SDP_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordtype">void</span> serviceNotSupported(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> serialPortResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keywordtype">void</span> serialPortResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordtype">void</span> l2capResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordtype">void</span> l2capResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="comment">/* RFCOMM Commands */</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keywordtype">void</span> RFCOMM_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordtype">void</span> sendRfcomm(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t* data, uint8_t length);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordtype">void</span> sendRfcommCredit(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t credit);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; uint8_t calcFcs(uint8_t *data);</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; uint8_t __crc(uint8_t* data);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;};</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="class_s_p_p.html"> 93</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_s_p_p.html">SPP</a> : <span class="keyword">public</span> <a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <a class="code" href="class_s_p_p.html#ae5cb4167b3ab9c891398f54729c6da81">SPP</a>(<a class="code" href="class_b_t_d.html">BTD</a> *p, <span class="keyword">const</span> <span class="keywordtype">char</span>* name = <span class="stringliteral">&quot;Arduino&quot;</span>, <span class="keyword">const</span> <span class="keywordtype">char</span>* pin = <span class="stringliteral">&quot;1234&quot;</span>);</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#abdfe9453fb82781bec53a191c2e9fb1d">ACLData</a>(uint8_t* <a class="code" href="class_s_p_p.html#abdfe9453fb82781bec53a191c2e9fb1d">ACLData</a>);</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a2de67ee7ad1be9d2f3daf7dc08dc5f90">Run</a>();</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#ae2c661bd46cd2d74bd29c4c771cd2ef0">Reset</a>();</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a2b4b1f85f553c6a2fdd523e50c75c7b0">disconnect</a>();</div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="code" href="class_s_p_p.html#ade5d4f0ab50ddcad14f75fce4450a028"> 118</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_s_p_p.html#ade5d4f0ab50ddcad14f75fce4450a028">connected</a>;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#acbea2d8894757fad6f9b903cad942b36">print</a>(<span class="keyword">const</span> String &amp;str);</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(<span class="keyword">const</span> String &amp;str);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#acbea2d8894757fad6f9b903cad942b36">print</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* str);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* str);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#acbea2d8894757fad6f9b903cad942b36">print</a>(uint8_t data);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(uint8_t data);</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#acbea2d8894757fad6f9b903cad942b36">print</a>(uint8_t* array, uint8_t length);</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(uint8_t* array, uint8_t length);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#acbea2d8894757fad6f9b903cad942b36">print</a>(<span class="keyword">const</span> __FlashStringHelper *ifsh);</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(<span class="keyword">const</span> __FlashStringHelper *ifsh);</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a4afe343fc15bba50507ab9205165b8dd">println</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; </div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#af31f14d7249f8a5b6eb2230a42a9d5ae">printNumber</a>(int32_t n);</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#ac3a2e5fa45ba0fe17d3341998a6c4640">printNumberln</a>(int32_t n);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#af31f14d7249f8a5b6eb2230a42a9d5ae">printNumber</a>(<span class="keywordtype">double</span> n, uint8_t digits = 2);</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#ac3a2e5fa45ba0fe17d3341998a6c4640">printNumberln</a>(<span class="keywordtype">double</span> n, uint8_t digits = 2); </div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#a3117df8f320d9d010b57c30255db054b">doubleToString</a>(<span class="keywordtype">double</span> input, <span class="keywordtype">char</span>* output, uint8_t digits = 2);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; </div>
<div class="line"><a name="l00212"></a><span class="lineno"><a class="code" href="class_s_p_p.html#a7de4c895e4056ac2964ce5d020611deb"> 212</a></span>&#160; uint8_t <a class="code" href="class_s_p_p.html#a7de4c895e4056ac2964ce5d020611deb">available</a>() { <span class="keywordflow">return</span> rfcommAvailable; };</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; uint8_t <a class="code" href="class_s_p_p.html#a53980e0d20944454790febe5c9be66af">read</a>();</div>
<div class="line"><a name="l00219"></a><span class="lineno"><a class="code" href="class_s_p_p.html#af354c72d54243f891faf4cc60a7b94aa"> 219</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_s_p_p.html#af354c72d54243f891faf4cc60a7b94aa">flush</a>() { rfcommAvailable = 0; };</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="comment">/* Bluetooth dongle library pointer */</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; </div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="comment">/* Set true when a channel is created */</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordtype">bool</span> SDPConnected;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordtype">bool</span> RFCOMMConnected;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; uint16_t hci_handle; <span class="comment">// The HCI Handle for the connection</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="comment">/* Variables used by L2CAP state maschines */</span> </div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; uint8_t l2cap_sdp_state;</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; uint8_t l2cap_rfcomm_state;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; uint16_t l2cap_event_flag; <span class="comment">// l2cap flags of received bluetooth events</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; </div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; uint8_t l2capoutbuf[<a class="code" href="_b_t_d_8h.html#a32d591ef5742a99963130616ef146787">BULK_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for l2cap out data</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; uint8_t rfcommbuf[10]; <span class="comment">// Buffer for RFCOMM Commands</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; </div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; uint8_t sdp_scid[2]; <span class="comment">// L2CAP source CID for SDP </span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; uint8_t sdp_dcid[2]; <span class="comment">// 0x0050</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; uint8_t rfcomm_scid[2]; <span class="comment">// L2CAP source CID for RFCOMM </span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; uint8_t rfcomm_dcid[2]; <span class="comment">// 0x0051</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; uint8_t identifier; <span class="comment">// Identifier for command</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="comment">/* RFCOMM Variables */</span></div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; uint8_t rfcommChannel;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; uint8_t rfcommChannelConnection; <span class="comment">// This is the channel the SPP chanel will be running at</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; uint8_t rfcommDirection;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; uint8_t rfcommCommandResponse; </div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; uint8_t rfcommChannelType;</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; uint8_t rfcommPfBit;</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; </div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="keywordtype">bool</span> waitForLastCommand;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keywordtype">bool</span> creditSent; </div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; </div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; uint8_t rfcommDataBuffer[100]; <span class="comment">// Create a 100 sized buffer for incoming data</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; uint8_t rfcommAvailable;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; </div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordtype">bool</span> firstMessage; <span class="comment">// Used to see if it&#39;s the first SDP request received </span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; uint8_t bytesRead; <span class="comment">// Counter to see when it&#39;s time to send more credit</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; </div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> printTimer; <span class="comment">// Used to set a delay, so it doesn&#39;t try to print too fast</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; </div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="comment">/* State machines */</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordtype">void</span> SDP_task(); <span class="comment">// SDP state machine</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="keywordtype">void</span> RFCOMM_task(); <span class="comment">// RFCOMM state machine</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; </div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="comment">/* SDP Commands */</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="keywordtype">void</span> SDP_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="keywordtype">void</span> serviceNotSupported(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="keywordtype">void</span> serialPortResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="keywordtype">void</span> serialPortResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordtype">void</span> l2capResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; <span class="keywordtype">void</span> l2capResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; </div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="comment">/* RFCOMM Commands */</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="keywordtype">void</span> RFCOMM_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="keywordtype">void</span> sendRfcomm(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t* data, uint8_t length);</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordtype">void</span> sendRfcommCredit(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t credit);</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; uint8_t calcFcs(uint8_t *data);</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; uint8_t __crc(uint8_t* data);</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;};</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -119,6 +119,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_u_s_b__desc_2pgmstrings_8h_source.html#l00006">6</a> of file <a class="el" href="_u_s_b__desc_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa1ba73e45dd29eeb526a52d9a3336f35"></a>
@ -135,6 +137,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_u_s_b__desc_2pgmstrings_8h_source.html#l00005">5</a> of file <a class="el" href="_u_s_b__desc_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<a class="anchor" id="a373c90214222e94d07424e7a8d41b92b"></a>
@ -151,6 +155,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_u_s_b__desc_2pgmstrings_8h_source.html#l00004">4</a> of file <a class="el" href="_u_s_b__desc_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
@ -164,12 +170,14 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_u_s_b__desc_2pgmstrings_8h_source.html#l00010">10</a> of file <a class="el" href="_u_s_b__desc_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -143,7 +143,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -100,10 +100,12 @@ Include dependency graph for Usb.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_usb_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_usb_8cpp">
<area shape="rect" id="node2" href="avrpins_8h.html" title="avrpins.h" alt="" coords="5,232,59,253"/><area shape="rect" id="node4" href="max3421e_8h.html" title="max3421e.h" alt="" coords="171,232,237,253"/><area shape="rect" id="node5" href="usbhost_8h.html" title="usbhost.h" alt="" coords="70,163,127,184"/><area shape="rect" id="node8" href="_usb_8h.html" title="Usb.h" alt="" coords="345,93,388,115"/><area shape="rect" id="node6" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="88,232,147,253"/><area shape="rect" id="node10" href="address_8h.html" title="address.h" alt="" coords="305,163,361,184"/><area shape="rect" id="node13" href="printhex_8h.html" title="printhex.h" alt="" coords="647,232,704,253"/><area shape="rect" id="node14" href="hexdump_8h.html" title="hexdump.h" alt="" coords="437,163,499,184"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="523,163,584,184"/></map>
</div>
</div></div><!-- contents -->
</div>
<p><a href="_usb_8cpp_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

741
_usb_8cpp_source.html Normal file
View file

@ -0,0 +1,741 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/Usb.cpp 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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Usb.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="_usb_8cpp.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 functions */</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="avrpins_8h.html">avrpins.h</a>&quot;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="max3421e_8h.html">max3421e.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="usbhost_8h.html">usbhost.h</a>&quot;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_usb_8h.html">Usb.h</a>&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;=100</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#include &quot;Arduino.h&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#include &lt;WProgram.h&gt;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">static</span> uint8_t usb_error = 0;</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="keyword">static</span> uint8_t usb_task_state;</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">/* constructor */</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a8ff8cd03496bdcb0ca26f18878ad299d"> 34</a></span>&#160;<a class="code" href="class_u_s_b.html#a8ff8cd03496bdcb0ca26f18878ad299d">USB::USB</a> () : bmHubPre(0)</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;{</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#a60a744d0f1386e4b28053a41bd6a958f">USB_DETACHED_SUBSTATE_INITIALIZE</a>; <span class="comment">//set up state machine</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; init(); </div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;}</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="comment">/* Initialize data structures */</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="keywordtype">void</span> USB::init()</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;{</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; devConfigIndex = 0;</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; bmHubPre = 0;</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;}</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a1c1aad8269403bf488e3bc4c79886ce4"> 47</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a1c1aad8269403bf488e3bc4c79886ce4">USB::getUsbTaskState</a>( <span class="keywordtype">void</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"> 49</span>&#160; <span class="keywordflow">return</span>( usb_task_state );</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;}</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a8ff697d334dc611720419374acd1e5fb"> 52</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#a8ff697d334dc611720419374acd1e5fb">USB::setUsbTaskState</a>( uint8_t state )</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;{</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; usb_task_state = state;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;} </div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a59ee57083ba492d87ff2947547848d58"> 57</a></span>&#160;<a class="code" href="struct_ep_info.html">EpInfo</a>* <a class="code" href="class_u_s_b.html#a59ee57083ba492d87ff2947547848d58">USB::getEpInfoEntry</a>( uint8_t addr, uint8_t ep )</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; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = addrPool.<a class="code" href="class_address_pool_impl.html#aa3e12dda249ef6acbb27592fc8fe1cba">GetUsbDevicePtr</a>(addr);</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"> 61</span>&#160; <span class="keywordflow">if</span> (!p || !p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>)</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *pep = p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;p-&gt;<a class="code" href="struct_usb_device.html#a828814f5231b866ac665a24ec5edaa3a">epcount</a>; i++)</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; {</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordflow">if</span> ((pep)-&gt;epAddr == ep)</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">return</span> pep;</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; pep ++;</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; <span class="keywordflow">return</span> NULL;</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;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="comment">/* set device table entry */</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="comment">/* each device is different and has different number of endpoints. This function plugs endpoint record structure, defined in application, to devtable */</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea"> 78</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">USB::setEpInfoEntry</a>( uint8_t addr, uint8_t epcount, <a class="code" href="struct_ep_info.html">EpInfo</a>* eprecord_ptr )</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;{</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="keywordflow">if</span> (!eprecord_ptr)</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a52c379fe7e22f53d3e3d47d65735fa3b">USB_ERROR_INVALID_ARGUMENT</a>;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = addrPool.<a class="code" href="class_address_pool_impl.html#aa3e12dda249ef6acbb27592fc8fe1cba">GetUsbDevicePtr</a>(addr);</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</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; p-&gt;<a class="code" href="struct_usb_device.html#a855beb4cbe3e48b93298ea44d6cae86f">address</a> = addr;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = eprecord_ptr;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a828814f5231b866ac665a24ec5edaa3a">epcount</a> = epcount;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;}</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;uint8_t USB::SetAddress(uint8_t addr, uint8_t ep, <a class="code" href="struct_ep_info.html">EpInfo</a> **ppep, uint16_t &amp;nak_limit)</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;{</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = addrPool.<a class="code" href="class_address_pool_impl.html#aa3e12dda249ef6acbb27592fc8fe1cba">GetUsbDevicePtr</a>(addr);</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>)</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; *ppep = <a class="code" href="class_u_s_b.html#a59ee57083ba492d87ff2947547848d58">getEpInfoEntry</a>(addr, ep);</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordflow">if</span> (!*ppep)</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#ad55f0079a95df5e4a9bb22e88a7395f5">USB_ERROR_EP_NOT_FOUND_IN_TBL</a>;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; nak_limit = (0x0001UL &lt;&lt; ( ( (*ppep)-&gt;bmNakPower &gt; <a class="code" href="address_8h.html#a517dfa014946e2d087d197312234a1de">USB_NAK_MAX_POWER</a> ) ? <a class="code" href="address_8h.html#a517dfa014946e2d087d197312234a1de">USB_NAK_MAX_POWER</a> : (*ppep)-&gt;bmNakPower) );</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; nak_limit--;</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">/*</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="comment"> USBTRACE2(&quot;\r\nAddress: &quot;, addr);</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="comment"> USBTRACE2(&quot; EP: &quot;, ep);</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="comment"> USBTRACE2(&quot; NAK Power: &quot;,(*ppep)-&gt;bmNakPower);</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="comment"> USBTRACE2(&quot; NAK Limit: &quot;, nak_limit);</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="comment"> USBTRACE(&quot;\r\n&quot;);</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="comment">*/</span> </div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#ac6d86063950bdbf438d358c907aefbfa">rPERADDR</a>, addr ); <span class="comment">//set peripheral address</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; uint8_t mode = <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a330db4fc764b8ccae5214645c1ee5423">rMODE</a> );</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="comment">// Set bmLOWSPEED and bmHUBPRE in case of low-speed device, reset them otherwise</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a330db4fc764b8ccae5214645c1ee5423">rMODE</a>, (p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a>) ? mode | <a class="code" href="max3421e_8h.html#a9744878036529e375f3b017b22b1eda2">bmLOWSPEED</a> | bmHubPre : mode &amp; ~(<a class="code" href="max3421e_8h.html#a8816c259368604d0de57f31bcb6c1674">bmHUBPRE</a> | <a class="code" href="max3421e_8h.html#a9744878036529e375f3b017b22b1eda2">bmLOWSPEED</a>)); </div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;}</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="comment">/* Control transfer. Sets address, endpoint, fills control packet with necessary data, dispatches control packet, and initiates bulk IN transfer, */</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="comment">/* depending on request. Actual requests are defined as inlines */</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="comment">/* return codes: */</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="comment">/* 00 = success */</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="comment">/* 01-0f = non-zero HRSLT */</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c"> 135</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">USB::ctrlReq</a>( uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, <a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a> *p)</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="keywordtype">boolean</span> direction = <span class="keyword">false</span>; <span class="comment">//request direction, IN or OUT</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; uint8_t rcode; </div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <a class="code" href="struct_s_e_t_u_p___p_k_t.html">SETUP_PKT</a> setup_pkt;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *pep = NULL;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; uint16_t nak_limit;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; rcode = SetAddress(addr, ep, &amp;pep, nak_limit);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; direction = (( bmReqType &amp; 0x80 ) &gt; 0);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="comment">/* fill in setup packet */</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; setup_pkt.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a3eee7ee04b7b4c1fcc3c49614de62c03">ReqType_u</a>.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a9bbd6cf5a93a6433d2eb97c59b9102d5">bmRequestType</a> = bmReqType;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; setup_pkt.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a321b931277d6ce278416dc5d74059016">bRequest</a> = bRequest;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; setup_pkt.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a84c5ecb1e46bf8a949a92992c8dd1a85">wVal_u</a>.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a68c9436c00560f96e044052c3fb681e9">wValueLo</a> = wValLo;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; setup_pkt.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a84c5ecb1e46bf8a949a92992c8dd1a85">wVal_u</a>.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a04ea2d151f9edb6575fc159a58f1e443">wValueHi</a> = wValHi;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; setup_pkt.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a299d9f88d294369ea88b48b5026f4c7e">wIndex</a> = wInd;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; setup_pkt.<a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1ec9b19c0ed1e66e399ad9cf3c4a6537">wLength</a> = total;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; </div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <a class="code" href="class_m_a_x3421e.html#ac61db72bd5952916cdc6edc20e1c763c">bytesWr</a>( <a class="code" href="max3421e_8h.html#acddbcc3176885ece538a7e71665c27be">rSUDFIFO</a>, 8, (uint8_t*)&amp;setup_pkt ); <span class="comment">//transfer to setup packet FIFO</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; rcode = <a class="code" href="class_u_s_b.html#a343d4b321cf8e99f0504cb04c7ce8b10">dispatchPkt</a>( <a class="code" href="max3421e_8h.html#acd574bdc815506033ec40fc96320520d">tokSETUP</a>, ep, nak_limit ); <span class="comment">//dispatch packet</span></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="keywordflow">if</span>( rcode ) <span class="comment">//return HRSLT if not zero</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">if</span>( dataptr != NULL ) <span class="comment">//data stage, if present</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; {</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">if</span>( direction ) <span class="comment">//IN transfer</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; { </div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; uint16_t left = total;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; pep-&gt;<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = 1; <span class="comment">//bmRCVTOG1;</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">while</span> (left)</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; {</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="comment">// Bytes read into buffer</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; uint16_t read = nbytes;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="comment">//uint16_t read = (left&lt;nbytes) ? left : nbytes;</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; rcode = InTransfer( pep, nak_limit, &amp;read, dataptr );</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="comment">// Invoke callback function if inTransfer completed successfuly and callback function pointer is specified</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keywordflow">if</span> (!rcode &amp;&amp; p)</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; ((<a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a>*)p)-&gt;Parse( read, dataptr, total - left );</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; left -= read;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordflow">if</span> (read &lt; nbytes)</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; }</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; }</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordflow">else</span> <span class="comment">//OUT transfer</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; { </div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; pep-&gt;<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = 1; <span class="comment">//bmSNDTOG1;</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; rcode = OutTransfer( pep, nak_limit, nbytes, dataptr );</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; } </div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordflow">if</span>( rcode ) <span class="comment">//return error</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; }</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="comment">// Status stage</span></div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_u_s_b.html#a343d4b321cf8e99f0504cb04c7ce8b10">dispatchPkt</a>( (direction) ? <a class="code" href="max3421e_8h.html#a9889c0ed9a43ff3fea670a96c3fbd165">tokOUTHS</a> : <a class="code" href="max3421e_8h.html#a100ac012a99f7cb9305a2eb921741ce3">tokINHS</a>, ep, nak_limit ); <span class="comment">//GET if direction</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;}</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;<span class="comment">/* IN transfer to arbitrary endpoint. Assumes PERADDR is set. Handles multiple packets if necessary. Transfers &#39;nbytes&#39; bytes. */</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;<span class="comment">/* Keep sending INs and writes data to memory area pointed by &#39;data&#39; */</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;<span class="comment">/* rcode 0 if no errors. rcode 01-0f is relayed from dispatchPkt(). Rcode f0 means RCVDAVIRQ error,</span></div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;<span class="comment"> fe USB xfer timeout */</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"><a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4"> 212</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">USB::inTransfer</a>( uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data)</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;{</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *pep = NULL;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; uint16_t nak_limit = 0;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; uint8_t rcode = SetAddress(addr, ep, &amp;pep, nak_limit);</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keywordflow">return</span> InTransfer(pep, nak_limit, nbytesptr, data);</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;}</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;uint8_t USB::InTransfer(<a class="code" href="struct_ep_info.html">EpInfo</a> *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t* data)</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;{</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; uint8_t rcode = 0;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; uint8_t pktsize;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; uint16_t nbytes = *nbytesptr;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; uint8_t maxpktsize = pep-&gt;<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a>; </div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; *nbytesptr = 0;</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a7e82a85eb165f82afde45df5f98504ff">rHCTL</a>, (pep-&gt;<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a>) ? <a class="code" href="max3421e_8h.html#a6864ac74e4ed056f9eb37f1c78bd6c6f">bmRCVTOG1</a> : <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a> ); <span class="comment">//set toggle value</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="keywordflow">while</span>( 1 ) <span class="comment">// use a &#39;return&#39; to exit this loop</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; { </div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; rcode = <a class="code" href="class_u_s_b.html#a343d4b321cf8e99f0504cb04c7ce8b10">dispatchPkt</a>( <a class="code" href="max3421e_8h.html#a436aef9c3815daee76dc227dcf15d4e4">tokIN</a>, pep-&gt;<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a>, nak_limit ); <span class="comment">//IN packet to EP-&#39;endpoint&#39;. Function takes care of NAKS.</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; </div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordflow">if</span>( rcode ) </div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordflow">return</span>( rcode ); <span class="comment">//should be 0, indicating ACK. Else return error code.</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; </div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <span class="comment">/* check for RCVDAVIRQ and generate error if not present */</span> </div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="comment">/* the only case when absense of RCVDAVIRQ makes sense is when toggle error occured. Need to add handling for that */</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordflow">if</span>(( <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a> ) &amp; <a class="code" href="max3421e_8h.html#ad780c154c3761f68e0e397e4fd8f9a07">bmRCVDAVIRQ</a> ) == 0 ) </div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordflow">return</span> ( 0xf0 ); <span class="comment">//receive error</span></div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; </div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; pktsize = <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#afa79b794eadcddfca2f62828dd83134b">rRCVBC</a> ); <span class="comment">//number of received bytes</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; </div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; assert(pktsize &lt;= nbytes);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; int16_t mem_left = (int16_t)nbytes - *((int16_t*)nbytesptr);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="keywordflow">if</span> (mem_left &lt; 0)</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; mem_left = 0;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; data = <a class="code" href="class_m_a_x3421e.html#af1ceb905ac614b98d58579946587b083">bytesRd</a>( <a class="code" href="max3421e_8h.html#a5ab905353668c35ea0d9f6989d24b849">rRCVFIFO</a>, ((pktsize &gt; mem_left) ? mem_left : pktsize), data );</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a>, bmRCVDAVIRQ ); <span class="comment">// Clear the IRQ &amp; free the buffer</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; *nbytesptr += pktsize; <span class="comment">// add this packet&#39;s byte count to total transfer length</span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="comment">/* The transfer is complete under two conditions: */</span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="comment">/* 1. The device sent a short packet (L.T. maxPacketSize) */</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; <span class="comment">/* 2. &#39;nbytes&#39; have been transferred. */</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordflow">if</span> (( pktsize &lt; maxpktsize ) || (*nbytesptr &gt;= nbytes )) <span class="comment">// have we transferred &#39;nbytes&#39; bytes?</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; { </div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="comment">// Save toggle value</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; pep-&gt;<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = (( <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a246dbd203f68062fab34f2869b76e479">rHRSL</a> ) &amp; <a class="code" href="max3421e_8h.html#acdfff8cccb2ba5a3dfaa67241ffe86a4">bmRCVTOGRD</a> )) ? 1 : 0;</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordflow">return</span>( 0 );</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; } <span class="comment">// if</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; } <span class="comment">//while( 1 )</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;}</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;<span class="comment">/* OUT transfer to arbitrary endpoint. Handles multiple packets if necessary. Transfers &#39;nbytes&#39; bytes. */</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;<span class="comment">/* Handles NAK bug per Maxim Application Note 4000 for single buffer transfer */</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="comment">/* rcode 0 if no errors. rcode 01-0f is relayed from HRSL */</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"><a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7"> 278</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">USB::outTransfer</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data )</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;{</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *pep = NULL;</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; uint16_t nak_limit;</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; uint8_t rcode = SetAddress(addr, ep, &amp;pep, nak_limit);</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keywordflow">return</span> OutTransfer(pep, nak_limit, nbytes, data);</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;}</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;uint8_t USB::OutTransfer(<a class="code" href="struct_ep_info.html">EpInfo</a> *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data)</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;{</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; uint8_t rcode, retry_count;</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; uint8_t *data_p = data; <span class="comment">//local copy of the data pointer</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; uint16_t bytes_tosend, nak_count;</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; uint16_t bytes_left = nbytes;</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; uint8_t maxpktsize = pep-&gt;<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a>; </div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; </div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordflow">if</span> (maxpktsize &lt; 1 || maxpktsize &gt; 64)</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a272428aaee5fccec4661bd5457d1928f">USB_ERROR_INVALID_MAX_PKT_SIZE</a>;</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; </div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timeout = millis() + <a class="code" href="_usb_8h.html#ad8686abbfa0d98547d450fe2a105a588">USB_XFER_TIMEOUT</a>;</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; </div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a7e82a85eb165f82afde45df5f98504ff">rHCTL</a>, (pep-&gt;<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a>) ? <a class="code" href="max3421e_8h.html#aee283b6d075581cdff38a6054e6f63a2">bmSNDTOG1</a> : <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a> ); <span class="comment">//set toggle value</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; </div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="keywordflow">while</span>( bytes_left ) </div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; {</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; retry_count = 0;</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; nak_count = 0;</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; bytes_tosend = ( bytes_left &gt;= maxpktsize ) ? maxpktsize : bytes_left;</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <a class="code" href="class_m_a_x3421e.html#ac61db72bd5952916cdc6edc20e1c763c">bytesWr</a>( <a class="code" href="max3421e_8h.html#aa5d5e67db32d736bab1ee8ef8764f6aa">rSNDFIFO</a>, bytes_tosend, data_p ); <span class="comment">//filling output FIFO</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a1eb6ec372ed236f1db3fbca201bdc28f">rSNDBC</a>, bytes_tosend ); <span class="comment">//set number of bytes </span></div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#aa541c456525254b21a0bc53aadaeee4d">rHXFR</a>, ( <a class="code" href="max3421e_8h.html#a6d59486bc96e76ebb429756a30ddb238">tokOUT</a> | pep-&gt;<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> )); <span class="comment">//dispatch packet</span></div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; <span class="keywordflow">while</span>(!(<a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a> ) &amp; <a class="code" href="max3421e_8h.html#a82f316064dd5442d86e1536d3f1d9f7a">bmHXFRDNIRQ</a> )); <span class="comment">//wait for the completion IRQ</span></div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a>, bmHXFRDNIRQ ); <span class="comment">//clear IRQ</span></div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; rcode = ( <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a246dbd203f68062fab34f2869b76e479">rHRSL</a> ) &amp; 0x0f );</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordflow">while</span>( rcode &amp;&amp; ( timeout &gt; millis())) </div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; {</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="keywordflow">switch</span>( rcode ) </div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; {</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#ab44a7968d08016b58d98951059c37076">hrNAK</a>:</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; nak_count ++;</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; <span class="keywordflow">if</span>( nak_limit &amp;&amp; ( nak_count == nak_limit )) </div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#ab4e9ff11b75e71171814fdab1ff7ce45">hrTIMEOUT</a>:</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; retry_count ++;</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; <span class="keywordflow">if</span>( retry_count == <a class="code" href="_usb_8h.html#a857a9899ad4f277faf074c3012e14ffa">USB_RETRY_LIMIT</a> ) </div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; }<span class="comment">//switch( rcode</span></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160;</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; <span class="comment">/* process NAK according to Host out NAK bug */</span></div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a1eb6ec372ed236f1db3fbca201bdc28f">rSNDBC</a>, 0 );</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#aa5d5e67db32d736bab1ee8ef8764f6aa">rSNDFIFO</a>, *data_p );</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a1eb6ec372ed236f1db3fbca201bdc28f">rSNDBC</a>, bytes_tosend );</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#aa541c456525254b21a0bc53aadaeee4d">rHXFR</a>, ( <a class="code" href="max3421e_8h.html#a6d59486bc96e76ebb429756a30ddb238">tokOUT</a> | pep-&gt;<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> )); <span class="comment">//dispatch packet</span></div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; <span class="keywordflow">while</span>(!(<a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a> ) &amp; bmHXFRDNIRQ )); <span class="comment">//wait for the completion IRQ</span></div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a>, bmHXFRDNIRQ ); <span class="comment">//clear IRQ</span></div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; rcode = ( <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a246dbd203f68062fab34f2869b76e479">rHRSL</a> ) &amp; 0x0f );</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; }<span class="comment">//while( rcode &amp;&amp; ....</span></div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; bytes_left -= bytes_tosend;</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; data_p += bytes_tosend;</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; }<span class="comment">//while( bytes_left...</span></div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; pep-&gt;<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = ( <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a246dbd203f68062fab34f2869b76e479">rHRSL</a> ) &amp; <a class="code" href="max3421e_8h.html#a4a9dee0254d637bcd27ac53fd2a7cb7c">bmSNDTOGRD</a> ) ? 1 : 0; <span class="comment">//bmSNDTOG1 : bmSNDTOG0; //update toggle</span></div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <span class="keywordflow">return</span>( rcode ); <span class="comment">//should be 0 in all cases</span></div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160;}</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160;<span class="comment">/* dispatch usb packet. Assumes peripheral address is set and relevant buffer is loaded/empty */</span></div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160;<span class="comment">/* If NAK, tries to re-send up to nak_limit times */</span></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160;<span class="comment">/* If nak_limit == 0, do not count NAKs, exit after timeout */</span></div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160;<span class="comment">/* If bus timeout, re-sends up to USB_RETRY_LIMIT times */</span></div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160;<span class="comment">/* return codes 0x00-0x0f are HRSLT( 0x00 being success ), 0xff means timeout */</span></div>
<div class="line"><a name="l00357"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a343d4b321cf8e99f0504cb04c7ce8b10"> 357</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a343d4b321cf8e99f0504cb04c7ce8b10">USB::dispatchPkt</a>( uint8_t token, uint8_t ep, uint16_t nak_limit )</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160;{</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timeout = millis() + <a class="code" href="_usb_8h.html#ad8686abbfa0d98547d450fe2a105a588">USB_XFER_TIMEOUT</a>;</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; uint8_t tmpdata; </div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; uint8_t retry_count = 0;</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; uint16_t nak_count = 0;</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160;</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; <span class="keywordflow">while</span>( timeout &gt; millis() ) </div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; {</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#aa541c456525254b21a0bc53aadaeee4d">rHXFR</a>, ( token|ep )); <span class="comment">//launch the transfer</span></div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160; rcode = <a class="code" href="_usb_8h.html#ae691ccb027b8e281ac87522a0e66aaa7">USB_ERROR_TRANSFER_TIMEOUT</a>; </div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160;</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; <span class="keywordflow">while</span>( millis() &lt; timeout ) <span class="comment">//wait for transfer completion</span></div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; { </div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; tmpdata = <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a> );</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160;</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <span class="keywordflow">if</span>( tmpdata &amp; bmHXFRDNIRQ ) </div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; {</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a>, bmHXFRDNIRQ ); <span class="comment">//clear the interrupt</span></div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; rcode = 0x00;</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; }<span class="comment">//if( tmpdata &amp; bmHXFRDNIRQ</span></div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160;</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160; }<span class="comment">//while ( millis() &lt; timeout</span></div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160;</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <span class="keywordflow">if</span>( rcode != 0x00 ) <span class="comment">//exit if timeout</span></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160;</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; rcode = ( <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a246dbd203f68062fab34f2869b76e479">rHRSL</a> ) &amp; 0x0f ); <span class="comment">//analyze transfer result</span></div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160;</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; <span class="keywordflow">switch</span>( rcode ) </div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; {</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#ab44a7968d08016b58d98951059c37076">hrNAK</a>:</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; nak_count ++;</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; <span class="keywordflow">if</span>( nak_limit &amp;&amp; ( nak_count == nak_limit )) </div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; <span class="comment">//delay(1); </span></div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#ab4e9ff11b75e71171814fdab1ff7ce45">hrTIMEOUT</a>:</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; retry_count ++;</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; <span class="keywordflow">if</span>( retry_count == <a class="code" href="_usb_8h.html#a857a9899ad4f277faf074c3012e14ffa">USB_RETRY_LIMIT</a> )</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; }<span class="comment">//switch( rcode</span></div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160;</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; }<span class="comment">//while( timeout &gt; millis() </span></div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; <span class="keywordflow">return</span>( rcode );</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160;}</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160;</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160;<span class="comment">/* USB main task. Performs enumeration/cleanup */</span></div>
<div class="line"><a name="l00410"></a><span class="lineno"><a class="code" href="class_u_s_b.html#aff8d1b2009c760bc27fb12762bd3c9b6"> 410</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#aff8d1b2009c760bc27fb12762bd3c9b6">USB::Task</a>( <span class="keywordtype">void</span> ) <span class="comment">//USB state machine</span></div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160;{</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; uint8_t tmpdata;</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> delay = 0;</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; <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> buf;</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; <span class="keywordtype">bool</span> lowspeed = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160;</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; <a class="code" href="class_m_a_x3421e.html#acb5728095a05814d6ae3c8ddb0452969">MAX3421E::Task</a>();</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160;</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160; tmpdata = <a class="code" href="class_m_a_x3421e.html#a0353d430ba18466706337ed623a224e3">getVbusState</a>();</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160;</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; <span class="comment">/* modify USB task state if Vbus changed */</span></div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; <span class="keywordflow">switch</span>( tmpdata ) </div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160; {</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#a5c3d7b0a5b0933cfc0183cd36ea91f16">SE1</a>: <span class="comment">//illegal state</span></div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#aff6ab2376cd29385b20c2b63d4ddd26d">USB_DETACHED_SUBSTATE_ILLEGAL</a>;</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; lowspeed = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#a3cb02fdd2d36f8a755c4b1946a0b0063">SE0</a>: <span class="comment">//disconnected</span></div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <span class="keywordflow">if</span>(( usb_task_state &amp; <a class="code" href="_usb_8h.html#a3168cf67661a2716677b9830f30b880c">USB_STATE_MASK</a> ) != <a class="code" href="_usb_8h.html#ae7fd7c5bb6dc87f44724dde2ad57df87">USB_STATE_DETACHED</a> ) </div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#a60a744d0f1386e4b28053a41bd6a958f">USB_DETACHED_SUBSTATE_INITIALIZE</a>;</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; lowspeed = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#aa05ee2be883f4b96948e18b0d55ab5c2">LSHOST</a>:</div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; lowspeed = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; <span class="keywordflow">case</span> <a class="code" href="max3421e_8h.html#a8ec45bdb8c5273e99c3ab89349cb43f9">FSHOST</a>: <span class="comment">//attached</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; <span class="keywordflow">if</span>(( usb_task_state &amp; USB_STATE_MASK ) == <a class="code" href="_usb_8h.html#ae7fd7c5bb6dc87f44724dde2ad57df87">USB_STATE_DETACHED</a> ) </div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; {</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; delay = millis() + <a class="code" href="_usb_8h.html#a1b082667723b29243b021a1829bdd8d6">USB_SETTLE_DELAY</a>;</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#aaadb20392558e23e3eba073e358a4493">USB_ATTACHED_SUBSTATE_SETTLE</a>;</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; }</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; }<span class="comment">// switch( tmpdata</span></div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160;</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; i++)</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; <span class="keywordflow">if</span> (devConfig[i])</div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; rcode = devConfig[i]-&gt;<a class="code" href="class_u_s_b_device_config.html#a4961e92df3e75c38e6953fb08b11f8b6">Poll</a>();</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160;</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; <span class="keywordflow">switch</span>( usb_task_state ) {</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#a60a744d0f1386e4b28053a41bd6a958f">USB_DETACHED_SUBSTATE_INITIALIZE</a>:</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; init();</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160;</div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; i++)</div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="keywordflow">if</span> (devConfig[i])</div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; rcode = devConfig[i]-&gt;<a class="code" href="class_u_s_b_device_config.html#a74c06c5fe641b20faeeebd39e33248b3">Release</a>();</div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160;</div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#a3708f4e8166d5d099e1982aa956eacce">USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE</a>;</div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#a3708f4e8166d5d099e1982aa956eacce">USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE</a>: <span class="comment">//just sit here</span></div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#aff6ab2376cd29385b20c2b63d4ddd26d">USB_DETACHED_SUBSTATE_ILLEGAL</a>: <span class="comment">//just sit here</span></div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#aaadb20392558e23e3eba073e358a4493">USB_ATTACHED_SUBSTATE_SETTLE</a>: <span class="comment">//setlle time for just attached device </span></div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; <span class="keywordflow">if</span>( delay &lt; millis() ) </div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#ada22633d6de30155a60cb19f6e6452fe">USB_ATTACHED_SUBSTATE_RESET_DEVICE</a>;</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#ada22633d6de30155a60cb19f6e6452fe">USB_ATTACHED_SUBSTATE_RESET_DEVICE</a>:</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a7e82a85eb165f82afde45df5f98504ff">rHCTL</a>, <a class="code" href="max3421e_8h.html#ab59b41d6ecb3a04e5bfc38b0eee4aec0">bmBUSRST</a> ); <span class="comment">//issue bus reset</span></div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#a311f11b79c4020d771cd6930e0a3223d">USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE</a>;</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#a311f11b79c4020d771cd6930e0a3223d">USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE</a>:</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; <span class="keywordflow">if</span>(( <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a7e82a85eb165f82afde45df5f98504ff">rHCTL</a> ) &amp; <a class="code" href="max3421e_8h.html#ab59b41d6ecb3a04e5bfc38b0eee4aec0">bmBUSRST</a> ) == 0 ) </div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; {</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; tmpdata = <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a330db4fc764b8ccae5214645c1ee5423">rMODE</a> ) | <a class="code" href="max3421e_8h.html#a1cde86dfa0124c81ebffcde9fdf61cc3">bmSOFKAENAB</a>; <span class="comment">//start SOF generation</span></div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <a class="code" href="class_m_a_x3421e.html#a74e387200f57bc03152247d630c166aa">regWr</a>( <a class="code" href="max3421e_8h.html#a330db4fc764b8ccae5214645c1ee5423">rMODE</a>, tmpdata );</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#a2d69537e663e7d5f188004f0d25ec0cc">USB_ATTACHED_SUBSTATE_WAIT_SOF</a>;</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; delay = millis() + 20; <span class="comment">//20ms wait after reset per USB spec</span></div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; }</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#a2d69537e663e7d5f188004f0d25ec0cc">USB_ATTACHED_SUBSTATE_WAIT_SOF</a>: <span class="comment">//todo: change check order</span></div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; <span class="keywordflow">if</span>( <a class="code" href="class_m_a_x3421e.html#ae7faae82a8d68c38b43833b8fddcb8e8">regRd</a>( <a class="code" href="max3421e_8h.html#a9ab289252615caa2d19ceb4359d71a44">rHIRQ</a> ) &amp; <a class="code" href="max3421e_8h.html#a042cc701398502fb70b8793ed76394ce">bmFRAMEIRQ</a> ) <span class="comment">//when first SOF received we can continue</span></div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; { </div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="keywordflow">if</span>( delay &lt; millis() ) <span class="comment">//20ms passed</span></div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#aac8c844e6a20f42298d70e4438a029e5">USB_STATE_CONFIGURING</a>;</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; }</div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#aac8c844e6a20f42298d70e4438a029e5">USB_STATE_CONFIGURING</a>:</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; rcode = <a class="code" href="class_u_s_b.html#af4008dfc1c2d15c23cf8a7815cc17765">Configuring</a>(0, 0, lowspeed);</div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; {</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; <span class="keywordflow">if</span> (rcode != <a class="code" href="_usb_8h.html#a7cb7070e699b7815e3c45dc8f7dd67f1">USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE</a>)</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; {</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; usb_error = rcode;</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#a6fef5305841ac36f67d8ddb0bd9127d4">USB_STATE_ERROR</a>;</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; }</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160; }</div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; usb_task_state = <a class="code" href="_usb_8h.html#a138c40c59f628eefbe273a8db0a96753">USB_STATE_RUNNING</a>;</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#a138c40c59f628eefbe273a8db0a96753">USB_STATE_RUNNING</a>:</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; <span class="keywordflow">case</span> <a class="code" href="_usb_8h.html#a6fef5305841ac36f67d8ddb0bd9127d4">USB_STATE_ERROR</a>:</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; } <span class="comment">// switch( usb_task_state )</span></div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160;} </div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160;</div>
<div class="line"><a name="l00508"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a5eb0d31372d26f0015a0d7be0b9ff4e1"> 508</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a5eb0d31372d26f0015a0d7be0b9ff4e1">USB::DefaultAddressing</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed)</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160;{</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; uint8_t buf[12];</div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p0 = NULL, *p = NULL;</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160;</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; <span class="comment">// Get pointer to pseudo device with address 0 assigned</span></div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; p0 = addrPool.<a class="code" href="class_address_pool_impl.html#aa3e12dda249ef6acbb27592fc8fe1cba">GetUsbDevicePtr</a>(0);</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160;</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; <span class="keywordflow">if</span> (!p0)</div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;</div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160; <span class="keywordflow">if</span> (!p0-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>)</div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;</div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160; p0-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = (lowspeed) ? <span class="keyword">true</span> : <span class="keyword">false</span>;</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160;</div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; uint8_t bAddress = addrPool.<a class="code" href="class_address_pool_impl.html#a14657183c73c631754b31bd0cc588c87">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;</div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160; <span class="keywordflow">if</span> (!bAddress)</div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160;</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; p = addrPool.<a class="code" href="class_address_pool_impl.html#aa3e12dda249ef6acbb27592fc8fe1cba">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160;</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160;</div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; p-&gt;lowspeed = lowspeed;</div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160; </div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; rcode = <a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( 0, 0, bAddress );</div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160;</div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160; {</div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160; addrPool.<a class="code" href="class_address_pool_impl.html#a3d59841faa336c359b0736ca45988ce5">FreeAddress</a>(bAddress);</div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160; bAddress = 0;</div>
<div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; }</div>
<div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160;};</div>
<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160;</div>
<div class="line"><a name="l00550"></a><span class="lineno"><a class="code" href="class_u_s_b.html#af4008dfc1c2d15c23cf8a7815cc17765"> 550</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#af4008dfc1c2d15c23cf8a7815cc17765">USB::Configuring</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed)</div>
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160;{</div>
<div class="line"><a name="l00552"></a><span class="lineno"> 552</span>&#160; <span class="keyword">static</span> uint8_t dev_index = 0;</div>
<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>&#160; uint8_t rcode = 0;</div>
<div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160;</div>
<div class="line"><a name="l00555"></a><span class="lineno"> 555</span>&#160; <span class="keywordflow">for</span> (; devConfigIndex&lt;<a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; devConfigIndex++)</div>
<div class="line"><a name="l00556"></a><span class="lineno"> 556</span>&#160; {</div>
<div class="line"><a name="l00557"></a><span class="lineno"> 557</span>&#160; <span class="keywordflow">if</span> (!devConfig[devConfigIndex])</div>
<div class="line"><a name="l00558"></a><span class="lineno"> 558</span>&#160; <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00559"></a><span class="lineno"> 559</span>&#160;</div>
<div class="line"><a name="l00560"></a><span class="lineno"> 560</span>&#160; rcode = devConfig[devConfigIndex]-&gt;<a class="code" href="class_u_s_b_device_config.html#a391dc824a3271671890cebeb829b35ed">Init</a>(parent, port, lowspeed);</div>
<div class="line"><a name="l00561"></a><span class="lineno"> 561</span>&#160;</div>
<div class="line"><a name="l00562"></a><span class="lineno"> 562</span>&#160; <span class="keywordflow">if</span> (!rcode)</div>
<div class="line"><a name="l00563"></a><span class="lineno"> 563</span>&#160; {</div>
<div class="line"><a name="l00564"></a><span class="lineno"> 564</span>&#160; devConfigIndex = 0;</div>
<div class="line"><a name="l00565"></a><span class="lineno"> 565</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00566"></a><span class="lineno"> 566</span>&#160; }</div>
<div class="line"><a name="l00567"></a><span class="lineno"> 567</span>&#160; <span class="keywordflow">if</span> (!(rcode == <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a> || rcode == <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>))</div>
<div class="line"><a name="l00568"></a><span class="lineno"> 568</span>&#160; {</div>
<div class="line"><a name="l00569"></a><span class="lineno"> 569</span>&#160; <span class="comment">// in case of an error dev_index should be reset to 0</span></div>
<div class="line"><a name="l00570"></a><span class="lineno"> 570</span>&#160; <span class="comment">// in order to start from the very beginning the </span></div>
<div class="line"><a name="l00571"></a><span class="lineno"> 571</span>&#160; <span class="comment">// next time the program gets here</span></div>
<div class="line"><a name="l00572"></a><span class="lineno"> 572</span>&#160; <span class="keywordflow">if</span> (rcode != <a class="code" href="_usb_8h.html#a7cb7070e699b7815e3c45dc8f7dd67f1">USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE</a>)</div>
<div class="line"><a name="l00573"></a><span class="lineno"> 573</span>&#160; devConfigIndex = 0;</div>
<div class="line"><a name="l00574"></a><span class="lineno"> 574</span>&#160;</div>
<div class="line"><a name="l00575"></a><span class="lineno"> 575</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00576"></a><span class="lineno"> 576</span>&#160; }</div>
<div class="line"><a name="l00577"></a><span class="lineno"> 577</span>&#160; }</div>
<div class="line"><a name="l00578"></a><span class="lineno"> 578</span>&#160; <span class="comment">// if we get here that means that the device class is not supported by any of registered classes</span></div>
<div class="line"><a name="l00579"></a><span class="lineno"> 579</span>&#160; devConfigIndex = 0;</div>
<div class="line"><a name="l00580"></a><span class="lineno"> 580</span>&#160;</div>
<div class="line"><a name="l00581"></a><span class="lineno"> 581</span>&#160; rcode = <a class="code" href="class_u_s_b.html#a5eb0d31372d26f0015a0d7be0b9ff4e1">DefaultAddressing</a>(parent, port, lowspeed);</div>
<div class="line"><a name="l00582"></a><span class="lineno"> 582</span>&#160;</div>
<div class="line"><a name="l00583"></a><span class="lineno"> 583</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00584"></a><span class="lineno"> 584</span>&#160;}</div>
<div class="line"><a name="l00585"></a><span class="lineno"> 585</span>&#160;</div>
<div class="line"><a name="l00586"></a><span class="lineno"><a class="code" href="class_u_s_b.html#ac681c6c98e1641f705bc14d670a2663a"> 586</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#ac681c6c98e1641f705bc14d670a2663a">USB::ReleaseDevice</a>(uint8_t addr)</div>
<div class="line"><a name="l00587"></a><span class="lineno"> 587</span>&#160;{</div>
<div class="line"><a name="l00588"></a><span class="lineno"> 588</span>&#160; <span class="keywordflow">if</span> (!addr)</div>
<div class="line"><a name="l00589"></a><span class="lineno"> 589</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00590"></a><span class="lineno"> 590</span>&#160;</div>
<div class="line"><a name="l00591"></a><span class="lineno"> 591</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; i++)</div>
<div class="line"><a name="l00592"></a><span class="lineno"> 592</span>&#160; <span class="keywordflow">if</span> (devConfig[i]-&gt;GetAddress() == addr)</div>
<div class="line"><a name="l00593"></a><span class="lineno"> 593</span>&#160; <span class="keywordflow">return</span> devConfig[i]-&gt;<a class="code" href="class_u_s_b_device_config.html#a74c06c5fe641b20faeeebd39e33248b3">Release</a>();</div>
<div class="line"><a name="l00594"></a><span class="lineno"> 594</span>&#160;}</div>
<div class="line"><a name="l00595"></a><span class="lineno"> 595</span>&#160;</div>
<div class="line"><a name="l00596"></a><span class="lineno"> 596</span>&#160;<span class="preprocessor">#if 1 </span></div>
<div class="line"><a name="l00597"></a><span class="lineno"> 597</span>&#160;<span class="preprocessor">//get device descriptor</span></div>
<div class="line"><a name="l00598"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24"> 598</a></span>&#160;<span class="preprocessor"></span>uint8_t <a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">USB::getDevDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr ) </div>
<div class="line"><a name="l00599"></a><span class="lineno"> 599</span>&#160;{</div>
<div class="line"><a name="l00600"></a><span class="lineno"> 600</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, 0x00, <a class="code" href="usb__ch9_8h.html#ac6d0566773ed4549fe1a7a932e6c46de">USB_DESCRIPTOR_DEVICE</a>, 0x0000, nbytes, nbytes, dataptr, NULL ));</div>
<div class="line"><a name="l00601"></a><span class="lineno"> 601</span>&#160;}</div>
<div class="line"><a name="l00602"></a><span class="lineno"> 602</span>&#160;<span class="comment">//get configuration descriptor </span></div>
<div class="line"><a name="l00603"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89"> 603</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">USB::getConfDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr ) </div>
<div class="line"><a name="l00604"></a><span class="lineno"> 604</span>&#160;{</div>
<div class="line"><a name="l00605"></a><span class="lineno"> 605</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, conf, <a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7">USB_DESCRIPTOR_CONFIGURATION</a>, 0x0000, nbytes, nbytes, dataptr, NULL ));</div>
<div class="line"><a name="l00606"></a><span class="lineno"> 606</span>&#160;}</div>
<div class="line"><a name="l00607"></a><span class="lineno"> 607</span>&#160;</div>
<div class="line"><a name="l00608"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a9ebd4acdc37b12bbab2ca893cb899eba"> 608</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">USB::getConfDescr</a>( uint8_t addr, uint8_t ep, uint8_t conf, <a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a> *p )</div>
<div class="line"><a name="l00609"></a><span class="lineno"> 609</span>&#160;{</div>
<div class="line"><a name="l00610"></a><span class="lineno"> 610</span>&#160; <span class="keyword">const</span> uint8_t bufSize = 64;</div>
<div class="line"><a name="l00611"></a><span class="lineno"> 611</span>&#160; uint8_t buf[bufSize];</div>
<div class="line"><a name="l00612"></a><span class="lineno"> 612</span>&#160;</div>
<div class="line"><a name="l00613"></a><span class="lineno"> 613</span>&#160; uint8_t ret = <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>( addr, ep, 8, conf, buf );</div>
<div class="line"><a name="l00614"></a><span class="lineno"> 614</span>&#160;</div>
<div class="line"><a name="l00615"></a><span class="lineno"> 615</span>&#160; <span class="keywordflow">if</span> (ret)</div>
<div class="line"><a name="l00616"></a><span class="lineno"> 616</span>&#160; <span class="keywordflow">return</span> ret;</div>
<div class="line"><a name="l00617"></a><span class="lineno"> 617</span>&#160;</div>
<div class="line"><a name="l00618"></a><span class="lineno"> 618</span>&#160; uint16_t total = ((<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>*)buf)-&gt;wTotalLength;</div>
<div class="line"><a name="l00619"></a><span class="lineno"> 619</span>&#160; delay(100);</div>
<div class="line"><a name="l00620"></a><span class="lineno"> 620</span>&#160; <span class="comment">//USBTRACE2(&quot;\r\ntotal conf.size:&quot;, total);</span></div>
<div class="line"><a name="l00621"></a><span class="lineno"> 621</span>&#160;</div>
<div class="line"><a name="l00622"></a><span class="lineno"> 622</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, conf, <a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7">USB_DESCRIPTOR_CONFIGURATION</a>, 0x0000, total, bufSize, buf, p ));</div>
<div class="line"><a name="l00623"></a><span class="lineno"> 623</span>&#160;}</div>
<div class="line"><a name="l00624"></a><span class="lineno"> 624</span>&#160;</div>
<div class="line"><a name="l00625"></a><span class="lineno"> 625</span>&#160;<span class="comment">//get string descriptor</span></div>
<div class="line"><a name="l00626"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833"> 626</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833">USB::getStrDescr</a>( uint8_t addr, uint8_t ep, uint16_t ns, uint8_t index, uint16_t langid, uint8_t* dataptr ) </div>
<div class="line"><a name="l00627"></a><span class="lineno"> 627</span>&#160;{</div>
<div class="line"><a name="l00628"></a><span class="lineno"> 628</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, index, <a class="code" href="usb__ch9_8h.html#abbad38caa1ca9c52f47adccd3a850aed">USB_DESCRIPTOR_STRING</a>, langid, ns, ns, dataptr, NULL ));</div>
<div class="line"><a name="l00629"></a><span class="lineno"> 629</span>&#160;}</div>
<div class="line"><a name="l00630"></a><span class="lineno"> 630</span>&#160;<span class="comment">//set address </span></div>
<div class="line"><a name="l00631"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47"> 631</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">USB::setAddr</a>( uint8_t oldaddr, uint8_t ep, uint8_t newaddr ) </div>
<div class="line"><a name="l00632"></a><span class="lineno"> 632</span>&#160;{</div>
<div class="line"><a name="l00633"></a><span class="lineno"> 633</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( oldaddr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#ac87659819bfd6491120c819fae2d46bc">USB_REQUEST_SET_ADDRESS</a>, newaddr, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL ));</div>
<div class="line"><a name="l00634"></a><span class="lineno"> 634</span>&#160;}</div>
<div class="line"><a name="l00635"></a><span class="lineno"> 635</span>&#160;<span class="comment">//set configuration</span></div>
<div class="line"><a name="l00636"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378"> 636</a></span>&#160;uint8_t <a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">USB::setConf</a>( uint8_t addr, uint8_t ep, uint8_t conf_value ) </div>
<div class="line"><a name="l00637"></a><span class="lineno"> 637</span>&#160;{</div>
<div class="line"><a name="l00638"></a><span class="lineno"> 638</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#aadef005acc40340955d34d9767ef297c">USB_REQUEST_SET_CONFIGURATION</a>, conf_value, 0x00, 0x0000, 0x0000, 0x0000, NULL, NULL )); </div>
<div class="line"><a name="l00639"></a><span class="lineno"> 639</span>&#160;}</div>
<div class="line"><a name="l00640"></a><span class="lineno"> 640</span>&#160;</div>
<div class="line"><a name="l00641"></a><span class="lineno"> 641</span>&#160;<span class="preprocessor">#endif // defined(USB_METHODS_INLINE)</span></div>
<div class="line"><a name="l00642"></a><span class="lineno"> 642</span>&#160;<span class="preprocessor"></span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

File diff suppressed because one or more lines are too long

View file

@ -1,43 +1,41 @@
<map id="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/Usb.h" name="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/Usb.h">
<area shape="rect" id="node2" href="$adk_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/adk.h" alt="" coords="117,90,243,121"/>
<area shape="rect" id="node4" href="$_b_t_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/BTD.h" alt="" coords="390,90,519,121"/>
<area shape="rect" id="node2" href="$adk_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/adk.h" alt="" coords="129,90,255,121"/>
<area shape="rect" id="node4" href="$_b_t_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/BTD.h" alt="" coords="413,90,541,121"/>
<area shape="rect" id="node12" href="$cdcacm_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcacm.h" alt="" coords="820,85,924,125"/>
<area shape="rect" id="node16" href="$cdcftdi_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcftdi.h" alt="" coords="1035,85,1139,125"/>
<area shape="rect" id="node14" href="$cdcprolific_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcprolific.h" alt="" coords="820,179,924,219"/>
<area shape="rect" id="node18" href="$le3dp__rptparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/le3dp/le3dp\l_rptparser.h" alt="" coords="1077,174,1195,223"/>
<area shape="rect" id="node20" href="$hidjoystickrptparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/USBHIDJoystick\l/hidjoystickrptparser.h" alt="" coords="1220,174,1356,223"/>
<area shape="rect" id="node22" href="$hid_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/hid.h" alt="" coords="1498,90,1621,121"/>
<area shape="rect" id="node22" href="$hid_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/hid.h" alt="" coords="1387,90,1511,121"/>
<area shape="rect" id="node24" href="$hidboot_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidboot.h" alt="" coords="1636,179,1740,219"/>
<area shape="rect" id="node26" href="$hidescriptorparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidescriptorparser.h" alt="" coords="1764,179,1868,219"/>
<area shape="rect" id="node30" href="$masstorage_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.h" alt="" coords="1749,85,1853,125"/>
<area shape="rect" id="node32" href="$max___l_c_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.h" alt="" coords="1877,85,1981,125"/>
<area shape="rect" id="node34" href="$_p_s3_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.h" alt="" coords="2005,85,2109,125"/>
<area shape="rect" id="node36" href="$_usb_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Usb.cpp" alt="" coords="2133,85,2237,125"/>
<area shape="rect" id="node37" href="$usbhub_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.h" alt="" coords="2263,85,2367,125"/>
<area shape="rect" id="node39" href="$_x_b_o_x_r_e_c_v_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.h" alt="" coords="2395,85,2499,125"/>
<area shape="rect" id="node41" href="$_x_b_o_x_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXUSB.h" alt="" coords="2531,85,2635,125"/>
<area shape="rect" id="node30" href="$masstorage_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.h" alt="" coords="1637,85,1741,125"/>
<area shape="rect" id="node32" href="$max___l_c_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.h" alt="" coords="1765,85,1869,125"/>
<area shape="rect" id="node34" href="$_p_s3_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.h" alt="" coords="1893,85,1997,125"/>
<area shape="rect" id="node36" href="$_usb_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Usb.cpp" alt="" coords="2021,85,2125,125"/>
<area shape="rect" id="node37" href="$usbhub_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.h" alt="" coords="2185,85,2289,125"/>
<area shape="rect" id="node39" href="$_x_b_o_x_r_e_c_v_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.h" alt="" coords="2385,85,2489,125"/>
<area shape="rect" id="node3" href="$adk_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/adk.cpp" alt="" coords="5,179,109,219"/>
<area shape="rect" id="node5" href="$_b_t_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/BTD.cpp" alt="" coords="133,179,237,219"/>
<area shape="rect" id="node6" href="$_p_s3_b_t_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.h" alt="" coords="261,179,365,219"/>
<area shape="rect" id="node8" href="$_s_p_p_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/SPP.h" alt="" coords="390,183,519,214"/>
<area shape="rect" id="node10" href="$_wii_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Wii.h" alt="" coords="543,183,667,214"/>
<area shape="rect" id="node7" href="$_p_s3_b_t_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.cpp" alt="" coords="261,277,365,317"/>
<area shape="rect" id="node9" href="$_s_p_p_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/SPP.cpp" alt="" coords="403,277,507,317"/>
<area shape="rect" id="node11" href="$_wii_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Wii.cpp" alt="" coords="553,277,657,317"/>
<area shape="rect" id="node5" href="$_b_t_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/BTD.cpp" alt="" coords="564,179,668,219"/>
<area shape="rect" id="node6" href="$_p_s3_b_t_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.h" alt="" coords="133,179,237,219"/>
<area shape="rect" id="node8" href="$_s_p_p_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/SPP.h" alt="" coords="262,183,391,214"/>
<area shape="rect" id="node10" href="$_wii_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Wii.h" alt="" coords="415,183,539,214"/>
<area shape="rect" id="node7" href="$_p_s3_b_t_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.cpp" alt="" coords="133,277,237,317"/>
<area shape="rect" id="node9" href="$_s_p_p_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/SPP.cpp" alt="" coords="275,277,379,317"/>
<area shape="rect" id="node11" href="$_wii_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Wii.cpp" alt="" coords="425,277,529,317"/>
<area shape="rect" id="node13" href="$cdcacm_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcacm.cpp" alt="" coords="692,179,796,219"/>
<area shape="rect" id="node15" href="$cdcprolific_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcprolific.cpp" alt="" coords="820,277,924,317"/>
<area shape="rect" id="node17" href="$cdcftdi_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcftdi.cpp" alt="" coords="948,179,1052,219"/>
<area shape="rect" id="node19" href="$le3dp__rptparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/le3dp/le3dp\l_rptparser.cpp" alt="" coords="1077,273,1195,322"/>
<area shape="rect" id="node21" href="$hidjoystickrptparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/USBHIDJoystick\l/hidjoystickrptparser.cpp" alt="" coords="1220,273,1356,322"/>
<area shape="rect" id="node23" href="$hid_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hid.cpp" alt="" coords="1380,179,1484,219"/>
<area shape="rect" id="node28" href="$hiduniversal_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.h" alt="" coords="1508,179,1612,219"/>
<area shape="rect" id="node23" href="$hid_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hid.cpp" alt="" coords="1508,179,1612,219"/>
<area shape="rect" id="node28" href="$hiduniversal_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.h" alt="" coords="1380,179,1484,219"/>
<area shape="rect" id="node25" href="$hidboot_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidboot.cpp" alt="" coords="1636,277,1740,317"/>
<area shape="rect" id="node27" href="$hidescriptorparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidescriptorparser.cpp" alt="" coords="1764,277,1868,317"/>
<area shape="rect" id="node29" href="$hiduniversal_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.cpp" alt="" coords="1508,277,1612,317"/>
<area shape="rect" id="node29" href="$hiduniversal_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.cpp" alt="" coords="1380,277,1484,317"/>
<area shape="rect" id="node31" href="$masstorage_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.cpp" alt="" coords="1892,179,1996,219"/>
<area shape="rect" id="node33" href="$max___l_c_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.cpp" alt="" coords="2020,179,2124,219"/>
<area shape="rect" id="node35" href="$_p_s3_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.cpp" alt="" coords="2148,179,2252,219"/>
<area shape="rect" id="node38" href="$usbhub_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.cpp" alt="" coords="2276,179,2380,219"/>
<area shape="rect" id="node40" href="$_x_b_o_x_r_e_c_v_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.cpp" alt="" coords="2404,179,2508,219"/>
<area shape="rect" id="node42" href="$_x_b_o_x_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXUSB.cpp" alt="" coords="2532,179,2636,219"/>
</map>

View file

@ -1 +1 @@
3f438c9e83996f317e8ae268ac2869d8
9d517d3420627fcc5b265a4785d5eab1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View file

@ -147,234 +147,236 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor"></span><span class="keyword">typedef</span> <a class="code" href="class_m_a_x3421e.html">MAX3421e&lt;P9, P8&gt;</a> <a class="code" href="_usb_8h.html#ae8ea2a106e94f5bb20be2fcbd4e402fb">MAX3421E</a>; <span class="comment">// Teensy++ 2.0 &amp; 1.0</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor">#elif defined(BOARD_MEGA_ADK)</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="preprocessor"></span><span class="keyword">typedef</span> <a class="code" href="class_m_a_x3421e.html">MAX3421e&lt;P53, P54&gt;</a> <a class="code" href="_usb_8h.html#ae8ea2a106e94f5bb20be2fcbd4e402fb">MAX3421E</a>; <span class="comment">// Arduino Mega ADK</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae8ea2a106e94f5bb20be2fcbd4e402fb"> 61</a></span>&#160;<span class="preprocessor"></span><span class="keyword">typedef</span> <a class="code" href="class_m_a_x3421e.html">MAX3421e&lt;P10, P9&gt;</a> <a class="code" href="_usb_8h.html#ae8ea2a106e94f5bb20be2fcbd4e402fb">MAX3421E</a>; <span class="comment">// Official Arduinos (UNO, Duemilanove, Mega, 2560</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="comment">//Debug macros. In 1.0 it is possible to move strings to PROGMEM by defining USBTRACE (Serial.print(F(s)))</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd"> 65</a></span>&#160;<span class="preprocessor">#define USBTRACE(s) (Serial.print((s)))</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3"> 66</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USBTRACE2(s,r) (Serial.print((s)), Serial.println((r),HEX))</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="comment">/* Common setup data constant combinations */</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285"> 71</a></span>&#160;<span class="preprocessor">#define bmREQ_GET_DESCR USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //get descriptor request type</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da"> 72</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define bmREQ_SET USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //set request type for all but &#39;set feature&#39; and &#39;set interface&#39;</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="_usb_8h.html#a9495c8ffdb784e111e8174e1541676f0"> 73</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define bmREQ_CL_GET_INTF USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE //get interface request type</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="comment">// D7 data transfer direction (0 - host-to-device, 1 - device-to-host)</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="comment">// D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="comment">// D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved)</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="comment">// USB Device Classes</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae157c9a62665e9ca41bf765518077f40"> 80</a></span>&#160;<span class="preprocessor">#define USB_CLASS_USE_CLASS_INFO 0x00 // Use Class Info in the Interface Descriptors</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="_usb_8h.html#a8785f84db1be6b0b5da34cd91a1b6138"> 81</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_AUDIO 0x01 // Audio</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="_usb_8h.html#abb99f6b1f38ff79ec678cd957ac86758"> 82</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_COM_AND_CDC_CTRL 0x02 // Communications and CDC Control</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="_usb_8h.html#af062e949014bed74a8b5fedcf1705602"> 83</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_HID 0x03 // HID</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="_usb_8h.html#aa5f3153d014b6267ba8da243b6b46443"> 84</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_PHYSICAL 0x05 // Physical</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="code" href="_usb_8h.html#a1cddf36a39f1299fcf654628c40eaafe"> 85</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_IMAGE 0x06 // Image</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="_usb_8h.html#ab3e03403111b64480ba298d2641cf92f"> 86</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_PRINTER 0x07 // Printer</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="_usb_8h.html#aa99b73e335df09e6545fc44798a3c1f2"> 87</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_MASS_STORAGE 0x08 // Mass Storage</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="_usb_8h.html#aac5a936a2d1a6e3403798b031294992a"> 88</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_HUB 0x09 // Hub</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="_usb_8h.html#a7dae7df3ce2685f96775f2a0fb8658ae"> 89</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_CDC_DATA 0x0a // CDC-Data</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="code" href="_usb_8h.html#a823e1d95a677968ba93d6bb1968c48db"> 90</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_SMART_CARD 0x0b // Smart-Card</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="_usb_8h.html#a311fda5cdf4960e05a892084c1b11288"> 91</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_CONTENT_SECURITY 0x0d // Content Security</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="_usb_8h.html#a42a579e1be399e32a495b82634411449"> 92</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_VIDEO 0x0e // Video</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="_usb_8h.html#aef502b63c6eb8229ba4d67224f19fb84"> 93</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_PERSONAL_HEALTH 0x0f // Personal Healthcare</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="code" href="_usb_8h.html#aa31549c5c0d9e18f310dddaeab27068b"> 94</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_DIAGNOSTIC_DEVICE 0xdc // Diagnostic Device</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="code" href="_usb_8h.html#afce880b09049d7105f8e68ff36d9ad17"> 95</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_WIRELESS_CTRL 0xe0 // Wireless Controller</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="_usb_8h.html#a02fb07e20ad6d1af64439f40093bc80f"> 96</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_MISC 0xef // Miscellaneous</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="code" href="_usb_8h.html#a47087a6e244a02251b650921ea3b71db"> 97</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_APP_SPECIFIC 0xfe // Application Specific</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="_usb_8h.html#a7c6212a5385ca1b4af75eeff62f7a871"> 98</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_VENDOR_SPECIFIC 0xff // Vendor Specific</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="comment">// Additional Error Codes</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589"> 101</a></span>&#160;<span class="preprocessor">#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED 0xD1</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="_usb_8h.html#a7cb7070e699b7815e3c45dc8f7dd67f1"> 102</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE 0xD2</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="_usb_8h.html#ad4929f74079f3bc22b00936ae84d18b0"> 103</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS 0xD3</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d"> 104</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL 0xD4</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="_usb_8h.html#ada55913b93ef46c430ed6979022c31b1"> 105</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_HUB_ADDRESS_OVERFLOW 0xD5</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0"> 106</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL 0xD6</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d"> 107</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_EPINFO_IS_NULL 0xD7</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="_usb_8h.html#a52c379fe7e22f53d3e3d47d65735fa3b"> 108</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_INVALID_ARGUMENT 0xD8</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595"> 109</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE 0xD9</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="_usb_8h.html#a272428aaee5fccec4661bd5457d1928f"> 110</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_INVALID_MAX_PKT_SIZE 0xDA</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="code" href="_usb_8h.html#ad55f0079a95df5e4a9bb22e88a7395f5"> 111</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_EP_NOT_FOUND_IN_TBL 0xDB</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae691ccb027b8e281ac87522a0e66aaa7"> 112</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_TRANSFER_TIMEOUT 0xFF</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="class_u_s_b_device_config.html"> 114</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;{</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_u_s_b_device_config.html#a391dc824a3271671890cebeb829b35ed">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed) = 0;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_u_s_b_device_config.html#a74c06c5fe641b20faeeebd39e33248b3">Release</a>() = 0;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_u_s_b_device_config.html#a4961e92df3e75c38e6953fb08b11f8b6">Poll</a>() = 0;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_u_s_b_device_config.html#aae3130517514c902bad5f153849b3811">GetAddress</a>() = 0;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;};</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="code" href="_usb_8h.html#ad8686abbfa0d98547d450fe2a105a588"> 123</a></span>&#160;<span class="preprocessor">#define USB_XFER_TIMEOUT 5000 //USB transfer timeout in milliseconds, per section 9.2.6.1 of USB 2.0 spec</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="preprocessor"></span><span class="comment">//#define USB_NAK_LIMIT 32000 //NAK limit for a transfer. 0 means NAKs are not counted</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"><a class="code" href="_usb_8h.html#a857a9899ad4f277faf074c3012e14ffa"> 125</a></span>&#160;<span class="preprocessor">#define USB_RETRY_LIMIT 3 //retry limit for a transfer</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="_usb_8h.html#a1b082667723b29243b021a1829bdd8d6"> 126</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETTLE_DELAY 200 //settle delay in milliseconds</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5"> 128</a></span>&#160;<span class="preprocessor">#define USB_NUMDEVICES 16 //number of USB devices</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="preprocessor"></span><span class="comment">//#define HUB_MAX_HUBS 7 // maximum number of hubs that can be attached to the host controller</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae843af5aa0de74b17c3d8c8f8fab4c00"> 130</a></span>&#160;<span class="preprocessor">#define HUB_PORT_RESET_DELAY 20 // hub port reset delay 10 ms recomended, can be up to 20 ms</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="comment">/* USB state machine states */</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="_usb_8h.html#a3168cf67661a2716677b9830f30b880c"> 133</a></span>&#160;<span class="preprocessor">#define USB_STATE_MASK 0xf0</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae7fd7c5bb6dc87f44724dde2ad57df87"> 135</a></span>&#160;<span class="preprocessor">#define USB_STATE_DETACHED 0x10</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="code" href="_usb_8h.html#a60a744d0f1386e4b28053a41bd6a958f"> 136</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DETACHED_SUBSTATE_INITIALIZE 0x11 </span></div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="_usb_8h.html#a3708f4e8166d5d099e1982aa956eacce"> 137</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE 0x12</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="_usb_8h.html#aff6ab2376cd29385b20c2b63d4ddd26d"> 138</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DETACHED_SUBSTATE_ILLEGAL 0x13</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="_usb_8h.html#aaadb20392558e23e3eba073e358a4493"> 139</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_SETTLE 0x20</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="_usb_8h.html#ada22633d6de30155a60cb19f6e6452fe"> 140</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_RESET_DEVICE 0x30 </span></div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="_usb_8h.html#a311f11b79c4020d771cd6930e0a3223d"> 141</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE 0x40</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="code" href="_usb_8h.html#a2d69537e663e7d5f188004f0d25ec0cc"> 142</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_WAIT_SOF 0x50</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="code" href="_usb_8h.html#a23ebcbb956f600e06435b28ae0c855d4"> 143</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE 0x60</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="code" href="_usb_8h.html#a474a95baaeb99abd17538c2a1364bf96"> 144</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_STATE_ADDRESSING 0x70</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="code" href="_usb_8h.html#aac8c844e6a20f42298d70e4438a029e5"> 145</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_STATE_CONFIGURING 0x80</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="code" href="_usb_8h.html#a138c40c59f628eefbe273a8db0a96753"> 146</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_STATE_RUNNING 0x90</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="code" href="_usb_8h.html#a6fef5305841ac36f67d8ddb0bd9127d4"> 147</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_STATE_ERROR 0xa0</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="comment">/* USB Setup Packet Structure */</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html"> 150</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keyword">union </span>{ <span class="comment">// offset description</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a9bbd6cf5a93a6433d2eb97c59b9102d5"> 152</a></span>&#160; uint8_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a9bbd6cf5a93a6433d2eb97c59b9102d5">bmRequestType</a>; <span class="comment">// 0 Bit-map of request type</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a690a55f65b2ce4e69c426b92004a1cc6"> 154</a></span>&#160; uint8_t recipient: 5; <span class="comment">// Recipient of the request</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#ad9346ba7b7a4da6829142e23e3ba8a2f"> 155</a></span>&#160; uint8_t type: 2; <span class="comment">// Type of request</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#ab50c95fb951cdebc78c3e024de1d6d65"> 156</a></span>&#160; uint8_t direction: 1; <span class="comment">// Direction of data X-fer</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; };</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; }ReqType_u;</div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a321b931277d6ce278416dc5d74059016"> 159</a></span>&#160; uint8_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a321b931277d6ce278416dc5d74059016">bRequest</a>; <span class="comment">// 1 Request</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keyword">union </span>{</div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1382f4a10a9b0774f803d1125dd9bb52"> 161</a></span>&#160; uint16_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1382f4a10a9b0774f803d1125dd9bb52">wValue</a>; <span class="comment">// 2 Depends on bRequest</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00163"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a68c9436c00560f96e044052c3fb681e9"> 163</a></span>&#160; uint8_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a68c9436c00560f96e044052c3fb681e9">wValueLo</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a04ea2d151f9edb6575fc159a58f1e443"> 164</a></span>&#160; uint8_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a04ea2d151f9edb6575fc159a58f1e443">wValueHi</a>;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; };</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; }wVal_u;</div>
<div class="line"><a name="l00167"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a299d9f88d294369ea88b48b5026f4c7e"> 167</a></span>&#160; uint16_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a299d9f88d294369ea88b48b5026f4c7e">wIndex</a>; <span class="comment">// 4 Depends on bRequest</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1ec9b19c0ed1e66e399ad9cf3c4a6537"> 168</a></span>&#160; uint16_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1ec9b19c0ed1e66e399ad9cf3c4a6537">wLength</a>; <span class="comment">// 6 Depends on bRequest</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;} <a class="code" href="struct_s_e_t_u_p___p_k_t.html">SETUP_PKT</a>, *<a class="code" href="_usb_8h.html#af36716855ff65599786d9bdf6e4c11f9">PSETUP_PKT</a>;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="preprocessor">#elif defined(BOARD_BALANDUINO)</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="preprocessor"></span><span class="keyword">typedef</span> <a class="code" href="class_m_a_x3421e.html">MAX3421e&lt;P20, P19&gt;</a> <a class="code" href="_usb_8h.html#ae8ea2a106e94f5bb20be2fcbd4e402fb">MAX3421E</a>; <span class="comment">// Balanduino</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae8ea2a106e94f5bb20be2fcbd4e402fb"> 63</a></span>&#160;<span class="preprocessor"></span><span class="keyword">typedef</span> <a class="code" href="class_m_a_x3421e.html">MAX3421e&lt;P10, P9&gt;</a> <a class="code" href="_usb_8h.html#ae8ea2a106e94f5bb20be2fcbd4e402fb">MAX3421E</a>; <span class="comment">// Official Arduinos (UNO, Duemilanove, Mega, 2560, Leonardo etc.)</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="comment">//Debug macros. In 1.0 it is possible to move strings to PROGMEM by defining USBTRACE (Serial.print(F(s)))</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd"> 67</a></span>&#160;<span class="preprocessor">#define USBTRACE(s) (Serial.print((s)))</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3"> 68</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USBTRACE2(s,r) (Serial.print((s)), Serial.println((r),HEX))</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="preprocessor"></span></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;</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="comment">/* Common setup data constant combinations */</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285"> 73</a></span>&#160;<span class="preprocessor">#define bmREQ_GET_DESCR USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //get descriptor request type</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da"> 74</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define bmREQ_SET USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_DEVICE //set request type for all but &#39;set feature&#39; and &#39;set interface&#39;</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="_usb_8h.html#a9495c8ffdb784e111e8174e1541676f0"> 75</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define bmREQ_CL_GET_INTF USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE //get interface request type</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="comment">// D7 data transfer direction (0 - host-to-device, 1 - device-to-host)</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="comment">// D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved)</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="comment">// D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved)</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="comment">// USB Device Classes</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae157c9a62665e9ca41bf765518077f40"> 82</a></span>&#160;<span class="preprocessor">#define USB_CLASS_USE_CLASS_INFO 0x00 // Use Class Info in the Interface Descriptors</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="_usb_8h.html#a8785f84db1be6b0b5da34cd91a1b6138"> 83</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_AUDIO 0x01 // Audio</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="_usb_8h.html#abb99f6b1f38ff79ec678cd957ac86758"> 84</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_COM_AND_CDC_CTRL 0x02 // Communications and CDC Control</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"><a class="code" href="_usb_8h.html#af062e949014bed74a8b5fedcf1705602"> 85</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_HID 0x03 // HID</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="_usb_8h.html#aa5f3153d014b6267ba8da243b6b46443"> 86</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_PHYSICAL 0x05 // Physical</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="_usb_8h.html#a1cddf36a39f1299fcf654628c40eaafe"> 87</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_IMAGE 0x06 // Image</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="_usb_8h.html#ab3e03403111b64480ba298d2641cf92f"> 88</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_PRINTER 0x07 // Printer</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="_usb_8h.html#aa99b73e335df09e6545fc44798a3c1f2"> 89</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_MASS_STORAGE 0x08 // Mass Storage</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="code" href="_usb_8h.html#aac5a936a2d1a6e3403798b031294992a"> 90</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_HUB 0x09 // Hub</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="code" href="_usb_8h.html#a7dae7df3ce2685f96775f2a0fb8658ae"> 91</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_CDC_DATA 0x0a // CDC-Data</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="_usb_8h.html#a823e1d95a677968ba93d6bb1968c48db"> 92</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_SMART_CARD 0x0b // Smart-Card</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="_usb_8h.html#a311fda5cdf4960e05a892084c1b11288"> 93</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_CONTENT_SECURITY 0x0d // Content Security</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="code" href="_usb_8h.html#a42a579e1be399e32a495b82634411449"> 94</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_VIDEO 0x0e // Video</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="code" href="_usb_8h.html#aef502b63c6eb8229ba4d67224f19fb84"> 95</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_PERSONAL_HEALTH 0x0f // Personal Healthcare</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="_usb_8h.html#aa31549c5c0d9e18f310dddaeab27068b"> 96</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_DIAGNOSTIC_DEVICE 0xdc // Diagnostic Device</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="code" href="_usb_8h.html#afce880b09049d7105f8e68ff36d9ad17"> 97</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_WIRELESS_CTRL 0xe0 // Wireless Controller</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="_usb_8h.html#a02fb07e20ad6d1af64439f40093bc80f"> 98</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_MISC 0xef // Miscellaneous</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="_usb_8h.html#a47087a6e244a02251b650921ea3b71db"> 99</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_APP_SPECIFIC 0xfe // Application Specific</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="_usb_8h.html#a7c6212a5385ca1b4af75eeff62f7a871"> 100</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_CLASS_VENDOR_SPECIFIC 0xff // Vendor Specific</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="comment">// Additional Error Codes</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589"> 103</a></span>&#160;<span class="preprocessor">#define USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED 0xD1</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="_usb_8h.html#a7cb7070e699b7815e3c45dc8f7dd67f1"> 104</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DEV_CONFIG_ERROR_DEVICE_INIT_INCOMPLETE 0xD2</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="_usb_8h.html#ad4929f74079f3bc22b00936ae84d18b0"> 105</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS 0xD3</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d"> 106</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL 0xD4</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="_usb_8h.html#ada55913b93ef46c430ed6979022c31b1"> 107</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_HUB_ADDRESS_OVERFLOW 0xD5</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0"> 108</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL 0xD6</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d"> 109</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_EPINFO_IS_NULL 0xD7</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="_usb_8h.html#a52c379fe7e22f53d3e3d47d65735fa3b"> 110</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_INVALID_ARGUMENT 0xD8</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595"> 111</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE 0xD9</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="code" href="_usb_8h.html#a272428aaee5fccec4661bd5457d1928f"> 112</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_INVALID_MAX_PKT_SIZE 0xDA</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="code" href="_usb_8h.html#ad55f0079a95df5e4a9bb22e88a7395f5"> 113</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_EP_NOT_FOUND_IN_TBL 0xDB</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae691ccb027b8e281ac87522a0e66aaa7"> 114</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ERROR_TRANSFER_TIMEOUT 0xFF</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="code" href="class_u_s_b_device_config.html"> 116</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;{</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_u_s_b_device_config.html#a391dc824a3271671890cebeb829b35ed">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed) = 0;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_u_s_b_device_config.html#a74c06c5fe641b20faeeebd39e33248b3">Release</a>() = 0;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_u_s_b_device_config.html#a4961e92df3e75c38e6953fb08b11f8b6">Poll</a>() = 0;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_u_s_b_device_config.html#aae3130517514c902bad5f153849b3811">GetAddress</a>() = 0;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;};</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"><a class="code" href="_usb_8h.html#ad8686abbfa0d98547d450fe2a105a588"> 125</a></span>&#160;<span class="preprocessor">#define USB_XFER_TIMEOUT 5000 //USB transfer timeout in milliseconds, per section 9.2.6.1 of USB 2.0 spec</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="preprocessor"></span><span class="comment">//#define USB_NAK_LIMIT 32000 //NAK limit for a transfer. 0 means NAKs are not counted</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="_usb_8h.html#a857a9899ad4f277faf074c3012e14ffa"> 127</a></span>&#160;<span class="preprocessor">#define USB_RETRY_LIMIT 3 //retry limit for a transfer</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="_usb_8h.html#a1b082667723b29243b021a1829bdd8d6"> 128</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_SETTLE_DELAY 200 //settle delay in milliseconds</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5"> 130</a></span>&#160;<span class="preprocessor">#define USB_NUMDEVICES 16 //number of USB devices</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor"></span><span class="comment">//#define HUB_MAX_HUBS 7 // maximum number of hubs that can be attached to the host controller</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae843af5aa0de74b17c3d8c8f8fab4c00"> 132</a></span>&#160;<span class="preprocessor">#define HUB_PORT_RESET_DELAY 20 // hub port reset delay 10 ms recomended, can be up to 20 ms</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="comment">/* USB state machine states */</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="_usb_8h.html#a3168cf67661a2716677b9830f30b880c"> 135</a></span>&#160;<span class="preprocessor">#define USB_STATE_MASK 0xf0</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="_usb_8h.html#ae7fd7c5bb6dc87f44724dde2ad57df87"> 137</a></span>&#160;<span class="preprocessor">#define USB_STATE_DETACHED 0x10</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="_usb_8h.html#a60a744d0f1386e4b28053a41bd6a958f"> 138</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DETACHED_SUBSTATE_INITIALIZE 0x11 </span></div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="_usb_8h.html#a3708f4e8166d5d099e1982aa956eacce"> 139</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DETACHED_SUBSTATE_WAIT_FOR_DEVICE 0x12</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="code" href="_usb_8h.html#aff6ab2376cd29385b20c2b63d4ddd26d"> 140</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_DETACHED_SUBSTATE_ILLEGAL 0x13</span></div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="_usb_8h.html#aaadb20392558e23e3eba073e358a4493"> 141</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_SETTLE 0x20</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="code" href="_usb_8h.html#ada22633d6de30155a60cb19f6e6452fe"> 142</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_RESET_DEVICE 0x30 </span></div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="code" href="_usb_8h.html#a311f11b79c4020d771cd6930e0a3223d"> 143</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE 0x40</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="code" href="_usb_8h.html#a2d69537e663e7d5f188004f0d25ec0cc"> 144</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_WAIT_SOF 0x50</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="code" href="_usb_8h.html#a23ebcbb956f600e06435b28ae0c855d4"> 145</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_ATTACHED_SUBSTATE_GET_DEVICE_DESCRIPTOR_SIZE 0x60</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="code" href="_usb_8h.html#a474a95baaeb99abd17538c2a1364bf96"> 146</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_STATE_ADDRESSING 0x70</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="code" href="_usb_8h.html#aac8c844e6a20f42298d70e4438a029e5"> 147</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_STATE_CONFIGURING 0x80</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"><a class="code" href="_usb_8h.html#a138c40c59f628eefbe273a8db0a96753"> 148</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_STATE_RUNNING 0x90</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="_usb_8h.html#a6fef5305841ac36f67d8ddb0bd9127d4"> 149</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define USB_STATE_ERROR 0xa0</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;<span class="comment">/* USB Setup Packet Structure */</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html"> 152</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keyword">union </span>{ <span class="comment">// offset description</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a9bbd6cf5a93a6433d2eb97c59b9102d5"> 154</a></span>&#160; uint8_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a9bbd6cf5a93a6433d2eb97c59b9102d5">bmRequestType</a>; <span class="comment">// 0 Bit-map of request type</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00156"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a690a55f65b2ce4e69c426b92004a1cc6"> 156</a></span>&#160; uint8_t recipient: 5; <span class="comment">// Recipient of the request</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#ad9346ba7b7a4da6829142e23e3ba8a2f"> 157</a></span>&#160; uint8_t type: 2; <span class="comment">// Type of request</span></div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#ab50c95fb951cdebc78c3e024de1d6d65"> 158</a></span>&#160; uint8_t direction: 1; <span class="comment">// Direction of data X-fer</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; };</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; }ReqType_u;</div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a321b931277d6ce278416dc5d74059016"> 161</a></span>&#160; uint8_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a321b931277d6ce278416dc5d74059016">bRequest</a>; <span class="comment">// 1 Request</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keyword">union </span>{</div>
<div class="line"><a name="l00163"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1382f4a10a9b0774f803d1125dd9bb52"> 163</a></span>&#160; uint16_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1382f4a10a9b0774f803d1125dd9bb52">wValue</a>; <span class="comment">// 2 Depends on bRequest</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00165"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a68c9436c00560f96e044052c3fb681e9"> 165</a></span>&#160; uint8_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a68c9436c00560f96e044052c3fb681e9">wValueLo</a>;</div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a04ea2d151f9edb6575fc159a58f1e443"> 166</a></span>&#160; uint8_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a04ea2d151f9edb6575fc159a58f1e443">wValueHi</a>;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; };</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; }wVal_u;</div>
<div class="line"><a name="l00169"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a299d9f88d294369ea88b48b5026f4c7e"> 169</a></span>&#160; uint16_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a299d9f88d294369ea88b48b5026f4c7e">wIndex</a>; <span class="comment">// 4 Depends on bRequest</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1ec9b19c0ed1e66e399ad9cf3c4a6537"> 170</a></span>&#160; uint16_t <a class="code" href="struct_s_e_t_u_p___p_k_t.html#a1ec9b19c0ed1e66e399ad9cf3c4a6537">wLength</a>; <span class="comment">// 6 Depends on bRequest</span></div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;} <a class="code" href="struct_s_e_t_u_p___p_k_t.html">SETUP_PKT</a>, *<a class="code" href="_usb_8h.html#af36716855ff65599786d9bdf6e4c11f9">PSETUP_PKT</a>;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;<span class="comment">// Base class for incomming data parser</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"><a class="code" href="class_u_s_b_read_parser.html"> 174</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;{</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_u_s_b_read_parser.html#afdb9cea2a2fe18d26f4ec595b86a7f7c">Parse</a>(<span class="keyword">const</span> uint16_t len, <span class="keyword">const</span> uint8_t *pbuf, <span class="keyword">const</span> uint16_t &amp;offset) = 0;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;};</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="code" href="class_u_s_b.html"> 181</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_u_s_b.html">USB</a> : <span class="keyword">public</span> <a class="code" href="class_m_a_x3421e.html">MAX3421E</a></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;{</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <a class="code" href="class_address_pool_impl.html">AddressPoolImpl&lt;USB_NUMDEVICES&gt;</a> addrPool;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a>* devConfig[<a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>];</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; uint8_t devConfigIndex;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; uint8_t bmHubPre;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="class_u_s_b.html#a8ff8cd03496bdcb0ca26f18878ad299d">USB</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div>
<div class="line"><a name="l00191"></a><span class="lineno"><a class="code" href="class_u_s_b.html#aedcc6c06badd14b6fd3b0dda94269ad4"> 191</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#aedcc6c06badd14b6fd3b0dda94269ad4">SetHubPreMask</a>() { bmHubPre |= <a class="code" href="max3421e_8h.html#a8816c259368604d0de57f31bcb6c1674">bmHUBPRE</a>; };</div>
<div class="line"><a name="l00192"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a5b4de045ea7fefe0fab967ddf44c39b1"> 192</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#a5b4de045ea7fefe0fab967ddf44c39b1">ResetHubPreMask</a>() { bmHubPre &amp;= (~<a class="code" href="max3421e_8h.html#a8816c259368604d0de57f31bcb6c1674">bmHUBPRE</a>); };</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;</div>
<div class="line"><a name="l00194"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4"> 194</a></span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a>&amp; <a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>()</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; {</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="class_address_pool.html">AddressPool</a>&amp;)addrPool;</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; };</div>
<div class="line"><a name="l00198"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2"> 198</a></span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2">RegisterDeviceClass</a>(<a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> *pdev)</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; {</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; i++)</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;<span class="comment">// Base class for incomming data parser</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="code" href="class_u_s_b_read_parser.html"> 176</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;{</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_u_s_b_read_parser.html#afdb9cea2a2fe18d26f4ec595b86a7f7c">Parse</a>(<span class="keyword">const</span> uint16_t len, <span class="keyword">const</span> uint8_t *pbuf, <span class="keyword">const</span> uint16_t &amp;offset) = 0;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;};</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div>
<div class="line"><a name="l00183"></a><span class="lineno"><a class="code" href="class_u_s_b.html"> 183</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_u_s_b.html">USB</a> : <span class="keyword">public</span> <a class="code" href="class_m_a_x3421e.html">MAX3421E</a></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;{</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <a class="code" href="class_address_pool_impl.html">AddressPoolImpl&lt;USB_NUMDEVICES&gt;</a> addrPool;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a>* devConfig[<a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>];</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; uint8_t devConfigIndex;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; uint8_t bmHubPre;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <a class="code" href="class_u_s_b.html#a8ff8cd03496bdcb0ca26f18878ad299d">USB</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div>
<div class="line"><a name="l00193"></a><span class="lineno"><a class="code" href="class_u_s_b.html#aedcc6c06badd14b6fd3b0dda94269ad4"> 193</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#aedcc6c06badd14b6fd3b0dda94269ad4">SetHubPreMask</a>() { bmHubPre |= <a class="code" href="max3421e_8h.html#a8816c259368604d0de57f31bcb6c1674">bmHUBPRE</a>; };</div>
<div class="line"><a name="l00194"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a5b4de045ea7fefe0fab967ddf44c39b1"> 194</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#a5b4de045ea7fefe0fab967ddf44c39b1">ResetHubPreMask</a>() { bmHubPre &amp;= (~<a class="code" href="max3421e_8h.html#a8816c259368604d0de57f31bcb6c1674">bmHUBPRE</a>); };</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;</div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4"> 196</a></span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a>&amp; <a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>()</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; {</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">return</span> (<a class="code" href="class_address_pool.html">AddressPool</a>&amp;)addrPool;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; };</div>
<div class="line"><a name="l00200"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2"> 200</a></span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2">RegisterDeviceClass</a>(<a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> *pdev)</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; {</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">if</span> (!devConfig[i])</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;<a class="code" href="_usb_8h.html#a0282f9f7a0313f957e02449d7313b7b5">USB_NUMDEVICES</a>; i++)</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; {</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; devConfig[i] = pdev;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; }</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; }</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#ad4929f74079f3bc22b00936ae84d18b0">USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS</a>;</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; };</div>
<div class="line"><a name="l00210"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a8346db8f2219f65257d735834940bc42"> 210</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#a8346db8f2219f65257d735834940bc42">ForEachUsbDevice</a>(<a class="code" href="address_8h.html#a90edb051235924cb5280032df397f393">UsbDeviceHandleFunc</a> pfunc)</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; {</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; addrPool.<a class="code" href="class_address_pool_impl.html#a09e6dc797f82543eba0879369116182e">ForEachUsbDevice</a>(pfunc);</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; };</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a1c1aad8269403bf488e3bc4c79886ce4">getUsbTaskState</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#a8ff697d334dc611720419374acd1e5fb">setUsbTaskState</a>( uint8_t state );</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a>* <a class="code" href="class_u_s_b.html#a59ee57083ba492d87ff2947547848d58">getEpInfoEntry</a>( uint8_t addr, uint8_t ep );</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>( uint8_t addr, uint8_t epcount, <a class="code" href="struct_ep_info.html">EpInfo</a>* eprecord_ptr );</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="comment">//uint8_t ctrlReq( uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t nbytes, uint8_t* dataptr);</span></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <span class="keywordflow">if</span> (!devConfig[i])</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; {</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; devConfig[i] = pdev;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; }</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; }</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#ad4929f74079f3bc22b00936ae84d18b0">USB_ERROR_UNABLE_TO_REGISTER_DEVICE_CLASS</a>;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; };</div>
<div class="line"><a name="l00212"></a><span class="lineno"><a class="code" href="class_u_s_b.html#a8346db8f2219f65257d735834940bc42"> 212</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#a8346db8f2219f65257d735834940bc42">ForEachUsbDevice</a>(<a class="code" href="address_8h.html#a90edb051235924cb5280032df397f393">UsbDeviceHandleFunc</a> pfunc)</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; {</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; addrPool.<a class="code" href="class_address_pool_impl.html#a09e6dc797f82543eba0879369116182e">ForEachUsbDevice</a>(pfunc);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; };</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a1c1aad8269403bf488e3bc4c79886ce4">getUsbTaskState</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#a8ff697d334dc611720419374acd1e5fb">setUsbTaskState</a>( uint8_t state );</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a>* <a class="code" href="class_u_s_b.html#a59ee57083ba492d87ff2947547848d58">getEpInfoEntry</a>( uint8_t addr, uint8_t ep );</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>( uint8_t addr, uint8_t epcount, <a class="code" href="struct_ep_info.html">EpInfo</a>* eprecord_ptr );</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="comment">/* Control requests */</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">getDevDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr );</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr );</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>( uint8_t addr, uint8_t ep, uint8_t conf, <a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a> *p );</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="comment">//uint8_t ctrlReq( uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, uint16_t wInd, uint16_t nbytes, uint8_t* dataptr);</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="comment">/* Control requests */</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">getDevDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr );</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr );</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833">getStrDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr );</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( uint8_t oldaddr, uint8_t ep, uint8_t newaddr );</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>( uint8_t addr, uint8_t ep, uint8_t conf_value );</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a994f9488ac6f91040c42d9b816d202c6">ctrlData</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr, <span class="keywordtype">boolean</span> direction );</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#ab18915ffbd8a70ac5bd6abc3e0f3c66a">ctrlStatus</a>( uint8_t ep, <span class="keywordtype">boolean</span> direction, uint16_t nak_limit );</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>( uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data );</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data );</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a343d4b321cf8e99f0504cb04c7ce8b10">dispatchPkt</a>( uint8_t token, uint8_t ep, uint16_t nak_limit );</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#aff8d1b2009c760bc27fb12762bd3c9b6">Task</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>( uint8_t addr, uint8_t ep, uint8_t conf, <a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a> *p );</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833">getStrDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t index, uint16_t langid, uint8_t* dataptr );</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( uint8_t oldaddr, uint8_t ep, uint8_t newaddr );</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>( uint8_t addr, uint8_t ep, uint8_t conf_value );</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; </div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a994f9488ac6f91040c42d9b816d202c6">ctrlData</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr, <span class="keywordtype">boolean</span> direction );</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#ab18915ffbd8a70ac5bd6abc3e0f3c66a">ctrlStatus</a>( uint8_t ep, <span class="keywordtype">boolean</span> direction, uint16_t nak_limit );</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>( uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data );</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data );</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a343d4b321cf8e99f0504cb04c7ce8b10">dispatchPkt</a>( uint8_t token, uint8_t ep, uint16_t nak_limit );</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a5eb0d31372d26f0015a0d7be0b9ff4e1">DefaultAddressing</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#af4008dfc1c2d15c23cf8a7815cc17765">Configuring</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#ac681c6c98e1641f705bc14d670a2663a">ReleaseDevice</a>(uint8_t addr);</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, </div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, <a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a> *p);</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="keywordtype">void</span> init();</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; uint8_t SetAddress(uint8_t addr, uint8_t ep, <a class="code" href="struct_ep_info.html">EpInfo</a> **ppep, uint16_t &amp;nak_limit);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; uint8_t OutTransfer(<a class="code" href="struct_ep_info.html">EpInfo</a> *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data);</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; uint8_t InTransfer (<a class="code" href="struct_ep_info.html">EpInfo</a> *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data);</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;};</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;<span class="preprocessor">#if 0 //defined(USB_METHODS_INLINE)</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;<span class="preprocessor"></span><span class="comment">//get device descriptor</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">USB::getDevDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr ) </div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;{</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, 0x00, <a class="code" href="usb__ch9_8h.html#ac6d0566773ed4549fe1a7a932e6c46de">USB_DESCRIPTOR_DEVICE</a>, 0x0000, nbytes, dataptr ));</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;}</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;<span class="comment">//get configuration descriptor </span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">USB::getConfDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr ) </div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;{</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, conf, <a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7">USB_DESCRIPTOR_CONFIGURATION</a>, 0x0000, nbytes, dataptr ));</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;}</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="comment">//get string descriptor</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833">USB::getStrDescr</a>( uint8_t addr, uint8_t ep, uint16_t nuint8_ts, uint8_t index, uint16_t langid, uint8_t* dataptr ) </div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;{</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, index, <a class="code" href="usb__ch9_8h.html#abbad38caa1ca9c52f47adccd3a850aed">USB_DESCRIPTOR_STRING</a>, langid, nuint8_ts, dataptr ));</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;}</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160;<span class="comment">//set address </span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">USB::setAddr</a>( uint8_t oldaddr, uint8_t ep, uint8_t newaddr ) </div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;{</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( oldaddr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#ac87659819bfd6491120c819fae2d46bc">USB_REQUEST_SET_ADDRESS</a>, newaddr, 0x00, 0x0000, 0x0000, NULL ));</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;}</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;<span class="comment">//set configuration</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">USB::setConf</a>( uint8_t addr, uint8_t ep, uint8_t conf_value ) </div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;{</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#aadef005acc40340955d34d9767ef297c">USB_REQUEST_SET_CONFIGURATION</a>, conf_value, 0x00, 0x0000, 0x0000, NULL )); </div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;}</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160;</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160;<span class="preprocessor">#endif // defined(USB_METHODS_INLINE)</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;<span class="preprocessor">#endif //_usb_h_</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_u_s_b.html#aff8d1b2009c760bc27fb12762bd3c9b6">Task</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a5eb0d31372d26f0015a0d7be0b9ff4e1">DefaultAddressing</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#af4008dfc1c2d15c23cf8a7815cc17765">Configuring</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#ac681c6c98e1641f705bc14d670a2663a">ReleaseDevice</a>(uint8_t addr);</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; uint8_t <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bRequest, uint8_t wValLo, uint8_t wValHi, </div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; uint16_t wInd, uint16_t total, uint16_t nbytes, uint8_t* dataptr, <a class="code" href="class_u_s_b_read_parser.html">USBReadParser</a> *p);</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordtype">void</span> init();</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; uint8_t SetAddress(uint8_t addr, uint8_t ep, <a class="code" href="struct_ep_info.html">EpInfo</a> **ppep, uint16_t &amp;nak_limit);</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; uint8_t OutTransfer(<a class="code" href="struct_ep_info.html">EpInfo</a> *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; uint8_t InTransfer (<a class="code" href="struct_ep_info.html">EpInfo</a> *pep, uint16_t nak_limit, uint16_t *nbytesptr, uint8_t *data);</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;};</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;<span class="preprocessor">#if 0 //defined(USB_METHODS_INLINE)</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;<span class="preprocessor"></span><span class="comment">//get device descriptor</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">USB::getDevDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr ) </div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;{</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, 0x00, <a class="code" href="usb__ch9_8h.html#ac6d0566773ed4549fe1a7a932e6c46de">USB_DESCRIPTOR_DEVICE</a>, 0x0000, nbytes, dataptr ));</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;}</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;<span class="comment">//get configuration descriptor </span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">USB::getConfDescr</a>( uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t conf, uint8_t* dataptr ) </div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;{</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, conf, <a class="code" href="usb__ch9_8h.html#aa17b365c4eb8bd2f6a4d4e4fb5f881c7">USB_DESCRIPTOR_CONFIGURATION</a>, 0x0000, nbytes, dataptr ));</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;}</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;<span class="comment">//get string descriptor</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a372ecbe1d23955e8b04b5e95e0e4a833">USB::getStrDescr</a>( uint8_t addr, uint8_t ep, uint16_t nuint8_ts, uint8_t index, uint16_t langid, uint8_t* dataptr ) </div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;{</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#a060f3a6423f1e3640aa7b14d5ce72285">bmREQ_GET_DESCR</a>, <a class="code" href="usb__ch9_8h.html#a3572226ee2137c7fbf7487a02b0f560f">USB_REQUEST_GET_DESCRIPTOR</a>, index, <a class="code" href="usb__ch9_8h.html#abbad38caa1ca9c52f47adccd3a850aed">USB_DESCRIPTOR_STRING</a>, langid, nuint8_ts, dataptr ));</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;}</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;<span class="comment">//set address </span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">USB::setAddr</a>( uint8_t oldaddr, uint8_t ep, uint8_t newaddr ) </div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;{</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( oldaddr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#ac87659819bfd6491120c819fae2d46bc">USB_REQUEST_SET_ADDRESS</a>, newaddr, 0x00, 0x0000, 0x0000, NULL ));</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;}</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="comment">//set configuration</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;<span class="keyword">inline</span> uint8_t <a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">USB::setConf</a>( uint8_t addr, uint8_t ep, uint8_t conf_value ) </div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;{</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( addr, ep, <a class="code" href="_usb_8h.html#af4965e768593007eacde7644979f56da">bmREQ_SET</a>, <a class="code" href="usb__ch9_8h.html#aadef005acc40340955d34d9767ef297c">USB_REQUEST_SET_CONFIGURATION</a>, conf_value, 0x00, 0x0000, 0x0000, NULL )); </div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160;}</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;<span class="preprocessor">#endif // defined(USB_METHODS_INLINE)</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;<span class="preprocessor">#endif //_usb_h_</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -99,7 +99,9 @@ Include dependency graph for Wii.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_wii_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_wii_8cpp">
<area shape="rect" id="node2" href="_wii_8h.html" title="Wii.h" alt="" coords="597,93,637,115"/><area shape="rect" id="node3" href="_b_t_d_8h.html" title="BTD.h" alt="" coords="549,163,594,184"/><area shape="rect" id="node21" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="619,163,705,184"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="342,232,385,253"/><area shape="rect" id="node19" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="708,232,791,253"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="251,371,305,392"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="159,371,226,392"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="175,301,231,323"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="349,371,407,392"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="41,301,98,323"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="721,440,778,461"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="634,371,695,392"/><area shape="rect" id="node18" href="message_8h.html" title="message.h" alt="" coords="719,371,781,392"/><area shape="rect" id="node20" href="parsetools_8h.html" title="parsetools.h" alt="" coords="788,301,853,323"/></map>
</div>
</div><table class="memberdecls">
</div>
<p><a href="_wii_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad72dbcf6d0153db1b8d8a58001feed83"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_wii_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a></td></tr>
@ -107,8 +109,8 @@ Macros</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ab8c57bec05e4992c35dfc1f432f02ce2"><td class="memItemLeft" align="right" valign="top">const uint8_t LEDS[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_wii_8cpp.html#ab8c57bec05e4992c35dfc1f432f02ce2">PROGMEM</a></td></tr>
<tr class="separator:ab8c57bec05e4992c35dfc1f432f02ce2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa59a533c04572a9aa97676c8e9a40d80"><td class="memItemLeft" align="right" valign="top">const uint8_t LEDS[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_wii_8cpp.html#aa59a533c04572a9aa97676c8e9a40d80">PROGMEM</a></td></tr>
<tr class="separator:aa59a533c04572a9aa97676c8e9a40d80"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ad72dbcf6d0153db1b8d8a58001feed83"></a>
@ -121,15 +123,17 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8cpp_source.html#l00023">23</a> of file <a class="el" href="_wii_8cpp_source.html">Wii.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="ab8c57bec05e4992c35dfc1f432f02ce2"></a>
<a class="anchor" id="aa59a533c04572a9aa97676c8e9a40d80"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const uint32_t BUTTONS [] PROGMEM</td>
<td class="memname">const uint32_t PROCONTROLLERBUTTONS [] PROGMEM</td>
</tr>
</table>
</div><div class="memdoc">
@ -147,12 +151,14 @@ Variables</h2></td></tr>
<div class="line"> 0xF0 </div>
<div class="line"> }</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="_wii_8cpp_source.html#l00027">27</a> of file <a class="el" href="_wii_8cpp_source.html">Wii.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

1257
_wii_8cpp_source.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -118,6 +118,8 @@ Classes</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a8a70a2d3fd20f9005aa8dc5849beb147"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_wii_8h.html#a8a70a2d3fd20f9005aa8dc5849beb147">WIICAMERA</a></td></tr>
<tr class="separator:a8a70a2d3fd20f9005aa8dc5849beb147"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15cc1db556ad9a4ec6144ca8a42f8919"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_wii_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919">L2CAP_WAIT</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a15cc1db556ad9a4ec6144ca8a42f8919"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abac08b5b24a1cd2b12517cd9aa6c616b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_wii_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b">L2CAP_CONTROL_SUCCESS</a>&#160;&#160;&#160;1</td></tr>
@ -207,6 +209,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00046">46</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a44edf5415459cba3cc378992fef7560b"></a>
@ -219,6 +223,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00045">45</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a39a58b19fb4ef26cf503ed57a43570a4"></a>
@ -231,6 +237,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00067">67</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9b3e87e1f460bc011e69f5e53e79c104"></a>
@ -243,6 +251,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00068">68</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="acaec1ddc53593c80dc625c1f361e3a24"></a>
@ -255,6 +265,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00065">65</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac72a2b645fafc5bdbd85c1f59cc937cc"></a>
@ -267,6 +279,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00066">66</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a728c7d92dd341dcc1b8f4bf95bb4826d"></a>
@ -279,6 +293,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00071">71</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9fa7bceb44bbdff3229fd431627b9868"></a>
@ -291,6 +307,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00072">72</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="aaaf733ee2c84bd8df4d24f2ae1f3b378"></a>
@ -303,6 +321,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00040">40</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a68bcdd68c269cd7970d5271a00bbe5fe"></a>
@ -315,6 +335,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00039">39</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9b5140e7ca5941e5535c575255ffc1cc"></a>
@ -327,6 +349,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00052">52</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="abac08b5b24a1cd2b12517cd9aa6c616b"></a>
@ -339,6 +363,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00035">35</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7f0cab74308e812106252c53b18c0391"></a>
@ -351,6 +377,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00069">69</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a667178a4486c4dee88e052b3562362cd"></a>
@ -363,6 +391,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00070">70</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae4da52ca67e1f8b977199b24e8f3a400"></a>
@ -375,6 +405,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00049">49</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0c444d5d06ec604820d426556c2f38d7"></a>
@ -387,6 +419,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00057">57</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2b3cdcd3124251a40ce825da0d8dcb6f"></a>
@ -399,6 +433,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00058">58</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a969a1ee84797f3ee5006c41f67373f96"></a>
@ -411,6 +447,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00061">61</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a015f3b25bd7a2908c84b973dec453f45"></a>
@ -423,6 +461,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00062">62</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2e5a9c283f0912833f3e0418d3feadd7"></a>
@ -435,6 +475,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00055">55</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a27057737ae0b2246442511c01eeed192"></a>
@ -447,6 +489,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00059">59</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="acc096a05301f3cbdece4ad372cc149c3"></a>
@ -459,6 +503,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00060">60</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="aad823543553cc7500ac49d7479eb858f"></a>
@ -471,6 +517,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00056">56</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a291cf8ab9832ac643cdbeaa5f0b84ed1"></a>
@ -483,6 +531,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00047">47</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a73e3a81d9a8850075fd10933acc5a035"></a>
@ -495,6 +545,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00043">43</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="af0b913a7e9e54b1f6ab95d82bd36f954"></a>
@ -507,6 +559,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00041">41</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab569b2085ad29f41d1da9c0ed352bd65"></a>
@ -519,6 +573,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00051">51</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac7aa7fd7a8a34a6c9e420e3cb114737b"></a>
@ -531,6 +587,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00036">36</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a11f7dbb22bf86e28848abc165e22c2de"></a>
@ -543,6 +601,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00048">48</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a15cc1db556ad9a4ec6144ca8a42f8919"></a>
@ -555,6 +615,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00032">32</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3d4b4f06162f96e91d97650f5c2e60f7"></a>
@ -567,6 +629,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00078">78</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7ae9154397104e4df34302ed0884bbfb"></a>
@ -579,6 +643,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00079">79</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8f0b5b0dedaf5c25c4887f03ebfdd425"></a>
@ -591,6 +657,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00081">81</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a34631633d4557244dc8eda52e8505acd"></a>
@ -603,6 +671,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00075">75</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae0ff99c8862a05df8877329982e1ef61"></a>
@ -615,6 +685,23 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00076">76</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8a70a2d3fd20f9005aa8dc5849beb147"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define WIICAMERA</td>
</tr>
</table>
</div><div class="memdoc">
<p>You will have to uncomment this to use the IR camera </p>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00029">29</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
@ -627,19 +714,24 @@ Enumerations</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Enum used to read the joystick on the Nunchuck. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d"></a>HatX</em>&nbsp;</td><td class="fielddoc">
<p>Read the x-axis on the Nunchuck joystick. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b"></a>HatY</em>&nbsp;</td><td class="fielddoc">
<p>Read the y-axis on the Nunchuck joystick. </p>
</td></tr>
</table>
<p>Definition at line <a class="el" href="_wii_8h_source.html#l00084">84</a> of file <a class="el" href="_wii_8h_source.html">Wii.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -115,248 +115,233 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_b_t_d_8h.html">BTD.h</a>&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="controller_enums_8h.html">controllerEnums.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="comment">//#define WIICAMERA //uncomment to enable IR camera</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment">/* Bluetooth L2CAP states for L2CAP_task() */</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="_wii_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919"> 31</a></span>&#160;<span class="preprocessor">#define L2CAP_WAIT 0</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="comment">// These states are used if the Wiimote is the host</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="code" href="_wii_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b"> 34</a></span>&#160;<span class="preprocessor">#define L2CAP_CONTROL_SUCCESS 1</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="_wii_8h.html#ac7aa7fd7a8a34a6c9e420e3cb114737b"> 35</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INTERRUPT_SETUP 2</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment">// These states are used if the Arduino is the host</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="_wii_8h.html#a68bcdd68c269cd7970d5271a00bbe5fe"> 38</a></span>&#160;<span class="preprocessor">#define L2CAP_CONTROL_CONNECT_REQUEST 3</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="_wii_8h.html#aaaf733ee2c84bd8df4d24f2ae1f3b378"> 39</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CONTROL_CONFIG_REQUEST 4</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="_wii_8h.html#af0b913a7e9e54b1f6ab95d82bd36f954"> 40</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INTERRUPT_CONNECT_REQUEST 5</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor"></span> </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="code" href="_wii_8h.html#a73e3a81d9a8850075fd10933acc5a035"> 42</a></span>&#160;<span class="preprocessor">#define L2CAP_INTERRUPT_CONFIG_REQUEST 6</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="_wii_8h.html#a44edf5415459cba3cc378992fef7560b"> 44</a></span>&#160;<span class="preprocessor">#define L2CAP_CHECK_MOTION_PLUS_STATE 7</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="_wii_8h.html#ab84d043703110a74ba9b8d7afa30c5de"> 45</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CHECK_EXTENSION_STATE 8</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_wii_8h.html#a291cf8ab9832ac643cdbeaa5f0b84ed1"> 46</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INIT_MOTION_PLUS_STATE 9</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="_wii_8h.html#a11f7dbb22bf86e28848abc165e22c2de"> 47</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_LED_STATE 10</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_wii_8h.html#ae4da52ca67e1f8b977199b24e8f3a400"> 48</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_DONE 11</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="_wii_8h.html#ab569b2085ad29f41d1da9c0ed352bd65"> 50</a></span>&#160;<span class="preprocessor">#define L2CAP_INTERRUPT_DISCONNECT 12</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9b5140e7ca5941e5535c575255ffc1cc"> 51</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CONTROL_DISCONNECT 13</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="comment">/* L2CAP event flags */</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_wii_8h.html#a2e5a9c283f0912833f3e0418d3feadd7"> 54</a></span>&#160;<span class="preprocessor">#define L2CAP_FLAG_CONTROL_CONNECTED 0x001</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_wii_8h.html#aad823543553cc7500ac49d7479eb858f"> 55</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_INTERRUPT_CONNECTED 0x002</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_wii_8h.html#a0c444d5d06ec604820d426556c2f38d7"> 56</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS 0x004</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_wii_8h.html#a2b3cdcd3124251a40ce825da0d8dcb6f"> 57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS 0x008</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_wii_8h.html#a27057737ae0b2246442511c01eeed192"> 58</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE 0x040</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="_wii_8h.html#acc096a05301f3cbdece4ad372cc149c3"> 59</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE 0x080</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="_wii_8h.html#a969a1ee84797f3ee5006c41f67373f96"> 60</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST 0x100</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_wii_8h.html#a015f3b25bd7a2908c84b973dec453f45"> 61</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST 0x200</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="comment">/* Macros for L2CAP event flag tests */</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="_wii_8h.html#acaec1ddc53593c80dc625c1f361e3a24"> 64</a></span>&#160;<span class="preprocessor">#define l2cap_connected_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONTROL_CONNECTED)</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="_wii_8h.html#ac72a2b645fafc5bdbd85c1f59cc937cc"> 65</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connected_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_INTERRUPT_CONNECTED)</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="_wii_8h.html#a39a58b19fb4ef26cf503ed57a43570a4"> 66</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9b3e87e1f460bc011e69f5e53e79c104"> 67</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="_wii_8h.html#a7f0cab74308e812106252c53b18c0391"> 68</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="_wii_8h.html#a667178a4486c4dee88e052b3562362cd"> 69</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="_wii_8h.html#a728c7d92dd341dcc1b8f4bf95bb4826d"> 70</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9fa7bceb44bbdff3229fd431627b9868"> 71</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)</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;<span class="comment">/* Wii event flags */</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="_wii_8h.html#a34631633d4557244dc8eda52e8505acd"> 74</a></span>&#160;<span class="preprocessor">#define WII_FLAG_MOTION_PLUS_CONNECTED 0x400</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="_wii_8h.html#ae0ff99c8862a05df8877329982e1ef61"> 75</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WII_FLAG_NUNCHUCK_CONNECTED 0x800</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3d4b4f06162f96e91d97650f5c2e60f7"> 77</a></span>&#160;<span class="preprocessor">#define motion_plus_connected_flag (l2cap_event_flag &amp; WII_FLAG_MOTION_PLUS_CONNECTED)</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="_wii_8h.html#a7ae9154397104e4df34302ed0884bbfb"> 78</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define nunchuck_connected_flag (l2cap_event_flag &amp; WII_FLAG_NUNCHUCK_CONNECTED)</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"><a class="code" href="_wii_8h.html#a8f0b5b0dedaf5c25c4887f03ebfdd425"> 80</a></span>&#160;<span class="preprocessor">#define PAIR 1</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7"> 82</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7">Hat</a> {</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d"> 83</a></span>&#160; <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d">HatX</a> = 0,</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b"> 84</a></span>&#160; <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b">HatY</a> = 1,</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;};</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="class_w_i_i.html"> 87</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_w_i_i.html">WII</a> : <span class="keyword">public</span> <a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <a class="code" href="class_w_i_i.html#a6597cb0e240a8ccb4ebdb236daef712e">WII</a>(<a class="code" href="class_b_t_d.html">BTD</a> *p, <span class="keywordtype">bool</span> pair=<span class="keyword">false</span>);</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="comment">// BluetoothService implementation</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">ACLData</a>(uint8_t* <a class="code" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">ACLData</a>); <span class="comment">// Used to pass acldata to the services</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#ac5cd06f3e9aa2a0d9b9691f00c047e72">Run</a>(); <span class="comment">// Used to run part of the state maschine</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a769ee2f9a0088da097438bc3cc677f7c">Reset</a>(); <span class="comment">// Use this to reset the service</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#aabe4780f258dada1c0564a4ac7607370">disconnect</a>(); <span class="comment">// Use this void to disconnect any of the controllers</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="comment">/*</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="comment"> getButtonPress will return true as long as the button is held down</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="comment"> While getButtonClick will only return it once</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="comment"> So you instance if you need to increase a variable once you would use getButtonClick,</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="comment"> but if you need to drive a robot forward you would use getButtonPress</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#acf4b3ef0a4fa0cf71133a22213361288">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b); <span class="comment">// This will read true as long as the button is held down</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#adbf9ccb1725dc432e07ca19468713116">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b); <span class="comment">// This will only be true when the button is clicked the first time</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; uint8_t <a class="code" href="class_w_i_i.html#ab16e907132354be9848fd91a6a5171db">getAnalogHat</a>(<a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7">Hat</a> a); <span class="comment">// Used to read the joystick of the Nunchuck</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e"> 108</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e">getPitch</a>() { <span class="keywordflow">return</span> pitch; }; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a6ac037d884f97319892e8671ef070c03"> 109</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a6ac037d884f97319892e8671ef070c03">getRoll</a>() { <span class="keywordflow">return</span> roll; }; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae92e129c54c8131f4a2c55582dfd2f11"> 110</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ae92e129c54c8131f4a2c55582dfd2f11">getYaw</a>() { <span class="keywordflow">return</span> <a class="code" href="class_w_i_i.html#a988db5b35cfc3c543f93f49587a50e62">gyroYaw</a>; }; <span class="comment">// This is the yaw calculated by the gyro</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a6e97bfcfb134b63d7190ba1bc326e1d3">setAllOff</a>(); <span class="comment">// Turn both rumble and all LEDs off</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a2c5c32841b020b248f757cb793acb936">setRumbleOff</a>();</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a0d9c869bd3677c4488a586c38558a137">setRumbleOn</a>();</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a841396b533cccccb05db37d35f6fef9c">setRumbleToggle</a>();</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a7efe7577ba30c218f6fbd3804a53d242">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a3a7b9dd571c5a8597bfb194000bd517c">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#af7755e2b2a161a550c99de2ca1018ce3">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a5d3b4a33ebc2ca9ebb154e10a05dbdd4">setLedStatus</a>(); <span class="comment">// This will set the LEDs, so the user can see which connections are active</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae25a8ea1b0713801e0209e795b4596fa"> 121</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#ae25a8ea1b0713801e0209e795b4596fa">wiimoteConnected</a>; <span class="comment">// Variable used to indicate if a Wiimote is connected</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a7cb4cec343c65fd350e6b05043d7f1a8"> 122</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a7cb4cec343c65fd350e6b05043d7f1a8">nunchuckConnected</a>; <span class="comment">// Variable used to indicate if a Nunchuck controller is connected</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a72bd4fad2e524276712a154b8cc2a16c"> 123</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a72bd4fad2e524276712a154b8cc2a16c">motionPlusConnected</a>; <span class="comment">// Variable used to indicate if a Nunchuck controller is connected</span></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">/* IMU Data, might be usefull if you need to do something more advanced than just calculating the angle */</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a304f56df9aae4a756b0ef34fc4aafc60"> 127</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a304f56df9aae4a756b0ef34fc4aafc60">wiiMotePitch</a>; <span class="comment">// Pitch and roll calculated from the accelerometer inside the Wiimote</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a6329a10968e53b88132eda72807003ed"> 128</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a6329a10968e53b88132eda72807003ed">wiiMoteRoll</a>;</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a2b5a934a1be4d7c5e788d3742dd09cbf"> 129</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a2b5a934a1be4d7c5e788d3742dd09cbf">nunchuckPitch</a>; <span class="comment">// Pitch and roll calculated from the accelerometer inside the Nunchuck</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ad6c01ce2e1f7bac2c8982ecfb3f53f71"> 130</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ad6c01ce2e1f7bac2c8982ecfb3f53f71">nunchuckRoll</a>;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a48bcc2e5c6253d0554d70357625ff3fb"> 132</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a48bcc2e5c6253d0554d70357625ff3fb">accX</a>; <span class="comment">// Accelerometer values used to calculate pitch and roll</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a07bef4e4acd42d680ac676b0e6315b2a"> 133</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a07bef4e4acd42d680ac676b0e6315b2a">accY</a>;</div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a7323e1f8b76f3f11f91cdb9601759cc4"> 134</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a7323e1f8b76f3f11f91cdb9601759cc4">accZ</a>;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="comment">/* Variables for the gyro inside the Motion Plus */</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="class_w_i_i.html#af61f57d34b81f2a878f0126a074e3af4"> 137</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#af61f57d34b81f2a878f0126a074e3af4">gyroPitch</a>; <span class="comment">// This is the pitch calculated by the gyro - use this to tune pitchGyroScale</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a2a0e4745bff7cfec644bcebe984c2bc8"> 138</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a2a0e4745bff7cfec644bcebe984c2bc8">gyroRoll</a>; <span class="comment">// This is the roll calculated by the gyro - use this to tune rollGyroScale</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a988db5b35cfc3c543f93f49587a50e62"> 139</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a988db5b35cfc3c543f93f49587a50e62">gyroYaw</a>; <span class="comment">// This is the yaw calculated by the gyro - use this to tune yawGyroScale</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="class_w_i_i.html#acfb290a86aa9a65dd4ae84d02e3c6ded"> 141</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#acfb290a86aa9a65dd4ae84d02e3c6ded">pitchGyroSpeed</a>; <span class="comment">// The speed in deg/s from the gyro</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a3fb552c6ad486e23434dcb347a2a4b84"> 142</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a3fb552c6ad486e23434dcb347a2a4b84">rollGyroSpeed</a>;</div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ad5df436cc5d073f26bf3ea5c60d788d6"> 143</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ad5df436cc5d073f26bf3ea5c60d788d6">yawGyroSpeed</a>;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="code" href="class_w_i_i.html#aea6ce6f3222df3e547e9957673c7a07a"> 145</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#aea6ce6f3222df3e547e9957673c7a07a">pitchGyroScale</a>; <span class="comment">// You might need to fine-tune these values</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a6c0971ae4c9ab752888a5871020c8331"> 146</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a6c0971ae4c9ab752888a5871020c8331">rollGyroScale</a>;</div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a0694969a30092b9b1dcb26120c7cff73"> 147</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a0694969a30092b9b1dcb26120c7cff73">yawGyroScale</a>;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ab813b65548e827f41a5192fcc34056ea"> 149</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#ab813b65548e827f41a5192fcc34056ea">gyroYawRaw</a>; <span class="comment">// Raw value read directly from the Motion Plus</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a0784c779ebeae2d459996c35a54ee3b8"> 150</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a0784c779ebeae2d459996c35a54ee3b8">gyroRollRaw</a>;</div>
<div class="line"><a name="l00151"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a749ea9dd39ba9a5320c5b24ce93bc544"> 151</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a749ea9dd39ba9a5320c5b24ce93bc544">gyroPitchRaw</a>;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ad4f0d2456c56414f9b8013b85a1ee7d2"> 153</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#ad4f0d2456c56414f9b8013b85a1ee7d2">gyroYawZero</a>; <span class="comment">// These values are set when the controller is first initialized</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a10d91cd5d73bc655be776b44d27004c9"> 154</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a10d91cd5d73bc655be776b44d27004c9">gyroRollZero</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="code" href="class_w_i_i.html#abbc31ecd4495d70258cfa095e34cb3c3"> 155</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#abbc31ecd4495d70258cfa095e34cb3c3">gyroPitchZero</a>;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae946f7d6e9ce89fb083f5f138c0736c2"> 157</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#ae946f7d6e9ce89fb083f5f138c0736c2">getBatteryLevel</a>() { <span class="keywordflow">return</span> batteryLevel; };</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a8e9ac1d379db5c07c478401046a1c0ac"> 158</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#a8e9ac1d379db5c07c478401046a1c0ac">getWiiState</a>() { <span class="keywordflow">return</span> wiiState; };</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;<span class="preprocessor">#ifdef WIICAMERA</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="preprocessor"></span> <span class="comment">/* These are functions for the IR camera */</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keywordtype">void</span> IRinitialize(); <span class="comment">// Initialises the camera as per the steps from http://wiibrew.org/wiki/Wiimote#IR_Camera </span></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; uint16_t getIRx1() { <span class="keywordflow">return</span> IR_object_x1; }; <span class="comment">// IR object 1 x position (0-1023)</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; uint16_t getIRy1() { <span class="keywordflow">return</span> IR_object_y1; }; <span class="comment">// IR object 1 y position (0-767)</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; uint8_t getIRs1() { <span class="keywordflow">return</span> IR_object_s1; }; <span class="comment">// IR object 1 size (0-15)</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; uint16_t getIRx2() { <span class="keywordflow">return</span> IR_object_x2; };</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; uint16_t getIRy2() { <span class="keywordflow">return</span> IR_object_y2; };</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; uint8_t getIRs2() { <span class="keywordflow">return</span> IR_object_s2; };</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; uint16_t getIRx3() { <span class="keywordflow">return</span> IR_object_x3; };</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; uint16_t getIRy3() { <span class="keywordflow">return</span> IR_object_y3; };</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; uint8_t getIRs3() { <span class="keywordflow">return</span> IR_object_s3; };</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; uint16_t getIRx4() { <span class="keywordflow">return</span> IR_object_x4; };</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; uint16_t getIRy4() { <span class="keywordflow">return</span> IR_object_y4; };</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; uint8_t getIRs4() { <span class="keywordflow">return</span> IR_object_s4; };</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordtype">bool</span> isIRCameraEnabled() { <span class="keywordflow">return</span> (wiiState &amp; 0x08); };</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;<span class="preprocessor"></span> </div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="comment">/* Mandatory members */</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="keywordtype">void</span> L2CAP_task(); <span class="comment">// L2CAP state machine</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; </div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">/* Variables filled from HCI event management */</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; uint16_t hci_handle;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it&#39;s already has established a connection</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; </div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="comment">/* variables used by high level L2CAP task */</span> </div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; uint8_t l2cap_state;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; uint16_t l2cap_event_flag;<span class="comment">// l2cap flags of received bluetooth events </span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; </div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; uint8_t hatValues[2];</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; uint8_t HIDBuffer[3];<span class="comment">// Used to store HID commands</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; </div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; uint16_t stateCounter;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordtype">bool</span> unknownExtensionConnected;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="keywordtype">bool</span> extensionConnected;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; </div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; uint8_t control_scid[2]; <span class="comment">// L2CAP source CID for HID_Control</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; uint8_t control_dcid[2]; <span class="comment">// 0x0060</span></div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; uint8_t interrupt_scid[2]; <span class="comment">// L2CAP source CID for HID_Interrupt</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; uint8_t interrupt_dcid[2]; <span class="comment">// 0x0061</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; uint8_t identifier; <span class="comment">// Identifier for connection</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; </div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordtype">void</span> HID_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordtype">void</span> setReportMode(<span class="keywordtype">bool</span> continuous, uint8_t mode);</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keywordtype">void</span> statusRequest();</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; </div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordtype">void</span> writeData(uint32_t offset, uint8_t size, uint8_t* data);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordtype">void</span> initExtension1();</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keywordtype">void</span> initExtension2();</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordtype">void</span> readData(uint32_t offset, uint16_t size, <span class="keywordtype">bool</span> EEPROM);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keywordtype">void</span> readExtensionType();</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordtype">void</span> readCalData();</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; </div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordtype">void</span> checkMotionPresent(); <span class="comment">// Used to see if a Motion Plus is connected to the Wiimote</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordtype">void</span> initMotionPlus();</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="keywordtype">void</span> activateMotionPlus();</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keywordtype">double</span> pitch; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; <span class="keywordtype">double</span> roll; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="keywordtype">bool</span> activateNunchuck;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="keywordtype">bool</span> motionValuesReset; <span class="comment">// This bool is true when the gyro values has been reset</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; uint8_t wiiState; <span class="comment">// Stores the value in l2capinbuf[12] - (0x01: Battery is nearly empty), (0x02: An Extension Controller is connected), (0x04: Speaker enabled), (0x08: IR enabled), (0x10: LED1, 0x20: LED2, 0x40: LED3, 0x80: LED4)</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; uint8_t batteryLevel;</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; </div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;<span class="preprocessor">#ifdef WIICAMERA</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;<span class="preprocessor"></span> <span class="comment">/* Private function and variables for the readings from teh IR Camera */</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="keywordtype">void</span> enableIRCamera1(); <span class="comment">// Sets bit 2 of output report 13 </span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordtype">void</span> enableIRCamera2(); <span class="comment">// Sets bit 2 of output report 1A</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="keywordtype">void</span> writeSensitivityBlock1();</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="keywordtype">void</span> writeSensitivityBlock2();</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="keywordtype">void</span> write0x08Value();</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <span class="keywordtype">void</span> setWiiModeNumber(uint8_t mode_number);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; </div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; uint16_t IR_object_x1; <span class="comment">// IR x position 10 bits</span></div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; uint16_t IR_object_y1; <span class="comment">// IR y position 10 bits</span></div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; uint8_t IR_object_s1; <span class="comment">// IR size value</span></div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; uint16_t IR_object_x2;</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; uint16_t IR_object_y2;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; uint8_t IR_object_s2;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; uint16_t IR_object_x3; <span class="comment">// IR x position 10 bits</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; uint16_t IR_object_y3; <span class="comment">// IR y position 10 bits</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; uint8_t IR_object_s3; <span class="comment">// IR size value</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; uint16_t IR_object_x4;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; uint16_t IR_object_y4;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; uint8_t IR_object_s4;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="preprocessor"></span>};</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="code" href="_wii_8h.html#a8a70a2d3fd20f9005aa8dc5849beb147"> 29</a></span>&#160;<span class="preprocessor">#define WIICAMERA</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="comment">/* Bluetooth L2CAP states for L2CAP_task() */</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="code" href="_wii_8h.html#a15cc1db556ad9a4ec6144ca8a42f8919"> 32</a></span>&#160;<span class="preprocessor">#define L2CAP_WAIT 0</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="comment">// These states are used if the Wiimote is the host</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="_wii_8h.html#abac08b5b24a1cd2b12517cd9aa6c616b"> 35</a></span>&#160;<span class="preprocessor">#define L2CAP_CONTROL_SUCCESS 1</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="_wii_8h.html#ac7aa7fd7a8a34a6c9e420e3cb114737b"> 36</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INTERRUPT_SETUP 2</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="comment">// These states are used if the Arduino is the host</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="_wii_8h.html#a68bcdd68c269cd7970d5271a00bbe5fe"> 39</a></span>&#160;<span class="preprocessor">#define L2CAP_CONTROL_CONNECT_REQUEST 3</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="_wii_8h.html#aaaf733ee2c84bd8df4d24f2ae1f3b378"> 40</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CONTROL_CONFIG_REQUEST 4</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="_wii_8h.html#af0b913a7e9e54b1f6ab95d82bd36f954"> 41</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INTERRUPT_CONNECT_REQUEST 5</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="_wii_8h.html#a73e3a81d9a8850075fd10933acc5a035"> 43</a></span>&#160;<span class="preprocessor">#define L2CAP_INTERRUPT_CONFIG_REQUEST 6</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"><a class="code" href="_wii_8h.html#a44edf5415459cba3cc378992fef7560b"> 45</a></span>&#160;<span class="preprocessor">#define L2CAP_CHECK_MOTION_PLUS_STATE 7</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_wii_8h.html#ab84d043703110a74ba9b8d7afa30c5de"> 46</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CHECK_EXTENSION_STATE 8</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="_wii_8h.html#a291cf8ab9832ac643cdbeaa5f0b84ed1"> 47</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_INIT_MOTION_PLUS_STATE 9</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_wii_8h.html#a11f7dbb22bf86e28848abc165e22c2de"> 48</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_LED_STATE 10</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="code" href="_wii_8h.html#ae4da52ca67e1f8b977199b24e8f3a400"> 49</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_DONE 11</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="_wii_8h.html#ab569b2085ad29f41d1da9c0ed352bd65"> 51</a></span>&#160;<span class="preprocessor">#define L2CAP_INTERRUPT_DISCONNECT 12</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9b5140e7ca5941e5535c575255ffc1cc"> 52</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_CONTROL_DISCONNECT 13</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="comment">/* L2CAP event flags */</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="_wii_8h.html#a2e5a9c283f0912833f3e0418d3feadd7"> 55</a></span>&#160;<span class="preprocessor">#define L2CAP_FLAG_CONTROL_CONNECTED 0x001</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_wii_8h.html#aad823543553cc7500ac49d7479eb858f"> 56</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_INTERRUPT_CONNECTED 0x002</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_wii_8h.html#a0c444d5d06ec604820d426556c2f38d7"> 57</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONFIG_CONTROL_SUCCESS 0x004</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_wii_8h.html#a2b3cdcd3124251a40ce825da0d8dcb6f"> 58</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS 0x008</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="_wii_8h.html#a27057737ae0b2246442511c01eeed192"> 59</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE 0x040</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="_wii_8h.html#acc096a05301f3cbdece4ad372cc149c3"> 60</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE 0x080</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_wii_8h.html#a969a1ee84797f3ee5006c41f67373f96"> 61</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONNECTION_CONTROL_REQUEST 0x100</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="_wii_8h.html#a015f3b25bd7a2908c84b973dec453f45"> 62</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST 0x200</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="comment">/* Macros for L2CAP event flag tests */</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="_wii_8h.html#acaec1ddc53593c80dc625c1f361e3a24"> 65</a></span>&#160;<span class="preprocessor">#define l2cap_connected_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONTROL_CONNECTED)</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="_wii_8h.html#ac72a2b645fafc5bdbd85c1f59cc937cc"> 66</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connected_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_INTERRUPT_CONNECTED)</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="_wii_8h.html#a39a58b19fb4ef26cf503ed57a43570a4"> 67</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONFIG_CONTROL_SUCCESS)</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9b3e87e1f460bc011e69f5e53e79c104"> 68</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONFIG_INTERRUPT_SUCCESS)</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="_wii_8h.html#a7f0cab74308e812106252c53b18c0391"> 69</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_CONTROL_RESPONSE)</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="_wii_8h.html#a667178a4486c4dee88e052b3562362cd"> 70</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_DISCONNECT_INTERRUPT_RESPONSE)</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="_wii_8h.html#a728c7d92dd341dcc1b8f4bf95bb4826d"> 71</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_control_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONNECTION_CONTROL_REQUEST)</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="_wii_8h.html#a9fa7bceb44bbdff3229fd431627b9868"> 72</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_interrupt_flag (l2cap_event_flag &amp; L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;<span class="comment">/* Wii event flags */</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="_wii_8h.html#a34631633d4557244dc8eda52e8505acd"> 75</a></span>&#160;<span class="preprocessor">#define WII_FLAG_MOTION_PLUS_CONNECTED 0x400</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="_wii_8h.html#ae0ff99c8862a05df8877329982e1ef61"> 76</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define WII_FLAG_NUNCHUCK_CONNECTED 0x800</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"><a class="code" href="_wii_8h.html#a3d4b4f06162f96e91d97650f5c2e60f7"> 78</a></span>&#160;<span class="preprocessor">#define motion_plus_connected_flag (l2cap_event_flag &amp; WII_FLAG_MOTION_PLUS_CONNECTED)</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="_wii_8h.html#a7ae9154397104e4df34302ed0884bbfb"> 79</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define nunchuck_connected_flag (l2cap_event_flag &amp; WII_FLAG_NUNCHUCK_CONNECTED)</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="_wii_8h.html#a8f0b5b0dedaf5c25c4887f03ebfdd425"> 81</a></span>&#160;<span class="preprocessor">#define PAIR 1</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7"> 84</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7">Hat</a> {</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d"> 86</a></span>&#160; <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7aed1a7a35bf1b9c1003fbe3dd4a61a06d">HatX</a> = 0,</div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b"> 88</a></span>&#160; <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b">HatY</a> = 1,</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;};</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="class_w_i_i.html"> 96</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_w_i_i.html">WII</a> : <span class="keyword">public</span> <a class="code" href="class_bluetooth_service.html">BluetoothService</a> {</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="class_w_i_i.html#a6597cb0e240a8ccb4ebdb236daef712e">WII</a>(<a class="code" href="class_b_t_d.html">BTD</a> *p, <span class="keywordtype">bool</span> pair=<span class="keyword">false</span>);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">ACLData</a>(uint8_t* <a class="code" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">ACLData</a>);</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#ac5cd06f3e9aa2a0d9b9691f00c047e72">Run</a>();</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a769ee2f9a0088da097438bc3cc677f7c">Reset</a>();</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#aabe4780f258dada1c0564a4ac7607370">disconnect</a>();</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#acf4b3ef0a4fa0cf71133a22213361288">getButtonPress</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#adbf9ccb1725dc432e07ca19468713116">getButtonClick</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; uint8_t <a class="code" href="class_w_i_i.html#ab16e907132354be9848fd91a6a5171db">getAnalogHat</a>(<a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7">Hat</a> a);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; uint16_t <a class="code" href="class_w_i_i.html#ab16e907132354be9848fd91a6a5171db">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e"> 149</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e">getPitch</a>() { <span class="keywordflow">return</span> pitch; };</div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a6ac037d884f97319892e8671ef070c03"> 154</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a6ac037d884f97319892e8671ef070c03">getRoll</a>() { <span class="keywordflow">return</span> roll; };</div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae92e129c54c8131f4a2c55582dfd2f11"> 161</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ae92e129c54c8131f4a2c55582dfd2f11">getYaw</a>() { <span class="keywordflow">return</span> <a class="code" href="class_w_i_i.html#a988db5b35cfc3c543f93f49587a50e62">gyroYaw</a>; };</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; </div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a6e97bfcfb134b63d7190ba1bc326e1d3">setAllOff</a>();</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a2c5c32841b020b248f757cb793acb936">setRumbleOff</a>();</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a0d9c869bd3677c4488a586c38558a137">setRumbleOn</a>();</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a841396b533cccccb05db37d35f6fef9c">setRumbleToggle</a>();</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a7efe7577ba30c218f6fbd3804a53d242">setLedOff</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a3a7b9dd571c5a8597bfb194000bd517c">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#af7755e2b2a161a550c99de2ca1018ce3">setLedToggle</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> a);</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a5d3b4a33ebc2ca9ebb154e10a05dbdd4">setLedStatus</a>();</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;</div>
<div class="line"><a name="l00201"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae946f7d6e9ce89fb083f5f138c0736c2"> 201</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#ae946f7d6e9ce89fb083f5f138c0736c2">getBatteryLevel</a>() { <span class="keywordflow">return</span> batteryLevel; };</div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae25a8ea1b0713801e0209e795b4596fa"> 206</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#a8e9ac1d379db5c07c478401046a1c0ac">getWiiState</a>() { <span class="keywordflow">return</span> wiiState; };</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#ae25a8ea1b0713801e0209e795b4596fa">wiimoteConnected</a>;</div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a7cb4cec343c65fd350e6b05043d7f1a8"> 213</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a7cb4cec343c65fd350e6b05043d7f1a8">nunchuckConnected</a>;</div>
<div class="line"><a name="l00215"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a72bd4fad2e524276712a154b8cc2a16c"> 215</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a72bd4fad2e524276712a154b8cc2a16c">motionPlusConnected</a>;</div>
<div class="line"><a name="l00217"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a461f5b7a5f2bc874e107fc776c284b16"> 217</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a461f5b7a5f2bc874e107fc776c284b16">wiiUProControllerConnected</a>;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="comment">/* IMU Data, might be usefull if you need to do something more advanced than just calculating the angle */</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a1421306c25a76c0fa24f7ee4b10b757b"> 224</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a1421306c25a76c0fa24f7ee4b10b757b">wiimotePitch</a>;</div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ab22594da86218dccf86806b13d6a7a70"> 225</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ab22594da86218dccf86806b13d6a7a70">wiimoteRoll</a>;</div>
<div class="line"><a name="l00230"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a2b5a934a1be4d7c5e788d3742dd09cbf"> 230</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a2b5a934a1be4d7c5e788d3742dd09cbf">nunchuckPitch</a>;</div>
<div class="line"><a name="l00231"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ad6c01ce2e1f7bac2c8982ecfb3f53f71"> 231</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ad6c01ce2e1f7bac2c8982ecfb3f53f71">nunchuckRoll</a>;</div>
<div class="line"><a name="l00236"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a48bcc2e5c6253d0554d70357625ff3fb"> 236</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a48bcc2e5c6253d0554d70357625ff3fb">accX</a>;</div>
<div class="line"><a name="l00237"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a07bef4e4acd42d680ac676b0e6315b2a"> 237</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a07bef4e4acd42d680ac676b0e6315b2a">accY</a>;</div>
<div class="line"><a name="l00238"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a7323e1f8b76f3f11f91cdb9601759cc4"> 238</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a7323e1f8b76f3f11f91cdb9601759cc4">accZ</a>;</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="comment">/* Variables for the gyro inside the Motion Plus */</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"><a class="code" href="class_w_i_i.html#af61f57d34b81f2a878f0126a074e3af4"> 243</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#af61f57d34b81f2a878f0126a074e3af4">gyroPitch</a>;</div>
<div class="line"><a name="l00245"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a2a0e4745bff7cfec644bcebe984c2bc8"> 245</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a2a0e4745bff7cfec644bcebe984c2bc8">gyroRoll</a>;</div>
<div class="line"><a name="l00247"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a988db5b35cfc3c543f93f49587a50e62"> 247</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a988db5b35cfc3c543f93f49587a50e62">gyroYaw</a>;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;</div>
<div class="line"><a name="l00251"></a><span class="lineno"><a class="code" href="class_w_i_i.html#acfb290a86aa9a65dd4ae84d02e3c6ded"> 251</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#acfb290a86aa9a65dd4ae84d02e3c6ded">pitchGyroSpeed</a>;</div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a3fb552c6ad486e23434dcb347a2a4b84"> 252</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#a3fb552c6ad486e23434dcb347a2a4b84">rollGyroSpeed</a>;</div>
<div class="line"><a name="l00253"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ad5df436cc5d073f26bf3ea5c60d788d6"> 253</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="class_w_i_i.html#ad5df436cc5d073f26bf3ea5c60d788d6">yawGyroSpeed</a>;</div>
<div class="line"><a name="l00258"></a><span class="lineno"><a class="code" href="class_w_i_i.html#aea6ce6f3222df3e547e9957673c7a07a"> 258</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#aea6ce6f3222df3e547e9957673c7a07a">pitchGyroScale</a>;</div>
<div class="line"><a name="l00259"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a6c0971ae4c9ab752888a5871020c8331"> 259</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a6c0971ae4c9ab752888a5871020c8331">rollGyroScale</a>;</div>
<div class="line"><a name="l00260"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a0694969a30092b9b1dcb26120c7cff73"> 260</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a0694969a30092b9b1dcb26120c7cff73">yawGyroScale</a>;</div>
<div class="line"><a name="l00265"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ab813b65548e827f41a5192fcc34056ea"> 265</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#ab813b65548e827f41a5192fcc34056ea">gyroYawRaw</a>;</div>
<div class="line"><a name="l00266"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a0784c779ebeae2d459996c35a54ee3b8"> 266</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a0784c779ebeae2d459996c35a54ee3b8">gyroRollRaw</a>;</div>
<div class="line"><a name="l00267"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a749ea9dd39ba9a5320c5b24ce93bc544"> 267</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a749ea9dd39ba9a5320c5b24ce93bc544">gyroPitchRaw</a>;</div>
<div class="line"><a name="l00272"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ad4f0d2456c56414f9b8013b85a1ee7d2"> 272</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#ad4f0d2456c56414f9b8013b85a1ee7d2">gyroYawZero</a>;</div>
<div class="line"><a name="l00273"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a10d91cd5d73bc655be776b44d27004c9"> 273</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#a10d91cd5d73bc655be776b44d27004c9">gyroRollZero</a>;</div>
<div class="line"><a name="l00274"></a><span class="lineno"><a class="code" href="class_w_i_i.html#abbc31ecd4495d70258cfa095e34cb3c3"> 274</a></span>&#160; int16_t <a class="code" href="class_w_i_i.html#abbc31ecd4495d70258cfa095e34cb3c3">gyroPitchZero</a>;</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="preprocessor">#ifdef WIICAMERA</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_w_i_i.html#a3505abbc01c71d134ce301dfb7c0c5b5">IRinitialize</a>();</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;</div>
<div class="line"><a name="l00285"></a><span class="lineno"><a class="code" href="class_w_i_i.html#af380eb3bf65ce33a60aaf35f74a44f6d"> 285</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#af380eb3bf65ce33a60aaf35f74a44f6d">getIRx1</a>() { <span class="keywordflow">return</span> IR_object_x1; };</div>
<div class="line"><a name="l00287"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a341b9a50bfdb18af9c66a3079e5804d9"> 287</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a341b9a50bfdb18af9c66a3079e5804d9">getIRy1</a>() { <span class="keywordflow">return</span> IR_object_y1; };</div>
<div class="line"><a name="l00289"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a2d8fd822e6e9c271d59c71dc7b757421"> 289</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#a2d8fd822e6e9c271d59c71dc7b757421">getIRs1</a>() { <span class="keywordflow">return</span> IR_object_s1; };</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;</div>
<div class="line"><a name="l00292"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a551e48a50c7b60722e807e68ae25f084"> 292</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a551e48a50c7b60722e807e68ae25f084">getIRx2</a>() { <span class="keywordflow">return</span> IR_object_x2; };</div>
<div class="line"><a name="l00294"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae148de3c99b3fb4ef65ea62d2848df7d"> 294</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#ae148de3c99b3fb4ef65ea62d2848df7d">getIRy2</a>() { <span class="keywordflow">return</span> IR_object_y2; };</div>
<div class="line"><a name="l00296"></a><span class="lineno"><a class="code" href="class_w_i_i.html#accf6ca623ffe93b3c78aaf60c7fd1f46"> 296</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#accf6ca623ffe93b3c78aaf60c7fd1f46">getIRs2</a>() { <span class="keywordflow">return</span> IR_object_s2; };</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div>
<div class="line"><a name="l00299"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a5648a03968d0c2331867f9b7bcaa3e3e"> 299</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a5648a03968d0c2331867f9b7bcaa3e3e">getIRx3</a>() { <span class="keywordflow">return</span> IR_object_x3; };</div>
<div class="line"><a name="l00301"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a5e778f879c6d0a73a94bd61e42d05b8d"> 301</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a5e778f879c6d0a73a94bd61e42d05b8d">getIRy3</a>() { <span class="keywordflow">return</span> IR_object_y3; };</div>
<div class="line"><a name="l00303"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a05841e1975803d561f80aeb3dd0a4a1e"> 303</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#a05841e1975803d561f80aeb3dd0a4a1e">getIRs3</a>() { <span class="keywordflow">return</span> IR_object_s3; };</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160;</div>
<div class="line"><a name="l00306"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a7a92d63c7cf9d3d5b38bdb9ad4d7ef66"> 306</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a7a92d63c7cf9d3d5b38bdb9ad4d7ef66">getIRx4</a>() { <span class="keywordflow">return</span> IR_object_x4; };</div>
<div class="line"><a name="l00308"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a759837b933f63ce7c3235639be29250a"> 308</a></span>&#160; uint16_t <a class="code" href="class_w_i_i.html#a759837b933f63ce7c3235639be29250a">getIRy4</a>() { <span class="keywordflow">return</span> IR_object_y4; };</div>
<div class="line"><a name="l00310"></a><span class="lineno"><a class="code" href="class_w_i_i.html#aef56b9f37422b0a41642b39d10db0735"> 310</a></span>&#160; uint8_t <a class="code" href="class_w_i_i.html#aef56b9f37422b0a41642b39d10db0735">getIRs4</a>() { <span class="keywordflow">return</span> IR_object_s4; };</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160;</div>
<div class="line"><a name="l00317"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a0a444d7e348026e062751cf723877e8f"> 317</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_w_i_i.html#a0a444d7e348026e062751cf723877e8f">isIRCameraEnabled</a>() { <span class="keywordflow">return</span> (wiiState &amp; 0x08); };</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;<span class="preprocessor"></span> </div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; <span class="comment">/* Mandatory members */</span></div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; <a class="code" href="class_b_t_d.html">BTD</a> *pBtd;</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; </div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; <span class="keywordtype">void</span> L2CAP_task(); <span class="comment">// L2CAP state machine</span></div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; </div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <span class="comment">/* Variables filled from HCI event management */</span></div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; uint16_t hci_handle;</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it&#39;s already has established a connection</span></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; </div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <span class="comment">/* variables used by high level L2CAP task */</span> </div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; uint8_t l2cap_state;</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; uint16_t l2cap_event_flag;<span class="comment">// l2cap flags of received bluetooth events </span></div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; </div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; uint32_t OldButtonState;</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; uint32_t ButtonClickState;</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; uint16_t hatValues[4];</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; </div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; uint8_t HIDBuffer[3];<span class="comment">// Used to store HID commands</span></div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; </div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; uint16_t stateCounter;</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; <span class="keywordtype">bool</span> unknownExtensionConnected;</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <span class="keywordtype">bool</span> extensionConnected;</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; </div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <span class="comment">/* L2CAP Channels */</span></div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; uint8_t control_scid[2]; <span class="comment">// L2CAP source CID for HID_Control</span></div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; uint8_t control_dcid[2]; <span class="comment">// 0x0060</span></div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; uint8_t interrupt_scid[2]; <span class="comment">// L2CAP source CID for HID_Interrupt</span></div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; uint8_t interrupt_dcid[2]; <span class="comment">// 0x0061</span></div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; uint8_t identifier; <span class="comment">// Identifier for connection</span></div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; </div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; <span class="comment">/* HID Commands */</span></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <span class="keywordtype">void</span> HID_Command(uint8_t* data, uint8_t nbytes);</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; <span class="keywordtype">void</span> setReportMode(<span class="keywordtype">bool</span> continuous, uint8_t mode);</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; <span class="keywordtype">void</span> statusRequest();</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; </div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; <span class="keywordtype">void</span> writeData(uint32_t offset, uint8_t size, uint8_t* data);</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; <span class="keywordtype">void</span> initExtension1();</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; <span class="keywordtype">void</span> initExtension2();</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; </div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; <span class="keywordtype">void</span> readData(uint32_t offset, uint16_t size, <span class="keywordtype">bool</span> EEPROM);</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; <span class="keywordtype">void</span> readExtensionType();</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; <span class="keywordtype">void</span> readCalData();</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; </div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; <span class="keywordtype">void</span> checkMotionPresent(); <span class="comment">// Used to see if a Motion Plus is connected to the Wiimote</span></div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160; <span class="keywordtype">void</span> initMotionPlus();</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160; <span class="keywordtype">void</span> activateMotionPlus();</div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160;</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; <span class="keywordtype">double</span> pitch; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; <span class="keywordtype">double</span> roll; <span class="comment">// Fusioned angle using a complimentary filter if the Motion Plus is connected</span></div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; </div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; <span class="keywordtype">bool</span> activateNunchuck;</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <span class="keywordtype">bool</span> motionValuesReset; <span class="comment">// This bool is true when the gyro values has been reset</span></div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160;</div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; uint8_t wiiState; <span class="comment">// Stores the value in l2capinbuf[12] - (0x01: Battery is nearly empty), (0x02: An Extension Controller is connected), (0x04: Speaker enabled), (0x08: IR enabled), (0x10: LED1, 0x20: LED2, 0x40: LED3, 0x80: LED4)</span></div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; uint8_t batteryLevel;</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; </div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160;<span class="preprocessor">#ifdef WIICAMERA</span></div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160;<span class="preprocessor"></span> <span class="comment">/* Private function and variables for the readings from teh IR Camera */</span></div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; <span class="keywordtype">void</span> enableIRCamera1(); <span class="comment">// Sets bit 2 of output report 13 </span></div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <span class="keywordtype">void</span> enableIRCamera2(); <span class="comment">// Sets bit 2 of output report 1A</span></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="keywordtype">void</span> writeSensitivityBlock1();</div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <span class="keywordtype">void</span> writeSensitivityBlock2();</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; <span class="keywordtype">void</span> write0x08Value();</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; <span class="keywordtype">void</span> setWiiModeNumber(uint8_t mode_number);</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; </div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; uint16_t IR_object_x1; <span class="comment">// IR x position 10 bits</span></div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; uint16_t IR_object_y1; <span class="comment">// IR y position 10 bits</span></div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; uint8_t IR_object_s1; <span class="comment">// IR size value</span></div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; uint16_t IR_object_x2;</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; uint16_t IR_object_y2;</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; uint8_t IR_object_s2;</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; uint16_t IR_object_x3; <span class="comment">// IR x position 10 bits</span></div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; uint16_t IR_object_y3; <span class="comment">// IR y position 10 bits</span></div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; uint8_t IR_object_s3; <span class="comment">// IR size value</span></div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; uint16_t IR_object_x4;</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; uint16_t IR_object_y4;</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; uint8_t IR_object_s4;</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160;<span class="preprocessor"></span>};</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -84,10 +84,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="title">/Users/Lauszus/GitHub/USB_Host_Shield_2.0/WiiCameraReadme.md File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a href="_wii_camera_readme_8md_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -4,7 +4,7 @@
<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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.cpp File Reference</title>
<title>USB_Host_Shield_2.0: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/WiiCameraReadme.md 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>
@ -64,6 +64,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
@ -78,49 +79,30 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> </div>
<div class="headertitle">
<div class="title">XBOXUSB.cpp File Reference</div> </div>
<div class="title">/Users/Lauszus/GitHub/USB_Host_Shield_2.0/WiiCameraReadme.md</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="_x_b_o_x_u_s_b_8h_source.html">XBOXUSB.h</a>&quot;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for XBOXUSB.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_u_s_b_8cpp__incl.png" border="0" usemap="#_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8cpp" alt=""/></div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8cpp">
<area shape="rect" id="node2" href="_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="161,93,228,115"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="381,163,424,184"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="723,301,777,323"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="540,301,607,323"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="666,232,723,253"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="631,301,689,323"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="407,232,464,253"/><area shape="rect" id="node14" href="printhex_8h.html" title="printhex.h" alt="" coords="77,301,133,323"/><area shape="rect" id="node15" href="hexdump_8h.html" title="hexdump.h" alt="" coords="267,232,328,253"/><area shape="rect" id="node17" href="message_8h.html" title="message.h" alt="" coords="173,232,235,253"/></map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad72dbcf6d0153db1b8d8a58001feed83"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a></td></tr>
<tr class="separator:ad72dbcf6d0153db1b8d8a58001feed83"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ad72dbcf6d0153db1b8d8a58001feed83"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DEBUG</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
</div><!-- contents -->
<a href="_wii_camera_readme_8md.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;Please see &lt;http:<span class="comment">//wiibrew.org/wiki/Wiimote#IR_Camera&gt; for the complete capabilities of the Wii camera. The IR camera code was written based on the above website and with support from Kristian Lauszus.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;Must omit the <span class="stringliteral">&quot;.&quot;</span> in the name of the USB_Host_Shiled_2.0 library folder when inserting into the Arudino library folder.</div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;</div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;This library is large, <span class="keywordflow">if</span> you run into memory problems when uploading to the arduino, comment out the #define <a class="code" href="_b_t_d_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a> in the <a class="code" href="class_b_t_d.html">BTD</a>.cpp and Wii.cpp files.</div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;To enable the IR camera code, uncomment #define <a class="code" href="_wii_8h.html#a8a70a2d3fd20f9005aa8dc5849beb147">WIICAMERA</a> in Wii.h.</div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;This library impliments the following settings:</div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;* Report sensitivity mode: 00 00 00 00 00 00 90 00 41 40 00 Suggested by inio (high sensitivity)</div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;* Data Format: Extended mode (0x03). <a class="code" href="_p_s3_enums_8h.html#a67a0db04d321a74b7e7fcfd3f1a3f70ba8b7c5cd8bd8eb51ee6d3fd0eac584679">Full</a> mode is not working yet. The output reports 0x3e and 0x3f need tampering with</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160; * In <span class="keyword">this</span> mode the camera outputs x and y corridinates and a size dimension <span class="keywordflow">for</span> the 4 brightest points.</div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;</div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;Again, read through &lt;http:<span class="comment">//wiibrew.org/wiki/Wiimote#IR_Camera&gt; to get an understanding of the camera and its settings.</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -99,7 +99,9 @@ Include dependency graph for XBOXRECV.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_r_e_c_v_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_r_e_c_v_8cpp">
<area shape="rect" id="node2" href="_x_b_o_x_r_e_c_v_8h.html" title="XBOXRECV.h" alt="" coords="366,93,439,115"/><area shape="rect" id="node4" href="_usb_8h.html" title="Usb.h" alt="" coords="381,163,424,184"/><area shape="rect" id="node18" href="controller_enums_8h.html" title="controllerEnums.h" alt="" coords="449,163,535,184"/><area shape="rect" id="node7" href="avrpins_8h.html" title="avrpins.h" alt="" coords="723,301,777,323"/><area shape="rect" id="node9" href="max3421e_8h.html" title="max3421e.h" alt="" coords="540,301,607,323"/><area shape="rect" id="node10" href="usbhost_8h.html" title="usbhost.h" alt="" coords="666,232,723,253"/><area shape="rect" id="node11" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="631,301,689,323"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="407,232,464,253"/><area shape="rect" id="node14" href="printhex_8h.html" title="printhex.h" alt="" coords="77,301,133,323"/><area shape="rect" id="node15" href="hexdump_8h.html" title="hexdump.h" alt="" coords="267,232,328,253"/><area shape="rect" id="node17" href="message_8h.html" title="message.h" alt="" coords="173,232,235,253"/></map>
</div>
</div><table class="memberdecls">
</div>
<p><a href="_x_b_o_x_r_e_c_v_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad72dbcf6d0153db1b8d8a58001feed83"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83">DEBUG</a></td></tr>
@ -121,6 +123,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8cpp_source.html#l00021">21</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8cpp_source.html">XBOXRECV.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
@ -141,12 +145,14 @@ Variables</h2></td></tr>
<div class="line"> 0x01 </div>
<div class="line"> }</div>
</div><!-- fragment -->
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8cpp_source.html#l00025">25</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8cpp_source.html">XBOXRECV.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -0,0 +1,639 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXRECV.cpp 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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">XBOXRECV.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="_x_b_o_x_r_e_c_v_8cpp.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) 2012 Kristian Lauszus, TKJ Electronics. 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"> Kristian Lauszus, TKJ Electronics</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> Web : http://www.tkjelectronics.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> e-mail : kristianl@tkjelectronics.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"> getBatteryLevel and checkStatus functions made by timstamp.co.uk found using BusHound from Perisoft.net</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_x_b_o_x_r_e_c_v_8h.html">XBOXRECV.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8cpp.html#ad72dbcf6d0153db1b8d8a58001feed83"> 21</a></span>&#160;<span class="preprocessor">#define DEBUG // Uncomment to print data for debugging</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor"></span><span class="comment">//#define EXTRADEBUG // Uncomment to get even more debugging data</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment">//#define PRINTREPORT // Uncomment to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8cpp.html#a2403439df9095a54a47f78fbdae332cd"> 25</a></span>&#160;<span class="keyword">const</span> uint8_t LEDS[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; 0x02, <span class="comment">// LED1</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; 0x03, <span class="comment">// LED2</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; 0x04, <span class="comment">// LED3</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; 0x05, <span class="comment">// LED4</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; 0x01 <span class="comment">// ALL - Used to blink all LEDs</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; };</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="keyword">const</span> uint16_t BUTTONS[] <a class="code" href="acm_2acm__terminal_2pgmstrings_8h.html#a3fa5cb2801cd8b7c78af8a465a662564">PROGMEM</a> = {</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; 0x0100, <span class="comment">// UP</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; 0x0800, <span class="comment">// RIGHT</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; 0x0200, <span class="comment">// DOWN</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; 0x0400, <span class="comment">// LEFT</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; 0x2000, <span class="comment">// BACK</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; 0x1000, <span class="comment">// START</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; 0x4000, <span class="comment">// L3</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; 0x8000, <span class="comment">// R3 </span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; 0,0, <span class="comment">// Skip L2 and R2 as these are analog buttons</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; 0x0001, <span class="comment">// L1</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; 0x0002, <span class="comment">// R1 </span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; 0x0020, <span class="comment">// B</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; 0x0010, <span class="comment">// A</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; 0x0040, <span class="comment">// X</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; 0x0080, <span class="comment">// Y</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; 0x0004, <span class="comment">// XBOX</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; 0x0008 <span class="comment">// SYNC</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;};</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ac856259af28db351f85302b5eddabf1d"> 56</a></span>&#160;<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac856259af28db351f85302b5eddabf1d">XBOXRECV::XBOXRECV</a>(<a class="code" href="class_u_s_b.html">USB</a> *p):</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;pUsb(p), <span class="comment">// pointer to USB class instance - mandatory</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;bAddress(0), <span class="comment">// device address - mandatory</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;bPollEnable(false) { <span class="comment">// don&#39;t start polling before dongle is connected</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0; i&lt;<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>; i++) {</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[i].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (i) ? 0 : 8;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = 0; </div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = (i) ? <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a> : <a class="code" href="address_8h.html#a517dfa014946e2d087d197312234a1de">USB_NAK_MAX_POWER</a>;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; }</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="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>) <span class="comment">// register in USB subsystem</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2">RegisterDeviceClass</a>(<span class="keyword">this</span>); <span class="comment">//set devConfig[] entry</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;}</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"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a07de216bf16a83501d74463c00bf1fc8"> 71</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a07de216bf16a83501d74463c00bf1fc8">XBOXRECV::Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed) {</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; uint8_t buf[<span class="keyword">sizeof</span>(<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="l00073"></a><span class="lineno"> 73</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = NULL;</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *oldep_ptr = NULL;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; uint16_t PID;</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; uint16_t VID;</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">// get memory address of USB device address pool</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>(); </div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXBOXRECV Init&quot;</span>));</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="preprocessor"></span> <span class="comment">// check if address has already been assigned to an instance</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>) {</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>));</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; }</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// Get pointer to pseudo device with address 0 assigned</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(0);</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="keywordflow">if</span> (!p) { </div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>));</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; }</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>) {</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nepinfo is null&quot;</span>));</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; }</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="comment">// Save old pointer to EP_RECORD of address 0</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; oldep_ptr = p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="comment">// Temporary assign new pointer to epInfo to p-&gt;epinfo in order to avoid toggle inconsistence</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="comment">// Get device descriptor</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">getDevDescr</a>(0, 0, <span class="keyword">sizeof</span>(<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>), (uint8_t*)buf);<span class="comment">// Get device descriptor - addr, ep, nbytes, data</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// Restore p-&gt;epinfo</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = oldep_ptr;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordflow">if</span>(rcode)</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordflow">goto</span> FailGetDevDescr;</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; VID = ((<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>*)buf)-&gt;idVendor;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; PID = ((<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>*)buf)-&gt;idProduct;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordflow">if</span>(VID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a> &amp;&amp; VID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>) <span class="comment">// We just check if it&#39;s a xbox receiver using the Vendor ID</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span>(PID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a1a97ce2829a30b96ea6640d387d245a9">XBOX_WIRELESS_RECEIVER_PID</a> &amp;&amp; PID != <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a6842663964e470b86786f046e4bc30d9">XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID</a>) {</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nYou&#39;ll need a wireless receiver for this libary to work&quot;</span>));</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> FailUnknownDevice;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; } </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a> = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; </div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>)</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="comment">// Extract Max Packet Size from device descriptor</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (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">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0; </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( 0, 0, <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a> );</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a> = 0;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetAddr: &quot;</span>));</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;<span class="preprocessor"></span> PrintHex&lt;uint8_t&gt;(rcode);</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; }</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddr: &quot;</span>));</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; PrintHex&lt;uint8_t&gt;(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="preprocessor"></span> p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</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="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>);</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keywordflow">if</span> (!p) </div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed; </div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; </div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, 1, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>);</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; </div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="comment">/* The application will work in reduced host mode, so we can save program and data</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;<span class="comment"> memory space. After verifying the VID we will use known values for the</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="comment"> configuration values for device, interface, endpoints and HID for the XBOX360 Wireless receiver */</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="comment">/* Initialize data structures for endpoints of device */</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x01; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; </div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x03; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x03; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; </div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x05; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x05; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; </div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x07; <span class="comment">// XBOX 360 report endpoint - poll interval 1ms</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0x07; <span class="comment">// XBOX 360 output endpoint - poll interval 8ms</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = <a class="code" href="_p_s3_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>; <span class="comment">// Only poll once for interrupt endpoints</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#ac85bff70ad0e5d71e50cb501f4d8caf3">bmSndToggle</a> = <a class="code" href="max3421e_8h.html#a4834ae7378471b63b9a1985c6294006f">bmSNDTOG0</a>;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a> ].<a class="code" href="struct_ep_info.html#a9238dd40c096baedf041c98b19386a14">bmRcvToggle</a> = <a class="code" href="max3421e_8h.html#aca6a8aa4f0aebbe07c5e175572a92ef7">bmRCVTOG0</a>;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, 9, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>);</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="keywordflow">if</span>( rcode )</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; </div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; delay(200);<span class="comment">//Give time for address change</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; </div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a> ].epAddr, 1);</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; <span class="keywordflow">if</span>( rcode )</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordflow">goto</span> FailSetConf; </div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox Wireless Receiver Connected\r\n&quot;</span>));</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">// successful configuration</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; </div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="comment">/* diagnostic messages */</span> </div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\ngetDevDescr:&quot;</span>));</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail; </div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetDevTblEn:&quot;</span>));</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;FailSetConf:</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nsetConf:&quot;</span>));</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">goto</span> Fail; </div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;FailUnknownDevice:</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nUnknown Device Connected - VID: &quot;</span>));</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; PrintHex&lt;uint16_t&gt;(VID);</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot; PID: &quot;</span>));</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; PrintHex&lt;uint16_t&gt;(PID);</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;<span class="preprocessor"></span> rcode = <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;Fail:</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nXbox 360 Init Failed, error code: &quot;</span>));</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; Serial.print(rcode,HEX);</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160;<span class="preprocessor"></span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">Release</a>();</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;}</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a"> 285</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">XBOXRECV::Release</a>() {</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0;i&lt;4;i++)</div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[i] = 0x00;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>); </div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a> = 0;</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;}</div>
<div class="line"><a name="l00294"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc"> 294</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc">XBOXRECV::Poll</a>() { </div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="keywordflow">if</span> (!bPollEnable)</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <span class="keywordflow">if</span>(!timer || ((millis() - timer) &gt; 3000)) { <span class="comment">// Run checkStatus every 3 seconds</span></div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; timer = millis();</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; checkStatus();</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; }</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; uint8_t inputPipe;</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; uint16_t bufferSize;</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0;i&lt;4;i++) { </div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="keywordflow">switch</span> (i) {</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <span class="keywordflow">case</span> 0: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a2824b25aa9a384c29f27a4e1bb443799">XBOX_INPUT_PIPE_1</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="keywordflow">case</span> 1: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#aab6feb681a78b190190bcc081868a485">XBOX_INPUT_PIPE_2</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="keywordflow">case</span> 2: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a86a3e5765d02bc043d5d1f674a7ffb0f">XBOX_INPUT_PIPE_3</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <span class="keywordflow">case</span> 3: inputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a5acfdaefe74aba1632c71acb79c49671">XBOX_INPUT_PIPE_4</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; }</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; bufferSize = <a class="code" href="_p_s3_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>; <span class="comment">// This is the maximum number of bytes we want to receive</span></div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ inputPipe ].epAddr, &amp;bufferSize, readBuf);</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <span class="keywordflow">if</span>(bufferSize &gt; 0) { <span class="comment">// The number of received bytes</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;Bytes Received: &quot;</span>));</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; Serial.print(bufferSize);</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>));</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;<span class="preprocessor"></span> readReport(i);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;<span class="preprocessor"></span> printReport(i,bufferSize); <span class="comment">// Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160;<span class="preprocessor"></span> }</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; }</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;}</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;</div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160;<span class="keywordtype">void</span> XBOXRECV::readReport(uint8_t controller) {</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; <span class="comment">// This report is send when a controller is connected and disconnected</span></div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <span class="keywordflow">if</span>(readBuf[0] == 0x08 &amp;&amp; readBuf[1] != <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller]) {</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller] = readBuf[1];</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;<span class="preprocessor"></span> <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;Controller &quot;</span>));</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; Serial.print(controller);</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller]) {</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160;<span class="preprocessor"></span> <span class="keywordtype">char</span>* str = 0;</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; <span class="keywordflow">switch</span>(readBuf[1]) {</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; <span class="keywordflow">case</span> 0x80: str = PSTR(<span class="stringliteral">&quot; as controller\r\n&quot;</span>); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; <span class="keywordflow">case</span> 0x40: str = PSTR(<span class="stringliteral">&quot; as headset\r\n&quot;</span>); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; <span class="keywordflow">case</span> 0xC0: str = PSTR(<span class="stringliteral">&quot; as controller+headset\r\n&quot;</span>); <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; } </div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;: connected&quot;</span>));</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(str);</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160;<span class="preprocessor"></span> <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led;</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; <span class="keywordflow">switch</span> (controller) {</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <span class="keywordflow">case</span> 0: led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; <span class="keywordflow">case</span> 1: led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a">LED2</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; <span class="keywordflow">case</span> 2: led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b">LED3</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; <span class="keywordflow">case</span> 3: led = <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342">LED4</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; }</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a9e17aa44f2946e710fb9343f27290c85">setLedOn</a>(controller,led);</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; }</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">else</span></div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;: disconnected\r\n&quot;</span>));</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; }</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; <span class="comment">// Controller status report</span></div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; <span class="keywordflow">if</span>(readBuf[1] == 0x00 &amp;&amp; readBuf[3] &amp; 0x13 &amp;&amp; readBuf[4] &gt;= 0x22) {</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; controllerStatus[controller] = ((uint16_t)readBuf[3] &lt;&lt; 8) | readBuf[4];</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160; }</div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160; <span class="keywordflow">if</span>(readBuf[1] != 0x01) <span class="comment">// Check if it&#39;s the correct report - the receiver also sends different status reports</span></div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; </div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; <span class="comment">// A controller must be connected if it&#39;s sending data</span></div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; <span class="keywordflow">if</span>(!<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller])</div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[controller] |= 0x80;</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160;</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; ButtonState[controller] = (uint32_t)(readBuf[9] | ((uint16_t)readBuf[8] &lt;&lt; 8) | ((uint32_t)readBuf[7] &lt;&lt; 16) | ((uint32_t)readBuf[6] &lt;&lt; 24));</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160; </div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a>] = (int16_t)(((uint16_t)readBuf[11] &lt;&lt; 8) | readBuf[10]);</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a>] = (int16_t)(((uint16_t)readBuf[13] &lt;&lt; 8) | readBuf[12]);</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a>] = (int16_t)(((uint16_t)readBuf[15] &lt;&lt; 8) | readBuf[14]);</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; hatValue[controller][<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a>] = (int16_t)(((uint16_t)readBuf[17] &lt;&lt; 8) | readBuf[16]);</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160; </div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; <span class="comment">//Notify(PSTR(&quot;\r\nButtonState: &quot;));</span></div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <span class="comment">//PrintHex&lt;uint32_t&gt;(ButtonState[controller]);</span></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; </div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <span class="keywordflow">if</span>(ButtonState[controller] != OldButtonState[controller]) {</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; buttonStateChanged[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; ButtonClickState[controller] = (ButtonState[controller] &gt;&gt; 16) &amp; ((~OldButtonState[controller]) &gt;&gt; 16); <span class="comment">// Update click state variable, but don&#39;t include the two trigger buttons L2 and R2</span></div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; <span class="keywordflow">if</span>(((uint8_t)OldButtonState[controller]) == 0 &amp;&amp; ((uint8_t)ButtonState[controller]) != 0) <span class="comment">// The L2 and R2 buttons are special as they are analog buttons</span></div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; R2Clicked[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; <span class="keywordflow">if</span>((uint8_t)(OldButtonState[controller] &gt;&gt; 8) == 0 &amp;&amp; (uint8_t)(ButtonState[controller] &gt;&gt; 8) != 0)</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; L2Clicked[controller] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; OldButtonState[controller] = ButtonState[controller];</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; }</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160;}</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160;</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160;<span class="keywordtype">void</span> XBOXRECV::printReport(uint8_t controller, uint8_t nBytes) { <span class="comment">//Uncomment &quot;#define PRINTREPORT&quot; to print the report send by the Xbox 360 Controller</span></div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160;<span class="preprocessor">#ifdef PRINTREPORT</span></div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span> (readBuf == NULL)</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;Controller &quot;</span>));</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; Serial.print(controller);</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;: &quot;</span>));</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; <span class="keywordflow">for</span>(uint8_t i = 0; i &lt; nBytes;i++) {</div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160; PrintHex&lt;uint8_t&gt;(readBuf[i]);</div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; Serial.print(<span class="stringliteral">&quot; &quot;</span>);</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; }</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; Serial.println();</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00410"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ad33cd16d10e438bb8051f7fa6052f6c9"> 410</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad33cd16d10e438bb8051f7fa6052f6c9">XBOXRECV::getButtonPress</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160; <span class="keywordflow">if</span>(b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) <span class="comment">// These are analog buttons</span></div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; <span class="keywordflow">return</span> (uint8_t)(ButtonState[controller] &gt;&gt; 8);</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span>(b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>)</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; <span class="keywordflow">return</span> (uint8_t)ButtonState[controller];</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; <span class="keywordflow">return</span> (ButtonState[controller] &amp; ((uint32_t)pgm_read_word(&amp;BUTTONS[(uint8_t)b]) &lt;&lt; 16));</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160;}</div>
<div class="line"><a name="l00417"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a5e9a59d90ec1941c7152cdd438c284d0"> 417</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5e9a59d90ec1941c7152cdd438c284d0">XBOXRECV::getButtonClick</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b) {</div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; <span class="keywordflow">if</span>(b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a>) {</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160; <span class="keywordflow">if</span>(L2Clicked[controller]) {</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160; L2Clicked[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; }</div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160; }</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span>(b == <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a>) {</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; <span class="keywordflow">if</span>(R2Clicked[controller]) {</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; R2Clicked[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160; }</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; }</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; uint16_t button = pgm_read_word(&amp;BUTTONS[(uint8_t)b]);</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; <span class="keywordtype">bool</span> click = (ButtonClickState[controller] &amp; button);</div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160; ButtonClickState[controller] &amp;= ~button; <span class="comment">// clear &quot;click&quot; event</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; <span class="keywordflow">return</span> click;</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160;}</div>
<div class="line"><a name="l00437"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a1b277f0980bd53f30283d4af9d9b8926"> 437</a></span>&#160;int16_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1b277f0980bd53f30283d4af9d9b8926">XBOXRECV::getAnalogHat</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a) {</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; <span class="keywordflow">return</span> hatValue[controller][a];</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160;}</div>
<div class="line"><a name="l00440"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aa2263642c0d422c6d21fed3933d6044c"> 440</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#aa2263642c0d422c6d21fed3933d6044c">XBOXRECV::buttonChanged</a>(uint8_t controller) {</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; <span class="keywordtype">bool</span> state = buttonStateChanged[controller];</div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; buttonStateChanged[controller] = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; <span class="keywordflow">return</span> state;</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160;}</div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160;<span class="comment">ControllerStatus Breakdown</span></div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0001 // 0</span></div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0002 // normal batteries, no rechargeable battery pack</span></div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0004 // controller starting up / settling</span></div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0008 // headset adapter plugged in, but no headphones connected (mute?)</span></div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0010 // 0</span></div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0020 // 1</span></div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0040 // battery level (high bit)</span></div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0080 // battery level (low bit)</span></div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0100 // 1</span></div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0200 // 1</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0400 // headset adapter plugged in</span></div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x0800 // 0</span></div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x1000 // 1</span></div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x2000 // 0</span></div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x4000 // 0</span></div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160;<span class="comment"> ControllerStatus[controller] &amp; 0x8000 // 0</span></div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00464"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a671caa6d19debca8ff14dc82ac3ed005"> 464</a></span>&#160;uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a671caa6d19debca8ff14dc82ac3ed005">XBOXRECV::getBatteryLevel</a>(uint8_t controller) {</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; uint8_t batteryLevel = ((controllerStatus[controller] &amp; 0x00C0) &gt;&gt; 6) * 33;</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; <span class="keywordflow">if</span>(batteryLevel == 99)</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; batteryLevel = 100; </div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; <span class="keywordflow">return</span> batteryLevel; </div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160;}</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;</div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;<span class="keywordtype">void</span> XBOXRECV::XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes) {</div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; uint8_t outputPipe;</div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; <span class="keywordflow">switch</span> (controller) {</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <span class="keywordflow">case</span> 0: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a962be1e740bce25cf37e111bd88be9bf">XBOX_OUTPUT_PIPE_1</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; <span class="keywordflow">case</span> 1: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a8ba688a4bdb47869d7ee3f49b6d07b7c">XBOX_OUTPUT_PIPE_2</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; <span class="keywordflow">case</span> 2: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#afce4154cabb3a0d2c7eeb39b1c15d353">XBOX_OUTPUT_PIPE_3</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; <span class="keywordflow">case</span> 3: outputPipe = <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a7a74e0ea052831dbbb4a0973fffc8179">XBOX_OUTPUT_PIPE_4</a>; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; }</div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; rcode = <a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>, <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[ outputPipe ].epAddr, nbytes, data);</div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160;<span class="preprocessor">#ifdef EXTRADEBUG</span></div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span>(rcode)</div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;Error sending Xbox message\r\n&quot;</span>));</div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00486"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d"> 486</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d">XBOXRECV::setLedRaw</a>(uint8_t controller, uint8_t value) {</div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160; writeBuf[2] = 0x08;</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; writeBuf[3] = value | 0x40;</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; </div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; XboxCommand(controller, writeBuf, 4);</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160;}</div>
<div class="line"><a name="l00494"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a9e17aa44f2946e710fb9343f27290c85"> 494</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a9e17aa44f2946e710fb9343f27290c85">XBOXRECV::setLedOn</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led) {</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; <span class="keywordflow">if</span>(led != <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a">ALL</a>) <span class="comment">// All LEDs can&#39;t be on a the same time</span></div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d">setLedRaw</a>(controller,(pgm_read_byte(&amp;LEDS[(uint8_t)led]))+4);</div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160;}</div>
<div class="line"><a name="l00498"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a54490f57e16eaee6689ca92351958017"> 498</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a54490f57e16eaee6689ca92351958017">XBOXRECV::setLedBlink</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> led) {</div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d">setLedRaw</a>(controller,pgm_read_byte(&amp;LEDS[(uint8_t)led]));</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160;}</div>
<div class="line"><a name="l00501"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ace7deafed6fa6991d38417b41a490c57"> 501</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ace7deafed6fa6991d38417b41a490c57">XBOXRECV::setLedMode</a>(uint8_t controller, <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> ledMode) { <span class="comment">// This function is used to do some speciel LED stuff the controller supports</span></div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d">setLedRaw</a>(controller,(uint8_t)ledMode);</div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160;}</div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160;<span class="comment">/* PC runs this at interval of approx 2 seconds </span></div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160;<span class="comment">Thanks to BusHound from Perisoft.net for the Windows USB Analysis output</span></div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160;<span class="comment">Found by timstamp.co.uk</span></div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160;<span class="keywordtype">void</span> XBOXRECV::checkStatus() {</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; <span class="keywordflow">if</span>(!bPollEnable) </div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; <span class="comment">// Get controller info</span></div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; writeBuf[0] = 0x08;</div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; writeBuf[2] = 0x0f;</div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; writeBuf[3] = 0xc0;</div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0; i&lt;4; i++) {</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; XboxCommand(i, writeBuf, 4);</div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; }</div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160; <span class="comment">// Get battery status</span></div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; writeBuf[1] = 0x00;</div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160; writeBuf[2] = 0x00;</div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160; writeBuf[3] = 0x40;</div>
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0; i&lt;4; i++) {</div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; <span class="keywordflow">if</span>(<a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[i])</div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; XboxCommand(i, writeBuf, 4);</div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160; }</div>
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160;}</div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160;</div>
<div class="line"><a name="l00530"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#afd1f58838a9aea8e742103fddbe8fe69"> 530</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#afd1f58838a9aea8e742103fddbe8fe69">XBOXRECV::setRumbleOn</a>(uint8_t controller, uint8_t lValue, uint8_t rValue) {</div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160; writeBuf[0] = 0x00;</div>
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; writeBuf[1] = 0x01;</div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; writeBuf[2] = 0x0f;</div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160; writeBuf[3] = 0xc0;</div>
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160; writeBuf[4] = 0x00;</div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; writeBuf[5] = lValue; <span class="comment">// big weight</span></div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160; writeBuf[6] = rValue; <span class="comment">// small weight</span></div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; </div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160; XboxCommand(controller, writeBuf, 7);</div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -154,17 +154,10 @@ Macros</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a57effb96f46e458675a2653d4c543ca2"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> { <br/>
&#160;&#160;<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b">ROTATING</a> = 0x0A,
<tr class="memitem:a57effb96f46e458675a2653d4c543ca2"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> { <a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b">ROTATING</a> = 0x0A,
<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a">FASTBLINK</a> = 0x0B,
<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454">SLOWBLINK</a> = 0x0C,
<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37">ALTERNATING</a> = 0x0D,
<br/>
&#160;&#160;<a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b">ROTATING</a> = 0x0A,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a">FASTBLINK</a> = 0x0B,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454">SLOWBLINK</a> = 0x0C,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37">ALTERNATING</a> = 0x0D
<br/>
<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37">ALTERNATING</a> = 0x0D
}</td></tr>
<tr class="separator:a57effb96f46e458675a2653d4c543ca2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
@ -179,6 +172,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00036">36</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="abcb805b13bfd36145e252b0633bbcfc0"></a>
@ -191,6 +186,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00033">33</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2f5523a1aaa6718e1d11c6bc5b29a575"></a>
@ -203,6 +200,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00054">54</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8f4ee68cc0f05690f5f26104c7d9e490"></a>
@ -215,6 +214,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00039">39</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2824b25aa9a384c29f27a4e1bb443799"></a>
@ -227,6 +228,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00040">40</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="aab6feb681a78b190190bcc081868a485"></a>
@ -239,6 +242,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00042">42</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a86a3e5765d02bc043d5d1f674a7ffb0f"></a>
@ -251,6 +256,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00044">44</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5acfdaefe74aba1632c71acb79c49671"></a>
@ -263,6 +270,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00046">46</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="af35f872fc33e690571eb99de648e8e96"></a>
@ -275,6 +284,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00056">56</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a962be1e740bce25cf37e111bd88be9bf"></a>
@ -287,6 +298,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00041">41</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8ba688a4bdb47869d7ee3f49b6d07b7c"></a>
@ -299,6 +312,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00043">43</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="afce4154cabb3a0d2c7eeb39b1c15d353"></a>
@ -311,6 +326,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00045">45</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7a74e0ea052831dbbb4a0973fffc8179"></a>
@ -323,6 +340,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00047">47</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8e7834e5604c4fb588cceab9258d0568"></a>
@ -335,6 +354,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00050">50</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1a97ce2829a30b96ea6640d387d245a9"></a>
@ -347,6 +368,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00051">51</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6842663964e470b86786f046e4bc30d9"></a>
@ -359,6 +382,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00052">52</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
@ -371,6 +396,7 @@ Enumerations</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Enum used to set special LED modes supported by the Xbox controller. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b"></a>ROTATING</em>&nbsp;</td><td class="fielddoc">
</td></tr>
@ -380,22 +406,16 @@ Enumerations</h2></td></tr>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37"></a>ALTERNATING</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b"></a>ROTATING</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a"></a>FASTBLINK</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454"></a>SLOWBLINK</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37"></a>ALTERNATING</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>
<p>Definition at line <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html#l00059">59</a> of file <a class="el" href="_x_b_o_x_r_e_c_v_8h_source.html">XBOXRECV.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -145,87 +145,74 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96"> 56</a></span>&#160;<span class="preprocessor">#define XBOX_MAX_ENDPOINTS 9</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2"> 58</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> {</div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b"> 59</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b">ROTATING</a> = 0x0A,</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a"> 60</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a">FASTBLINK</a> = 0x0B,</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454"> 61</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454">SLOWBLINK</a> = 0x0C,</div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37"> 62</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37">ALTERNATING</a> = 0x0D, </div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;};</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"><a class="code" href="class_x_b_o_x_r_e_c_v.html"> 65</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_x_b_o_x_r_e_c_v.html">XBOXRECV</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac856259af28db351f85302b5eddabf1d">XBOXRECV</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>);</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="comment">// USBDeviceConfig implementation</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a07de216bf16a83501d74463c00bf1fc8">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">Release</a>();</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc">Poll</a>();</div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a2d58b0a20eb804d853713ade83d01631"> 73</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a2d58b0a20eb804d853713ade83d01631">GetAddress</a>() { <span class="keywordflow">return</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>; };</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a570568108edafee8d060aad8fe40db57"> 74</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a570568108edafee8d060aad8fe40db57">isReady</a>() { <span class="keywordflow">return</span> bPollEnable; };</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">/* </span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="comment"> Xbox Controller Readings.</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="comment"> getButtonPress will return true as long as the button is held down</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="comment"> While getButtonClick will only return it once</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="comment"> So for instance if you need to increase a variable once you would use getButtonClick,</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="comment"> but if you need to drive a robot forward you would use getButtonPress</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad33cd16d10e438bb8051f7fa6052f6c9">getButtonPress</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5e9a59d90ec1941c7152cdd438c284d0">getButtonClick</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; int16_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1b277f0980bd53f30283d4af9d9b8926">getAnalogHat</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">/* Xbox Controller Command */</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a65f4ca4dc0156418fbac30060c06730d"> 88</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a65f4ca4dc0156418fbac30060c06730d">setAllOff</a>(uint8_t controller) { <a class="code" href="class_x_b_o_x_r_e_c_v.html#afd1f58838a9aea8e742103fddbe8fe69">setRumbleOn</a>(controller,0,0); <a class="code" href="class_x_b_o_x_r_e_c_v.html#abedb93ccf24954f652d8f1cbc138924f">setLedOff</a>(controller); };</div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aa75c1d01b94b7c50fb518bc0f9228782"> 89</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#aa75c1d01b94b7c50fb518bc0f9228782">setRumbleOff</a>(uint8_t controller) { <a class="code" href="class_x_b_o_x_r_e_c_v.html#afd1f58838a9aea8e742103fddbe8fe69">setRumbleOn</a>(controller,0,0); };</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#afd1f58838a9aea8e742103fddbe8fe69">setRumbleOn</a>(uint8_t controller, uint8_t lValue, uint8_t rValue);</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d">setLedRaw</a>(uint8_t controller, uint8_t value);</div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#abedb93ccf24954f652d8f1cbc138924f"> 92</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#abedb93ccf24954f652d8f1cbc138924f">setLedOff</a>(uint8_t controller) { <a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d">setLedRaw</a>(controller,0); };</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a9e17aa44f2946e710fb9343f27290c85">setLedOn</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a54490f57e16eaee6689ca92351958017">setLedBlink</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ace7deafed6fa6991d38417b41a490c57">setLedMode</a>(uint8_t controller, <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> lm);</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a671caa6d19debca8ff14dc82ac3ed005">getBatteryLevel</a>(uint8_t controller); <span class="comment">// Returns the battery level in percentage in 33% steps</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#aa2263642c0d422c6d21fed3933d6044c">buttonChanged</a>(uint8_t controller);</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c"> 99</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a>; <span class="comment">// True if a wireless receiver is connected</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a"> 100</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[4]; <span class="comment">// Variable used to indicate if the XBOX 360 controller is successfully connected</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="keyword">protected</span>: </div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="comment">/* Mandatory members */</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8"> 104</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>;</div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730"> 105</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>; <span class="comment">// device address</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb"> 106</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>]; <span class="comment">//endpoint info structure</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="keyword">private</span>: </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordtype">bool</span> bPollEnable; </div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="comment">/* Variables to store the buttons */</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; uint32_t ButtonState[4];</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; uint32_t OldButtonState[4];</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; uint16_t ButtonClickState[4];</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; int16_t hatValue[4][4];</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; uint16_t controllerStatus[4];</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordtype">bool</span> buttonStateChanged[4]; <span class="comment">// True if a button has changed</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordtype">bool</span> L2Clicked[4]; <span class="comment">// These buttons are analog, so we use we use these bools to check if they where clicked or not</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordtype">bool</span> R2Clicked[4];</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer; <span class="comment">// Timing for checkStatus() signals</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; uint8_t readBuf[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; uint8_t writeBuf[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordtype">void</span> readReport(uint8_t controller); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordtype">void</span> printReport(uint8_t controller, uint8_t nBytes); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordtype">void</span> XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keywordtype">void</span> checkStatus();</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;};</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2"> 59</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> {</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b"> 60</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b">ROTATING</a> = 0x0A,</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a"> 61</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a">FASTBLINK</a> = 0x0B,</div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454"> 62</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454">SLOWBLINK</a> = 0x0C,</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37"> 63</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37">ALTERNATING</a> = 0x0D, </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;</div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html"> 71</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_x_b_o_x_r_e_c_v.html">XBOXRECV</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac856259af28db351f85302b5eddabf1d">XBOXRECV</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a07de216bf16a83501d74463c00bf1fc8">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad0e6b53a818516b7d6af0beaa8cebc7a">Release</a>();</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#aafe1688ba3dc9b9ac425ebbbf001a1cc">Poll</a>();</div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a2d58b0a20eb804d853713ade83d01631"> 102</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a2d58b0a20eb804d853713ade83d01631">GetAddress</a>() { <span class="keywordflow">return</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>; };</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a570568108edafee8d060aad8fe40db57"> 107</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a570568108edafee8d060aad8fe40db57">isReady</a>() { <span class="keywordflow">return</span> bPollEnable; };</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ad33cd16d10e438bb8051f7fa6052f6c9">getButtonPress</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5e9a59d90ec1941c7152cdd438c284d0">getButtonClick</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; int16_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1b277f0980bd53f30283d4af9d9b8926">getAnalogHat</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a65f4ca4dc0156418fbac30060c06730d"> 137</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a65f4ca4dc0156418fbac30060c06730d">setAllOff</a>(uint8_t controller) { <a class="code" href="class_x_b_o_x_r_e_c_v.html#afd1f58838a9aea8e742103fddbe8fe69">setRumbleOn</a>(controller,0,0); <a class="code" href="class_x_b_o_x_r_e_c_v.html#abedb93ccf24954f652d8f1cbc138924f">setLedOff</a>(controller); };</div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#aa75c1d01b94b7c50fb518bc0f9228782"> 142</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#aa75c1d01b94b7c50fb518bc0f9228782">setRumbleOff</a>(uint8_t controller) { <a class="code" href="class_x_b_o_x_r_e_c_v.html#afd1f58838a9aea8e742103fddbe8fe69">setRumbleOn</a>(controller,0,0); };</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#afd1f58838a9aea8e742103fddbe8fe69">setRumbleOn</a>(uint8_t controller, uint8_t lValue, uint8_t rValue);</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d">setLedRaw</a>(uint8_t controller, uint8_t value);</div>
<div class="line"><a name="l00162"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#abedb93ccf24954f652d8f1cbc138924f"> 162</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#abedb93ccf24954f652d8f1cbc138924f">setLedOff</a>(uint8_t controller) { <a class="code" href="class_x_b_o_x_r_e_c_v.html#a354ede498c38b95a60c1b27deb01e47d">setLedRaw</a>(controller,0); };</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a9e17aa44f2946e710fb9343f27290c85">setLedOn</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a54490f57e16eaee6689ca92351958017">setLedBlink</a>(uint8_t controller, <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#ace7deafed6fa6991d38417b41a490c57">setLedMode</a>(uint8_t controller, <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> lm);</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a671caa6d19debca8ff14dc82ac3ed005">getBatteryLevel</a>(uint8_t controller);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#aa2263642c0d422c6d21fed3933d6044c">buttonChanged</a>(uint8_t controller);</div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c"> 196</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_r_e_c_v.html#a5ff16bba78f05af3023f395a342b625c">XboxReceiverConnected</a>;</div>
<div class="line"><a name="l00198"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a"> 198</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#ac07faada38e159f1e7831d90863ebe3a">Xbox360Connected</a>[4];</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="keyword">protected</span>: </div>
<div class="line"><a name="l00202"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8"> 202</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_r_e_c_v.html#a53047c86c8c2f625916af62238d50fc8">pUsb</a>;</div>
<div class="line"><a name="l00204"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730"> 204</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_r_e_c_v.html#a1d4bdb1b740c87fd51aca3969e67c730">bAddress</a>;</div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb"> 206</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_x_b_o_x_r_e_c_v.html#af97c8d0efc945fa4ba1d120c8a5a9cbb">epInfo</a>[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>];</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; </div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;<span class="keyword">private</span>: </div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordtype">bool</span> bPollEnable; </div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="comment">/* Variables to store the buttons */</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; uint32_t ButtonState[4];</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; uint32_t OldButtonState[4];</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; uint16_t ButtonClickState[4];</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; int16_t hatValue[4][4];</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; uint16_t controllerStatus[4];</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <span class="keywordtype">bool</span> buttonStateChanged[4]; <span class="comment">// True if a button has changed</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; </div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordtype">bool</span> L2Clicked[4]; <span class="comment">// These buttons are analog, so we use we use these bools to check if they where clicked or not</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordtype">bool</span> R2Clicked[4];</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer; <span class="comment">// Timing for checkStatus() signals</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; uint8_t readBuf[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; uint8_t writeBuf[<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordtype">void</span> readReport(uint8_t controller); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keywordtype">void</span> printReport(uint8_t controller, uint8_t nBytes); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordtype">void</span> XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keywordtype">void</span> checkStatus();</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;};</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -1,12 +0,0 @@
<map id="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.cpp" name="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.cpp">
<area shape="rect" id="node2" href="$_x_b_o_x_u_s_b_8h.html" title="XBOXUSB.h" alt="" coords="161,93,228,115"/>
<area shape="rect" id="node4" href="$_usb_8h.html" title="Usb.h" alt="" coords="381,163,424,184"/>
<area shape="rect" id="node7" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="723,301,777,323"/>
<area shape="rect" id="node9" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="540,301,607,323"/>
<area shape="rect" id="node10" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="666,232,723,253"/>
<area shape="rect" id="node11" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="631,301,689,323"/>
<area shape="rect" id="node12" href="$address_8h.html" title="address.h" alt="" coords="407,232,464,253"/>
<area shape="rect" id="node14" href="$printhex_8h.html" title="printhex.h" alt="" coords="77,301,133,323"/>
<area shape="rect" id="node15" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="267,232,328,253"/>
<area shape="rect" id="node17" href="$message_8h.html" title="message.h" alt="" coords="173,232,235,253"/>
</map>

View file

@ -1 +0,0 @@
76c55ae7ec25bbf8c323479d51b760b5

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

View file

@ -1,666 +0,0 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.h File Reference</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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> </div>
<div class="headertitle">
<div class="title">XBOXUSB.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;WProgram.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="_usb_8h_source.html">Usb.h</a>&quot;</code><br/>
</div><div class="textblock"><div class="dynheader">
Include dependency graph for XBOXUSB.h:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_u_s_b_8h__incl.png" border="0" usemap="#_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8h" alt=""/></div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8h" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8h">
<area shape="rect" id="node3" href="_usb_8h.html" title="Usb.h" alt="" coords="381,93,424,115"/><area shape="rect" id="node6" href="avrpins_8h.html" title="avrpins.h" alt="" coords="723,232,777,253"/><area shape="rect" id="node8" href="max3421e_8h.html" title="max3421e.h" alt="" coords="540,232,607,253"/><area shape="rect" id="node9" href="usbhost_8h.html" title="usbhost.h" alt="" coords="666,163,723,184"/><area shape="rect" id="node10" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="631,232,689,253"/><area shape="rect" id="node11" href="address_8h.html" title="address.h" alt="" coords="407,163,464,184"/><area shape="rect" id="node13" href="printhex_8h.html" title="printhex.h" alt="" coords="77,232,133,253"/><area shape="rect" id="node14" href="hexdump_8h.html" title="hexdump.h" alt="" coords="267,163,328,184"/><area shape="rect" id="node16" href="message_8h.html" title="message.h" alt="" coords="173,163,235,184"/></map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_x_b_o_x_u_s_b_8h__dep__incl.png" border="0" usemap="#_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8hdep" alt=""/></div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8hdep" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2_x_b_o_x_u_s_b_8hdep">
<area shape="rect" id="node2" href="_x_b_o_x_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXUSB.cpp" alt="" coords="5,93,109,133"/></map>
</div>
</div>
<p><a href="_x_b_o_x_u_s_b_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_x_b_o_x_u_s_b.html">XBOXUSB</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:abcb805b13bfd36145e252b0633bbcfc0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>&#160;&#160;&#160;32</td></tr>
<tr class="separator:abcb805b13bfd36145e252b0633bbcfc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4d26e1c566064f2259faf65f0858b6e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e">EP_INTERRUPT</a>&#160;&#160;&#160;0x03</td></tr>
<tr class="separator:ad4d26e1c566064f2259faf65f0858b6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f4ee68cc0f05690f5f26104c7d9e490"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490">XBOX_CONTROL_PIPE</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a8f4ee68cc0f05690f5f26104c7d9e490"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fd9ad9bf7a7d5767940c2ec224ef5e8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8">XBOX_INPUT_PIPE</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a4fd9ad9bf7a7d5767940c2ec224ef5e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92d2d844a70224a10c100c0a877aacfe"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a92d2d844a70224a10c100c0a877aacfe">XBOX_OUTPUT_PIPE</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:a92d2d844a70224a10c100c0a877aacfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e7834e5604c4fb588cceab9258d0568"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a8e7834e5604c4fb588cceab9258d0568">XBOX_VID</a>&#160;&#160;&#160;0x045E</td></tr>
<tr class="separator:a8e7834e5604c4fb588cceab9258d0568"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10c2a7a8da78e76d7020c2c347f0a687"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a10c2a7a8da78e76d7020c2c347f0a687">XBOX_WIRELESS_PID</a>&#160;&#160;&#160;0x028F</td></tr>
<tr class="separator:a10c2a7a8da78e76d7020c2c347f0a687"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a97ce2829a30b96ea6640d387d245a9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a1a97ce2829a30b96ea6640d387d245a9">XBOX_WIRELESS_RECEIVER_PID</a>&#160;&#160;&#160;0x0719</td></tr>
<tr class="separator:a1a97ce2829a30b96ea6640d387d245a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6842663964e470b86786f046e4bc30d9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a6842663964e470b86786f046e4bc30d9">XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID</a>&#160;&#160;&#160;0x0291</td></tr>
<tr class="separator:a6842663964e470b86786f046e4bc30d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575">MADCATZ_VID</a>&#160;&#160;&#160;0x1BAD</td></tr>
<tr class="separator:a2f5523a1aaa6718e1d11c6bc5b29a575"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa3e91675875fbf14a37369f9513874a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#aaa3e91675875fbf14a37369f9513874a">XBOX_REPORT_BUFFER_SIZE</a>&#160;&#160;&#160;14</td></tr>
<tr class="separator:aaa3e91675875fbf14a37369f9513874a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bd4ea095da29635414952894bd527f5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a5bd4ea095da29635414952894bd527f5">bmREQ_HID_OUT</a>&#160;&#160;&#160;<a class="el" href="usb__ch9_8h.html#a610dad02930a3061c746f84885e1e11e">USB_SETUP_HOST_TO_DEVICE</a>|<a class="el" href="usb__ch9_8h.html#acf3fd30992e9fe01f1bac9aaa7fea61b">USB_SETUP_TYPE_CLASS</a>|<a class="el" href="usb__ch9_8h.html#a59754621c21db801e11513ba06a3a02e">USB_SETUP_RECIPIENT_INTERFACE</a></td></tr>
<tr class="separator:a5bd4ea095da29635414952894bd527f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee05d40a014750b24a7e9967f6f389f4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#aee05d40a014750b24a7e9967f6f389f4">HID_REQUEST_SET_REPORT</a>&#160;&#160;&#160;0x09</td></tr>
<tr class="separator:aee05d40a014750b24a7e9967f6f389f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af35f872fc33e690571eb99de648e8e96"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>&#160;&#160;&#160;3</td></tr>
<tr class="separator:af35f872fc33e690571eb99de648e8e96"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:aadcb6002d2b42fdfe01490f730ab00a6"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> { <br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a> = 0,
<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a">LED2</a> = 1,
<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b">LED3</a> = 2,
<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342">LED4</a> = 3,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6af4ea6611b98f83a6e1ec4ce823bf9217">LED5</a> = 4,
<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a03c3d5ea066596a27a595c5f0a35ce62">LED6</a> = 5,
<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a0f8249a7cb803db1aba3043b227e2902">LED7</a> = 6,
<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a42e32062c4a32ac8a0ba01a940519aec">LED8</a> = 7,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a013f4214d13b932c7b8529159727b493">LED9</a> = 8,
<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a1a7a5cb1ae9d8199b2d320731c112ab5">LED10</a> = 9,
<a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a">ALL</a> = 4,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a">ALL</a> = 0x01,
<br/>
&#160;&#160;<a class="el" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a> = 0x02,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a">LED2</a> = 0x03,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b">LED3</a> = 0x04,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342">LED4</a> = 0x05
<br/>
}</td></tr>
<tr class="separator:aadcb6002d2b42fdfe01490f730ab00a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57effb96f46e458675a2653d4c543ca2"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> { <br/>
&#160;&#160;<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b">ROTATING</a> = 0x0A,
<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a">FASTBLINK</a> = 0x0B,
<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454">SLOWBLINK</a> = 0x0C,
<a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37">ALTERNATING</a> = 0x0D,
<br/>
&#160;&#160;<a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b">ROTATING</a> = 0x0A,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a">FASTBLINK</a> = 0x0B,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454">SLOWBLINK</a> = 0x0C,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37">ALTERNATING</a> = 0x0D
<br/>
}</td></tr>
<tr class="separator:a57effb96f46e458675a2653d4c543ca2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03bfec859eac87be20f8952c1eb89de0"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> { <br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aba595d8bca8bc5e67c37c0a9d89becfa">UP</a> = 0,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aec8379af7490bb9eaaf579cf17876f38">RIGHT</a> = 1,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a9b0b4a95b99523966e0e34ffdadac9da">DOWN</a> = 2,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0adb45120aafd37a973140edee24708065">LEFT</a> = 3,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a87fe59ef12c3d13dc2a4d14c9b16c1f9">PLUS</a> = 5,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0e793500a63ffa575b9b712ca3bc9851">TWO</a> = 6,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a7a725f13af144bdef532d0389ba75e0d">ONE</a> = 7,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0af613d73b4e7b570ffd967df4a13c4225">MINUS</a> = 8,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a8f280224da64e98f2d52d50ec43bc197">HOME</a> = 9,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aa70478ce277ffc322f8e1e3418e07355">Z</a> = 10,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a739ce3f516592d245d16fd8a3893472c">C</a> = 11,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a3f2a77ecd272aa6d6b5902faa5e5fc68">B</a> = 12,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f">A</a> = 13,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a1697a91b22c2369eb2ba427c2d193329">SELECT</a> = 4,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a78d20b793a10e7c2f1012114803147c3">L3</a> = 5,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aad0b4725f69a34fed2c914517bcd9baa">R3</a> = 6,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a13d000b4d7dc70d90239b7430d1eb6b2">START</a> = 7,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a> = 8,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a> = 9,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ae5bc7ee7d6dda5340a28f91834f10543">L1</a> = 10,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0af8d87ff07efe24755164f550526f4dac">R1</a> = 11,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a2fd33892864d1c342d3bead2f2d9ad56">TRIANGLE</a> = 12,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aa79c827759ea48f0735386c4b1188911">CIRCLE</a> = 13,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ad699bdf1731bd839b56c299536ba1d9d">CROSS</a> = 14,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a4233fbf0cafb86abcee94b38d769fc59">SQUARE</a> = 15,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a1a5245963a3a51b8e68460090fd1f147">PS</a> = 16,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aed3ef32890b6da0919b57254c5206c62">MOVE</a> = 17,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a21f40778b7db9343a6ca75ec2c41ccce">T</a> = 18,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ac921ff2cfc571c1d19b0485d7f6926ee">BACK</a> = 4,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a58833a3110c570fb05130d40c365d1e4">X</a> = 14,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a5596231eabd6cf29050967d5ac83ad84">Y</a> = 15,
<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ad4689acdcdf0e61373d52de14ff07eae">XBOX</a> = 16,
<br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a447bfe7992c2fe70bfe561225f74d379">SYNC</a> = 17,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0aba595d8bca8bc5e67c37c0a9d89becfa">UP</a> = (2 &lt;&lt; 8) | 0x01,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a9b0b4a95b99523966e0e34ffdadac9da">DOWN</a> = (2 &lt;&lt; 8) | 0x02,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0adb45120aafd37a973140edee24708065">LEFT</a> = (2 &lt;&lt; 8) | 0x04,
<br/>
&#160;&#160;<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0aec8379af7490bb9eaaf579cf17876f38">RIGHT</a> = (2 &lt;&lt; 8) | 0x08,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a13d000b4d7dc70d90239b7430d1eb6b2">START</a> = (2 &lt;&lt; 8) | 0x10,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0ac921ff2cfc571c1d19b0485d7f6926ee">BACK</a> = (2 &lt;&lt; 8) | 0x20,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a78d20b793a10e7c2f1012114803147c3">L3</a> = (2 &lt;&lt; 8) | 0x40,
<br/>
&#160;&#160;<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0aad0b4725f69a34fed2c914517bcd9baa">R3</a> = (2 &lt;&lt; 8) | 0x80,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0ae5bc7ee7d6dda5340a28f91834f10543">L1</a> = (3 &lt;&lt; 8) | 0x01,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0af8d87ff07efe24755164f550526f4dac">R1</a> = (3 &lt;&lt; 8) | 0x02,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0ad4689acdcdf0e61373d52de14ff07eae">XBOX</a> = (3 &lt;&lt; 8) | 0x04,
<br/>
&#160;&#160;<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f">A</a> = (3 &lt;&lt; 8) | 0x10,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a3f2a77ecd272aa6d6b5902faa5e5fc68">B</a> = (3 &lt;&lt; 8) | 0x20,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a58833a3110c570fb05130d40c365d1e4">X</a> = (3 &lt;&lt; 8) | 0x40,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a5596231eabd6cf29050967d5ac83ad84">Y</a> = (3 &lt;&lt; 8) | 0x80,
<br/>
&#160;&#160;<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a> = 4,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a> = 5
<br/>
}</td></tr>
<tr class="separator:a03bfec859eac87be20f8952c1eb89de0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaaabdefc068fd57ec2bef2b62ea4ba92"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> { <br/>
&#160;&#160;<a class="el" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a> = 0,
<a class="el" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a> = 1,
<a class="el" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a> = 2,
<a class="el" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a> = 3,
<br/>
&#160;&#160;<a class="el" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a> = 6,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a> = 8,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a> = 10,
<a class="el" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a> = 12
<br/>
}</td></tr>
<tr class="separator:aaaabdefc068fd57ec2bef2b62ea4ba92"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a5bd4ea095da29635414952894bd527f5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define bmREQ_HID_OUT&#160;&#160;&#160;<a class="el" href="usb__ch9_8h.html#a610dad02930a3061c746f84885e1e11e">USB_SETUP_HOST_TO_DEVICE</a>|<a class="el" href="usb__ch9_8h.html#acf3fd30992e9fe01f1bac9aaa7fea61b">USB_SETUP_TYPE_CLASS</a>|<a class="el" href="usb__ch9_8h.html#a59754621c21db801e11513ba06a3a02e">USB_SETUP_RECIPIENT_INTERFACE</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ad4d26e1c566064f2259faf65f0858b6e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EP_INTERRUPT&#160;&#160;&#160;0x03</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="abcb805b13bfd36145e252b0633bbcfc0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define EP_MAXPKTSIZE&#160;&#160;&#160;32</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="aee05d40a014750b24a7e9967f6f389f4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define HID_REQUEST_SET_REPORT&#160;&#160;&#160;0x09</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a2f5523a1aaa6718e1d11c6bc5b29a575"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MADCATZ_VID&#160;&#160;&#160;0x1BAD</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a8f4ee68cc0f05690f5f26104c7d9e490"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_CONTROL_PIPE&#160;&#160;&#160;0</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a4fd9ad9bf7a7d5767940c2ec224ef5e8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_INPUT_PIPE&#160;&#160;&#160;1</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="af35f872fc33e690571eb99de648e8e96"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_MAX_ENDPOINTS&#160;&#160;&#160;3</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a92d2d844a70224a10c100c0a877aacfe"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_OUTPUT_PIPE&#160;&#160;&#160;2</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="aaa3e91675875fbf14a37369f9513874a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_REPORT_BUFFER_SIZE&#160;&#160;&#160;14</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a8e7834e5604c4fb588cceab9258d0568"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_VID&#160;&#160;&#160;0x045E</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a10c2a7a8da78e76d7020c2c347f0a687"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_PID&#160;&#160;&#160;0x028F</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a1a97ce2829a30b96ea6640d387d245a9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_RECEIVER_PID&#160;&#160;&#160;0x0719</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a6842663964e470b86786f046e4bc30d9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID&#160;&#160;&#160;0x0291</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a></td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca"></a>LeftHatX</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3"></a>LeftHatY</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b"></a>RightHatX</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a"></a>RightHatY</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca"></a>LeftHatX</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3"></a>LeftHatY</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b"></a>RightHatX</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a"></a>RightHatY</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>
</div>
</div>
<a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a></td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aba595d8bca8bc5e67c37c0a9d89becfa"></a>UP</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aec8379af7490bb9eaaf579cf17876f38"></a>RIGHT</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a9b0b4a95b99523966e0e34ffdadac9da"></a>DOWN</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0adb45120aafd37a973140edee24708065"></a>LEFT</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a87fe59ef12c3d13dc2a4d14c9b16c1f9"></a>PLUS</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a0e793500a63ffa575b9b712ca3bc9851"></a>TWO</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a7a725f13af144bdef532d0389ba75e0d"></a>ONE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0af613d73b4e7b570ffd967df4a13c4225"></a>MINUS</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a8f280224da64e98f2d52d50ec43bc197"></a>HOME</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aa70478ce277ffc322f8e1e3418e07355"></a>Z</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a739ce3f516592d245d16fd8a3893472c"></a>C</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a3f2a77ecd272aa6d6b5902faa5e5fc68"></a>B</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f"></a>A</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a1697a91b22c2369eb2ba427c2d193329"></a>SELECT</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a78d20b793a10e7c2f1012114803147c3"></a>L3</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aad0b4725f69a34fed2c914517bcd9baa"></a>R3</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a13d000b4d7dc70d90239b7430d1eb6b2"></a>START</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066"></a>L2</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a"></a>R2</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0ae5bc7ee7d6dda5340a28f91834f10543"></a>L1</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0af8d87ff07efe24755164f550526f4dac"></a>R1</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a2fd33892864d1c342d3bead2f2d9ad56"></a>TRIANGLE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aa79c827759ea48f0735386c4b1188911"></a>CIRCLE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0ad699bdf1731bd839b56c299536ba1d9d"></a>CROSS</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a4233fbf0cafb86abcee94b38d769fc59"></a>SQUARE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a1a5245963a3a51b8e68460090fd1f147"></a>PS</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aed3ef32890b6da0919b57254c5206c62"></a>MOVE</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a21f40778b7db9343a6ca75ec2c41ccce"></a>T</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0ac921ff2cfc571c1d19b0485d7f6926ee"></a>BACK</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a58833a3110c570fb05130d40c365d1e4"></a>X</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a5596231eabd6cf29050967d5ac83ad84"></a>Y</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0ad4689acdcdf0e61373d52de14ff07eae"></a>XBOX</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a447bfe7992c2fe70bfe561225f74d379"></a>SYNC</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aba595d8bca8bc5e67c37c0a9d89becfa"></a>UP</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a9b0b4a95b99523966e0e34ffdadac9da"></a>DOWN</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0adb45120aafd37a973140edee24708065"></a>LEFT</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aec8379af7490bb9eaaf579cf17876f38"></a>RIGHT</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a13d000b4d7dc70d90239b7430d1eb6b2"></a>START</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0ac921ff2cfc571c1d19b0485d7f6926ee"></a>BACK</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a78d20b793a10e7c2f1012114803147c3"></a>L3</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0aad0b4725f69a34fed2c914517bcd9baa"></a>R3</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0ae5bc7ee7d6dda5340a28f91834f10543"></a>L1</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0af8d87ff07efe24755164f550526f4dac"></a>R1</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0ad4689acdcdf0e61373d52de14ff07eae"></a>XBOX</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f"></a>A</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a3f2a77ecd272aa6d6b5902faa5e5fc68"></a>B</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a58833a3110c570fb05130d40c365d1e4"></a>X</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a5596231eabd6cf29050967d5ac83ad84"></a>Y</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066"></a>L2</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a"></a>R2</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>
</div>
</div>
<a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a></td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44"></a>LED1</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a"></a>LED2</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b"></a>LED3</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342"></a>LED4</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6af4ea6611b98f83a6e1ec4ce823bf9217"></a>LED5</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a03c3d5ea066596a27a595c5f0a35ce62"></a>LED6</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a0f8249a7cb803db1aba3043b227e2902"></a>LED7</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a42e32062c4a32ac8a0ba01a940519aec"></a>LED8</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a013f4214d13b932c7b8529159727b493"></a>LED9</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a1a7a5cb1ae9d8199b2d320731c112ab5"></a>LED10</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a"></a>ALL</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a"></a>ALL</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44"></a>LED1</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a"></a>LED2</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b"></a>LED3</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342"></a>LED4</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>
</div>
</div>
<a class="anchor" id="a57effb96f46e458675a2653d4c543ca2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a></td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b"></a>ROTATING</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a"></a>FASTBLINK</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454"></a>SLOWBLINK</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37"></a>ALTERNATING</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b"></a>ROTATING</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a"></a>FASTBLINK</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454"></a>SLOWBLINK</em>&nbsp;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37"></a>ALTERNATING</em>&nbsp;</td><td class="fielddoc">
</td></tr>
</table>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 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>

View file

@ -1,3 +0,0 @@
<map id="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.h" name="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.h">
<area shape="rect" id="node2" href="$_x_b_o_x_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXUSB.cpp" alt="" coords="5,93,109,133"/>
</map>

View file

@ -1 +0,0 @@
1f3801e91b575908dfc70af1118e58f4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View file

@ -1,11 +0,0 @@
<map id="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.h" name="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.h">
<area shape="rect" id="node3" href="$_usb_8h.html" title="Usb.h" alt="" coords="381,93,424,115"/>
<area shape="rect" id="node6" href="$avrpins_8h.html" title="avrpins.h" alt="" coords="723,232,777,253"/>
<area shape="rect" id="node8" href="$max3421e_8h.html" title="max3421e.h" alt="" coords="540,232,607,253"/>
<area shape="rect" id="node9" href="$usbhost_8h.html" title="usbhost.h" alt="" coords="666,163,723,184"/>
<area shape="rect" id="node10" href="$usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="631,232,689,253"/>
<area shape="rect" id="node11" href="$address_8h.html" title="address.h" alt="" coords="407,163,464,184"/>
<area shape="rect" id="node13" href="$printhex_8h.html" title="printhex.h" alt="" coords="77,232,133,253"/>
<area shape="rect" id="node14" href="$hexdump_8h.html" title="hexdump.h" alt="" coords="267,163,328,184"/>
<area shape="rect" id="node16" href="$message_8h.html" title="message.h" alt="" coords="173,163,235,184"/>
</map>

View file

@ -1 +0,0 @@
dec509e8edb62065c7cc3f9b00a1b33f

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

View file

@ -1,251 +0,0 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/XBOXUSB.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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">XBOXUSB.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="_x_b_o_x_u_s_b_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) 2012 Kristian Lauszus, TKJ Electronics. 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"> Kristian Lauszus, TKJ Electronics</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> Web : http://www.tkjelectronics.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> e-mail : kristianl@tkjelectronics.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;</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#ifndef _xboxusb_h_</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define _xboxusb_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">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#include &quot;Arduino.h&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#include &quot;WProgram.h&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_usb_8h.html">Usb.h</a>&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="comment">/* Data Xbox 360 taken from descriptors */</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0"> 30</a></span>&#160;<span class="preprocessor">#define EP_MAXPKTSIZE 32 // max size for data via USB</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="comment">/* Endpoint types */</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#ad4d26e1c566064f2259faf65f0858b6e"> 33</a></span>&#160;<span class="preprocessor">#define EP_INTERRUPT 0x03</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="comment">/* Names we give to the 3 Xbox360 pipes */</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a8f4ee68cc0f05690f5f26104c7d9e490"> 36</a></span>&#160;<span class="preprocessor">#define XBOX_CONTROL_PIPE 0</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a4fd9ad9bf7a7d5767940c2ec224ef5e8"> 37</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_INPUT_PIPE 1</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a92d2d844a70224a10c100c0a877aacfe"> 38</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_OUTPUT_PIPE 2</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="comment">// PID and VID of the different devices</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a8e7834e5604c4fb588cceab9258d0568"> 41</a></span>&#160;<span class="preprocessor">#define XBOX_VID 0x045E // Microsoft Corporation</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a10c2a7a8da78e76d7020c2c347f0a687"> 42</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_PID 0x028F // Wireless controller only support charging</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a1a97ce2829a30b96ea6640d387d245a9"> 43</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a6842663964e470b86786f046e4bc30d9"> 44</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a2f5523a1aaa6718e1d11c6bc5b29a575"> 46</a></span>&#160;<span class="preprocessor">#define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aaa3e91675875fbf14a37369f9513874a"> 48</a></span>&#160;<span class="preprocessor">#define XBOX_REPORT_BUFFER_SIZE 14 // Size of the input report buffer</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment">// Used in control endpoint header for HID Commands</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a5bd4ea095da29635414952894bd527f5"> 51</a></span>&#160;<span class="preprocessor">#define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aee05d40a014750b24a7e9967f6f389f4"> 52</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HID_REQUEST_SET_REPORT 0x09</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#af35f872fc33e690571eb99de648e8e96"> 54</a></span>&#160;<span class="preprocessor">#define XBOX_MAX_ENDPOINTS 3</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6"> 56</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> {</div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a"> 57</a></span>&#160; <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ab1d5eac4b1dca480c8056eaea7663b7a">ALL</a> = 0x01, <span class="comment">// Used to blink all LEDs</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44"> 58</a></span>&#160; <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6adac6477842247cab1a8c02c65f431b44">LED1</a> = 0x02,</div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a"> 59</a></span>&#160; <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a8379bbaa96d151e6adac488b2a147b7a">LED2</a> = 0x03,</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b"> 60</a></span>&#160; <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6a5dec293e081e0fc78369c842fab8452b">LED3</a> = 0x04,</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342"> 61</a></span>&#160; <a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6ad60e39b8d1701d30aa64f80343217342">LED4</a> = 0x05,</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;};</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2"> 63</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> {</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b"> 64</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ab341b3ec217357462f12510d0435c25b">ROTATING</a> = 0x0A,</div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a"> 65</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2ae88cfa0f6acd518889cef621446d9d2a">FASTBLINK</a> = 0x0B,</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454"> 66</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2acfcb52b0be6da777e98f28261a9d2454">SLOWBLINK</a> = 0x0C,</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37"> 67</a></span>&#160; <a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2a699ca8594a49a8c786c6881a14caeb37">ALTERNATING</a> = 0x0D, </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;};</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0"> 70</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> {</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="comment">// byte location | bit location </span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0aba595d8bca8bc5e67c37c0a9d89becfa"> 72</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aba595d8bca8bc5e67c37c0a9d89becfa">UP</a> = (2 &lt;&lt; 8) | 0x01,</div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a9b0b4a95b99523966e0e34ffdadac9da"> 73</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a9b0b4a95b99523966e0e34ffdadac9da">DOWN</a> = (2 &lt;&lt; 8) | 0x02,</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0adb45120aafd37a973140edee24708065"> 74</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0adb45120aafd37a973140edee24708065">LEFT</a> = (2 &lt;&lt; 8) | 0x04,</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0aec8379af7490bb9eaaf579cf17876f38"> 75</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aec8379af7490bb9eaaf579cf17876f38">RIGHT</a> = (2 &lt;&lt; 8) | 0x08,</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a13d000b4d7dc70d90239b7430d1eb6b2"> 77</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a13d000b4d7dc70d90239b7430d1eb6b2">START</a> = (2 &lt;&lt; 8) | 0x10,</div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0ac921ff2cfc571c1d19b0485d7f6926ee"> 78</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ac921ff2cfc571c1d19b0485d7f6926ee">BACK</a> = (2 &lt;&lt; 8) | 0x20,</div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a78d20b793a10e7c2f1012114803147c3"> 79</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a78d20b793a10e7c2f1012114803147c3">L3</a> = (2 &lt;&lt; 8) | 0x40,</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0aad0b4725f69a34fed2c914517bcd9baa"> 80</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0aad0b4725f69a34fed2c914517bcd9baa">R3</a> = (2 &lt;&lt; 8) | 0x80,</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0ae5bc7ee7d6dda5340a28f91834f10543"> 82</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ae5bc7ee7d6dda5340a28f91834f10543">L1</a> = (3 &lt;&lt; 8) | 0x01,</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0af8d87ff07efe24755164f550526f4dac"> 83</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0af8d87ff07efe24755164f550526f4dac">R1</a> = (3 &lt;&lt; 8) | 0x02,</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0ad4689acdcdf0e61373d52de14ff07eae"> 84</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0ad4689acdcdf0e61373d52de14ff07eae">XBOX</a> = (3 &lt;&lt; 8) | 0x04,</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f"> 86</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a42a4ade1acd55a49164099104990e09f">A</a> = (3 &lt;&lt; 8) | 0x10,</div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a3f2a77ecd272aa6d6b5902faa5e5fc68"> 87</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a3f2a77ecd272aa6d6b5902faa5e5fc68">B</a> = (3 &lt;&lt; 8) | 0x20,</div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a58833a3110c570fb05130d40c365d1e4"> 88</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a58833a3110c570fb05130d40c365d1e4">X</a> = (3 &lt;&lt; 8) | 0x40,</div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a5596231eabd6cf29050967d5ac83ad84"> 89</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a5596231eabd6cf29050967d5ac83ad84">Y</a> = (3 &lt;&lt; 8) | 0x80, </div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="comment">// These buttons are analog</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066"> 92</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a0adffb24dae0c41be5b803f4d444f066">L2</a> = 4,</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a"> 93</a></span>&#160; <a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0a629d7b403cea5f826352f3aefb9a6d6a">R2</a> = 5,</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"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92"> 95</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> {</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca"> 96</a></span>&#160; <a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a383cb8895dd296b7f69ce845ed16b0ca">LeftHatX</a> = 6,</div>
<div class="line"><a name="l00097"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3"> 97</a></span>&#160; <a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92af3f3925efa9762c4e9e71ac7da7a94a3">LeftHatY</a> = 8,</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b"> 98</a></span>&#160; <a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92aaeb027a0ae5bbc6ba25e1c78a6486c7b">RightHatX</a> = 10,</div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="code" href="_x_b_o_x_u_s_b_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a"> 99</a></span>&#160; <a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92a7f1fb2db5381286691f4dec179ed5d5a">RightHatY</a> = 12,</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;};</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html"> 102</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_x_b_o_x_u_s_b.html">XBOXUSB</a> : <span class="keyword">public</span> <a class="code" href="class_u_s_b_device_config.html">USBDeviceConfig</a> {</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <a class="code" href="class_x_b_o_x_u_s_b.html#a4b676a33152112e6edfb14be125a78d2">XBOXUSB</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="comment">// USBDeviceConfig implementation</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a9d2ad06354787bc252058bb28015b56e">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a9a296b98b40f5a36d46297d98ef0f9b5">Release</a>();</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a2f4684fe0785e50de434d95f4336fa12">Poll</a>();</div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a42c870e64582980634423248d64500b4"> 110</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a42c870e64582980634423248d64500b4">GetAddress</a>() { <span class="keywordflow">return</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>; };</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#ac2507bfe85896b7fcc772894a7a9f272"> 111</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ac2507bfe85896b7fcc772894a7a9f272">isReady</a>() { <span class="keywordflow">return</span> bPollEnable; };</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">/* XBOX Controller Readings */</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#acfa82f94f8228f450e45285ff8cabcb4">getButton</a>(<a class="code" href="controller_enums_8h.html#a03bfec859eac87be20f8952c1eb89de0">Button</a> b);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; int16_t <a class="code" href="class_x_b_o_x_u_s_b.html#a7fcef8741de99d56f3a4d7fad9f954ff">getAnalogHat</a>(<a class="code" href="controller_enums_8h.html#aaaabdefc068fd57ec2bef2b62ea4ba92">AnalogHat</a> a);</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="comment">/* Commands for Dualshock 3 and Navigation controller */</span> </div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a6200dc185ecb6e0d3ffdb2a9ecf49c40"> 118</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a6200dc185ecb6e0d3ffdb2a9ecf49c40">setAllOff</a>() { <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(0,0); <a class="code" href="class_x_b_o_x_u_s_b.html#a155637a4ef946f19c7ee40c0fc1c6b98">setLedOff</a>(); };</div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a5d9ac92da5086409ad864484bdf95871"> 119</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a5d9ac92da5086409ad864484bdf95871">setRumbleOff</a>() { <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(0,0); };</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#ae70ae50ed8188a2bf8c25d0ee17f54d9">setRumbleOn</a>(uint8_t lValue, uint8_t rValue);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a155637a4ef946f19c7ee40c0fc1c6b98">setLedOff</a>();</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a2348a35d4302f0a76bbeb319e84349a1">setLedOn</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l); </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#acc52982e6105d029d1e0980367dc10f6">setLedBlink</a>(<a class="code" href="controller_enums_8h.html#aadcb6002d2b42fdfe01490f730ab00a6">LED</a> l);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a7426adef803da704df7593858389926e">setLedMode</a>(<a class="code" href="_x_b_o_x_r_e_c_v_8h.html#a57effb96f46e458675a2653d4c543ca2">LEDMode</a> lm);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; </div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868"> 126</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a1c779ae5483a2f73426650242a37d868">Xbox360Connected</a>;<span class="comment">// Variable used to indicate if the XBOX 360 controller is successfully connected</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a4333f4d9205517ad4c3701d9f3065b2c"> 127</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a4333f4d9205517ad4c3701d9f3065b2c">buttonChanged</a>;<span class="comment">//Indicate if a button has been changed</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#aaeda25e0d8a01b2cab04319fca90b573"> 128</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#aaeda25e0d8a01b2cab04319fca90b573">buttonPressed</a>;<span class="comment">//Indicate if a button has been pressed</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a1f32de88d5cd780401894826a8356568"> 129</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_x_b_o_x_u_s_b.html#a1f32de88d5cd780401894826a8356568">buttonReleased</a>;<span class="comment">//Indicate if a button has been released</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; </div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="keyword">protected</span>: </div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">/* mandatory members */</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18"> 133</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_x_b_o_x_u_s_b.html#a9c701658d4f63b5407cbcd5b78d8eb18">pUsb</a>;</div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65"> 134</a></span>&#160; uint8_t <a class="code" href="class_x_b_o_x_u_s_b.html#a5e9c00af9f4b978c53819791b0a0eb65">bAddress</a>; <span class="comment">// device address</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f"> 135</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_x_b_o_x_u_s_b.html#abef4a852d877d8136f198431ce54550f">epInfo</a>[<a class="code" href="_x_b_o_x_u_s_b_8h.html#af35f872fc33e690571eb99de648e8e96">XBOX_MAX_ENDPOINTS</a>]; <span class="comment">//endpoint info structure</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="keyword">private</span>: </div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="keywordtype">bool</span> bPollEnable; </div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; uint32_t ButtonState;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; uint32_t OldButtonState; </div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; uint8_t readBuf[<a class="code" href="_x_b_o_x_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for input data</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; uint8_t writeBuf[<a class="code" href="_x_b_o_x_u_s_b_8h.html#abcb805b13bfd36145e252b0633bbcfc0">EP_MAXPKTSIZE</a>]; <span class="comment">// General purpose buffer for output data</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keywordtype">void</span> readReport(); <span class="comment">// read incoming data</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordtype">void</span> printReport(); <span class="comment">// print incoming date - Uncomment for debugging</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="comment">/* Private commands */</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keywordtype">void</span> XboxCommand(uint8_t* data, uint16_t nbytes);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;};</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 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>

View file

@ -119,6 +119,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="acm_2acm__terminal_2pgmstrings_8h_source.html#l00006">6</a> of file <a class="el" href="acm_2acm__terminal_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa1ba73e45dd29eeb526a52d9a3336f35"></a>
@ -135,6 +137,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="acm_2acm__terminal_2pgmstrings_8h_source.html#l00005">5</a> of file <a class="el" href="acm_2acm__terminal_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<a class="anchor" id="a373c90214222e94d07424e7a8d41b92b"></a>
@ -151,6 +155,8 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="acm_2acm__terminal_2pgmstrings_8h_source.html#l00004">4</a> of file <a class="el" href="acm_2acm__terminal_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
@ -164,12 +170,14 @@ Variables</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="acm_2acm__terminal_2pgmstrings_8h_source.html#l00010">10</a> of file <a class="el" href="acm_2acm__terminal_2pgmstrings_8h_source.html">pgmstrings.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -143,7 +143,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

File diff suppressed because one or more lines are too long

View file

@ -1,44 +1,42 @@
<map id="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/address.h" name="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/address.h">
<area shape="rect" id="node2" href="$_usb_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Usb.h" alt="" coords="1598,94,1724,125"/>
<area shape="rect" id="node3" href="$adk_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/adk.h" alt="" coords="117,178,243,209"/>
<area shape="rect" id="node5" href="$_b_t_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/BTD.h" alt="" coords="390,178,519,209"/>
<area shape="rect" id="node2" href="$_usb_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Usb.h" alt="" coords="1435,94,1561,125"/>
<area shape="rect" id="node3" href="$adk_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/adk.h" alt="" coords="129,178,255,209"/>
<area shape="rect" id="node5" href="$_b_t_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/BTD.h" alt="" coords="413,178,541,209"/>
<area shape="rect" id="node13" href="$cdcacm_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcacm.h" alt="" coords="820,173,924,213"/>
<area shape="rect" id="node17" href="$cdcftdi_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcftdi.h" alt="" coords="1035,173,1139,213"/>
<area shape="rect" id="node15" href="$cdcprolific_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcprolific.h" alt="" coords="820,267,924,307"/>
<area shape="rect" id="node19" href="$le3dp__rptparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/le3dp/le3dp\l_rptparser.h" alt="" coords="1077,262,1195,311"/>
<area shape="rect" id="node21" href="$hidjoystickrptparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/USBHIDJoystick\l/hidjoystickrptparser.h" alt="" coords="1220,262,1356,311"/>
<area shape="rect" id="node23" href="$hid_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/hid.h" alt="" coords="1498,178,1621,209"/>
<area shape="rect" id="node23" href="$hid_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/hid.h" alt="" coords="1387,178,1511,209"/>
<area shape="rect" id="node25" href="$hidboot_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidboot.h" alt="" coords="1636,267,1740,307"/>
<area shape="rect" id="node27" href="$hidescriptorparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidescriptorparser.h" alt="" coords="1764,267,1868,307"/>
<area shape="rect" id="node31" href="$masstorage_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.h" alt="" coords="1749,173,1853,213"/>
<area shape="rect" id="node33" href="$max___l_c_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.h" alt="" coords="1877,173,1981,213"/>
<area shape="rect" id="node35" href="$_p_s3_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.h" alt="" coords="2005,173,2109,213"/>
<area shape="rect" id="node37" href="$_usb_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Usb.cpp" alt="" coords="2133,173,2237,213"/>
<area shape="rect" id="node38" href="$usbhub_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.h" alt="" coords="2263,173,2367,213"/>
<area shape="rect" id="node40" href="$_x_b_o_x_r_e_c_v_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.h" alt="" coords="2395,173,2499,213"/>
<area shape="rect" id="node42" href="$_x_b_o_x_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXUSB.h" alt="" coords="2531,173,2635,213"/>
<area shape="rect" id="node31" href="$masstorage_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.h" alt="" coords="1637,173,1741,213"/>
<area shape="rect" id="node33" href="$max___l_c_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.h" alt="" coords="1765,173,1869,213"/>
<area shape="rect" id="node35" href="$_p_s3_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.h" alt="" coords="1893,173,1997,213"/>
<area shape="rect" id="node37" href="$_usb_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Usb.cpp" alt="" coords="2021,173,2125,213"/>
<area shape="rect" id="node38" href="$usbhub_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.h" alt="" coords="2185,173,2289,213"/>
<area shape="rect" id="node40" href="$_x_b_o_x_r_e_c_v_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.h" alt="" coords="2385,173,2489,213"/>
<area shape="rect" id="node4" href="$adk_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/adk.cpp" alt="" coords="5,267,109,307"/>
<area shape="rect" id="node6" href="$_b_t_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/BTD.cpp" alt="" coords="133,267,237,307"/>
<area shape="rect" id="node7" href="$_p_s3_b_t_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.h" alt="" coords="261,267,365,307"/>
<area shape="rect" id="node9" href="$_s_p_p_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/SPP.h" alt="" coords="390,271,519,302"/>
<area shape="rect" id="node11" href="$_wii_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Wii.h" alt="" coords="543,271,667,302"/>
<area shape="rect" id="node8" href="$_p_s3_b_t_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.cpp" alt="" coords="261,365,365,405"/>
<area shape="rect" id="node10" href="$_s_p_p_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/SPP.cpp" alt="" coords="403,365,507,405"/>
<area shape="rect" id="node12" href="$_wii_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Wii.cpp" alt="" coords="553,365,657,405"/>
<area shape="rect" id="node6" href="$_b_t_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/BTD.cpp" alt="" coords="564,267,668,307"/>
<area shape="rect" id="node7" href="$_p_s3_b_t_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.h" alt="" coords="133,267,237,307"/>
<area shape="rect" id="node9" href="$_s_p_p_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/SPP.h" alt="" coords="262,271,391,302"/>
<area shape="rect" id="node11" href="$_wii_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Wii.h" alt="" coords="415,271,539,302"/>
<area shape="rect" id="node8" href="$_p_s3_b_t_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.cpp" alt="" coords="133,365,237,405"/>
<area shape="rect" id="node10" href="$_s_p_p_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/SPP.cpp" alt="" coords="275,365,379,405"/>
<area shape="rect" id="node12" href="$_wii_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Wii.cpp" alt="" coords="425,365,529,405"/>
<area shape="rect" id="node14" href="$cdcacm_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcacm.cpp" alt="" coords="692,267,796,307"/>
<area shape="rect" id="node16" href="$cdcprolific_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcprolific.cpp" alt="" coords="820,365,924,405"/>
<area shape="rect" id="node18" href="$cdcftdi_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcftdi.cpp" alt="" coords="948,267,1052,307"/>
<area shape="rect" id="node20" href="$le3dp__rptparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/le3dp/le3dp\l_rptparser.cpp" alt="" coords="1077,361,1195,410"/>
<area shape="rect" id="node22" href="$hidjoystickrptparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/USBHIDJoystick\l/hidjoystickrptparser.cpp" alt="" coords="1220,361,1356,410"/>
<area shape="rect" id="node24" href="$hid_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hid.cpp" alt="" coords="1380,267,1484,307"/>
<area shape="rect" id="node29" href="$hiduniversal_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.h" alt="" coords="1508,267,1612,307"/>
<area shape="rect" id="node24" href="$hid_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hid.cpp" alt="" coords="1508,267,1612,307"/>
<area shape="rect" id="node29" href="$hiduniversal_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.h" alt="" coords="1380,267,1484,307"/>
<area shape="rect" id="node26" href="$hidboot_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidboot.cpp" alt="" coords="1636,365,1740,405"/>
<area shape="rect" id="node28" href="$hidescriptorparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidescriptorparser.cpp" alt="" coords="1764,365,1868,405"/>
<area shape="rect" id="node30" href="$hiduniversal_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.cpp" alt="" coords="1508,365,1612,405"/>
<area shape="rect" id="node30" href="$hiduniversal_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.cpp" alt="" coords="1380,365,1484,405"/>
<area shape="rect" id="node32" href="$masstorage_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.cpp" alt="" coords="1892,267,1996,307"/>
<area shape="rect" id="node34" href="$max___l_c_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.cpp" alt="" coords="2020,267,2124,307"/>
<area shape="rect" id="node36" href="$_p_s3_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.cpp" alt="" coords="2148,267,2252,307"/>
<area shape="rect" id="node39" href="$usbhub_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.cpp" alt="" coords="2276,267,2380,307"/>
<area shape="rect" id="node41" href="$_x_b_o_x_r_e_c_v_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.cpp" alt="" coords="2404,267,2508,307"/>
<area shape="rect" id="node43" href="$_x_b_o_x_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXUSB.cpp" alt="" coords="2532,267,2636,307"/>
</map>

View file

@ -1 +1 @@
be6cdf32d11b18a00b67a35bc43b9785
064d9727bc230108749ee8bcca6331f7

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View file

@ -379,7 +379,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -96,10 +96,12 @@ Include dependency graph for adk.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2adk_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2adk_8cpp">
<area shape="rect" id="node2" href="adk_8h.html" title="adk.h" alt="" coords="706,93,747,115"/><area shape="rect" id="node5" href="avrpins_8h.html" title="avrpins.h" alt="" coords="79,301,133,323"/><area shape="rect" id="node7" href="max3421e_8h.html" title="max3421e.h" alt="" coords="213,301,280,323"/><area shape="rect" id="node8" href="usbhost_8h.html" title="usbhost.h" alt="" coords="195,232,252,253"/><area shape="rect" id="node9" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="613,301,672,323"/><area shape="rect" id="node10" href="_usb_8h.html" title="Usb.h" alt="" coords="477,163,520,184"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="1151,371,1208,392"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="1104,301,1165,323"/><area shape="rect" id="node17" href="message_8h.html" title="message.h" alt="" coords="816,301,877,323"/><area shape="rect" id="node18" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="933,163,1016,184"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="430,232,487,253"/><area shape="rect" id="node19" href="parsetools_8h.html" title="parsetools.h" alt="" coords="942,232,1007,253"/></map>
</div>
</div></div><!-- contents -->
</div>
<p><a href="adk_8cpp_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

454
adk_8cpp_source.html Normal file
View file

@ -0,0 +1,454 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/adk.cpp 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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">adk.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="adk_8cpp.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;</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">/* Google ADK interface */</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="adk_8h.html">adk.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_k.html#a964ec80ac133bf8d65cf0274e37b29da">ADK::epDataInIndex</a> = 1; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_k.html#acfc5a7e45f15bba7ff8cd42552796624">ADK::epDataOutIndex</a> = 2; </div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="code" href="class_a_d_k.html#a29492dcd9b7f6023b7866cd05188d61c"> 25</a></span>&#160;<a class="code" href="class_a_d_k.html#a29492dcd9b7f6023b7866cd05188d61c">ADK::ADK</a>(<a class="code" href="class_u_s_b.html">USB</a> *p, <span class="keyword">const</span> <span class="keywordtype">char</span>* manufacturer,</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* model,</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* description,</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* version,</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* uri,</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* serial) :</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; </div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; pUsb(p), <span class="comment">//pointer to USB class instance - mandatory</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; bAddress(0), <span class="comment">//device address - mandatory </span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; bNumEP(1), <span class="comment">//if config descriptor needs to be parsed</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; ready(false),</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="comment">/* ADK ID Strings */</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; manufacturer(manufacturer),</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; model(model),</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; description(description),</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; version(version),</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; uri(uri),</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; serial(serial)</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;{</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="comment">// initialize endpoint data structures</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0; i&lt;<a class="code" href="adk_8h.html#ac39da606ffc273bd855152107297d6a1">ADK_MAX_ENDPOINTS</a>; i++) {</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0;</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[i].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (i) ? 0 : 8;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = 0;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = (i) ? <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a> : <a class="code" href="address_8h.html#a517dfa014946e2d087d197312234a1de">USB_NAK_MAX_POWER</a>;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; }<span class="comment">//for(uint8_t i=0; i&lt;ADK_MAX_ENDPOINTS; i++...</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; </div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">// register in USB subsystem</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>) {</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2">RegisterDeviceClass</a>(<span class="keyword">this</span>); <span class="comment">//set devConfig[] entry</span></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;}</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"> 61</span>&#160;<span class="comment">/* Connection initialization of an Android phone */</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="class_a_d_k.html#a8c5c2e212c748966ccd863499d202063"> 62</a></span>&#160;uint8_t <a class="code" href="class_a_d_k.html#a8c5c2e212c748966ccd863499d202063">ADK::Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed)</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;{</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; uint8_t buf[<span class="keyword">sizeof</span>(<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="l00066"></a><span class="lineno"> 66</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = NULL;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *oldep_ptr = NULL;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; uint8_t num_of_conf; <span class="comment">// number of configurations</span></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="comment">// get memory address of USB device address pool</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>();</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; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\nADK Init&quot;</span>);</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// check if address has already been assigned to an instance</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>) {</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\nAddress in use&quot;</span>);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; }</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="comment">// Get pointer to pseudo device with address 0 assigned</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(0);</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordflow">if</span> (!p) {</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\nAddress not found&quot;</span>);</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; }</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>) {</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;epinfo is null\r\n&quot;</span>);</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; }</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">// Save old pointer to EP_RECORD of address 0</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; oldep_ptr = p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">// Temporary assign new pointer to epInfo to p-&gt;epinfo in order to avoid toggle inconsistence</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="comment">// Get device descriptor</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; rcode = <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">getDevDescr</a>( 0, 0, <span class="keyword">sizeof</span>(<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>), (uint8_t*)buf );</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <span class="comment">// Restore p-&gt;epinfo</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = oldep_ptr;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordflow">if</span>( rcode ){ </div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordflow">goto</span> FailGetDevDescr;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; }</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">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a> = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="comment">// Extract Max Packet Size from device descriptor</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (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">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0; </div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; rcode = <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( 0, 0, <a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a> );</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a> = 0;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="comment">//USBTRACE2(&quot;setAddr:&quot;,rcode);</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; }<span class="comment">//if (rcode...</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">//USBTRACE2(&quot;\r\nAddr:&quot;, bAddress);</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">//get pointer to assigned address record</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">if</span> (!p) {</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</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;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - only EP0 is known</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; rcode = <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, 1, <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; }</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="comment">//check if ADK device is already in accessory mode; if yes, configure and exit</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">if</span>(((<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>*)buf)-&gt;idVendor == <a class="code" href="adk_8h.html#a37223416b6c1bba6b86ab17211bc9af2">ADK_VID</a> &amp;&amp;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; (((<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>*)buf)-&gt;idProduct == <a class="code" href="adk_8h.html#a32e861258886323d4dbcf066641597a4">ADK_PID</a> || ((<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>*)buf)-&gt;idProduct == <a class="code" href="adk_8h.html#a355cd5e5557b754645d4e1bfffabbf99">ADB_PID</a>)) {</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\nAcc.mode device detected&quot;</span>);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment">/* go through configurations, find first bulk-IN, bulk-OUT EP, fill epInfo and quit */</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; num_of_conf = ((<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>*)buf)-&gt;bNumConfigurations;</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; </div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="comment">//USBTRACE2(&quot;\r\nNC:&quot;,num_of_conf);</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;num_of_conf; i++) {</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <a class="code" href="class_config_desc_parser.html">ConfigDescParser&lt;0, 0, 0, 0&gt;</a> confDescrParser(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; delay(1);</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; rcode = <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, 0, i, &amp;confDescrParser);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;<span class="preprocessor">#if defined(XOOM)</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="preprocessor"></span> <span class="comment">//added by Jaylen Scott Vanorden</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keywordflow">if</span>( rcode ) {</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;\r\nGot 1st bad code for config: &quot;</span>, rcode);</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; <span class="comment">// Try once more</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; rcode = <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, 0, i, &amp;confDescrParser);</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; }</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span>( rcode ) {</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">goto</span> FailGetConfDescr;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; }</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">if</span>( <a class="code" href="class_a_d_k.html#adf969d306da15baecd5c59bbb568053e">bNumEP</a> &gt; 2 ) {</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; }</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; } <span class="comment">// for (uint8_t i=0; i&lt;num_of_conf; i++...</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; </div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="keywordflow">if</span>( <a class="code" href="class_a_d_k.html#adf969d306da15baecd5c59bbb568053e">bNumEP</a> == 3 ) {</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer - this time all 3 endpoins</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; rcode = <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, 3, <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>);</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="keywordflow">if</span> (rcode) {</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; }</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; }</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; </div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="comment">// Set Configuration Value</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; rcode = <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, 0, <a class="code" href="class_a_d_k.html#ae8fcc6a6fccab61116cea10dd1f17738">bConfNum</a>);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="keywordflow">if</span>( rcode ){ </div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordflow">goto</span> FailSetConf;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; }</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="comment">/* print endpoint structure */</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;<span class="comment">// USBTRACE(&quot;\r\nEndpoint Structure:&quot;);</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;<span class="comment">// USBTRACE(&quot;\r\nEP0:&quot;);</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nAddr: &quot;, epInfo[0].epAddr );</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nMax.pkt.size: &quot;, epInfo[0].maxPktSize );</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nAttr: &quot;, epInfo[0].epAttribs );</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;<span class="comment">// USBTRACE(&quot;\r\nEpout:&quot;);</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nAddr: &quot;, epInfo[epDataOutIndex].epAddr );</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nMax.pkt.size: &quot;, epInfo[epDataOutIndex].maxPktSize );</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nAttr: &quot;, epInfo[epDataOutIndex].epAttribs );</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="comment">// USBTRACE(&quot;\r\nEpin:&quot;);</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nAddr: &quot;, epInfo[epDataInIndex].epAddr );</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nMax.pkt.size: &quot;, epInfo[epDataInIndex].maxPktSize );</span></div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="comment">// USBTRACE2(&quot;\r\nAttr: &quot;, epInfo[epDataInIndex].epAttribs );</span></div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\nConfiguration successful&quot;</span>);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <a class="code" href="class_a_d_k.html#a135db75b9e8cdd59b89f46c44dd83dd4">ready</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="keywordflow">return</span> 0; <span class="comment">//successful configuration</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; }<span class="comment">//if( buf-&gt;idVendor == ADK_VID...</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; </div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="comment">//probe device - get accessory protocol revision</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; {</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; uint16_t adkproto = -1;</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; delay(1);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; rcode = getProto((uint8_t*)&amp;adkproto );</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;<span class="preprocessor">#if defined(XOOM)</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="preprocessor"></span> <span class="comment">//added by Jaylen Scott Vanorden</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keywordflow">if</span>( rcode ) {</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;\r\nGot 1st bad code for proto: &quot;</span>, rcode);</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="comment">// Try once more</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; rcode = getProto((uint8_t*)&amp;adkproto );</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; } </div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;<span class="preprocessor"></span> <span class="keywordflow">if</span>( rcode ){</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="keywordflow">goto</span> FailGetProto; <span class="comment">//init fails</span></div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; }</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;\r\nADK protocol rev. &quot;</span>, adkproto );</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; }</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="comment">//sending ID strings</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; sendStr( <a class="code" href="adk_8h.html#a12e00d6841cbb8fd9ae7c97402efa062">ACCESSORY_STRING_MANUFACTURER</a>, manufacturer);</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; sendStr( <a class="code" href="adk_8h.html#a962954d4b489994aa347721c582fe242">ACCESSORY_STRING_MODEL</a>, model);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; sendStr( <a class="code" href="adk_8h.html#aa376dd887b57d0628df287dd1fce7f3b">ACCESSORY_STRING_DESCRIPTION</a>, description);</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; sendStr( <a class="code" href="adk_8h.html#aab852db9aa38642ad7be827ae95351c5">ACCESSORY_STRING_VERSION</a>, version);</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; sendStr( <a class="code" href="adk_8h.html#a0485b5be230520d0acde7ef32fb8210e">ACCESSORY_STRING_URI</a>, uri);</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; sendStr( <a class="code" href="adk_8h.html#a31b2b6ec818e90cd9fe47bd4f7f86c16">ACCESSORY_STRING_SERIAL</a>, serial);</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; </div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="comment">//switch to accessory mode</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="comment">//the Android phone will reset </span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; rcode = switchAcc();</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="keywordflow">if</span>( rcode ) {</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordflow">goto</span> FailSwAcc; <span class="comment">//init fails</span></div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; }</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; rcode = -1;</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="keywordflow">goto</span> SwAttempt; <span class="comment">//switch to accessory mode attempted</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; </div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="comment">/* diagnostic messages */</span> </div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\ngetDevDescr:&quot;</span>);</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\nsetDevTblEn:&quot;</span>);</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;FailGetProto:</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\ngetProto:&quot;</span>);</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; </div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;FailSwAcc:</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\nswAcc:&quot;</span>);</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; </div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;SwAttempt:</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;\r\nAccessory mode switch attempt&quot;</span>);</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; <span class="keywordflow">goto</span> Fail; </div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;FailGetConfDescr:</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;<span class="comment">// USBTRACE(&quot;getConf:&quot;);</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;FailSetConf:</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;<span class="comment">// USBTRACE(&quot;setConf:&quot;);</span></div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160;<span class="comment">//FailOnInit:</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="comment">// USBTRACE(&quot;OnInit:&quot;);</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160;<span class="comment">// goto Fail;</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160;Fail:</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="comment">//USBTRACE2(&quot;\r\nADK Init Failed, error code: &quot;, rcode);</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <a class="code" href="class_a_d_k.html#a7f64af34d7890f87ceab5d144f6c26ef">Release</a>();</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;}</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160;</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160;<span class="comment">/* Extracts bulk-IN and bulk-OUT endpoint information from config descriptor */</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"><a class="code" href="class_a_d_k.html#aac2fac5410faea0e439b4f7e688b3d75"> 287</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_a_d_k.html#aac2fac5410faea0e439b4f7e688b3d75">ADK::EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, <span class="keyword">const</span> <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> *pep) </div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;{</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="comment">//ErrorMessage&lt;uint8_t&gt;(PSTR(&quot;Conf.Val&quot;), conf);</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <span class="comment">//ErrorMessage&lt;uint8_t&gt;(PSTR(&quot;Iface Num&quot;),iface);</span></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <span class="comment">//ErrorMessage&lt;uint8_t&gt;(PSTR(&quot;Alt.Set&quot;), alt);</span></div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; </div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="comment">//added by Yuuichi Akagawa</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="keywordflow">if</span>( <a class="code" href="class_a_d_k.html#adf969d306da15baecd5c59bbb568053e">bNumEP</a> == 3 ) {</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; }</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; </div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <a class="code" href="class_a_d_k.html#ae8fcc6a6fccab61116cea10dd1f17738">bConfNum</a> = conf;</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160;</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; uint8_t index;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; </div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <span class="keywordflow">if</span> ((pep-&gt;<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> &amp; 0x02) == 2) {</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; index = ((pep-&gt;<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> &amp; 0x80) == 0x80) ? <a class="code" href="class_a_d_k.html#a964ec80ac133bf8d65cf0274e37b29da">epDataInIndex</a> : <a class="code" href="class_a_d_k.html#acfc5a7e45f15bba7ff8cd42552796624">epDataOutIndex</a>;</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; }</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; </div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="comment">// Fill in the endpoint info structure</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[index].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = (pep-&gt;<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> &amp; 0x0F);</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[index].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (uint8_t)pep-&gt;<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>;</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160;</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <a class="code" href="class_a_d_k.html#adf969d306da15baecd5c59bbb568053e">bNumEP</a> ++;</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160;</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; <span class="comment">//PrintEndpointDescriptor(pep);</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;}</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160;</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;<span class="comment">/* Performs a cleanup after failed Init() attempt */</span></div>
<div class="line"><a name="l00316"></a><span class="lineno"><a class="code" href="class_a_d_k.html#a7f64af34d7890f87ceab5d144f6c26ef"> 316</a></span>&#160;uint8_t <a class="code" href="class_a_d_k.html#a7f64af34d7890f87ceab5d144f6c26ef">ADK::Release</a>()</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;{</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>);</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160;</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; <a class="code" href="class_a_d_k.html#adf969d306da15baecd5c59bbb568053e">bNumEP</a> = 1; <span class="comment">//must have to be reset to 1 </span></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; </div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; <a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a> = 0;</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; <a class="code" href="class_a_d_k.html#a135db75b9e8cdd59b89f46c44dd83dd4">ready</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;}</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;</div>
<div class="line"><a name="l00327"></a><span class="lineno"><a class="code" href="class_a_d_k.html#a66b9943dfa89f783a8cdeb655e6fe9b1"> 327</a></span>&#160;uint8_t <a class="code" href="class_a_d_k.html#a66b9943dfa89f783a8cdeb655e6fe9b1">ADK::RcvData</a>(uint16_t *bytes_rcvd, uint8_t *dataptr)</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;{</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="comment">//USBTRACE2(&quot;\r\nAddr: &quot;, bAddress );</span></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; <span class="comment">//USBTRACE2(&quot;\r\nEP: &quot;,epInfo[epDataInIndex].epAddr);</span></div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[<a class="code" href="class_a_d_k.html#a964ec80ac133bf8d65cf0274e37b29da">epDataInIndex</a>].epAddr, bytes_rcvd, dataptr);</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160;}</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;</div>
<div class="line"><a name="l00334"></a><span class="lineno"><a class="code" href="class_a_d_k.html#ac37bde02b6ed1436712d3619afb07c84"> 334</a></span>&#160;uint8_t <a class="code" href="class_a_d_k.html#ac37bde02b6ed1436712d3619afb07c84">ADK::SndData</a>(uint16_t nbytes, uint8_t *dataptr)</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160;{</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[<a class="code" href="class_a_d_k.html#acfc5a7e45f15bba7ff8cd42552796624">epDataOutIndex</a>].epAddr, nbytes, dataptr);</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160;}</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160;</div>
<div class="line"><a name="l00339"></a><span class="lineno"><a class="code" href="class_a_d_k.html#ac4bd3303b99921289c3f59e2df219e50"> 339</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_a_d_k.html#ac4bd3303b99921289c3f59e2df219e50">ADK::PrintEndpointDescriptor</a>( <span class="keyword">const</span> <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>* ep_ptr )</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160;{</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;Endpoint descriptor:&quot;</span>));</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nLength:\t\t&quot;</span>));</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nType:\t\t&quot;</span>));</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress:\t&quot;</span>));</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAttributes:\t&quot;</span>));</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMaxPktSize:\t&quot;</span>));</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; PrintHex&lt;uint16_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPoll Intrv:\t&quot;</span>));</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>));</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -171,6 +171,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00062">62</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a12e00d6841cbb8fd9ae7c97402efa062"></a>
@ -183,6 +185,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00060">60</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a962954d4b489994aa347721c582fe242"></a>
@ -195,6 +199,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00061">61</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a31b2b6ec818e90cd9fe47bd4f7f86c16"></a>
@ -207,6 +213,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00065">65</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0485b5be230520d0acde7ef32fb8210e"></a>
@ -219,6 +227,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00064">64</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="aab852db9aa38642ad7be827ae95351c5"></a>
@ -231,6 +241,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00063">63</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a355cd5e5557b754645d4e1bfffabbf99"></a>
@ -243,6 +255,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00045">45</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6ebdba027fb7072f681e6445a385e8f2"></a>
@ -255,6 +269,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00055">55</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4c3e43d4d2955f93260f3e5ffe207e41"></a>
@ -267,6 +283,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00053">53</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac39da606ffc273bd855152107297d6a1"></a>
@ -279,6 +297,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00067">67</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a32e861258886323d4dbcf066641597a4"></a>
@ -291,6 +311,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00044">44</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4ab0e7e3adbc8bfc1bcdf29887c9a455"></a>
@ -303,6 +325,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00054">54</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a37223416b6c1bba6b86ab17211bc9af2"></a>
@ -315,6 +339,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00043">43</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a67b2829fb8d9f0e52eebef518ec6ebb0"></a>
@ -327,6 +353,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00057">57</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7da9c6adbc669b65ca3e4bd3f90c4c7b"></a>
@ -339,6 +367,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00058">58</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="aeb9a797aace2bcf4a9d1f786a632ca4b"></a>
@ -351,12 +381,14 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00047">47</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -236,7 +236,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -161,14 +161,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tr id="row_70_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="class_u_s_b_hub.html" target="_self">USBHub</a></td><td class="desc"></td></tr>
<tr id="row_71_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="class_u_s_b_read_parser.html" target="_self">USBReadParser</a></td><td class="desc"></td></tr>
<tr id="row_72_" class="even"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="class_w_i_i.html" target="_self">WII</a></td><td class="desc"></td></tr>
<tr id="row_73_"><td class="entry"><img src="ftv2node.png" alt="o" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="class_x_b_o_x_r_e_c_v.html" target="_self">XBOXRECV</a></td><td class="desc"></td></tr>
<tr id="row_74_" class="even"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="class_x_b_o_x_u_s_b.html" target="_self">XBOXUSB</a></td><td class="desc"></td></tr>
<tr id="row_73_"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><img src="ftv2cl.png" alt="C" width="24" height="22" /><a class="el" href="class_x_b_o_x_r_e_c_v.html" target="_self">XBOXRECV</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:58 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:23 for USB_Host_Shield_2.0 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>

File diff suppressed because one or more lines are too long

View file

@ -1,45 +1,43 @@
<map id="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/avrpins.h" name="/Users/Lauszus/GitHub/USB_Host_Shield_2.0/avrpins.h">
<area shape="rect" id="node2" href="$adk_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/adk.h" alt="" coords="808,266,933,297"/>
<area shape="rect" id="node4" href="$usbhost_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhost.h" alt="" coords="1739,93,1843,133"/>
<area shape="rect" id="node5" href="$_usb_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Usb.h" alt="" coords="1419,182,1545,213"/>
<area shape="rect" id="node14" href="$cdcacm_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcacm.h" alt="" coords="296,261,400,301"/>
<area shape="rect" id="node18" href="$cdcftdi_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcftdi.h" alt="" coords="680,261,784,301"/>
<area shape="rect" id="node16" href="$cdcprolific_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcprolific.h" alt="" coords="133,355,237,395"/>
<area shape="rect" id="node20" href="$le3dp__rptparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/le3dp/le3dp\l_rptparser.h" alt="" coords="2121,350,2239,399"/>
<area shape="rect" id="node22" href="$hidjoystickrptparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/USBHIDJoystick\l/hidjoystickrptparser.h" alt="" coords="2520,350,2656,399"/>
<area shape="rect" id="node24" href="$hid_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/hid.h" alt="" coords="2259,266,2383,297"/>
<area shape="rect" id="node26" href="$hidboot_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidboot.h" alt="" coords="1992,355,2096,395"/>
<area shape="rect" id="node28" href="$hidescriptorparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidescriptorparser.h" alt="" coords="1864,355,1968,395"/>
<area shape="rect" id="node32" href="$masstorage_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.h" alt="" coords="1749,261,1853,301"/>
<area shape="rect" id="node38" href="$_usb_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Usb.cpp" alt="" coords="1979,261,2083,301"/>
<area shape="rect" id="node39" href="$usbhub_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.h" alt="" coords="1621,261,1725,301"/>
<area shape="rect" id="node3" href="$adk_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/adk.cpp" alt="" coords="949,355,1053,395"/>
<area shape="rect" id="node6" href="$_b_t_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/BTD.h" alt="" coords="526,266,655,297"/>
<area shape="rect" id="node34" href="$max___l_c_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.h" alt="" coords="1085,261,1189,301"/>
<area shape="rect" id="node36" href="$_p_s3_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.h" alt="" coords="1213,261,1317,301"/>
<area shape="rect" id="node41" href="$_x_b_o_x_r_e_c_v_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.h" alt="" coords="957,261,1061,301"/>
<area shape="rect" id="node43" href="$_x_b_o_x_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXUSB.h" alt="" coords="1341,261,1445,301"/>
<area shape="rect" id="node7" href="$_b_t_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/BTD.cpp" alt="" coords="411,355,515,395"/>
<area shape="rect" id="node8" href="$_p_s3_b_t_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.h" alt="" coords="539,355,643,395"/>
<area shape="rect" id="node10" href="$_s_p_p_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/SPP.h" alt="" coords="667,359,796,390"/>
<area shape="rect" id="node12" href="$_wii_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Wii.h" alt="" coords="262,359,385,390"/>
<area shape="rect" id="node9" href="$_p_s3_b_t_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.cpp" alt="" coords="539,453,643,493"/>
<area shape="rect" id="node11" href="$_s_p_p_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/SPP.cpp" alt="" coords="680,453,784,493"/>
<area shape="rect" id="node13" href="$_wii_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Wii.cpp" alt="" coords="272,453,376,493"/>
<area shape="rect" id="node15" href="$cdcacm_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcacm.cpp" alt="" coords="5,355,109,395"/>
<area shape="rect" id="node17" href="$cdcprolific_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcprolific.cpp" alt="" coords="133,453,237,493"/>
<area shape="rect" id="node19" href="$cdcftdi_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcftdi.cpp" alt="" coords="821,355,925,395"/>
<area shape="rect" id="node21" href="$le3dp__rptparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/le3dp/le3dp\l_rptparser.cpp" alt="" coords="2121,449,2239,498"/>
<area shape="rect" id="node23" href="$hidjoystickrptparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/USBHIDJoystick\l/hidjoystickrptparser.cpp" alt="" coords="2520,449,2656,498"/>
<area shape="rect" id="node25" href="$hid_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hid.cpp" alt="" coords="2392,355,2496,395"/>
<area shape="rect" id="node30" href="$hiduniversal_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.h" alt="" coords="2264,355,2368,395"/>
<area shape="rect" id="node27" href="$hidboot_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidboot.cpp" alt="" coords="1992,453,2096,493"/>
<area shape="rect" id="node29" href="$hidescriptorparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidescriptorparser.cpp" alt="" coords="1864,453,1968,493"/>
<area shape="rect" id="node31" href="$hiduniversal_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.cpp" alt="" coords="2264,453,2368,493"/>
<area shape="rect" id="node33" href="$masstorage_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.cpp" alt="" coords="1736,355,1840,395"/>
<area shape="rect" id="node35" href="$max___l_c_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.cpp" alt="" coords="1205,355,1309,395"/>
<area shape="rect" id="node37" href="$_p_s3_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.cpp" alt="" coords="1333,355,1437,395"/>
<area shape="rect" id="node40" href="$usbhub_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.cpp" alt="" coords="1608,355,1712,395"/>
<area shape="rect" id="node42" href="$_x_b_o_x_r_e_c_v_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.cpp" alt="" coords="1077,355,1181,395"/>
<area shape="rect" id="node44" href="$_x_b_o_x_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXUSB.cpp" alt="" coords="1461,355,1565,395"/>
<area shape="rect" id="node2" href="$adk_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/adk.h" alt="" coords="2167,266,2292,297"/>
<area shape="rect" id="node4" href="$usbhost_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhost.h" alt="" coords="1887,93,1991,133"/>
<area shape="rect" id="node5" href="$_usb_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Usb.h" alt="" coords="1434,182,1560,213"/>
<area shape="rect" id="node14" href="$cdcacm_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcacm.h" alt="" coords="769,261,873,301"/>
<area shape="rect" id="node18" href="$cdcftdi_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcftdi.h" alt="" coords="385,261,489,301"/>
<area shape="rect" id="node16" href="$cdcprolific_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcprolific.h" alt="" coords="692,355,796,395"/>
<area shape="rect" id="node20" href="$le3dp__rptparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/le3dp/le3dp\l_rptparser.h" alt="" coords="1334,350,1452,399"/>
<area shape="rect" id="node22" href="$hidjoystickrptparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/USBHIDJoystick\l/hidjoystickrptparser.h" alt="" coords="1733,350,1869,399"/>
<area shape="rect" id="node24" href="$hid_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/hid.h" alt="" coords="1535,266,1659,297"/>
<area shape="rect" id="node26" href="$hidboot_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidboot.h" alt="" coords="1896,355,2000,395"/>
<area shape="rect" id="node28" href="$hidescriptorparser_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidescriptorparser.h" alt="" coords="2025,355,2129,395"/>
<area shape="rect" id="node32" href="$masstorage_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.h" alt="" coords="2444,261,2548,301"/>
<area shape="rect" id="node38" href="$_usb_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Usb.cpp" alt="" coords="1836,261,1940,301"/>
<area shape="rect" id="node39" href="$usbhub_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.h" alt="" coords="2316,261,2420,301"/>
<area shape="rect" id="node3" href="$adk_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/adk.cpp" alt="" coords="2177,355,2281,395"/>
<area shape="rect" id="node6" href="$_b_t_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/BTD.h" alt="" coords="514,266,643,297"/>
<area shape="rect" id="node34" href="$max___l_c_d_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.h" alt="" coords="948,261,1052,301"/>
<area shape="rect" id="node36" href="$_p_s3_u_s_b_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.h" alt="" coords="1076,261,1180,301"/>
<area shape="rect" id="node41" href="$_x_b_o_x_r_e_c_v_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.h" alt="" coords="1204,261,1308,301"/>
<area shape="rect" id="node7" href="$_b_t_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/BTD.cpp" alt="" coords="436,355,540,395"/>
<area shape="rect" id="node8" href="$_p_s3_b_t_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.h" alt="" coords="564,355,668,395"/>
<area shape="rect" id="node10" href="$_s_p_p_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/SPP.h" alt="" coords="134,359,263,390"/>
<area shape="rect" id="node12" href="$_wii_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0/Wii.h" alt="" coords="287,359,411,390"/>
<area shape="rect" id="node9" href="$_p_s3_b_t_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3BT.cpp" alt="" coords="564,453,668,493"/>
<area shape="rect" id="node11" href="$_s_p_p_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/SPP.cpp" alt="" coords="147,453,251,493"/>
<area shape="rect" id="node13" href="$_wii_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/Wii.cpp" alt="" coords="297,453,401,493"/>
<area shape="rect" id="node15" href="$cdcacm_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcacm.cpp" alt="" coords="820,355,924,395"/>
<area shape="rect" id="node17" href="$cdcprolific_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcprolific.cpp" alt="" coords="692,453,796,493"/>
<area shape="rect" id="node19" href="$cdcftdi_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/cdcftdi.cpp" alt="" coords="5,355,109,395"/>
<area shape="rect" id="node21" href="$le3dp__rptparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/le3dp/le3dp\l_rptparser.cpp" alt="" coords="1334,449,1452,498"/>
<area shape="rect" id="node23" href="$hidjoystickrptparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/examples/HID/USBHIDJoystick\l/hidjoystickrptparser.cpp" alt="" coords="1733,449,1869,498"/>
<area shape="rect" id="node25" href="$hid_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hid.cpp" alt="" coords="1605,355,1709,395"/>
<area shape="rect" id="node30" href="$hiduniversal_8h.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.h" alt="" coords="1477,355,1581,395"/>
<area shape="rect" id="node27" href="$hidboot_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidboot.cpp" alt="" coords="1896,453,2000,493"/>
<area shape="rect" id="node29" href="$hidescriptorparser_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hidescriptorparser.cpp" alt="" coords="2025,453,2129,493"/>
<area shape="rect" id="node31" href="$hiduniversal_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/hiduniversal.cpp" alt="" coords="1477,453,1581,493"/>
<area shape="rect" id="node33" href="$masstorage_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/masstorage.cpp" alt="" coords="2444,355,2548,395"/>
<area shape="rect" id="node35" href="$max___l_c_d_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/max_LCD.cpp" alt="" coords="948,355,1052,395"/>
<area shape="rect" id="node37" href="$_p_s3_u_s_b_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/PS3USB.cpp" alt="" coords="1076,355,1180,395"/>
<area shape="rect" id="node40" href="$usbhub_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/usbhub.cpp" alt="" coords="2316,355,2420,395"/>
<area shape="rect" id="node42" href="$_x_b_o_x_r_e_c_v_8cpp.html" title="/Users/Lauszus/GitHub\l/USB_Host_Shield_2.0\l/XBOXRECV.cpp" alt="" coords="1204,355,1308,395"/>
</map>

View file

@ -1 +1 @@
ec46f74a03913c59d6802a20aa198a7a
252a859ba6e6a088b5d76a3585b78527

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 228 KiB

File diff suppressed because it is too large Load diff

View file

@ -96,10 +96,12 @@ Include dependency graph for cdcacm.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2cdcacm_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2cdcacm_8cpp">
<area shape="rect" id="node2" href="cdcacm_8h.html" title="cdcacm.h" alt="" coords="699,93,755,115"/><area shape="rect" id="node5" href="avrpins_8h.html" title="avrpins.h" alt="" coords="79,301,133,323"/><area shape="rect" id="node7" href="max3421e_8h.html" title="max3421e.h" alt="" coords="213,301,280,323"/><area shape="rect" id="node8" href="usbhost_8h.html" title="usbhost.h" alt="" coords="195,232,252,253"/><area shape="rect" id="node9" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="613,301,672,323"/><area shape="rect" id="node10" href="_usb_8h.html" title="Usb.h" alt="" coords="477,163,520,184"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="1151,371,1208,392"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="1104,301,1165,323"/><area shape="rect" id="node17" href="message_8h.html" title="message.h" alt="" coords="816,301,877,323"/><area shape="rect" id="node18" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="933,163,1016,184"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="430,232,487,253"/><area shape="rect" id="node19" href="parsetools_8h.html" title="parsetools.h" alt="" coords="942,232,1007,253"/></map>
</div>
</div></div><!-- contents -->
</div>
<p><a href="cdcacm_8cpp_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

458
cdcacm_8cpp_source.html Normal file
View file

@ -0,0 +1,458 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/cdcacm.cpp 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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">cdcacm.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="cdcacm_8cpp.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="preprocessor">#include &quot;<a class="code" href="cdcacm_8h.html">cdcacm.h</a>&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="keyword">const</span> uint8_t <a class="code" href="class_a_c_m.html#a5917b5098e529fafe67a53e03f1e7011">ACM::epDataInIndex</a> = 1; </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="keyword">const</span> uint8_t <a class="code" href="class_a_c_m.html#a0dc940bc4f1bed7525bb768e37e6cb61">ACM::epDataOutIndex</a> = 2; </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="keyword">const</span> uint8_t <a class="code" href="class_a_c_m.html#a9b32207fdf256e5f8553ba4048b64307">ACM::epInterruptInIndex</a> = 3; </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"><a class="code" href="class_a_c_m.html#aa5d83ef9d48dab404090e9136522707a"> 23</a></span>&#160;<a class="code" href="class_a_c_m.html#aa5d83ef9d48dab404090e9136522707a">ACM::ACM</a>(<a class="code" href="class_u_s_b.html">USB</a> *p, <a class="code" href="class_c_d_c_async_oper.html">CDCAsyncOper</a> *pasync) :</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; pUsb(p),</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; pAsync(pasync),</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; bAddress(0),</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; qNextPollTime(0), </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; bPollEnable(false), </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; bControlIface(0), </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; bDataIface(0), </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; bNumEP(1),</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; ready(false) </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;{</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0; i&lt;<a class="code" href="cdcacm_8h.html#aa11e629b02a0cd7d768f796732cb2694">ACM_MAX_ENDPOINTS</a>; i++)</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; {</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[i].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (i) ? 0 : 8;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = 0;</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a660e8da9c1167a8450aef91c5c03761d">USB_NAK_NOWAIT</a>;</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="comment">//epInfo[i].bmNakPower = USB_NAK_MAX_POWER;</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keywordflow">if</span> (!i)</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[i].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a517dfa014946e2d087d197312234a1de">USB_NAK_MAX_POWER</a>; </div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; }</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>)</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2">RegisterDeviceClass</a>(<span class="keyword">this</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"> 49</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="class_a_c_m.html#ad3210651d58c77d3ded4b4b83a9476b7"> 50</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#ad3210651d58c77d3ded4b4b83a9476b7">ACM::Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed)</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;{</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keyword">const</span> uint8_t constBufSize = <span class="keyword">sizeof</span>(<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="l00053"></a><span class="lineno"> 53</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; uint8_t buf[constBufSize];</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = NULL;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *oldep_ptr = NULL;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; uint8_t num_of_conf; <span class="comment">// number of configurations</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>();</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;ACM Init\r\n&quot;</span>);</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>)</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</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">// Get pointer to pseudo device with address 0 assigned</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(0);</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</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; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>)</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; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;epinfo\r\n&quot;</span>);</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">// Save old pointer to EP_RECORD of address 0</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; oldep_ptr = p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="comment">// Temporary assign new pointer to epInfo to p-&gt;epinfo in order to avoid toggle inconsistence</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>;</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">// Get device descriptor</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">getDevDescr</a>( 0, 0, constBufSize, (uint8_t*)buf );</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="comment">// Restore p-&gt;epinfo</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = oldep_ptr;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">if</span>( rcode ) </div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">goto</span> FailGetDevDescr;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a> = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>)</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="comment">// Extract Max Packet Size from the device descriptor</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (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">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0; </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( 0, 0, <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a> );</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; {</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a> = 0;</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;setAddr:&quot;</span>,rcode);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; }</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;Addr:&quot;</span>, <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>);</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; num_of_conf = ((<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>*)buf)-&gt;bNumConfigurations;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 1, <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;NC:&quot;</span>, num_of_conf);</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="keywordflow">for</span> (uint8_t i=0; i&lt;num_of_conf; i++)</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; {</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <a class="code" href="class_config_desc_parser.html">ConfigDescParser</a>&lt; <a class="code" href="_usb_8h.html#abb99f6b1f38ff79ec678cd957ac86758">USB_CLASS_COM_AND_CDC_CTRL</a>, </div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <a class="code" href="cdcacm_8h.html#acce3aedc4473cc5526efc16448b89221">CDC_SUBCLASS_ACM</a>, </div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <a class="code" href="cdcacm_8h.html#a13977894f3398454f6573995afb89c5b">CDC_PROTOCOL_ITU_T_V_250</a>, </div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <a class="code" href="confdescparser_8h.html#a97d95efc3446be55adbb1801c356c55c">CP_MASK_COMPARE_CLASS</a> | </div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <a class="code" href="confdescparser_8h.html#a640401f5d117e10f0f0fd26f74f3975e">CP_MASK_COMPARE_SUBCLASS</a> | </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <a class="code" href="confdescparser_8h.html#a1e4d3b53bdd61abb61f20d5973e194d7">CP_MASK_COMPARE_PROTOCOL</a>&gt; CdcControlParser(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; </div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <a class="code" href="class_config_desc_parser.html">ConfigDescParser</a>&lt;<a class="code" href="_usb_8h.html#a7dae7df3ce2685f96775f2a0fb8658ae">USB_CLASS_CDC_DATA</a>, 0, 0, </div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <a class="code" href="confdescparser_8h.html#a97d95efc3446be55adbb1801c356c55c">CP_MASK_COMPARE_CLASS</a>&gt; CdcDataParser(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, i, &amp;CdcControlParser);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, i, &amp;CdcDataParser);</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_a_c_m.html#a058b4d4a088a002fcde4fb2b75e33f93">bNumEP</a> &gt; 1)</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; } <span class="comment">// for</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_a_c_m.html#a058b4d4a088a002fcde4fb2b75e33f93">bNumEP</a> &lt; 4)</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, <a class="code" href="class_a_c_m.html#a058b4d4a088a002fcde4fb2b75e33f93">bNumEP</a>, <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>);</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;Conf:&quot;</span>, <a class="code" href="class_a_c_m.html#af1a17c2d77625599da12b26cb0c90d39">bConfNum</a>);</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="comment">// Set Configuration Value</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="class_a_c_m.html#af1a17c2d77625599da12b26cb0c90d39">bConfNum</a>);</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordflow">goto</span> FailSetConf;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; rcode = <a class="code" href="class_a_c_m.html#a3f160c6c757994f0c30bd5c5f1fb9d95">pAsync</a>-&gt;<a class="code" href="class_c_d_c_async_oper.html#a899353c3cbf83d7f874d11e5d9db4722">OnInit</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordflow">goto</span> FailOnInit;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;ACM configured\r\n&quot;</span>);</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <a class="code" href="class_a_c_m.html#a8ebf4b872b0ed66e93b4ed39f46290fd">ready</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="comment">//bPollEnable = true;</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="comment">//USBTRACE(&quot;Poll enabled\r\n&quot;);</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;getDevDescr:&quot;</span>);</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;setDevTblEn:&quot;</span>);</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;FailGetConfDescr:</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;getConf:&quot;</span>);</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;FailSetConf:</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;setConf:&quot;</span>);</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;FailOnInit:</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;OnInit:&quot;</span>);</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;Fail:</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; Serial.println(rcode, HEX);</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <a class="code" href="class_a_c_m.html#a768c0fd4ef7f5c52de9e5e7431685279">Release</a>();</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;}</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;</div>
<div class="line"><a name="l00211"></a><span class="lineno"><a class="code" href="class_a_c_m.html#af5b411a7ccc82bd77a7c5cfba6cd9a86"> 211</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_a_c_m.html#af5b411a7ccc82bd77a7c5cfba6cd9a86">ACM::EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, <span class="keyword">const</span> <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> *pep) </div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;{</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="comment">//ErrorMessage&lt;uint8_t&gt;(PSTR(&quot;Conf.Val&quot;), conf);</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="comment">//ErrorMessage&lt;uint8_t&gt;(PSTR(&quot;Iface Num&quot;),iface);</span></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="comment">//ErrorMessage&lt;uint8_t&gt;(PSTR(&quot;Alt.Set&quot;), alt);</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <a class="code" href="class_a_c_m.html#af1a17c2d77625599da12b26cb0c90d39">bConfNum</a> = conf;</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; uint8_t index;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keywordflow">if</span> ((pep-&gt;<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> &amp; 0x03) == 3 &amp;&amp; (pep-&gt;<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> &amp; 0x80) == 0x80)</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; index = <a class="code" href="class_a_c_m.html#a9b32207fdf256e5f8553ba4048b64307">epInterruptInIndex</a>;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="keywordflow">else</span> </div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">if</span> ((pep-&gt;<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> &amp; 0x02) == 2)</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; index = ((pep-&gt;<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> &amp; 0x80) == 0x80) ? <a class="code" href="class_a_c_m.html#a5917b5098e529fafe67a53e03f1e7011">epDataInIndex</a> : <a class="code" href="class_a_c_m.html#a0dc940bc4f1bed7525bb768e37e6cb61">epDataOutIndex</a>; </div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="comment">// Fill in the endpoint info structure</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[index].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = (pep-&gt;<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> &amp; 0x0F);</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[index].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (uint8_t)pep-&gt;<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>;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="comment">//epInfo[index].epAttribs = 0;</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <a class="code" href="class_a_c_m.html#a058b4d4a088a002fcde4fb2b75e33f93">bNumEP</a> ++;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="comment">//PrintEndpointDescriptor(pep);</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;}</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;</div>
<div class="line"><a name="l00239"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a768c0fd4ef7f5c52de9e5e7431685279"> 239</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a768c0fd4ef7f5c52de9e5e7431685279">ACM::Release</a>()</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;{</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>);</div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; <a class="code" href="class_a_c_m.html#a5512d9e8c8c59371f16018fe8ce46b19">bControlIface</a> = 0; </div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <a class="code" href="class_a_c_m.html#a720b72b524e03da8f17c045e0d689ba1">bDataIface</a> = 0; </div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <a class="code" href="class_a_c_m.html#a058b4d4a088a002fcde4fb2b75e33f93">bNumEP</a> = 1; </div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a> = 0;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <a class="code" href="class_a_c_m.html#a6701d70ae4734e8a81971d9fb8b085f2">qNextPollTime</a> = 0;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <a class="code" href="class_a_c_m.html#acd6716c4fc871942fca55e1501dc5b09">bPollEnable</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <a class="code" href="class_a_c_m.html#a8ebf4b872b0ed66e93b4ed39f46290fd">ready</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;}</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160;</div>
<div class="line"><a name="l00254"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a79e4da2cae9145d895a6a1211a96fe36"> 254</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a79e4da2cae9145d895a6a1211a96fe36">ACM::Poll</a>()</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160;{</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; uint8_t rcode = 0;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_a_c_m.html#acd6716c4fc871942fca55e1501dc5b09">bPollEnable</a>)</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="comment">//uint32_t time_now = millis();</span></div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="comment">//if (qNextPollTime &lt;= time_now)</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; <span class="comment">//{</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="comment">// qNextPollTime = time_now + 100;</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="comment">// uint8_t rcode;</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="comment">// const uint8_t constBufSize = 16;</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; <span class="comment">// uint8_t buf[constBufSize];</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="comment">// for (uint8_t i=0; i&lt;constBufSize; i++)</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="comment">// buf[i] = 0;</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="comment">// uint16_t read = (constBufSize &gt; epInfo[epInterruptInIndex].maxPktSize) </span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="comment">// ? epInfo[epInterruptInIndex].maxPktSize : constBufSize;</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="comment">// rcode = pUsb-&gt;inTransfer(bAddress, epInfo[epInterruptInIndex].epAddr, &amp;read, buf);</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="comment">// if (rcode)</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="comment">// return rcode;</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160;</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <span class="comment">// for (uint8_t i=0; i&lt;read; i++)</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; <span class="comment">// {</span></div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="comment">// PrintHex&lt;uint8_t&gt;(buf[i]);</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="comment">// Serial.print(&quot; &quot;);</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="comment">// }</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="comment">// USBTRACE(&quot;\r\n&quot;);</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="comment">//}</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;}</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;</div>
<div class="line"><a name="l00291"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a7f455b7a649522c29f2e63d668b0ccca"> 291</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a7f455b7a649522c29f2e63d668b0ccca">ACM::RcvData</a>(uint16_t *bytes_rcvd, uint8_t *dataptr)</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;{</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[<a class="code" href="class_a_c_m.html#a5917b5098e529fafe67a53e03f1e7011">epDataInIndex</a>].epAddr, bytes_rcvd, dataptr);</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160;}</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160;</div>
<div class="line"><a name="l00296"></a><span class="lineno"><a class="code" href="class_a_c_m.html#ac96caeb8d657fa76219872ceb4379923"> 296</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#ac96caeb8d657fa76219872ceb4379923">ACM::SndData</a>(uint16_t nbytes, uint8_t *dataptr)</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;{</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[<a class="code" href="class_a_c_m.html#a0dc940bc4f1bed7525bb768e37e6cb61">epDataOutIndex</a>].epAddr, nbytes, dataptr);</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160;}</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;<span class="comment">/* untested */</span></div>
<div class="line"><a name="l00302"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a4deddfbfb1d9010b71096cbfd46b2dfb"> 302</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a4deddfbfb1d9010b71096cbfd46b2dfb">ACM::GetNotif</a>( uint16_t *bytes_rcvd, uint8_t *dataptr )</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160;{</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[<a class="code" href="class_a_c_m.html#a9b32207fdf256e5f8553ba4048b64307">epInterruptInIndex</a>].epAddr, bytes_rcvd, dataptr);</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160;}</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;</div>
<div class="line"><a name="l00307"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a62c91ac62e8e3bf66bc3940d5b934c10"> 307</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a62c91ac62e8e3bf66bc3940d5b934c10">ACM::SetCommFeature</a>(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160;{</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="cdcacm_8h.html#a5797aa38c730dde78bf3181282bd6bf9">bmREQ_CDCOUT</a>, <a class="code" href="cdcacm_8h.html#a893b79445f99070657e8d45f6495b174">CDC_SET_COMM_FEATURE</a>, (fid &amp; 0xff), (fid &gt;&gt; 8), <a class="code" href="class_a_c_m.html#a5512d9e8c8c59371f16018fe8ce46b19">bControlIface</a>, nbytes, nbytes, dataptr, NULL )); </div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;}</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160;</div>
<div class="line"><a name="l00312"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a18208672a707391863b8abdc6714c825"> 312</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a18208672a707391863b8abdc6714c825">ACM::GetCommFeature</a>(uint16_t fid, uint8_t nbytes, uint8_t *dataptr)</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;{</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="cdcacm_8h.html#af2ac2e2644603a3d1013be940c43314d">bmREQ_CDCIN</a>, <a class="code" href="cdcacm_8h.html#ad0912dac888d01142b225b0c6f8a508f">CDC_GET_COMM_FEATURE</a>, (fid &amp; 0xff), (fid &gt;&gt; 8), <a class="code" href="class_a_c_m.html#a5512d9e8c8c59371f16018fe8ce46b19">bControlIface</a>, nbytes, nbytes, dataptr, NULL )); </div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;}</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160;</div>
<div class="line"><a name="l00317"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a74a3484a0f524ddf0e228c17addcebdf"> 317</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a74a3484a0f524ddf0e228c17addcebdf">ACM::ClearCommFeature</a>(uint16_t fid)</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;{</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="cdcacm_8h.html#a5797aa38c730dde78bf3181282bd6bf9">bmREQ_CDCOUT</a>, <a class="code" href="cdcacm_8h.html#a6c79b8666110840333ad3785bf7ce87c">CDC_CLEAR_COMM_FEATURE</a>, (fid &amp; 0xff), (fid &gt;&gt; 8), <a class="code" href="class_a_c_m.html#a5512d9e8c8c59371f16018fe8ce46b19">bControlIface</a>, 0, 0, NULL, NULL )); </div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;}</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;</div>
<div class="line"><a name="l00322"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a79eb8706c7f1432593fb2f2eee0da504"> 322</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a79eb8706c7f1432593fb2f2eee0da504">ACM::SetLineCoding</a>(<span class="keyword">const</span> <a class="code" href="struct_l_i_n_e___c_o_d_i_n_g.html">LINE_CODING</a> *dataptr)</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160;{</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="cdcacm_8h.html#a5797aa38c730dde78bf3181282bd6bf9">bmREQ_CDCOUT</a>, <a class="code" href="cdcacm_8h.html#ad07ce089c8757b8d2ff37ddd83dc9351">CDC_SET_LINE_CODING</a>, 0x00, 0x00, <a class="code" href="class_a_c_m.html#a5512d9e8c8c59371f16018fe8ce46b19">bControlIface</a>, <span class="keyword">sizeof</span>(<a class="code" href="struct_l_i_n_e___c_o_d_i_n_g.html">LINE_CODING</a>), <span class="keyword">sizeof</span>(<a class="code" href="struct_l_i_n_e___c_o_d_i_n_g.html">LINE_CODING</a>), (uint8_t*)dataptr, NULL )); </div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;}</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;</div>
<div class="line"><a name="l00327"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a9d922317b25a7ae086a6fe79984ab8d1"> 327</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a9d922317b25a7ae086a6fe79984ab8d1">ACM::GetLineCoding</a>(<a class="code" href="struct_l_i_n_e___c_o_d_i_n_g.html">LINE_CODING</a> *dataptr)</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;{</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="cdcacm_8h.html#af2ac2e2644603a3d1013be940c43314d">bmREQ_CDCIN</a>, <a class="code" href="cdcacm_8h.html#a1068ab45668e413d964a01bc36fa2d43">CDC_GET_LINE_CODING</a>, 0x00, 0x00, <a class="code" href="class_a_c_m.html#a5512d9e8c8c59371f16018fe8ce46b19">bControlIface</a>, <span class="keyword">sizeof</span>(<a class="code" href="struct_l_i_n_e___c_o_d_i_n_g.html">LINE_CODING</a>), <span class="keyword">sizeof</span>(<a class="code" href="struct_l_i_n_e___c_o_d_i_n_g.html">LINE_CODING</a>), (uint8_t*)dataptr, NULL )); </div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;}</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;</div>
<div class="line"><a name="l00332"></a><span class="lineno"><a class="code" href="class_a_c_m.html#af2e08e5f03f17ed039985147a7129bbd"> 332</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#af2e08e5f03f17ed039985147a7129bbd">ACM::SetControlLineState</a>(uint8_t state)</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;{</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="cdcacm_8h.html#a5797aa38c730dde78bf3181282bd6bf9">bmREQ_CDCOUT</a>, <a class="code" href="cdcacm_8h.html#a11c392243dec4d03970f1eaa1f8053ae">CDC_SET_CONTROL_LINE_STATE</a>, state, 0, <a class="code" href="class_a_c_m.html#a5512d9e8c8c59371f16018fe8ce46b19">bControlIface</a>, 0, 0, NULL, NULL )); </div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160;}</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160;</div>
<div class="line"><a name="l00337"></a><span class="lineno"><a class="code" href="class_a_c_m.html#a2a618cbff52737740e76977db557ddff"> 337</a></span>&#160;uint8_t <a class="code" href="class_a_c_m.html#a2a618cbff52737740e76977db557ddff">ACM::SendBreak</a>(uint16_t duration)</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160;{</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; <span class="keywordflow">return</span>( <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>( <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="cdcacm_8h.html#a5797aa38c730dde78bf3181282bd6bf9">bmREQ_CDCOUT</a>, <a class="code" href="cdcacm_8h.html#a868c480caf0abda6b458c82281dda8ad">CDC_SEND_BREAK</a>, (duration &amp; 0xff), (duration &gt;&gt; 8), <a class="code" href="class_a_c_m.html#a5512d9e8c8c59371f16018fe8ce46b19">bControlIface</a>, 0, 0, NULL, NULL )); </div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160;}</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160;</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160;</div>
<div class="line"><a name="l00343"></a><span class="lineno"><a class="code" href="class_a_c_m.html#aa05a65487f5e02bab40ccba1018ee5b6"> 343</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_a_c_m.html#aa05a65487f5e02bab40ccba1018ee5b6">ACM::PrintEndpointDescriptor</a>( <span class="keyword">const</span> <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>* ep_ptr )</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160;{</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;Endpoint descriptor:&quot;</span>));</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nLength:\t\t&quot;</span>));</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nType:\t\t&quot;</span>));</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress:\t&quot;</span>));</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAttributes:\t&quot;</span>));</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMaxPktSize:\t&quot;</span>));</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; PrintHex&lt;uint16_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPoll Intrv:\t&quot;</span>));</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>));</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -265,6 +265,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00160">160</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac79c185e34b15634c1ba5d15eb8c831c"></a>
@ -277,6 +279,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00095">95</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="af2ac2e2644603a3d1013be940c43314d"></a>
@ -289,6 +293,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00041">41</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5797aa38c730dde78bf3181282bd6bf9"></a>
@ -301,6 +307,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00040">40</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a16e45b21be9797a7190330fd10bc1b07"></a>
@ -313,6 +321,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00098">98</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6c79b8666110840333ad3785bf7ce87c"></a>
@ -325,6 +335,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00073">73</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4d1029757801882e8d6589c05a3c41db"></a>
@ -337,6 +349,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00090">90</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad0912dac888d01142b225b0c6f8a508f"></a>
@ -349,6 +363,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00072">72</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6170632c774a3163b5a9927cc4e960ec"></a>
@ -361,6 +377,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00068">68</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1068ab45668e413d964a01bc36fa2d43"></a>
@ -373,6 +391,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00081">81</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a725da0e1d595c7aebacb9fa3df4d7231"></a>
@ -385,6 +405,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00089">89</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a257e7150670c8cc0b1d90c8f19c36b38"></a>
@ -397,6 +419,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00087">87</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7a17ca0755e655bd1fe6ac97b68ec10f"></a>
@ -409,6 +433,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00085">85</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0cdc3e66270e78dc62f6fdab6806e4ac"></a>
@ -421,6 +447,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00062">62</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a25dc8a5a03fa46bc6d18be73a318b725"></a>
@ -433,6 +461,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00063">63</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a74f58c97749d65adfcf0d8fcd8739713"></a>
@ -445,6 +475,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00061">61</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a13977894f3398454f6573995afb89c5b"></a>
@ -457,6 +489,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00058">58</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad5fce51c970f6a1c2bd70a304db8504f"></a>
@ -469,6 +503,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00059">59</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a199157a779e1f1d70b7460157b874fbb"></a>
@ -481,6 +517,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00060">60</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae0e669ccb182282b45af577b84ea190f"></a>
@ -493,6 +531,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00064">64</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="aab5439915442bd5b835d7c755ba5fec1"></a>
@ -505,6 +545,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00076">76</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a763f022025ebdaa3e6fb3dd6b5bef118"></a>
@ -517,6 +559,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00079">79</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a868c480caf0abda6b458c82281dda8ad"></a>
@ -529,6 +573,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00083">83</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7aaa245703a0a2191c27697715f3727c"></a>
@ -541,6 +587,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00067">67</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="af83535db4560a2fa52c72571f914dfc1"></a>
@ -553,6 +601,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00077">77</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac39a42b128864ba4fae224be0078adba"></a>
@ -565,6 +615,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00074">74</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a893b79445f99070657e8d45f6495b174"></a>
@ -577,6 +629,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00071">71</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a11c392243dec4d03970f1eaa1f8053ae"></a>
@ -589,6 +643,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00082">82</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a367e07b7ce50e3a17703da1dea7f05a1"></a>
@ -601,6 +657,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00075">75</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad07ce089c8757b8d2ff37ddd83dc9351"></a>
@ -613,6 +671,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00080">80</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a74433e0421d2cfd59982db6417a8ea41"></a>
@ -625,6 +685,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00088">88</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a437557c6adb23d8cdde7842b62a03a21"></a>
@ -637,6 +699,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00086">86</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a83ededfa85fdc32e603f9d1cdccbad78"></a>
@ -649,6 +713,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00078">78</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="aacceff07ade4b94b3c924d4f4ad6b139"></a>
@ -661,6 +727,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00084">84</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="acce3aedc4473cc5526efc16448b89221"></a>
@ -673,6 +741,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00045">45</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="af1a7d3d1e1dd78003500d6fccd205461"></a>
@ -685,6 +755,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00050">50</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab35e4890d2a9820b89f17d86e63e6a30"></a>
@ -697,6 +769,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00048">48</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a27674e866e3a2422d8fc38b873f19723"></a>
@ -709,6 +783,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00052">52</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9d555a2c20cdda9166df1f1a0deb2fe6"></a>
@ -721,6 +797,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00044">44</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="aad198585b3a333441d39c04c9a6f8dfc"></a>
@ -733,6 +811,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00049">49</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6ef074fafbca12dadc97de1511563629"></a>
@ -745,6 +825,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00055">55</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a279c0e93e9cf1c328e9551e62ebdc342"></a>
@ -757,6 +839,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00047">47</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a110580c0368ed8a8d657e6812fa5cffe"></a>
@ -769,6 +853,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00053">53</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab1094071380f381e0b8b88d240aedd03"></a>
@ -781,6 +867,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00054">54</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8e66107828e9b10a8b37823cb4436209"></a>
@ -793,6 +881,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00046">46</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad331bb2702e65696ca33c2d933ab2d73"></a>
@ -805,6 +895,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00051">51</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0bf4e444b84f8ab8bb1b3dfe16dc93de"></a>
@ -817,6 +909,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00100">100</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0a06858faca59d300fbadd0e37e312c9"></a>
@ -829,6 +923,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00099">99</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9e48b736a3dbd35ebbe8507b29dec86a"></a>
@ -841,6 +937,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00093">93</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac0ba0ade7f2d2a3b9c4cef90931e8237"></a>
@ -853,6 +951,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00094">94</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a83130a0c72dea5b783134e28665628ee"></a>
@ -865,6 +965,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00096">96</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8e278dbd137d5d873d24e1647be9d4e6"></a>
@ -877,6 +979,8 @@ Typedefs</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00097">97</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
@ -920,7 +1024,7 @@ Typedefs</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -302,7 +302,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -96,10 +96,12 @@ Include dependency graph for cdcftdi.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2cdcftdi_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2cdcftdi_8cpp">
<area shape="rect" id="node2" href="cdcftdi_8h.html" title="cdcftdi.h" alt="" coords="701,93,752,115"/><area shape="rect" id="node5" href="avrpins_8h.html" title="avrpins.h" alt="" coords="79,301,133,323"/><area shape="rect" id="node7" href="max3421e_8h.html" title="max3421e.h" alt="" coords="213,301,280,323"/><area shape="rect" id="node8" href="usbhost_8h.html" title="usbhost.h" alt="" coords="195,232,252,253"/><area shape="rect" id="node9" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="613,301,672,323"/><area shape="rect" id="node10" href="_usb_8h.html" title="Usb.h" alt="" coords="477,163,520,184"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="1151,371,1208,392"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="1104,301,1165,323"/><area shape="rect" id="node17" href="message_8h.html" title="message.h" alt="" coords="816,301,877,323"/><area shape="rect" id="node18" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="933,163,1016,184"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="430,232,487,253"/><area shape="rect" id="node19" href="parsetools_8h.html" title="parsetools.h" alt="" coords="942,232,1007,253"/></map>
</div>
</div></div><!-- contents -->
</div>
<p><a href="cdcftdi_8cpp_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

447
cdcftdi_8cpp_source.html Normal file
View file

@ -0,0 +1,447 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/cdcftdi.cpp 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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">cdcftdi.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="cdcftdi_8cpp.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="preprocessor">#include &quot;<a class="code" href="cdcftdi_8h.html">cdcftdi.h</a>&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="keyword">const</span> uint8_t FTDI::epDataInIndex = 1; </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="keyword">const</span> uint8_t FTDI::epDataOutIndex = 2; </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="keyword">const</span> uint8_t FTDI::epInterruptInIndex = 3; </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"><a class="code" href="class_f_t_d_i.html#ae517a5435ada4145998aa7b07e78adb3"> 23</a></span>&#160;<a class="code" href="class_f_t_d_i.html#ae517a5435ada4145998aa7b07e78adb3">FTDI::FTDI</a>(<a class="code" href="class_u_s_b.html">USB</a> *p, <a class="code" href="class_f_t_d_i_async_oper.html">FTDIAsyncOper</a> *pasync) :</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160; pAsync(pasync),</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; pUsb(p),</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; bAddress(0),</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; bNumEP(1),</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; wFTDIType(0)</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;{</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; <span class="keywordflow">for</span>(uint8_t i=0; i&lt;<a class="code" href="cdcftdi_8h.html#a9d25344c78c7608f2e49de9767abd0d9">FTDI_MAX_ENDPOINTS</a>; i++)</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; {</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; epInfo[i].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = 0;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; epInfo[i].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (i) ? 0 : 8;</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; epInfo[i].<a class="code" href="struct_ep_info.html#a1dea928517c961235eef7b0876e69f10">epAttribs</a> = 0;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="comment">//if (!i)</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; epInfo[i].<a class="code" href="struct_ep_info.html#a3a5b1c017a034cd9e06e76729e727c46">bmNakPower</a> = <a class="code" href="address_8h.html#a517dfa014946e2d087d197312234a1de">USB_NAK_MAX_POWER</a>;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; }</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; <span class="keywordflow">if</span> (pUsb)</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; pUsb-&gt;<a class="code" href="class_u_s_b.html#a3f66bf622590413ef2e1864f93a3e0d2">RegisterDeviceClass</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;}</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#a2d40115414dadfee8c284e0f5d397621"> 43</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#a2d40115414dadfee8c284e0f5d397621">FTDI::Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed)</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;{</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">const</span> uint8_t constBufSize = <span class="keyword">sizeof</span>(<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="l00046"></a><span class="lineno"> 46</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; uint8_t buf[constBufSize];</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = NULL;</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *oldep_ptr = NULL;</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; uint8_t len = 0;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; uint16_t cd_len = 0;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; uint8_t num_of_conf; <span class="comment">// number of configurations</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; uint8_t num_of_intf; <span class="comment">// number of interfaces</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = pUsb-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>();</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; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;FTDI Init\r\n&quot;</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"> 61</span>&#160; <span class="keywordflow">if</span> (bAddress)</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="comment">// Get pointer to pseudo device with address 0 assigned</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(0);</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="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>)</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; {</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;epinfo\r\n&quot;</span>);</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</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;</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">// Save old pointer to EP_RECORD of address 0</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; oldep_ptr = p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>;</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">// Temporary assign new pointer to epInfo to p-&gt;epinfo in order to avoid toggle inconsistence</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = epInfo;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="comment">// Get device descriptor</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; rcode = pUsb-&gt;<a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">getDevDescr</a>( 0, 0, <span class="keyword">sizeof</span>(<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>), (uint8_t*)buf );</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">// Restore p-&gt;epinfo</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = oldep_ptr;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keywordflow">if</span>( rcode ) </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">goto</span> FailGetDevDescr;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">if</span> (((<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>*)buf)-&gt;idVendor != <a class="code" href="cdcftdi_8h.html#a4462aa466c5ff32a8106849d347e9b24">FTDI_VID</a> || ((<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>*)buf)-&gt;idProduct != <a class="code" href="cdcftdi_8h.html#a38bbee602455b866024aa7a03c6cefb7">FTDI_PID</a>)</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="comment">// Save type of FTDI chip</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; wFTDIType = ((<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>*)buf)-&gt;bcdDevice;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; bAddress = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordflow">if</span> (!bAddress)</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="comment">// Extract Max Packet Size from the device descriptor</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; epInfo[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (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">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0; </div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; rcode = pUsb-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( 0, 0, bAddress );</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">if</span> (rcode)</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; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(bAddress);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; bAddress = 0;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;setAddr:&quot;</span>,rcode);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; }</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;Addr:&quot;</span>, bAddress);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(bAddress);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; num_of_conf = ((<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>*)buf)-&gt;bNumConfigurations;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; rcode = pUsb-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, 1, epInfo);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;NC:&quot;</span>, num_of_conf);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">for</span> (uint8_t i=0; i&lt;num_of_conf; i++)</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; {</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <a class="code" href="class_hex_dumper.html">HexDumper&lt;USBReadParser, uint16_t, uint16_t&gt;</a> HexDump;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <a class="code" href="class_config_desc_parser.html">ConfigDescParser&lt;0xFF, 0xFF, 0xFF, CP_MASK_COMPARE_ALL&gt;</a> confDescrParser(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; rcode = pUsb-&gt;<a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(bAddress, 0, i, &amp;HexDump);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; rcode = pUsb-&gt;<a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(bAddress, 0, i, &amp;confDescrParser);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="keywordflow">if</span> (bNumEP &gt; 1)</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; } <span class="comment">// for</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">if</span> (bNumEP &lt; 2)</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;NumEP:&quot;</span>, bNumEP);</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="comment">// Assign epInfo to epinfo pointer</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; rcode = pUsb-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(bAddress, bNumEP, epInfo);</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;Conf:&quot;</span>, bConfNum);</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="comment">// Set Configuration Value</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; rcode = pUsb-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(bAddress, 0, bConfNum);</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; rcode = pAsync-&gt;<a class="code" href="class_f_t_d_i_async_oper.html#ae9178132b564edd5f75b65d6943aa400">OnInit</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <span class="keywordflow">goto</span> FailOnInit;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;FTDI configured\r\n&quot;</span>);</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; bPollEnable = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;getDevDescr:&quot;</span>);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;setDevTblEn:&quot;</span>);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;FailGetConfDescr:</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;getConf:&quot;</span>);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;setConf:&quot;</span>);</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;FailSetBaudRate:</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;SetBaudRate:&quot;</span>);</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;FailSetFlowControl:</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;SetFlowControl:&quot;</span>);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;FailOnInit:</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;OnInit:&quot;</span>);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;Fail:</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; Serial.println(rcode, HEX);</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <a class="code" href="class_f_t_d_i.html#aadee262e2eda31deda790d5d10090b6f">Release</a>();</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;}</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;</div>
<div class="line"><a name="l00214"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#a3e3f771b9f2a99fcedf7ed665b597109"> 214</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_f_t_d_i.html#a3e3f771b9f2a99fcedf7ed665b597109">FTDI::EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, <span class="keyword">const</span> <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> *pep) </div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;{</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; ErrorMessage&lt;uint8_t&gt;(PSTR(<span class="stringliteral">&quot;Conf.Val&quot;</span>), conf);</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; ErrorMessage&lt;uint8_t&gt;(PSTR(<span class="stringliteral">&quot;Iface Num&quot;</span>),iface);</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; ErrorMessage&lt;uint8_t&gt;(PSTR(<span class="stringliteral">&quot;Alt.Set&quot;</span>), alt);</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; bConfNum = conf;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; uint8_t index;</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160;</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">if</span> ((pep-&gt;<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> &amp; 0x03) == 3 &amp;&amp; (pep-&gt;<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> &amp; 0x80) == 0x80)</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; index = epInterruptInIndex;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordflow">else</span> </div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keywordflow">if</span> ((pep-&gt;<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> &amp; 0x02) == 2)</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; index = ((pep-&gt;<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> &amp; 0x80) == 0x80) ? epDataInIndex : epDataOutIndex; </div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="comment">// Fill in the endpoint info structure</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; epInfo[index].<a class="code" href="struct_ep_info.html#a9f92be74c75c037b39e2cae1eb49b89b">epAddr</a> = (pep-&gt;<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> &amp; 0x0F);</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; epInfo[index].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (uint8_t)pep-&gt;<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>;</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="comment">//epInfo[index].epAttribs = 0;</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; bNumEP ++;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; PrintEndpointDescriptor(pep);</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;}</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;</div>
<div class="line"><a name="l00242"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#aadee262e2eda31deda790d5d10090b6f"> 242</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#aadee262e2eda31deda790d5d10090b6f">FTDI::Release</a>()</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;{</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; pUsb-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>().<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(bAddress);</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160;</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; bAddress = 0;</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; bNumEP = 1;</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; qNextPollTime = 0;</div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; bPollEnable = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;}</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;</div>
<div class="line"><a name="l00253"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#a5f383dd8eb114563194da011f1d613fd"> 253</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#a5f383dd8eb114563194da011f1d613fd">FTDI::Poll</a>()</div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;{</div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; uint8_t rcode = 0;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="comment">//if (!bPollEnable)</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="comment">// return 0;</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; <span class="comment">//if (qNextPollTime &lt;= millis())</span></div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="comment">//{</span></div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="comment">// Serial.println(bAddress, HEX);</span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; <span class="comment">// qNextPollTime = millis() + 100;</span></div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="comment">//}</span></div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;}</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;</div>
<div class="line"><a name="l00269"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#acb8efdc33bd503563018b7eee577aecf"> 269</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#acb8efdc33bd503563018b7eee577aecf">FTDI::SetBaudRate</a>(uint32_t baud)</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160;{</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; uint16_t baud_value, baud_index = 0;</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; uint32_t divisor3;</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; divisor3 = 48000000 / 2 / baud; <span class="comment">// divisor shifted 3 bits to the left</span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160;</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keywordflow">if</span> (wFTDIType == <a class="code" href="cdcftdi_8h.html#a15e9dfb0c839422b73f378a35a22cd75">FT232AM</a>)</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; {</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordflow">if</span> ((divisor3 &amp; 0x7) == 7) </div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; divisor3 ++; <span class="comment">// round x.7/8 up to x+1</span></div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160;</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; baud_value = divisor3 &gt;&gt; 3;</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; divisor3 &amp;= 0x7;</div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordflow">if</span> (divisor3 == 1) baud_value |= 0xc000; <span class="keywordflow">else</span> <span class="comment">// 0.125</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="keywordflow">if</span> (divisor3 &gt;= 4) baud_value |= 0x4000; <span class="keywordflow">else</span> <span class="comment">// 0.5</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="keywordflow">if</span> (divisor3 != 0) baud_value |= 0x8000; <span class="comment">// 0.25</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="keywordflow">if</span> (baud_value == 1) baud_value = 0; <span class="comment">/* special case for maximum baud rate */</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; }</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <span class="keywordflow">else</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; {</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> divfrac [8] = { 0, 3, 2, 0, 1, 1, 2, 3 };</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> divindex[8] = { 0, 0, 0, 1, 0, 1, 1, 1 };</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; baud_value = divisor3 &gt;&gt; 3;</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; baud_value |= divfrac [divisor3 &amp; 0x7] &lt;&lt; 14;</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; baud_index = divindex[divisor3 &amp; 0x7];</div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="comment">/* Deal with special cases for highest baud rates. */</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="keywordflow">if</span> (baud_value == 1) baud_value = 0; <span class="keywordflow">else</span> <span class="comment">// 1.0</span></div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keywordflow">if</span> (baud_value == 0x4001) baud_value = 1; <span class="comment">// 1.5</span></div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; }</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;baud_value:&quot;</span>, baud_value);</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;baud_index:&quot;</span>, baud_index);</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; <span class="keywordflow">return</span> pUsb-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(bAddress, 0, <a class="code" href="cdcftdi_8h.html#a92ff48c614d1c236c34d7b2dc4d28ad2">bmREQ_FTDI_OUT</a>, <a class="code" href="cdcftdi_8h.html#aeb562ba85606fa0e08fc188705098f0d">FTDI_SIO_SET_BAUD_RATE</a>, baud_value &amp; 0xff, baud_value &gt;&gt; 8, baud_index, 0, 0, NULL, NULL );</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160;}</div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160;</div>
<div class="line"><a name="l00307"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#a86130f30e67e934346c3c7faf5ee6c56"> 307</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#a86130f30e67e934346c3c7faf5ee6c56">FTDI::SetModemControl</a>(uint16_t signal)</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160;{</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; <span class="keywordflow">return</span> pUsb-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(bAddress, 0, <a class="code" href="cdcftdi_8h.html#a92ff48c614d1c236c34d7b2dc4d28ad2">bmREQ_FTDI_OUT</a>, <a class="code" href="cdcftdi_8h.html#a0a5515eba4af8c37b71db51de289b3b4">FTDI_SIO_MODEM_CTRL</a>, signal &amp; 0xff, signal &gt;&gt; 8, 0, 0, 0, NULL, NULL);</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160;}</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160;</div>
<div class="line"><a name="l00312"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#a7c107efeff2d46cb711cadd0a6c31636"> 312</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#a7c107efeff2d46cb711cadd0a6c31636">FTDI::SetFlowControl</a>(uint8_t protocol, uint8_t xon, uint8_t xoff)</div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160;{</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keywordflow">return</span> pUsb-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(bAddress, 0, <a class="code" href="cdcftdi_8h.html#a92ff48c614d1c236c34d7b2dc4d28ad2">bmREQ_FTDI_OUT</a>, <a class="code" href="cdcftdi_8h.html#abdb21a829e0aca82178834602e34be7f">FTDI_SIO_SET_FLOW_CTRL</a>, xon, xoff, protocol &lt;&lt; 8, 0, 0, NULL, NULL);</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;}</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160;</div>
<div class="line"><a name="l00317"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#ab7d7c305729fe4bbc746fa0569261a71"> 317</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#ab7d7c305729fe4bbc746fa0569261a71">FTDI::SetData</a>(uint16_t databm)</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160;{</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keywordflow">return</span> pUsb-&gt;<a class="code" href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(bAddress, 0, <a class="code" href="cdcftdi_8h.html#a92ff48c614d1c236c34d7b2dc4d28ad2">bmREQ_FTDI_OUT</a>, <a class="code" href="cdcftdi_8h.html#ac7603bf715c4b1281f8e5907d0a61e0f">FTDI_SIO_SET_DATA</a>, databm &amp; 0xff, databm &gt;&gt; 8, 0, 0, 0, NULL, NULL);</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;}</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160;</div>
<div class="line"><a name="l00322"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#aa367ae72fbfda931cae8ec751e9dc434"> 322</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#aa367ae72fbfda931cae8ec751e9dc434">FTDI::RcvData</a>(uint16_t *bytes_rcvd, uint8_t *dataptr)</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160;{</div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; <span class="keywordflow">return</span> pUsb-&gt;<a class="code" href="class_u_s_b.html#ad75d64f648b102fab2bd75e53e1324a4">inTransfer</a>(bAddress, epInfo[epDataInIndex].epAddr, bytes_rcvd, dataptr);</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160;}</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;</div>
<div class="line"><a name="l00327"></a><span class="lineno"><a class="code" href="class_f_t_d_i.html#a90309b11a160bad9ceb0b77545b7a240"> 327</a></span>&#160;uint8_t <a class="code" href="class_f_t_d_i.html#a90309b11a160bad9ceb0b77545b7a240">FTDI::SndData</a>(uint16_t nbytes, uint8_t *dataptr)</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;{</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <span class="keywordflow">return</span> pUsb-&gt;<a class="code" href="class_u_s_b.html#affbc018973a588995457d535b0ac7ee7">outTransfer</a>(bAddress, epInfo[epDataOutIndex].epAddr, nbytes, dataptr);</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;}</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160;<span class="keywordtype">void</span> FTDI::PrintEndpointDescriptor( <span class="keyword">const</span> <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>* ep_ptr )</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;{</div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;Endpoint descriptor:&quot;</span>));</div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nLength:\t\t&quot;</span>));</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nType:\t\t&quot;</span>));</div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAddress:\t&quot;</span>));</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nAttributes:\t&quot;</span>));</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nMaxPktSize:\t&quot;</span>));</div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; PrintHex&lt;uint16_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\nPoll Intrv:\t&quot;</span>));</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; PrintHex&lt;uint8_t&gt;(ep_ptr-&gt;<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>);</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; <a class="code" href="message_8cpp.html#a968335d1c8fd7b45c95634e0828411be">Notify</a>(PSTR(<span class="stringliteral">&quot;\r\n&quot;</span>));</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -227,6 +227,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00041">41</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a92ff48c614d1c236c34d7b2dc4d28ad2"></a>
@ -239,6 +241,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00040">40</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a139af590edc937741d109cc0d8150bcb"></a>
@ -251,6 +255,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00051">51</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a15e9dfb0c839422b73f378a35a22cd75"></a>
@ -263,6 +269,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00049">49</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7e3f04e312bdfc37076d1650f3860147"></a>
@ -275,6 +283,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00050">50</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="abc93995e54d77a8f602ff23b72cda110"></a>
@ -287,6 +297,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00052">52</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9d25344c78c7608f2e49de9767abd0d9"></a>
@ -299,6 +311,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00106">106</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a38bbee602455b866024aa7a03c6cefb7"></a>
@ -311,6 +325,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00047">47</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a91bed54fb7aa0e99449effed2e330822"></a>
@ -323,6 +339,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00090">90</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7d0d35ef22b504afd608531c8e5275a0"></a>
@ -335,6 +353,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00085">85</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3c495d7b1e010aa66a68066307c636dd"></a>
@ -347,6 +367,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00091">91</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6e9fa56460716bc7bd0beea4d7a3fe19"></a>
@ -359,6 +381,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00087">87</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9fb2b825dd0fd02df1df0d4667758f11"></a>
@ -371,6 +395,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00060">60</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0a5515eba4af8c37b71db51de289b3b4"></a>
@ -383,6 +409,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00056">56</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0c4ac1b95162aa3c959931bc46aa762c"></a>
@ -395,6 +423,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00055">55</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a89e71c8a21d2a6fdddcec8c3447b8cb0"></a>
@ -407,6 +437,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00065">65</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="aef90c1417ef6f4d59753c876a0057545"></a>
@ -419,6 +451,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00066">66</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a184292199f79a3982b4a563504afe7c4"></a>
@ -431,6 +465,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00064">64</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad817d85eb0f62257585caf7bb556aafb"></a>
@ -443,6 +479,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00092">92</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="aeb09e7783acb50bd02981ce387ef8e7e"></a>
@ -455,6 +493,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00093">93</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="af5cdb59ccbb8eba190eca16cb74bddcb"></a>
@ -467,6 +507,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00086">86</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="aeb562ba85606fa0e08fc188705098f0d"></a>
@ -479,6 +521,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00058">58</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a05cebcdf1d7563fe77df8f1a0280086d"></a>
@ -491,6 +535,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00076">76</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac7603bf715c4b1281f8e5907d0a61e0f"></a>
@ -503,6 +549,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00059">59</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac38ca9725e25bbe4d6234438bedd8275"></a>
@ -515,6 +563,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00070">70</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a37489061b7bfcd57321325d5ad44bc4e"></a>
@ -527,6 +577,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00071">71</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1d3b7a2a5e8a5cb449ced0025c5304e3"></a>
@ -539,6 +591,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00068">68</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3b8f65480530dc9a12240655a77a23e6"></a>
@ -551,6 +605,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00069">69</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab0c4afbaade6efa1f36ada212e4e5fc7"></a>
@ -563,6 +619,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00072">72</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae4c01efa00c78a56989fe8bc9ba5eac6"></a>
@ -575,6 +633,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00073">73</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3a9592e16482faa197623337739cc1df"></a>
@ -587,6 +647,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00074">74</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="acd6333c509f4f1fa3d44d3077ae9c7df"></a>
@ -599,6 +661,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00075">75</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6f781cb804f9754fe91ca90b78821482"></a>
@ -611,6 +675,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00079">79</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab6ff468afcf80b382582d04633767f11"></a>
@ -623,6 +689,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00080">80</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="adf02c870aee2747263e4bad434f3ee92"></a>
@ -635,6 +703,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00078">78</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="adf6c6c6c120d42411c243936e177f3f7"></a>
@ -647,6 +717,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00062">62</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="af9f8c0df356ae4c9cf44656ea7c9ed5d"></a>
@ -659,6 +731,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00061">61</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="abdb21a829e0aca82178834602e34be7f"></a>
@ -671,6 +745,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00057">57</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5b6822103572e1d583c7587103406eec"></a>
@ -683,6 +759,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00082">82</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4990d64ac8d725be89527a6dc21bd6c5"></a>
@ -695,6 +773,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00083">83</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="affb7aa2801805beaa49dbc5ca8793fd8"></a>
@ -707,6 +787,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00081">81</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a082065ffd54c708f8c632d3454045809"></a>
@ -719,6 +801,8 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00088">88</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4462aa466c5ff32a8106849d347e9b24"></a>
@ -731,12 +815,14 @@ Macros</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcftdi_8h_source.html#l00046">46</a> of file <a class="el" href="cdcftdi_8h_source.html">cdcftdi.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -241,7 +241,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -96,10 +96,12 @@ Include dependency graph for cdcprolific.cpp:</div>
<map name="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2cdcprolific_8cpp" id="_2_users_2_lauszus_2_git_hub_2_u_s_b___host___shield__2_80_2cdcprolific_8cpp">
<area shape="rect" id="node2" href="cdcprolific_8h.html" title="cdcprolific.h" alt="" coords="821,93,885,115"/><area shape="rect" id="node5" href="avrpins_8h.html" title="avrpins.h" alt="" coords="146,371,200,392"/><area shape="rect" id="node7" href="max3421e_8h.html" title="max3421e.h" alt="" coords="292,371,359,392"/><area shape="rect" id="node8" href="usbhost_8h.html" title="usbhost.h" alt="" coords="297,301,353,323"/><area shape="rect" id="node9" href="usb__ch9_8h.html" title="usb_ch9.h" alt="" coords="840,371,899,392"/><area shape="rect" id="node10" href="_usb_8h.html" title="Usb.h" alt="" coords="629,232,672,253"/><area shape="rect" id="node15" href="printhex_8h.html" title="printhex.h" alt="" coords="1027,440,1084,461"/><area shape="rect" id="node16" href="hexdump_8h.html" title="hexdump.h" alt="" coords="1301,371,1363,392"/><area shape="rect" id="node17" href="message_8h.html" title="message.h" alt="" coords="1216,371,1277,392"/><area shape="rect" id="node18" href="confdescparser_8h.html" title="confdescparser.h" alt="" coords="1339,232,1423,253"/><area shape="rect" id="node20" href="cdcacm_8h.html" title="cdcacm.h" alt="" coords="977,163,1033,184"/><area shape="rect" id="node12" href="address_8h.html" title="address.h" alt="" coords="505,301,561,323"/><area shape="rect" id="node19" href="parsetools_8h.html" title="parsetools.h" alt="" coords="1499,301,1564,323"/></map>
</div>
</div></div><!-- contents -->
</div>
<p><a href="cdcprolific_8cpp_source.html">Go to the source code of this file.</a></p>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -0,0 +1,342 @@
<!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: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/cdcprolific.cpp 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" />
</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_c8a8870798f18a14afbce47230dc4059.html">GitHub</a></li><li class="navelem"><a class="el" href="dir_8d22a5dfb299d0b3a2bdc551c5cdbd10.html">USB_Host_Shield_2.0</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">cdcprolific.cpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="cdcprolific_8cpp.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="preprocessor">#include &quot;<a class="code" href="cdcprolific_8h.html">cdcprolific.h</a>&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="code" href="class_p_l2303.html#ab3dfad9e451152abbdab4856accbb80c"> 19</a></span>&#160;<a class="code" href="class_p_l2303.html#ab3dfad9e451152abbdab4856accbb80c">PL2303::PL2303</a>(<a class="code" href="class_u_s_b.html">USB</a> *p, <a class="code" href="class_c_d_c_async_oper.html">CDCAsyncOper</a> *pasync) :</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; <a class="code" href="class_a_c_m.html">ACM</a>(p, pasync)</div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; <span class="comment">//wPLType(0)</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;}</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="code" href="class_p_l2303.html#a23c849fb504c1fe6f46c84d04c0a47cf"> 25</a></span>&#160;uint8_t <a class="code" href="class_p_l2303.html#a23c849fb504c1fe6f46c84d04c0a47cf">PL2303::Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed)</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;{</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; <span class="keyword">const</span> uint8_t constBufSize = <span class="keyword">sizeof</span>(<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="l00028"></a><span class="lineno"> 28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; uint8_t buf[constBufSize];</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; uint8_t rcode;</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; <a class="code" href="struct_usb_device.html">UsbDevice</a> *p = NULL;</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> *oldep_ptr = NULL;</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; uint8_t num_of_conf; <span class="comment">// number of configurations</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; <span class="keyword">enum</span> <a class="code" href="cdcprolific_8h.html#a6003f43ffe2391c0c31ea48f6b772627">pl2303_type</a> pltype = <a class="code" href="cdcprolific_8h.html#a6003f43ffe2391c0c31ea48f6b772627a5b9f6d065e6e98483b3d3ed01f4f6cbe">unknown</a>;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <a class="code" href="class_address_pool.html">AddressPool</a> &amp;addrPool = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a66ab8f5eda239e761d5a48741ea1f9d4">GetAddressPool</a>();</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;PL Init\r\n&quot;</span>);</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>)</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a44416ff64fc0e3691f98addac13d4595">USB_ERROR_CLASS_INSTANCE_ALREADY_IN_USE</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="comment">// Get pointer to pseudo device with address 0 assigned</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(0);</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</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"> 49</span>&#160; <span class="keywordflow">if</span> (!p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>)</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; {</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;epinfo\r\n&quot;</span>);</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#af192c59cafe2192ad802b22e6dbc077d">USB_ERROR_EPINFO_IS_NULL</a>;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; }</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">// Save old pointer to EP_RECORD of address 0</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; oldep_ptr = p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a>;</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; <span class="comment">// Temporary assign new pointer to epInfo to p-&gt;epinfo in order to avoid toggle inconsistence</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>;</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"> 61</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="comment">// Get device descriptor</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a193e63c149fad46adabd77ceb09b2b24" title="defined(USB_METHODS_INLINE)">getDevDescr</a>( 0, 0, <span class="keyword">sizeof</span>(<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>), (uint8_t*)buf );</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="comment">// Restore p-&gt;epinfo</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a410d39fb7758157f57794335e990ed02">epinfo</a> = oldep_ptr;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">if</span>( rcode ) </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">goto</span> FailGetDevDescr;</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">if</span> (((<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>*)buf)-&gt;idVendor != <a class="code" href="cdcprolific_8h.html#ac33a32ea1e6c88a3041b8fd579bb439b">PL_VID</a> &amp;&amp; ((<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>*)buf)-&gt;idProduct != <a class="code" href="cdcprolific_8h.html#a07de3d09679a16223690f65ada967a24">PL_PID</a> ) {</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</a>;</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; </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="comment">/* determine chip variant */</span> </div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">if</span> (((<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>*)buf)-&gt;bDeviceClass == 0x02 ) {</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; pltype = <a class="code" href="cdcprolific_8h.html#a6003f43ffe2391c0c31ea48f6b772627af7bb5f5cb18b8f8cac6c93db12ad7997">type_0</a>;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; }</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (((<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>*)buf)-&gt;bMaxPacketSize0 == 0x40 ) { </div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; pltype = <a class="code" href="cdcprolific_8h.html#a6003f43ffe2391c0c31ea48f6b772627a6035ccdf4905b89a274404ba50766fd7">rev_HX</a>;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; }</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (((<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>*)buf)-&gt;bDeviceClass == 0x00) {</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; pltype = <a class="code" href="cdcprolific_8h.html#a6003f43ffe2391c0c31ea48f6b772627af55eb000231282fd0e3556a1c4e1dab8">type_1</a>;</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; }</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (((<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>*)buf)-&gt;bDeviceClass == 0xff) {</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; pltype = <a class="code" href="cdcprolific_8h.html#a6003f43ffe2391c0c31ea48f6b772627af55eb000231282fd0e3556a1c4e1dab8">type_1</a>;</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; }</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="comment">// Allocate new address according to device class</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a> = addrPool.<a class="code" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AllocAddress</a>(parent, <span class="keyword">false</span>, port);</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160;</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">if</span> (!<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>)</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#a15370eb665cdded5514e69ca58d9f39d">USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL</a>;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="comment">// Extract Max Packet Size from the device descriptor</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>[0].<a class="code" href="struct_ep_info.html#aa2ca775b63736df4008e88da7dd4dddb">maxPktSize</a> = (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">USB_DEVICE_DESCRIPTOR</a>*)buf)-&gt;bMaxPacketSize0; </div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">// Assign new address to the device</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a3aea534daed66b5606fa798df7ad3c47">setAddr</a>( 0, 0, <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a> );</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; {</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; addrPool.<a class="code" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a> = 0;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;setAddr:&quot;</span>,rcode);</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; }</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;Addr:&quot;</span>, <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>);</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; p = addrPool.<a class="code" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">GetUsbDevicePtr</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordflow">if</span> (!p)</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#afe2fedb4b0ccc89a688c0b4b59691ce0">USB_ERROR_ADDRESS_NOT_FOUND_IN_POOL</a>;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; p-&gt;<a class="code" href="struct_usb_device.html#a86a815577ad7883437d3ca72b32b8e8a">lowspeed</a> = lowspeed;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; num_of_conf = ((<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>*)buf)-&gt;bNumConfigurations;</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">// Assign epInfo to epinfo pointer</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 1, <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a>);</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keywordflow">goto</span> FailSetDevTblEntry;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;NC:&quot;</span>, num_of_conf);</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">for</span>( uint8_t i=0; i&lt;num_of_conf; i++ )</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; {</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">//HexDumper&lt;USBReadParser, uint16_t, uint16_t&gt; HexDump;</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <a class="code" href="class_config_desc_parser.html">ConfigDescParser&lt;0xFF, 0, 0, CP_MASK_COMPARE_CLASS&gt;</a> confDescrParser(<span class="keyword">this</span>);</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">//rcode = pUsb-&gt;getConfDescr(bAddress, 0, i, &amp;HexDump);</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a618eedabc161d8315be45cae0c8b6f89">getConfDescr</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, i, &amp;confDescrParser);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; </div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="class_a_c_m.html#a058b4d4a088a002fcde4fb2b75e33f93">bNumEP</a> &gt; 1)</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; } <span class="comment">// for</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <span class="keywordflow">if</span> ( <a class="code" href="class_a_c_m.html#a058b4d4a088a002fcde4fb2b75e33f93">bNumEP</a> &lt; 2 )</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keywordflow">return</span> <a class="code" href="_usb_8h.html#ae9e139d0fd29bb0b3e7afad2f76cd589">USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED</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">// Assign epInfo to epinfo pointer</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a6c3ba3f7e6dccb450267011ce783d7ea">setEpInfoEntry</a>( <a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, <a class="code" href="class_a_c_m.html#a058b4d4a088a002fcde4fb2b75e33f93">bNumEP</a>, <a class="code" href="class_a_c_m.html#a60fb6a365b78fb80a4a9842e364cf1a3">epInfo</a> );</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <a class="code" href="_usb_8h.html#adbe3f00986df48a9254f8bf0992041d3">USBTRACE2</a>(<span class="stringliteral">&quot;Conf:&quot;</span>, <a class="code" href="class_a_c_m.html#af1a17c2d77625599da12b26cb0c90d39">bConfNum</a>);</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="comment">// Set Configuration Value</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; rcode = <a class="code" href="class_a_c_m.html#ae403b0129d7beda921de9d9586b597f7">pUsb</a>-&gt;<a class="code" href="class_u_s_b.html#a31e2c132ec32ffdde94dff72be87c378">setConf</a>(<a class="code" href="class_a_c_m.html#abaa06a619a519f4cb39cc8482af6f111">bAddress</a>, 0, <a class="code" href="class_a_c_m.html#af1a17c2d77625599da12b26cb0c90d39">bConfNum</a>);</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordflow">goto</span> FailSetConfDescr;</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"> 159</span>&#160;<span class="preprocessor">#if defined(PL2303_COMPAT)</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;<span class="preprocessor"></span> <span class="comment">/* shamanic dance - sending Prolific init data as-is */</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; vendorRead( 0x84, 0x84, 0, buf );</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; vendorWrite( 0x04, 0x04, 0 );</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; vendorRead( 0x84, 0x84, 0, buf );</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; vendorRead( 0x83, 0x83, 0, buf );</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; vendorRead( 0x84, 0x84, 0, buf );</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; vendorWrite( 0x04, 0x04, 1 );</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; vendorRead( 0x84, 0x84, 0, buf);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; vendorRead( 0x83, 0x83, 0, buf);</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; vendorWrite( 0, 0, 1 );</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; vendorWrite( 1, 0, 0 );</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordflow">if</span> ( pltype == <a class="code" href="cdcprolific_8h.html#a6003f43ffe2391c0c31ea48f6b772627a6035ccdf4905b89a274404ba50766fd7">rev_HX</a> ) {</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; vendorWrite( 2, 0, 0x44 );</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; vendorWrite( 0x06, 0x06, 0 ); <span class="comment">//from W7 init</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; }</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; vendorWrite( 2, 0, 0x24 );</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; }</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="comment">/* shamanic dance end */</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="preprocessor">#endif </span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<span class="preprocessor"></span> </div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="comment">/* calling post-init callback */</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; rcode = <a class="code" href="class_a_c_m.html#a3f160c6c757994f0c30bd5c5f1fb9d95">pAsync</a>-&gt;<a class="code" href="class_c_d_c_async_oper.html#a899353c3cbf83d7f874d11e5d9db4722">OnInit</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; <span class="keywordflow">if</span> (rcode)</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; <span class="keywordflow">goto</span> FailOnInit;</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;PL configured\r\n&quot;</span>);</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">//bPollEnable = true;</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <a class="code" href="class_a_c_m.html#a8ebf4b872b0ed66e93b4ed39f46290fd">ready</a> = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;FailGetDevDescr:</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;getDevDescr:&quot;</span>);</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;FailSetDevTblEntry:</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;setDevTblEn:&quot;</span>);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;FailGetConfDescr:</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;getConf:&quot;</span>);</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;FailSetConfDescr:</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;setConf:&quot;</span>);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160;FailSetControlLineState:</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;SetControlLineState:&quot;</span>);</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;FailSetLineCoding:</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;SetLineCoding:&quot;</span>);</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;FailOnInit:</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <a class="code" href="_usb_8h.html#afc6fe7f947af35317a49a4dcfc8189fd">USBTRACE</a>(<span class="stringliteral">&quot;OnInit:&quot;</span>);</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="keywordflow">goto</span> Fail;</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160;</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;Fail:</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; Serial.println(rcode, HEX);</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <a class="code" href="class_a_c_m.html#a768c0fd4ef7f5c52de9e5e7431685279">Release</a>();</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordflow">return</span> rcode;</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160;}</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160;</div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="comment">//uint8_t PL::Poll()</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160;<span class="comment">//{</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;<span class="comment">// uint8_t rcode = 0;</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;<span class="comment">// //if (!bPollEnable)</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="comment">// // return 0;</span></div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160;<span class="comment">// //if (qNextPollTime &lt;= millis())</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160;<span class="comment">// //{</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="comment">// // Serial.println(bAddress, HEX);</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;<span class="comment">// // qNextPollTime = millis() + 100;</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="comment">// //}</span></div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;<span class="comment">// return rcode;</span></div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="comment">//}</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160;</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160;</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -283,6 +283,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00059">59</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a197aa848c18becf5360bd06d2b9b8757"></a>
@ -295,6 +297,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00060">60</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab31d90a1365ace8148b4ffb5b09c3204"></a>
@ -307,6 +311,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00067">67</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad74aa175219ba20da29bd49595fb424a"></a>
@ -319,6 +325,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00110">110</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6521e0d1199772f08f29722ae9e61f8d"></a>
@ -331,6 +339,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00111">111</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad00143b247ef00ec41be356bd0e17229"></a>
@ -343,6 +353,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00112">112</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="af83aa2f107968838d73809c4f9a05e75"></a>
@ -355,6 +367,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00116">116</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae539702b1c81f50770d282c4ab425709"></a>
@ -367,6 +381,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00117">117</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="af9f58d0a0dbcd375b60f17beba78cbca"></a>
@ -379,6 +395,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00121">121</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a195b68bbe6b9e565f2dc133c010f617f"></a>
@ -391,6 +409,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00122">122</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="acc570c15816dfccb107fa119c255dc26"></a>
@ -403,6 +423,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00063">63</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a858860d62527650b80da4ef4aaac1317"></a>
@ -415,6 +437,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00064">64</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="af93d7c80faa6ebd086460cde2d5dd27e"></a>
@ -427,6 +451,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00065">65</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a18bdc379296992f91a263a8aa869cf24"></a>
@ -439,6 +465,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00061">61</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa9df6c27f8bf720206bc88285994c54b"></a>
@ -451,6 +479,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00057">57</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac43d59739a4945979e600bb15df8347c"></a>
@ -463,6 +493,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00058">58</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a27f1e77863200d1f798db253340e05e0"></a>
@ -475,6 +507,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00109">109</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a62ab8c44b9b3111fe0ba193e30d2612d"></a>
@ -487,6 +521,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00115">115</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="aedd5c473d7ee45d806c4d7c13856089f"></a>
@ -499,6 +535,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00120">120</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad77e166d8f5931c693952f5e89c2b732"></a>
@ -511,6 +549,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00062">62</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7f802be6da599613666caca90940a118"></a>
@ -523,6 +563,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00090">90</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="afd88d628823395976fc1f615226f9c94"></a>
@ -535,6 +577,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00076">76</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a329541dad3c626b963b0ece5a478247f"></a>
@ -547,6 +591,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00077">77</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6e04ec5299b97050655485fb091c1d47"></a>
@ -559,6 +605,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00072">72</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9ee874fc96875d7eb2e505324cd4e22e"></a>
@ -571,6 +619,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00095">95</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac76313fb4cf0164772450e8e205d77dc"></a>
@ -583,6 +633,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00098">98</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="af9973cf2cb19393174ae738d2e3eadc6"></a>
@ -595,6 +647,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00096">96</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a25ba69ccbb225bf2c900f87ca5c51fb1"></a>
@ -607,6 +661,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00091">91</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae9976c97335cf1b46c32caaa054438a9"></a>
@ -619,6 +675,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00099">99</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad1f4fc023b3b7effa71d68bd1665fcff"></a>
@ -631,6 +689,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00093">93</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad976aee3d980aedb2aa6dd6fc6ac805f"></a>
@ -643,6 +703,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00092">92</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4d0d61b5b66d1518198ca9d1150b1d7d"></a>
@ -655,6 +717,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00097">97</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a38efb3430a780bf3f5df85fea0dd2b78"></a>
@ -667,6 +731,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00070">70</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6d7bb5515cc4b6020dea9b12874114d7"></a>
@ -679,6 +745,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00073">73</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a65ac8ac3d08ee7862ed09a2ac1f64cf4"></a>
@ -691,6 +759,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00089">89</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3e17e71021c4f1610edaf9ac0b004773"></a>
@ -703,6 +773,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00071">71</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1f5d458d623cc15052a3e184ab811707"></a>
@ -715,6 +787,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00074">74</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a360660ec5b280900c26b5d8b96277c3c"></a>
@ -727,6 +801,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00052">52</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a825d6b262c88a98f58597060b6f3b822"></a>
@ -739,6 +815,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00051">51</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa6d1fd101c19f5199c26480d3284c30a"></a>
@ -751,6 +829,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00068">68</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a225d7c12a1320152c218824d7fccfb29"></a>
@ -763,6 +843,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00139">139</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a07de3d09679a16223690f65ada967a24"></a>
@ -775,6 +857,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00044">44</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac33a32ea1e6c88a3041b8fd579bb439b"></a>
@ -787,6 +871,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00043">43</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9c2ce56792e2f2641b822909d38c4820"></a>
@ -799,6 +885,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00049">49</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a961cb737481f7f216ba32049bbdb8d28"></a>
@ -811,6 +899,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00046">46</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a95aad329b927ced24fc54a2c1c604c4f"></a>
@ -823,6 +913,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00048">48</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="acf39e8d7280a59ca15242695443c9c08"></a>
@ -835,6 +927,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00047">47</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a810fdf3da740b4c9e309cefb29f4eb3a"></a>
@ -847,6 +941,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00125">125</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="aea64b328d877a5eead187856dd28f847"></a>
@ -859,6 +955,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00126">126</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0301d2726a35e10b2e05965cca3a4d3d"></a>
@ -871,6 +969,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00108">108</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a409b94ba55c55a98d939e7bf4b347758"></a>
@ -883,6 +983,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00114">114</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac4f863f56f6198308d98983b157e25cf"></a>
@ -895,6 +997,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00119">119</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="af1a33db53b892c714bd96fb67e446014"></a>
@ -907,6 +1011,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00055">55</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a81ae660feed6809dadd118b7b68bd2b6"></a>
@ -919,6 +1025,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00054">54</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac41d29368b62bc84d0d63d2b79b4d260"></a>
@ -931,6 +1039,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00056">56</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a230385b0735fad9d7b33e4f80d7deb4d"></a>
@ -943,6 +1053,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00105">105</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a21c64a6ccc471ac907896f8590dcf7b2"></a>
@ -955,6 +1067,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00104">104</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa0dae52300cd2ca352f5d3cd2194824b"></a>
@ -967,6 +1081,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00102">102</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="a242bbbe616270b5c01d3614dbe57fe45"></a>
@ -979,6 +1095,8 @@ Enumerations</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00101">101</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
@ -1006,6 +1124,8 @@ Enumerations</h2></td></tr>
</td></tr>
</table>
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00128">128</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
<a class="anchor" id="add931a54ea58b7022eab1911dfd744fb"></a>
@ -1030,12 +1150,14 @@ Enumerations</h2></td></tr>
</td></tr>
</table>
<p>Definition at line <a class="el" href="cdcprolific_8h_source.html#l00080">80</a> of file <a class="el" href="cdcprolific_8h_source.html">cdcprolific.h</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -269,7 +269,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:56 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:21 for USB_Host_Shield_2.0 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>

View file

@ -124,7 +124,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -185,7 +185,10 @@ Static Protected Attributes</h2></td></tr>
<tr class="memitem:a9b32207fdf256e5f8553ba4048b64307"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_c_m.html#a9b32207fdf256e5f8553ba4048b64307">epInterruptInIndex</a> = 3</td></tr>
<tr class="separator:a9b32207fdf256e5f8553ba4048b64307"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00162">162</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa5d83ef9d48dab404090e9136522707a"></a>
<div class="memitem">
<div class="memproto">
@ -210,6 +213,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00023">23</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
@ -227,6 +232,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00317">317</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af5b411a7ccc82bd77a7c5cfba6cd9a86"></a>
@ -281,6 +288,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_usb_config_xtracter.html#aceb5da8339172cbb2e9ce2064e34e5ef">UsbConfigXtracter</a>.</p>
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00211">211</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7e0bb108012af9a99bb98aefca036d84"></a>
@ -306,6 +315,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#aae3130517514c902bad5f153849b3811">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00204">204</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a18208672a707391863b8abdc6714c825"></a>
@ -338,6 +349,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00312">312</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a9d922317b25a7ae086a6fe79984ab8d1"></a>
@ -354,6 +367,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00327">327</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a4deddfbfb1d9010b71096cbfd46b2dfb"></a>
@ -380,6 +395,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00302">302</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad3210651d58c77d3ded4b4b83a9476b7"></a>
@ -424,6 +441,8 @@ Static Protected Attributes</h2></td></tr>
<p>Reimplemented in <a class="el" href="class_p_l2303.html#a23c849fb504c1fe6f46c84d04c0a47cf">PL2303</a>.</p>
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00050">50</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7161082e88359738596dd12a706ee286"></a>
@ -447,6 +466,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00205">205</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a79e4da2cae9145d895a6a1211a96fe36"></a>
@ -472,6 +493,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a4961e92df3e75c38e6953fb08b11f8b6">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00254">254</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa05a65487f5e02bab40ccba1018ee5b6"></a>
@ -496,6 +519,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00343">343</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7f455b7a649522c29f2e63d668b0ccca"></a>
@ -522,6 +547,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00291">291</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a768c0fd4ef7f5c52de9e5e7431685279"></a>
@ -547,6 +574,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a74c06c5fe641b20faeeebd39e33248b3">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00239">239</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a2a618cbff52737740e76977db557ddff"></a>
@ -563,6 +592,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00337">337</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a62c91ac62e8e3bf66bc3940d5b934c10"></a>
@ -595,6 +626,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00307">307</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="af2e08e5f03f17ed039985147a7129bbd"></a>
@ -611,6 +644,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00332">332</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a79eb8706c7f1432593fb2f2eee0da504"></a>
@ -627,6 +662,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00322">322</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac96caeb8d657fa76219872ceb4379923"></a>
@ -653,6 +690,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8cpp_source.html#l00296">296</a> of file <a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
@ -674,6 +713,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00171">171</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="af1a17c2d77625599da12b26cb0c90d39"></a>
@ -694,6 +735,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00172">172</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5512d9e8c8c59371f16018fe8ce46b19"></a>
@ -714,6 +757,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00173">173</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a720b72b524e03da8f17c045e0d689ba1"></a>
@ -734,6 +779,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00174">174</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a058b4d4a088a002fcde4fb2b75e33f93"></a>
@ -754,6 +801,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00175">175</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="acd6716c4fc871942fca55e1501dc5b09"></a>
@ -774,6 +823,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00177">177</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5917b5098e529fafe67a53e03f1e7011"></a>
@ -794,6 +845,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00165">165</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0dc940bc4f1bed7525bb768e37e6cb61"></a>
@ -814,6 +867,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00166">166</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a60fb6a365b78fb80a4a9842e364cf1a3"></a>
@ -834,6 +889,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00180">180</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9b32207fdf256e5f8553ba4048b64307"></a>
@ -854,6 +911,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00167">167</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3f160c6c757994f0c30bd5c5f1fb9d95"></a>
@ -874,6 +933,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00170">170</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae403b0129d7beda921de9d9586b597f7"></a>
@ -894,6 +955,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00169">169</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6701d70ae4734e8a81971d9fb8b085f2"></a>
@ -914,6 +977,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00176">176</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8ebf4b872b0ed66e93b4ed39f46290fd"></a>
@ -934,16 +999,18 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00178">178</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="cdcacm_8h_source.html">cdcacm.h</a></li>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="cdcacm_8cpp.html">cdcacm.cpp</a></li>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="cdcacm_8cpp_source.html">cdcacm.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -110,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -157,7 +157,10 @@ Static Protected Attributes</h2></td></tr>
<tr class="memitem:acfc5a7e45f15bba7ff8cd42552796624"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_d_k.html#acfc5a7e45f15bba7ff8cd42552796624">epDataOutIndex</a> = 2</td></tr>
<tr class="separator:acfc5a7e45f15bba7ff8cd42552796624"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00071">71</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a29492dcd9b7f6023b7866cd05188d61c"></a>
<div class="memitem">
<div class="memproto">
@ -212,6 +215,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8cpp_source.html#l00025">25</a> of file <a class="el" href="adk_8cpp_source.html">adk.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
@ -267,6 +272,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_usb_config_xtracter.html#aceb5da8339172cbb2e9ce2064e34e5ef">UsbConfigXtracter</a>.</p>
<p>Definition at line <a class="el" href="adk_8cpp_source.html#l00287">287</a> of file <a class="el" href="adk_8cpp_source.html">adk.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1a972e8dc98b60ab27528db3af2618c3"></a>
@ -292,6 +299,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#aae3130517514c902bad5f153849b3811">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="adk_8h_source.html#l00121">121</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8c5c2e212c748966ccd863499d202063"></a>
@ -334,6 +343,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a391dc824a3271671890cebeb829b35ed">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="adk_8cpp_source.html#l00062">62</a> of file <a class="el" href="adk_8cpp_source.html">adk.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1dee02856625dfcac4b0cdd4e8672cef"></a>
@ -357,6 +368,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00122">122</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="af3784434ee6a1c6f3dc5b591f467e703"></a>
@ -382,6 +395,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a4961e92df3e75c38e6953fb08b11f8b6">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="adk_8h_source.html#l00120">120</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac4bd3303b99921289c3f59e2df219e50"></a>
@ -406,6 +421,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8cpp_source.html#l00339">339</a> of file <a class="el" href="adk_8cpp_source.html">adk.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a66b9943dfa89f783a8cdeb655e6fe9b1"></a>
@ -432,6 +449,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8cpp_source.html#l00327">327</a> of file <a class="el" href="adk_8cpp_source.html">adk.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7f64af34d7890f87ceab5d144f6c26ef"></a>
@ -457,6 +476,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a74c06c5fe641b20faeeebd39e33248b3">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="adk_8cpp_source.html#l00316">316</a> of file <a class="el" href="adk_8cpp_source.html">adk.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac37bde02b6ed1436712d3619afb07c84"></a>
@ -483,6 +504,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8cpp_source.html#l00334">334</a> of file <a class="el" href="adk_8cpp_source.html">adk.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
@ -504,6 +527,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00093">93</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae8fcc6a6fccab61116cea10dd1f17738"></a>
@ -524,6 +549,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00094">94</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="adf969d306da15baecd5c59bbb568053e"></a>
@ -544,6 +571,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00096">96</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a964ec80ac133bf8d65cf0274e37b29da"></a>
@ -564,6 +593,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00088">88</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="acfc5a7e45f15bba7ff8cd42552796624"></a>
@ -584,6 +615,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00089">89</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6ffc693d731ddeb9499c11e893fc467d"></a>
@ -604,6 +637,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00100">100</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab28e3a19569c27f3ed5362e9800065c1"></a>
@ -624,6 +659,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00092">92</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<a class="anchor" id="a135db75b9e8cdd59b89f46c44dd83dd4"></a>
@ -644,16 +681,18 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="adk_8h_source.html#l00097">97</a> of file <a class="el" href="adk_8h_source.html">adk.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="adk_8h_source.html">adk.h</a></li>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="adk_8cpp.html">adk.cpp</a></li>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="adk_8cpp_source.html">adk.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -95,7 +95,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -108,7 +108,10 @@ Public Member Functions</h2></td></tr>
<tr class="memitem:a15fde13223dcb1da89305ad229763562"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">FreeAddress</a> (uint8_t addr)=0</td></tr>
<tr class="separator:a15fde13223dcb1da89305ad229763562"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="address_8h_source.html#l00087">87</a> of file <a class="el" href="address_8h_source.html">address.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a97df4ef42e50960ce2165f4cdb53e590"></a>
<div class="memitem">
<div class="memproto">
@ -209,7 +212,7 @@ Public Member Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -97,7 +97,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -119,7 +119,13 @@ Public Member Functions</h2></td></tr>
<tr class="memitem:a3d59841faa336c359b0736ca45988ce5"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_address_pool_impl.html#a3d59841faa336c359b0736ca45988ce5">FreeAddress</a> (uint8_t addr)</td></tr>
<tr class="separator:a3d59841faa336c359b0736ca45988ce5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;const uint8_t MAX_DEVICES_ALLOWED&gt;<br/>
class AddressPoolImpl&lt; MAX_DEVICES_ALLOWED &gt;</h3>
<p>Definition at line <a class="el" href="address_8h_source.html#l00101">101</a> of file <a class="el" href="address_8h_source.html">address.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aeaf73d809ebb97bb1015789b8dc31ffa"></a>
<div class="memitem">
<div class="memproto">
@ -143,6 +149,8 @@ template&lt;const uint8_t MAX_DEVICES_ALLOWED&gt; </div>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="address_8h_source.html#l00167">167</a> of file <a class="el" href="address_8h_source.html">address.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
@ -188,6 +196,8 @@ template&lt;const uint8_t MAX_DEVICES_ALLOWED&gt; </div>
<p>Implements <a class="el" href="class_address_pool.html#a97df4ef42e50960ce2165f4cdb53e590">AddressPool</a>.</p>
<p>Definition at line <a class="el" href="address_8h_source.html#l00203">203</a> of file <a class="el" href="address_8h_source.html">address.h</a>.</p>
</div>
</div>
<a class="anchor" id="a09e6dc797f82543eba0879369116182e"></a>
@ -214,6 +224,8 @@ template&lt;const uint8_t MAX_DEVICES_ALLOWED&gt; </div>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="address_8h_source.html#l00193">193</a> of file <a class="el" href="address_8h_source.html">address.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3d59841faa336c359b0736ca45988ce5"></a>
@ -242,6 +254,8 @@ template&lt;const uint8_t MAX_DEVICES_ALLOWED&gt; </div>
<p>Implements <a class="el" href="class_address_pool.html#a15fde13223dcb1da89305ad229763562">AddressPool</a>.</p>
<p>Definition at line <a class="el" href="address_8h_source.html#l00259">259</a> of file <a class="el" href="address_8h_source.html">address.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa3e12dda249ef6acbb27592fc8fe1cba"></a>
@ -270,6 +284,8 @@ template&lt;const uint8_t MAX_DEVICES_ALLOWED&gt; </div>
<p>Implements <a class="el" href="class_address_pool.html#aa92d7e8f0f515340ae2dc1679b627056">AddressPool</a>.</p>
<p>Definition at line <a class="el" href="address_8h_source.html#l00182">182</a> of file <a class="el" href="address_8h_source.html">address.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
@ -278,7 +294,7 @@ template&lt;const uint8_t MAX_DEVICES_ALLOWED&gt; </div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -93,63 +93,67 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a10c34527ae90e95791ac48ac7d1154a2">bConfNum</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a893dd35932821cddda7e482a1904af66">bNumEP</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a5f07597fe15a2b917cce405fe87f2981">BTD</a>(USB *p)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c">BTD_DATAIN_PIPE</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd">BTD_DATAOUT_PIPE</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec">BTD_EVENT_PIPE</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9">btdName</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c">btdPin</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e">connectToWii</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182">disc_bdaddr</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da">disconnect</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a23928cd0e5711a2433aec763cfa55773">EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e">epInfo</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3">GetAddress</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a1cb07a155c69bb1fcf45ae030b8947ec">hci_accept_connection</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#addd07c18c725a324a05792a83026d36d">hci_authentication_request</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#af11ad71d20783d46fe42dd405d10dfda">HCI_Command</a>(uint8_t *data, uint16_t nbytes)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#ae7066ea743f8907708db945ebef3ad76">hci_connect</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(uint16_t handle)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98">hci_handle</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a678f2c995553ce6a9f48f9b59f2f1555">hci_inquiry</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a45ffbc7a40bbb763b0ece907c3dfc9ff">hci_inquiry_cancel</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#af4d28b9c1a3b9688a1871610caee2cfc">hci_link_key_request_negative_reply</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a7114d2cb62aa413e5ecb25c45c76832b">hci_pin_code_negative_request_reply</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a70047b0f624c3f0ef29f8b76b8a34938">hci_pin_code_request_reply</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#acb94a629477d85cebd16a9c5ecd4a8b3">hci_read_bdaddr</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#ae2ba215b6942f4131e4c5fdef2771e22">hci_read_local_version_information</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a8767529bd203c549348a38ac9c6682b3">hci_remote_name</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#ae6f942eabd29257bc4896e5f263275b6">hci_reset</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a9a6747d58951f53389922d80e25b886c">hci_set_local_name</a>(const char *name)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#aff59ab45d917406141ae0c9c79047f08">hci_write_scan_disable</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a7dd7faaec1d3d9a1d8159cc2a4190977">hci_write_scan_enable</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee">incomingWii</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a48608619d8253972dd132edbb3001c5f">Init</a>(uint8_t parent, uint8_t port, bool lowspeed)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8">isReady</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#ab646a59311344966f139bb3b78f30233">l2cap_config_request</a>(uint16_t handle, uint8_t rxid, uint8_t *dcid)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(uint16_t handle, uint8_t rxid, uint8_t *scid)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a55cf412a2053972a353b1ab964ca9d3e">l2cap_connection_request</a>(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a91f61915c503fe7b861c88f5b3e6733c">l2cap_information_response</a>(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc">motionPlusInside</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a76e201c5b561e3a6d0405894ba5c2e41">Poll</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#aa5976eead215a58553aee683d42405a0">PrintEndpointDescriptor</a>(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1">pUsb</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079">qNextPollTime</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a>(BluetoothService *pService)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#aa87c23bce56a20f2db47c6a40c8eda87">Release</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e">remote_name</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737">watingForConnection</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a49f433ab824f259c3815e180c73bb0ad">BTD_CONTROL_PIPE</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c">BTD_DATAIN_PIPE</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd">BTD_DATAOUT_PIPE</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec">BTD_EVENT_PIPE</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">static</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9">btdName</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c">btdPin</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#ac7caac80fb6f5f0e794af3644887d88e">connectToWii</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#ab23f95f12675d7b4505ca6807d379182">disc_bdaddr</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da">disconnect</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a23928cd0e5711a2433aec763cfa55773">EndpointXtract</a>(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a91d92fee94e5a4cbca472bb3fd883e3e">epInfo</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#aecdd9d00fc9c12bb3677ed213a6687c3">GetAddress</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a1cb07a155c69bb1fcf45ae030b8947ec">hci_accept_connection</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#addd07c18c725a324a05792a83026d36d">hci_authentication_request</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#af11ad71d20783d46fe42dd405d10dfda">HCI_Command</a>(uint8_t *data, uint16_t nbytes)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#ae7066ea743f8907708db945ebef3ad76">hci_connect</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a>(uint16_t handle)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#aa3bb6c692701cb33dfad1ea4d68b6f98">hci_handle</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a678f2c995553ce6a9f48f9b59f2f1555">hci_inquiry</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a45ffbc7a40bbb763b0ece907c3dfc9ff">hci_inquiry_cancel</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#af4d28b9c1a3b9688a1871610caee2cfc">hci_link_key_request_negative_reply</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a7114d2cb62aa413e5ecb25c45c76832b">hci_pin_code_negative_request_reply</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a70047b0f624c3f0ef29f8b76b8a34938">hci_pin_code_request_reply</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#acb94a629477d85cebd16a9c5ecd4a8b3">hci_read_bdaddr</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#ae2ba215b6942f4131e4c5fdef2771e22">hci_read_local_version_information</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a8767529bd203c549348a38ac9c6682b3">hci_remote_name</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#ae6f942eabd29257bc4896e5f263275b6">hci_reset</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a9a6747d58951f53389922d80e25b886c">hci_set_local_name</a>(const char *name)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#addaddee110af23a3195ad56f631e69ea">hci_version</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#aff59ab45d917406141ae0c9c79047f08">hci_write_scan_disable</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a7dd7faaec1d3d9a1d8159cc2a4190977">hci_write_scan_enable</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a4dc8f94fe85028f3d54f13dde1e5b4ee">incomingWii</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a48608619d8253972dd132edbb3001c5f">Init</a>(uint8_t parent, uint8_t port, bool lowspeed)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8">isReady</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a>(uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#ab646a59311344966f139bb3b78f30233">l2cap_config_request</a>(uint16_t handle, uint8_t rxid, uint8_t *dcid)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a792ac4529b65235698ecf3d37982c05e">l2cap_config_response</a>(uint16_t handle, uint8_t rxid, uint8_t *scid)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a55cf412a2053972a353b1ab964ca9d3e">l2cap_connection_request</a>(uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a7d34c62b1d561679dea5cd27356b38a7">l2cap_connection_response</a>(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#ac7053ef7ac690be3afbbdd985b163f10">l2cap_disconnection_request</a>(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a29d176d9194e5c92fbe54791fc245407">l2cap_disconnection_response</a>(uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a91f61915c503fe7b861c88f5b3e6733c">l2cap_information_response</a>(uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc">motionPlusInside</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a1f8e9171a310e50f2c4a3c19066efe5a">my_bdaddr</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a0c8cc2a2dd2cda3e760b8b4c1a2d169c">pairWithWii</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a76e201c5b561e3a6d0405894ba5c2e41">Poll</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#aa5976eead215a58553aee683d42405a0">PrintEndpointDescriptor</a>(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a4bcd1d622a6455ee3d0cccc4408700a1">pUsb</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a52d6c7895f6bb01729d01ce28a2f3079">qNextPollTime</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a>(BluetoothService *pService)</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#aa87c23bce56a20f2db47c6a40c8eda87">Release</a>()</td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#aede42d995c384c238fd49d728df01e4e">remote_name</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#a9e5a34242007b64cd6a226cfd1901e74">rfcommConnectionClaimed</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#af5e5b085cec1da5c83c75e80e95b3590">sdpConnectionClaimed</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_b_t_d.html#aa7735da01865bab01b569ee836173737">watingForConnection</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_b_t_d.html#a962a5714c225dcb633434f02e3657583">wiiUProController</a></td><td class="entry"><a class="el" href="class_b_t_d.html">BTD</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -114,6 +114,11 @@ Collaboration diagram for BTD:</div>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5f07597fe15a2b917cce405fe87f2981"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a5f07597fe15a2b917cce405fe87f2981">BTD</a> (<a class="el" href="class_u_s_b.html">USB</a> *p)</td></tr>
<tr class="separator:a5f07597fe15a2b917cce405fe87f2981"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a610183f9ddf04155ef2612d1839af7da"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da">disconnect</a> ()</td></tr>
<tr class="separator:a610183f9ddf04155ef2612d1839af7da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4adfc7e51ad3b3c03e7c37d1af159e73"><td class="memItemLeft" align="right" valign="top">int8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a> (<a class="el" href="class_bluetooth_service.html">BluetoothService</a> *pService)</td></tr>
<tr class="separator:a4adfc7e51ad3b3c03e7c37d1af159e73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">USBDeviceConfig implementation</div></td></tr>
<tr class="memitem:a48608619d8253972dd132edbb3001c5f"><td class="memItemLeft" align="right" valign="top">virtual uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a48608619d8253972dd132edbb3001c5f">Init</a> (uint8_t parent, uint8_t port, bool lowspeed)</td></tr>
<tr class="separator:a48608619d8253972dd132edbb3001c5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa87c23bce56a20f2db47c6a40c8eda87"><td class="memItemLeft" align="right" valign="top">virtual uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#aa87c23bce56a20f2db47c6a40c8eda87">Release</a> ()</td></tr>
@ -124,12 +129,10 @@ Public Member Functions</h2></td></tr>
<tr class="separator:aecdd9d00fc9c12bb3677ed213a6687c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b2440748bdaaeb552a05b0f0902f5d8"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a1b2440748bdaaeb552a05b0f0902f5d8">isReady</a> ()</td></tr>
<tr class="separator:a1b2440748bdaaeb552a05b0f0902f5d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">UsbConfigXtracter implementation</div></td></tr>
<tr class="memitem:a23928cd0e5711a2433aec763cfa55773"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a23928cd0e5711a2433aec763cfa55773">EndpointXtract</a> (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const <a class="el" 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> *ep)</td></tr>
<tr class="separator:a23928cd0e5711a2433aec763cfa55773"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a610183f9ddf04155ef2612d1839af7da"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a610183f9ddf04155ef2612d1839af7da">disconnect</a> ()</td></tr>
<tr class="separator:a610183f9ddf04155ef2612d1839af7da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4adfc7e51ad3b3c03e7c37d1af159e73"><td class="memItemLeft" align="right" valign="top">int8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a4adfc7e51ad3b3c03e7c37d1af159e73">registerServiceClass</a> (<a class="el" href="class_bluetooth_service.html">BluetoothService</a> *pService)</td></tr>
<tr class="separator:a4adfc7e51ad3b3c03e7c37d1af159e73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">HCI Commands</div></td></tr>
<tr class="memitem:af11ad71d20783d46fe42dd405d10dfda"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#af11ad71d20783d46fe42dd405d10dfda">HCI_Command</a> (uint8_t *data, uint16_t nbytes)</td></tr>
<tr class="separator:af11ad71d20783d46fe42dd405d10dfda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6f942eabd29257bc4896e5f263275b6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#ae6f942eabd29257bc4896e5f263275b6">hci_reset</a> ()</td></tr>
@ -142,12 +145,12 @@ Public Member Functions</h2></td></tr>
<tr class="separator:a9a6747d58951f53389922d80e25b886c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dd7faaec1d3d9a1d8159cc2a4190977"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a7dd7faaec1d3d9a1d8159cc2a4190977">hci_write_scan_enable</a> ()</td></tr>
<tr class="separator:a7dd7faaec1d3d9a1d8159cc2a4190977"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff59ab45d917406141ae0c9c79047f08"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#aff59ab45d917406141ae0c9c79047f08">hci_write_scan_disable</a> ()</td></tr>
<tr class="separator:aff59ab45d917406141ae0c9c79047f08"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8767529bd203c549348a38ac9c6682b3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a8767529bd203c549348a38ac9c6682b3">hci_remote_name</a> ()</td></tr>
<tr class="separator:a8767529bd203c549348a38ac9c6682b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cb07a155c69bb1fcf45ae030b8947ec"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a1cb07a155c69bb1fcf45ae030b8947ec">hci_accept_connection</a> ()</td></tr>
<tr class="separator:a1cb07a155c69bb1fcf45ae030b8947ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff59ab45d917406141ae0c9c79047f08"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#aff59ab45d917406141ae0c9c79047f08">hci_write_scan_disable</a> ()</td></tr>
<tr class="separator:aff59ab45d917406141ae0c9c79047f08"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bea5dd793a2f47006b4a7642efc9e56"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a1bea5dd793a2f47006b4a7642efc9e56">hci_disconnect</a> (uint16_t handle)</td></tr>
<tr class="separator:a1bea5dd793a2f47006b4a7642efc9e56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70047b0f624c3f0ef29f8b76b8a34938"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a70047b0f624c3f0ef29f8b76b8a34938">hci_pin_code_request_reply</a> ()</td></tr>
@ -164,6 +167,7 @@ Public Member Functions</h2></td></tr>
<tr class="separator:a45ffbc7a40bbb763b0ece907c3dfc9ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7066ea743f8907708db945ebef3ad76"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#ae7066ea743f8907708db945ebef3ad76">hci_connect</a> ()</td></tr>
<tr class="separator:ae7066ea743f8907708db945ebef3ad76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">L2CAP Commands</div></td></tr>
<tr class="memitem:aad7d8ef46e60b48ff4aaabefb0b290e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#aad7d8ef46e60b48ff4aaabefb0b290e7">L2CAP_Command</a> (uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00)</td></tr>
<tr class="separator:aad7d8ef46e60b48ff4aaabefb0b290e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55cf412a2053972a353b1ab964ca9d3e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a55cf412a2053972a353b1ab964ca9d3e">l2cap_connection_request</a> (uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm)</td></tr>
@ -187,6 +191,10 @@ Public Attributes</h2></td></tr>
<tr class="separator:aa7735da01865bab01b569ee836173737"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f1c28a03bcbe62cc7c083f97ea27594"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a0f1c28a03bcbe62cc7c083f97ea27594">l2capConnectionClaimed</a></td></tr>
<tr class="separator:a0f1c28a03bcbe62cc7c083f97ea27594"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5e5b085cec1da5c83c75e80e95b3590"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#af5e5b085cec1da5c83c75e80e95b3590">sdpConnectionClaimed</a></td></tr>
<tr class="separator:af5e5b085cec1da5c83c75e80e95b3590"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e5a34242007b64cd6a226cfd1901e74"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a9e5a34242007b64cd6a226cfd1901e74">rfcommConnectionClaimed</a></td></tr>
<tr class="separator:a9e5a34242007b64cd6a226cfd1901e74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0359c0c158c864c27319810cbd1534f9"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a0359c0c158c864c27319810cbd1534f9">btdName</a></td></tr>
<tr class="separator:a0359c0c158c864c27319810cbd1534f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a215cb939c01ed3ff56db37841224546c"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a215cb939c01ed3ff56db37841224546c">btdPin</a></td></tr>
@ -209,6 +217,8 @@ Public Attributes</h2></td></tr>
<tr class="separator:a0c8cc2a2dd2cda3e760b8b4c1a2d169c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3aea445b2349e99ef057db1a4ffdd9dc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a3aea445b2349e99ef057db1a4ffdd9dc">motionPlusInside</a></td></tr>
<tr class="separator:a3aea445b2349e99ef057db1a4ffdd9dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a962a5714c225dcb633434f02e3657583"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a962a5714c225dcb633434f02e3657583">wiiUProController</a></td></tr>
<tr class="separator:a962a5714c225dcb633434f02e3657583"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
@ -232,6 +242,8 @@ Protected Attributes</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-attribs"></a>
Static Protected Attributes</h2></td></tr>
<tr class="memitem:a49f433ab824f259c3815e180c73bb0ad"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a49f433ab824f259c3815e180c73bb0ad">BTD_CONTROL_PIPE</a> = 0</td></tr>
<tr class="separator:a49f433ab824f259c3815e180c73bb0ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24166c9b308925eeb2f635fae43ca5ec"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a24166c9b308925eeb2f635fae43ca5ec">BTD_EVENT_PIPE</a> = 1</td></tr>
<tr class="separator:a24166c9b308925eeb2f635fae43ca5ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a480510bd399ae74a97cd74c8474ef59c"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a480510bd399ae74a97cd74c8474ef59c">BTD_DATAIN_PIPE</a> = 2</td></tr>
@ -239,7 +251,11 @@ Static Protected Attributes</h2></td></tr>
<tr class="memitem:a0d82870f7eef8c27c33e6f5989d7a4dd"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_b_t_d.html#a0d82870f7eef8c27c33e6f5989d7a4dd">BTD_DATAOUT_PIPE</a> = 3</td></tr>
<tr class="separator:a0d82870f7eef8c27c33e6f5989d7a4dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The Bluetooth Dongle class will take care of all the <a class="el" href="class_u_s_b.html">USB</a> communication and then pass the data to the <a class="el" href="class_bluetooth_service.html">BluetoothService</a> classes. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00153">153</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5f07597fe15a2b917cce405fe87f2981"></a>
<div class="memitem">
<div class="memproto">
@ -253,6 +269,15 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor for the <a class="el" href="class_b_t_d.html">BTD</a> class. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">p</td><td>Pointer to <a class="el" href="class_u_s_b.html">USB</a> class instance. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00027">27</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -277,6 +302,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Disconnects both the L2CAP Channel and the HCI Connection for all Bluetooth services. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00205">205</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -329,9 +357,22 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="class_usb_config_xtracter.html">UsbConfigXtracter</a> implementation, used to extract endpoint information. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">conf</td><td>Configuration value. </td></tr>
<tr><td class="paramname">iface</td><td>Interface number. </td></tr>
<tr><td class="paramname">alt</td><td>Alternate setting. </td></tr>
<tr><td class="paramname">proto</td><td>Interface Protocol. </td></tr>
<tr><td class="paramname">ep</td><td>Endpoint Descriptor. </td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="class_usb_config_xtracter.html#aceb5da8339172cbb2e9ce2064e34e5ef">UsbConfigXtracter</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00252">252</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aecdd9d00fc9c12bb3677ed213a6687c3"></a>
@ -354,9 +395,13 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Get the device address. </p>
<dl class="section return"><dt>Returns</dt><dd>The device address. </dd></dl>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#aae3130517514c902bad5f153849b3811">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00184">184</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1cb07a155c69bb1fcf45ae030b8947ec"></a>
@ -371,6 +416,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Accept the connection with the Bluetooth device. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00814">814</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -386,6 +434,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to try to authenticate with the remote device. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00969">969</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -412,6 +463,16 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to send a HCI Command. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Data to send. </td></tr>
<tr><td class="paramname">nbytes</td><td>Number of bytes to send. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00773">773</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -427,6 +488,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Connect to a device. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00878">878</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -443,6 +507,15 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Disconnect the HCI connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>The HCI Handle for the connection. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00978">978</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -458,6 +531,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Start a HCI inquiry. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00858">858</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -473,6 +549,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Cancel a HCI inquiry. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00871">871</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -488,6 +567,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Command is used to reply to a Link Key Request event from the BR/EDR Controller if the Host does not have a stored Link Key for the connection. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00956">956</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -503,6 +585,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Respons when no pin was set. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00943">943</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -518,6 +603,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Respond with the pin for the connection. The pin is automatically set for the Wii library, but can be customized for the <a class="el" href="class_s_p_p.html">SPP</a> library. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00899">899</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -533,6 +621,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Read the Bluetooth address of the dongle. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00802">802</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -548,6 +639,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Read the HCI Version of the Bluetooth dongle. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00808">808</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -563,6 +657,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Read the remote devices name. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00829">829</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -578,6 +675,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Reset the Bluetooth dongle. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00777">777</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -594,6 +694,15 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Set the local name of the Bluetooth dongle. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>Desired name. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00847">847</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -609,6 +718,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Disable visibility to other Bluetooth devices. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00795">795</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -624,6 +736,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Enable visibility to other Bluetooth devices. </p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00784">784</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -664,9 +779,21 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize the Bluetooth dongle. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parent</td><td>Hub number. </td></tr>
<tr><td class="paramname">port</td><td>Port number on the hub. </td></tr>
<tr><td class="paramname">lowspeed</td><td>Speed of the device. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd></dl>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a391dc824a3271671890cebeb829b35ed">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00045">45</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a1b2440748bdaaeb552a05b0f0902f5d8"></a>
@ -689,6 +816,10 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to check if the dongle has been initialized. </p>
<dl class="section return"><dt>Returns</dt><dd>True if it's ready. </dd></dl>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00189">189</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -733,6 +864,18 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to send L2CAP Commands. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>HCI Handle. </td></tr>
<tr><td class="paramname">data</td><td>Data to send. </td></tr>
<tr><td class="paramname">nbytes</td><td>Number of bytes to send. </td></tr>
<tr><td class="paramname">channelLow,channelHigh</td><td>Low and high byte of channel to send to. If argument is omitted then the Standard L2CAP header: Channel ID (0x01) for ACL-U will be used. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l01014">1014</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -765,6 +908,17 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>L2CAP Config Request. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>HCI Handle. </td></tr>
<tr><td class="paramname">rxid</td><td>Identifier. </td></tr>
<tr><td class="paramname">dcid</td><td>Destination Channel Identifier. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l01069">1069</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -797,6 +951,17 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>L2CAP Config Response. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>HCI Handle. </td></tr>
<tr><td class="paramname">rxid</td><td>Identifier. </td></tr>
<tr><td class="paramname">scid</td><td>Source Channel Identifier. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l01085">1085</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -835,6 +1000,18 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>L2CAP Connection Request. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>HCI handle. </td></tr>
<tr><td class="paramname">rxid</td><td>Identifier. </td></tr>
<tr><td class="paramname">scid</td><td>Source Channel Identifier. </td></tr>
<tr><td class="paramname">psm</td><td>Protocol/Service Multiplexer - see: <a href="https://www.bluetooth.org/Technical/AssignedNumbers/logical_link.htm">https://www.bluetooth.org/Technical/AssignedNumbers/logical_link.htm</a>. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l01041">1041</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -879,6 +1056,19 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>L2CAP Connection Response. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>HCI handle. </td></tr>
<tr><td class="paramname">rxid</td><td>Identifier. </td></tr>
<tr><td class="paramname">dcid</td><td>Destination Channel Identifier. </td></tr>
<tr><td class="paramname">scid</td><td>Source Channel Identifier. </td></tr>
<tr><td class="paramname">result</td><td>Result - First send <a class="el" href="_b_t_d_8h.html#a9960d0d5ae92fc92c70bbb84c2a5c0cc">PENDING</a> and then <a class="el" href="_b_t_d_8h.html#a1be7a56cdddcdb7dedf16d4dee381e93">SUCCESSFUL</a>. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l01053">1053</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -917,6 +1107,18 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>L2CAP Disconnection Request. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>HCI Handle. </td></tr>
<tr><td class="paramname">rxid</td><td>Identifier. </td></tr>
<tr><td class="paramname">dcid</td><td>Device Channel Identifier. </td></tr>
<tr><td class="paramname">scid</td><td>Source Channel Identifier. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l01103">1103</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -955,6 +1157,18 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>L2CAP Disconnection Response. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>HCI Handle. </td></tr>
<tr><td class="paramname">rxid</td><td>Identifier. </td></tr>
<tr><td class="paramname">dcid</td><td>Device Channel Identifier. </td></tr>
<tr><td class="paramname">scid</td><td>Source Channel Identifier. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l01114">1114</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -993,6 +1207,17 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>L2CAP Information Response. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">handle</td><td>HCI Handle. </td></tr>
<tr><td class="paramname">rxid</td><td>Identifier. </td></tr>
<tr><td class="paramname">infoTypeLow,infoTypeHigh</td><td>Infotype. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l01125">1125</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -1016,9 +1241,13 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Poll the <a class="el" href="class_u_s_b.html">USB</a> Input endpoins and run the state machines. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd></dl>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a4961e92df3e75c38e6953fb08b11f8b6">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00312">312</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa5976eead215a58553aee683d42405a0"></a>
@ -1042,6 +1271,15 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to print the <a class="el" href="class_u_s_b.html">USB</a> Endpoint Descriptor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ep_ptr</td><td>Pointer to <a class="el" href="class_u_s_b.html">USB</a> Endpoint Descriptor. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00283">283</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
@ -1066,6 +1304,16 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Register bluetooth dongle members/services. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pService</td><td>Pointer to <a class="el" href="class_bluetooth_service.html">BluetoothService</a> class instance. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The serice ID on succes or -1 on fail. </dd></dl>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00215">215</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1089,9 +1337,13 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Release the <a class="el" href="class_u_s_b.html">USB</a> device. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd></dl>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a74c06c5fe641b20faeeebd39e33248b3">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="_b_t_d_8cpp_source.html#l00302">302</a> of file <a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
@ -1112,6 +1364,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Device address. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00388">388</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1132,6 +1387,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Configuration number. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00393">393</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1152,6 +1410,32 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Total number of endpoints in the configuration. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00395">395</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a49f433ab824f259c3815e180c73bb0ad"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const uint8_t BTD::BTD_CONTROL_PIPE = 0</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Bluetooth dongle control endpoint. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00400">400</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1172,6 +1456,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>ACL In endpoint index. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00404">404</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1192,6 +1479,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>ACL Out endpoint index. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00406">406</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1212,6 +1502,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>HCI event endpoint index. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00402">402</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1224,6 +1517,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>The name you wish to make the dongle show up as. It is set automatically by the <a class="el" href="class_s_p_p.html">SPP</a> library. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00355">355</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1236,6 +1532,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>The pin you wish to make the dongle use for authentication. It is set automatically by the <a class="el" href="class_s_p_p.html">SPP</a> library. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00357">357</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1248,6 +1547,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to only send the ACL data to the wiimote. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00374">374</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1260,6 +1562,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Last incoming devices Bluetooth address. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00364">364</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1280,6 +1585,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Endpoint info structure. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00390">390</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1292,6 +1600,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>HCI handle for the last connection. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00362">362</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1304,6 +1615,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>The supported HCI Version read from the Bluetooth dongle. Used by the <a class="el" href="class_p_s3_b_t.html">PS3BT</a> library to check the HCI Version of the Bluetooth dongle, it should be at least 3 to work properly with the library. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00372">372</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1316,6 +1630,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>True if a Wiimote is connecting. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00376">376</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1328,6 +1645,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>This is used by the service to know when to store the device information. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00348">348</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1340,6 +1660,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>True if it's the new Wiimote with the Motion Plus Inside or a Wii U Pro Controller. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00380">380</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1352,6 +1675,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>The bluetooth dongles Bluetooth address. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00360">360</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1364,6 +1690,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>True when it should pair with the incoming Wiimote. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00378">378</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1384,6 +1713,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Pointer to <a class="el" href="class_u_s_b.html">USB</a> class instance. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00386">386</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1404,6 +1736,9 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Next poll time based on poll interval taken from the <a class="el" href="class_u_s_b.html">USB</a> descriptor. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00397">397</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1416,6 +1751,39 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>First 30 chars of last remote name. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00366">366</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9e5a34242007b64cd6a226cfd1901e74"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool BTD::rfcommConnectionClaimed</td>
</tr>
</table>
</div><div class="memdoc">
<p>This is used by the <a class="el" href="class_s_p_p.html">SPP</a> library to claim the current RFCOMM incoming request. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00352">352</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="af5e5b085cec1da5c83c75e80e95b3590"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool BTD::sdpConnectionClaimed</td>
</tr>
</table>
</div><div class="memdoc">
<p>This is used by the <a class="el" href="class_s_p_p.html">SPP</a> library to claim the current SDP incoming request. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00350">350</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
@ -1428,17 +1796,35 @@ Static Protected Attributes</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Use this to see if it is waiting for a incoming connection. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00346">346</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<a class="anchor" id="a962a5714c225dcb633434f02e3657583"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool BTD::wiiUProController</td>
</tr>
</table>
</div><div class="memdoc">
<p>True if it's a Wii U Pro Controller. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00382">382</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="_b_t_d_8h_source.html">BTD.h</a></li>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="_b_t_d_8cpp.html">BTD.cpp</a></li>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="_b_t_d_8cpp_source.html">BTD.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -96,7 +96,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -110,7 +110,11 @@ Public Member Functions</h2></td></tr>
<tr class="memitem:a66ee2f09c6087b82e3920c3d652a99b2"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bluetooth_service.html#a66ee2f09c6087b82e3920c3d652a99b2">disconnect</a> ()</td></tr>
<tr class="separator:a66ee2f09c6087b82e3920c3d652a99b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>All Bluetooth services should include this class. </p>
<p>Definition at line <a class="el" href="_b_t_d_8h_source.html#l00134">134</a> of file <a class="el" href="_b_t_d_8h_source.html">BTD.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a8dc98310fe481357eaa86c53e49af113"></a>
<div class="memitem">
<div class="memproto">
@ -132,8 +136,15 @@ Public Member Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to pass acldata to the Bluetooth service. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ACLData</td><td>Pointer to the incoming acldata. </td></tr>
</table>
</dd>
</dl>
<p>Reimplemented in <a class="el" href="class_s_p_p.html#abdfe9453fb82781bec53a191c2e9fb1d">SPP</a>, <a class="el" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">WII</a>, and <a class="el" href="class_p_s3_b_t.html#aa310ede24b68b1b03cfc49c4308c66b7">PS3BT</a>.</p>
<p>Reimplemented in <a class="el" href="class_w_i_i.html#a81e1eb4d9ef9999a84e71d764d54dff7">WII</a>, <a class="el" href="class_s_p_p.html#abdfe9453fb82781bec53a191c2e9fb1d">SPP</a>, and <a class="el" href="class_p_s3_b_t.html#aa310ede24b68b1b03cfc49c4308c66b7">PS3BT</a>.</p>
</div>
</div>
@ -157,8 +168,9 @@ Public Member Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to disconnect both the L2CAP Channel and the HCI Connection for the Bluetooth service. </p>
<p>Reimplemented in <a class="el" href="class_s_p_p.html#a2b4b1f85f553c6a2fdd523e50c75c7b0">SPP</a>, <a class="el" href="class_w_i_i.html#aabe4780f258dada1c0564a4ac7607370">WII</a>, and <a class="el" href="class_p_s3_b_t.html#a39ad8810c67e85eddc68c8a16d38a985">PS3BT</a>.</p>
<p>Reimplemented in <a class="el" href="class_w_i_i.html#aabe4780f258dada1c0564a4ac7607370">WII</a>, <a class="el" href="class_s_p_p.html#a2b4b1f85f553c6a2fdd523e50c75c7b0">SPP</a>, and <a class="el" href="class_p_s3_b_t.html#a39ad8810c67e85eddc68c8a16d38a985">PS3BT</a>.</p>
</div>
</div>
@ -182,8 +194,9 @@ Public Member Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to reset the Bluetooth service. </p>
<p>Reimplemented in <a class="el" href="class_s_p_p.html#ae2c661bd46cd2d74bd29c4c771cd2ef0">SPP</a>, <a class="el" href="class_w_i_i.html#a769ee2f9a0088da097438bc3cc677f7c">WII</a>, and <a class="el" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">PS3BT</a>.</p>
<p>Reimplemented in <a class="el" href="class_w_i_i.html#a769ee2f9a0088da097438bc3cc677f7c">WII</a>, <a class="el" href="class_s_p_p.html#ae2c661bd46cd2d74bd29c4c771cd2ef0">SPP</a>, and <a class="el" href="class_p_s3_b_t.html#a576d72cdf12af58ae59c8f2a02f99c0f">PS3BT</a>.</p>
</div>
</div>
@ -207,8 +220,9 @@ Public Member Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p>Used to run the different state machines in the Bluetooth service. </p>
<p>Reimplemented in <a class="el" href="class_s_p_p.html#a2de67ee7ad1be9d2f3daf7dc08dc5f90">SPP</a>, <a class="el" href="class_w_i_i.html#ac5cd06f3e9aa2a0d9b9691f00c047e72">WII</a>, and <a class="el" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086">PS3BT</a>.</p>
<p>Reimplemented in <a class="el" href="class_w_i_i.html#ac5cd06f3e9aa2a0d9b9691f00c047e72">WII</a>, <a class="el" href="class_s_p_p.html#a2de67ee7ad1be9d2f3daf7dc08dc5f90">SPP</a>, and <a class="el" href="class_p_s3_b_t.html#ab41f25f45573239990f68611dc825086">PS3BT</a>.</p>
</div>
</div>
@ -218,7 +232,7 @@ Public Member Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -128,7 +128,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -193,7 +193,10 @@ Static Protected Attributes</h2></td></tr>
<tr class="memitem:a03cd96b415990821bdce43b4004c85e4"><td class="memItemLeft" align="right" valign="top">static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bulk_only.html#a03cd96b415990821bdce43b4004c85e4">epInterruptInIndex</a> = 3</td></tr>
<tr class="separator:a03cd96b415990821bdce43b4004c85e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00185">185</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a530fb250b0a0c92b48bc57e2957ace25"></a>
<div class="memitem">
<div class="memproto">
@ -208,6 +211,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00054">54</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
@ -233,6 +238,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00413">413</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a13d33906543d5d6b44620f430dc729ff"></a>
@ -287,6 +294,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_usb_config_xtracter.html#aceb5da8339172cbb2e9ce2064e34e5ef">UsbConfigXtracter</a>.</p>
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00265">265</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a376cb3367071555816e2b0c74ad7eb12"></a>
@ -312,6 +321,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#aae3130517514c902bad5f153849b3811">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00246">246</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="abe1e768a46e751e6792164334c973b44"></a>
@ -335,6 +346,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00229">229</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3358d6e445096c99817d276315b841cc"></a>
@ -351,6 +364,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00365">365</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5e96d4028abd1885359fc36f644b8363"></a>
@ -375,6 +390,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00388">388</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a51870da9badc037166b86da60bcda6ea"></a>
@ -417,6 +434,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a391dc824a3271671890cebeb829b35ed">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00076">76</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aab14f15d29a05f2260aaaeb8e9b3db01"></a>
@ -449,6 +468,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00442">442</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa62fd9f43fb0e8b3a9973ead5d577dcb"></a>
@ -483,6 +504,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00350">350</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a49762e86fea9ee137097691c5eac062e"></a>
@ -517,6 +540,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00343">343</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a51b8a76f5e16697476ce2dcff2514bc6"></a>
@ -542,6 +567,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a4961e92df3e75c38e6953fb08b11f8b6">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00306">306</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac8a1d7b2ef82d9f6da44928c78039964"></a>
@ -566,6 +593,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00630">630</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a116e4f6f9c5ce8df1c7978a47e7dfc76"></a>
@ -604,6 +633,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00521">521</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="abf6c027a7a3a9d1c2db13835657048fa"></a>
@ -636,6 +667,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00482">482</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a8a9b213d1800db2d8e661d242b57b195"></a>
@ -661,6 +694,8 @@ Static Protected Attributes</h2></td></tr>
<p>Implements <a class="el" href="class_u_s_b_device_config.html#a74c06c5fe641b20faeeebd39e33248b3">USBDeviceConfig</a>.</p>
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00293">293</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a42e3ee7f4fdb3327ff2d5bab0ef05422"></a>
@ -693,6 +728,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00462">462</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0e90c8ec2622fb6c5b19de16c244a8a1"></a>
@ -708,6 +745,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00360">360</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3605db2357c817d46962b703bec21ea7"></a>
@ -723,6 +762,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00419">419</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7f970ddfbc562e53dcdc839753e79067"></a>
@ -739,6 +780,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00502">502</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6534434c067e35aa71066a2a9ee1b82d"></a>
@ -785,6 +828,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8cpp_source.html#l00545">545</a> of file <a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
@ -806,6 +851,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00193">193</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab54f472ec9cd39abdb9f90867943d162"></a>
@ -826,6 +873,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00194">194</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac18ad598cd9a1ee99f49d51a572a50a4"></a>
@ -846,6 +895,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00195">195</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a20ff3cc4bb15c557f57a8c6200b412d1"></a>
@ -866,6 +917,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00205">205</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6bbdd41bf6efc4060f3c36da7d6ed8b2"></a>
@ -886,6 +939,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00204">204</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6cb56ebd0307845321340919e2b35952"></a>
@ -906,6 +961,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00196">196</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a21961ad1130480f534ef3e91f24c56a0"></a>
@ -926,6 +983,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00198">198</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7b90227b0707d19385b9fa2fae85e184"></a>
@ -946,6 +1005,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00203">203</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7ae682d50badd1386a06f30f35a32d1d"></a>
@ -966,6 +1027,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00202">202</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9e487226408578a2971570bcf7de62fe"></a>
@ -986,6 +1049,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00188">188</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8d527bdc285870f3571481a4fd982721"></a>
@ -1006,6 +1071,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00189">189</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="aee2247fd0a251e4da36e8c09bbe6917f"></a>
@ -1026,6 +1093,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00200">200</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a03cd96b415990821bdce43b4004c85e4"></a>
@ -1046,6 +1115,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00190">190</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6b4ae384eea3aacd8bf916439621973a"></a>
@ -1066,6 +1137,8 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00192">192</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2d422ee0745cd7c04afff905278c4233"></a>
@ -1086,16 +1159,18 @@ Static Protected Attributes</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="masstorage_8h_source.html#l00197">197</a> of file <a class="el" href="masstorage_8h_source.html">masstorage.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="masstorage_8h_source.html">masstorage.h</a></li>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="masstorage_8cpp.html">masstorage.cpp</a></li>
<li>/Users/Lauszus/GitHub/USB_Host_Shield_2.0/<a class="el" href="masstorage_8cpp_source.html">masstorage.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -95,7 +95,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -101,7 +101,10 @@ Public Member Functions</h2></td></tr>
<tr class="memitem:a1ff6b49682f75c6edab2966540f2ede0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_byte_skipper.html#a1ff6b49682f75c6edab2966540f2ede0">Skip</a> (uint8_t **pp, uint16_t *pcntdn, uint16_t bytes_to_skip)</td></tr>
<tr class="separator:a1ff6b49682f75c6edab2966540f2ede0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="parsetools_8h_source.html#l00058">58</a> of file <a class="el" href="parsetools_8h_source.html">parsetools.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abfe4186513af9389e93931f0bee2c606"></a>
<div class="memitem">
<div class="memproto">
@ -123,6 +126,8 @@ Public Member Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="parsetools_8h_source.html#l00065">65</a> of file <a class="el" href="parsetools_8h_source.html">parsetools.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
@ -148,6 +153,8 @@ Public Member Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="parsetools_8h_source.html#l00067">67</a> of file <a class="el" href="parsetools_8h_source.html">parsetools.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1ff6b49682f75c6edab2966540f2ede0"></a>
@ -188,6 +195,8 @@ Public Member Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="parsetools_8h_source.html#l00073">73</a> of file <a class="el" href="parsetools_8h_source.html">parsetools.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
@ -196,7 +205,7 @@ Public Member Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -93,7 +93,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

View file

@ -97,7 +97,10 @@ Public Member Functions</h2></td></tr>
<tr class="memitem:a899353c3cbf83d7f874d11e5d9db4722"><td class="memItemLeft" align="right" valign="top">virtual uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_d_c_async_oper.html#a899353c3cbf83d7f874d11e5d9db4722">OnInit</a> (<a class="el" href="class_a_c_m.html">ACM</a> *pacm)=0</td></tr>
<tr class="separator:a899353c3cbf83d7f874d11e5d9db4722"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="cdcacm_8h_source.html#l00151">151</a> of file <a class="el" href="cdcacm_8h_source.html">cdcacm.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a899353c3cbf83d7f874d11e5d9db4722"></a>
<div class="memitem">
<div class="memproto">
@ -128,7 +131,7 @@ Public Member Functions</h2></td></tr>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 30 2013 21:23:57 for USB_Host_Shield_2.0 by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Tue Feb 5 2013 19:53:22 for USB_Host_Shield_2.0 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>

Some files were not shown because too many files have changed in this diff Show more