USB_Host_Shield_2.0/adk_8h_source.html

255 lines
40 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2013-01-30 22:00:18 +01:00
<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.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>USB Host Shield 2.0: adk.h Source File</title>
2013-01-30 22:00:18 +01:00
<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/searchdata.js"></script>
2013-01-30 22:00:18 +01:00
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="imageStyle.css" rel="stylesheet" type="text/css"/>
2013-01-30 22:00:18 +01:00
</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 id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">USB Host Shield 2.0
2013-01-30 22:00:18 +01:00
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
2013-01-30 22:00:18 +01:00
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
2013-01-30 22:00:18 +01:00
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
2013-01-30 22:00:18 +01:00
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
2013-01-30 22:00:18 +01:00
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
2013-01-30 22:00:18 +01:00
<!-- 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">adk.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="adk_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">This software may be distributed and modified under the terms of the GNU</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">General Public License version 2 (GPL2) as published by the Free Software</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">Foundation and appearing in the file GPL2.TXT included in the packaging of</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">this file. Please note that GPL2 Section 2[b] requires that all works based</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">on this software must also be made publicly available under the terms of</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">the GPL2 (&quot;Copyleft&quot;).</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">Contact information</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">-------------------</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment">Circuits At Home, LTD</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">Web : http://www.circuitsathome.com</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">e-mail : support@circuitsathome.com</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">/* Google ADK interface support header */</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">#if !defined(_ADK_H_)</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#define _ADK_H_</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_usb_8h.html">Usb.h</a>&quot;</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="line" href="adk_8h.html#a37223416b6c1bba6b86ab17211bc9af2"> 25</a></span>&#160;<span class="preprocessor">#define ADK_VID 0x18D1</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="adk_8h.html#a32e861258886323d4dbcf066641597a4"> 26</a></span>&#160;<span class="preprocessor">#define ADK_PID 0x2D00</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="adk_8h.html#a355cd5e5557b754645d4e1bfffabbf99"> 27</a></span>&#160;<span class="preprocessor">#define ADB_PID 0x2D01</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"><a class="line" href="adk_8h.html#aeb9a797aace2bcf4a9d1f786a632ca4b"> 29</a></span>&#160;<span class="preprocessor">#define XOOM //enables repeating getProto() and getConf() attempts</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment">//necessary for slow devices such as Motorola XOOM</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="comment">//defined by default, can be commented out to save memory</span></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">/* requests */</span></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="line" href="adk_8h.html#a4c3e43d4d2955f93260f3e5ffe207e41"> 35</a></span>&#160;<span class="preprocessor">#define ADK_GETPROTO 51 //check USB accessory protocol version</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="adk_8h.html#a4ab0e7e3adbc8bfc1bcdf29887c9a455"> 36</a></span>&#160;<span class="preprocessor">#define ADK_SENDSTR 52 //send identifying string</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="adk_8h.html#a6ebdba027fb7072f681e6445a385e8f2"> 37</a></span>&#160;<span class="preprocessor">#define ADK_ACCSTART 53 //start device in accessory mode</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"><a class="line" href="adk_8h.html#a67b2829fb8d9f0e52eebef518ec6ebb0"> 39</a></span>&#160;<span class="preprocessor">#define bmREQ_ADK_GET USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_VENDOR|USB_SETUP_RECIPIENT_DEVICE</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="adk_8h.html#a7da9c6adbc669b65ca3e4bd3f90c4c7b"> 40</a></span>&#160;<span class="preprocessor">#define bmREQ_ADK_SEND USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_VENDOR|USB_SETUP_RECIPIENT_DEVICE</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"><a class="line" href="adk_8h.html#a12e00d6841cbb8fd9ae7c97402efa062"> 42</a></span>&#160;<span class="preprocessor">#define ACCESSORY_STRING_MANUFACTURER 0</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="adk_8h.html#a962954d4b489994aa347721c582fe242"> 43</a></span>&#160;<span class="preprocessor">#define ACCESSORY_STRING_MODEL 1</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="adk_8h.html#aa376dd887b57d0628df287dd1fce7f3b"> 44</a></span>&#160;<span class="preprocessor">#define ACCESSORY_STRING_DESCRIPTION 2</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="adk_8h.html#aab852db9aa38642ad7be827ae95351c5"> 45</a></span>&#160;<span class="preprocessor">#define ACCESSORY_STRING_VERSION 3</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="adk_8h.html#a0485b5be230520d0acde7ef32fb8210e"> 46</a></span>&#160;<span class="preprocessor">#define ACCESSORY_STRING_URI 4</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="adk_8h.html#a31b2b6ec818e90cd9fe47bd4f7f86c16"> 47</a></span>&#160;<span class="preprocessor">#define ACCESSORY_STRING_SERIAL 5</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="adk_8h.html#ac39da606ffc273bd855152107297d6a1"> 49</a></span>&#160;<span class="preprocessor">#define ADK_MAX_ENDPOINTS 3 //endpoint 0, bulk_IN, bulk_OUT</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="keyword">class </span><a class="code" href="class_a_d_k.html">ADK</a>;</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"><a class="line" href="class_a_d_k.html"> 53</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_a_d_k.html">ADK</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="l00054"></a><span class="lineno"> 54</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="comment">/* ID strings */</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* manufacturer;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* model;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* description;</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* version;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* uri;</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* serial;</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">/* ADK proprietary requests */</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; uint8_t getProto(uint8_t* adkproto);</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; uint8_t sendStr(uint8_t index, <span class="keyword">const</span> <span class="keywordtype">char</span>* str);</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; uint8_t switchAcc(<span class="keywordtype">void</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;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="class_a_d_k.html#a964ec80ac133bf8d65cf0274e37b29da"> 69</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_k.html#a964ec80ac133bf8d65cf0274e37b29da">epDataInIndex</a>; <span class="comment">// DataIn endpoint index</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="class_a_d_k.html#acfc5a7e45f15bba7ff8cd42552796624"> 70</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_k.html#acfc5a7e45f15bba7ff8cd42552796624">epDataOutIndex</a>; <span class="comment">// DataOUT endpoint index</span></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">/* mandatory members */</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1"> 73</a></span>&#160; <a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>;</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf"> 74</a></span>&#160; uint8_t <a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>;</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="class_a_d_k.html#ae8fcc6a6fccab61116cea10dd1f17738"> 75</a></span>&#160; uint8_t <a class="code" href="class_a_d_k.html#ae8fcc6a6fccab61116cea10dd1f17738">bConfNum</a>; <span class="comment">// configuration number</span></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="line" href="class_a_d_k.html#adf969d306da15baecd5c59bbb568053e"> 77</a></span>&#160; uint8_t <a class="code" href="class_a_d_k.html#adf969d306da15baecd5c59bbb568053e">bNumEP</a>; <span class="comment">// total number of EP in the configuration</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_a_d_k.html#a135db75b9e8cdd59b89f46c44dd83dd4"> 78</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_a_d_k.html#a135db75b9e8cdd59b89f46c44dd83dd4">ready</a>;</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="comment">/* Endpoint data structure */</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d"> 81</a></span>&#160; <a class="code" href="struct_ep_info.html">EpInfo</a> <a class="code" href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">epInfo</a>[<a class="code" href="adk_8h.html#ac39da606ffc273bd855152107297d6a1">ADK_MAX_ENDPOINTS</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; <span class="keywordtype">void</span> <a class="code" href="class_a_d_k.html#ac4bd3303b99921289c3f59e2df219e50">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="l00084"></a><span class="lineno"> 84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <a class="code" href="class_a_d_k.html#a29492dcd9b7f6023b7866cd05188d61c">ADK</a>(<a class="code" href="class_u_s_b.html">USB</a> *<a class="code" href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">pUsb</a>, <span class="keyword">const</span> <span class="keywordtype">char</span>* manufacturer,</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* model,</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* description,</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* version,</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* uri,</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keyword">const</span> <span class="keywordtype">char</span>* serial);</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="comment">// Methods for receiving and sending data</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; uint8_t <a class="code" href="class_a_d_k.html#a66b9943dfa89f783a8cdeb655e6fe9b1">RcvData</a>(uint16_t *nbytesptr, uint8_t *dataptr);</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; uint8_t <a class="code" href="class_a_d_k.html#ac37bde02b6ed1436712d3619afb07c84">SndData</a>(uint16_t nbytes, uint8_t *dataptr);</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; </div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">// USBDeviceConfig implementation</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; uint8_t <a class="code" href="class_a_d_k.html#a14f24ca8246c5b6126a5aa72cf6ee120">ConfigureDevice</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; uint8_t <a class="code" href="class_a_d_k.html#a8c5c2e212c748966ccd863499d202063">Init</a>(uint8_t parent, uint8_t port, <span class="keywordtype">bool</span> lowspeed);</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; uint8_t <a class="code" href="class_a_d_k.html#a7f64af34d7890f87ceab5d144f6c26ef">Release</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"><a class="line" href="class_a_d_k.html#af3784434ee6a1c6f3dc5b591f467e703"> 103</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_a_d_k.html#af3784434ee6a1c6f3dc5b591f467e703">Poll</a>() {</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">return</span> 0;</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; </div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="class_a_d_k.html#a1a972e8dc98b60ab27528db3af2618c3"> 107</a></span>&#160; <span class="keyword">virtual</span> uint8_t <a class="code" href="class_a_d_k.html#a1a972e8dc98b60ab27528db3af2618c3">GetAddress</a>() {</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</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; </div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="class_a_d_k.html#a1dee02856625dfcac4b0cdd4e8672cef"> 111</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_d_k.html#a1dee02856625dfcac4b0cdd4e8672cef">isReady</a>() {</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_a_d_k.html#a135db75b9e8cdd59b89f46c44dd83dd4">ready</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; </div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="class_a_d_k.html#a9ad9aa3153c4cd1e083251bf42ab536f"> 115</a></span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_d_k.html#a9ad9aa3153c4cd1e083251bf42ab536f">VIDPIDOK</a>(uint16_t vid, uint16_t pid) {</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordflow">return</span> (vid == <a class="code" href="adk_8h.html#a37223416b6c1bba6b86ab17211bc9af2">ADK_VID</a> &amp;&amp; (pid == <a class="code" href="adk_8h.html#a32e861258886323d4dbcf066641597a4">ADK_PID</a> || pid == <a class="code" href="adk_8h.html#a355cd5e5557b754645d4e1bfffabbf99">ADB_PID</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; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="comment">//UsbConfigXtracter implementation</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_a_d_k.html#aac2fac5410faea0e439b4f7e688b3d75">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="l00121"></a><span class="lineno"> 121</span>&#160;}; <span class="comment">//class ADK : public USBDeviceConfig ...</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="comment">/* get ADK protocol version */</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">/* returns 2 bytes in *adkproto */</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="keyword">inline</span> uint8_t ADK::getProto(uint8_t* adkproto) {</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</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#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, 0, <a class="code" href="adk_8h.html#a67b2829fb8d9f0e52eebef518ec6ebb0">bmREQ_ADK_GET</a>, <a class="code" href="adk_8h.html#a4c3e43d4d2955f93260f3e5ffe207e41">ADK_GETPROTO</a>, 0, 0, 0, 2, 2, adkproto, NULL));</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">/* send ADK string */</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="keyword">inline</span> uint8_t ADK::sendStr(uint8_t index, <span class="keyword">const</span> <span class="keywordtype">char</span>* str) {</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</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#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, 0, <a class="code" href="adk_8h.html#a7da9c6adbc669b65ca3e4bd3f90c4c7b">bmREQ_ADK_SEND</a>, <a class="code" href="adk_8h.html#a4ab0e7e3adbc8bfc1bcdf29887c9a455">ADK_SENDSTR</a>, 0, 0, index, strlen(str) + 1, strlen(str) + 1, (uint8_t*)str, NULL));</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; </div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="comment">/* switch to accessory mode */</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="keyword">inline</span> uint8_t ADK::switchAcc(<span class="keywordtype">void</span>) {</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</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#a636695a5c3d35cd6b9e31c54edfacd7c">ctrlReq</a>(<a class="code" href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">bAddress</a>, 0, <a class="code" href="adk_8h.html#a7da9c6adbc669b65ca3e4bd3f90c4c7b">bmREQ_ADK_SEND</a>, <a class="code" href="adk_8h.html#a6ebdba027fb7072f681e6445a385e8f2">ADK_ACCSTART</a>, 0, 0, 0, 0, 0, NULL, NULL));</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; </div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="preprocessor">#endif // _ADK_H_</span></div>
2013-01-30 22:00:18 +01:00
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_a_d_k_html_a29492dcd9b7f6023b7866cd05188d61c"><div class="ttname"><a href="class_a_d_k.html#a29492dcd9b7f6023b7866cd05188d61c">ADK::ADK</a></div><div class="ttdeci">ADK(USB *pUsb, const char *manufacturer, const char *model, const char *description, const char *version, const char *uri, const char *serial)</div><div class="ttdef"><b>Definition:</b> <a href="adk_8cpp_source.html#l00025">adk.cpp:25</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a1dee02856625dfcac4b0cdd4e8672cef"><div class="ttname"><a href="class_a_d_k.html#a1dee02856625dfcac4b0cdd4e8672cef">ADK::isReady</a></div><div class="ttdeci">virtual bool isReady()</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00111">adk.h:111</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a66b9943dfa89f783a8cdeb655e6fe9b1"><div class="ttname"><a href="class_a_d_k.html#a66b9943dfa89f783a8cdeb655e6fe9b1">ADK::RcvData</a></div><div class="ttdeci">uint8_t RcvData(uint16_t *nbytesptr, uint8_t *dataptr)</div><div class="ttdef"><b>Definition:</b> <a href="adk_8cpp_source.html#l00347">adk.cpp:347</a></div></div>
<div class="ttc" id="aadk_8h_html_a4c3e43d4d2955f93260f3e5ffe207e41"><div class="ttname"><a href="adk_8h.html#a4c3e43d4d2955f93260f3e5ffe207e41">ADK_GETPROTO</a></div><div class="ttdeci">#define ADK_GETPROTO</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00035">adk.h:35</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a964ec80ac133bf8d65cf0274e37b29da"><div class="ttname"><a href="class_a_d_k.html#a964ec80ac133bf8d65cf0274e37b29da">ADK::epDataInIndex</a></div><div class="ttdeci">static const uint8_t epDataInIndex</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00069">adk.h:69</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_ab22a7c60cec56823727d4ff2cf2c4edf"><div class="ttname"><a href="class_a_d_k.html#ab22a7c60cec56823727d4ff2cf2c4edf">ADK::bAddress</a></div><div class="ttdeci">uint8_t bAddress</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00074">adk.h:74</a></div></div>
<div class="ttc" id="aclass_u_s_b_device_config_html"><div class="ttname"><a href="class_u_s_b_device_config.html">USBDeviceConfig</a></div><div class="ttdef"><b>Definition:</b> <a href="_usb_core_8h_source.html#l00134">UsbCore.h:134</a></div></div>
<div class="ttc" id="astruct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r_html"><div class="ttname"><a href="struct_u_s_b___e_n_d_p_o_i_n_t___d_e_s_c_r_i_p_t_o_r.html">USB_ENDPOINT_DESCRIPTOR</a></div><div class="ttdef"><b>Definition:</b> <a href="usb__ch9_8h_source.html#l00148">usb_ch9.h:148</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_ab28e3a19569c27f3ed5362e9800065c1"><div class="ttname"><a href="class_a_d_k.html#ab28e3a19569c27f3ed5362e9800065c1">ADK::pUsb</a></div><div class="ttdeci">USB * pUsb</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00073">adk.h:73</a></div></div>
<div class="ttc" id="aclass_usb_config_xtracter_html"><div class="ttname"><a href="class_usb_config_xtracter.html">UsbConfigXtracter</a></div><div class="ttdef"><b>Definition:</b> <a href="confdescparser_8h_source.html#l00030">confdescparser.h:30</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_ac37bde02b6ed1436712d3619afb07c84"><div class="ttname"><a href="class_a_d_k.html#ac37bde02b6ed1436712d3619afb07c84">ADK::SndData</a></div><div class="ttdeci">uint8_t SndData(uint16_t nbytes, uint8_t *dataptr)</div><div class="ttdef"><b>Definition:</b> <a href="adk_8cpp_source.html#l00353">adk.cpp:353</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_aac2fac5410faea0e439b4f7e688b3d75"><div class="ttname"><a href="class_a_d_k.html#aac2fac5410faea0e439b4f7e688b3d75">ADK::EndpointXtract</a></div><div class="ttdeci">void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep)</div><div class="ttdef"><b>Definition:</b> <a href="adk_8cpp_source.html#l00312">adk.cpp:312</a></div></div>
<div class="ttc" id="aadk_8h_html_a7da9c6adbc669b65ca3e4bd3f90c4c7b"><div class="ttname"><a href="adk_8h.html#a7da9c6adbc669b65ca3e4bd3f90c4c7b">bmREQ_ADK_SEND</a></div><div class="ttdeci">#define bmREQ_ADK_SEND</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00040">adk.h:40</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_af3784434ee6a1c6f3dc5b591f467e703"><div class="ttname"><a href="class_a_d_k.html#af3784434ee6a1c6f3dc5b591f467e703">ADK::Poll</a></div><div class="ttdeci">virtual uint8_t Poll()</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00103">adk.h:103</a></div></div>
<div class="ttc" id="aadk_8h_html_a32e861258886323d4dbcf066641597a4"><div class="ttname"><a href="adk_8h.html#a32e861258886323d4dbcf066641597a4">ADK_PID</a></div><div class="ttdeci">#define ADK_PID</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00026">adk.h:26</a></div></div>
<div class="ttc" id="aadk_8h_html_a67b2829fb8d9f0e52eebef518ec6ebb0"><div class="ttname"><a href="adk_8h.html#a67b2829fb8d9f0e52eebef518ec6ebb0">bmREQ_ADK_GET</a></div><div class="ttdeci">#define bmREQ_ADK_GET</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00039">adk.h:39</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a7f64af34d7890f87ceab5d144f6c26ef"><div class="ttname"><a href="class_a_d_k.html#a7f64af34d7890f87ceab5d144f6c26ef">ADK::Release</a></div><div class="ttdeci">uint8_t Release()</div><div class="ttdef"><b>Definition:</b> <a href="adk_8cpp_source.html#l00337">adk.cpp:337</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a1a972e8dc98b60ab27528db3af2618c3"><div class="ttname"><a href="class_a_d_k.html#a1a972e8dc98b60ab27528db3af2618c3">ADK::GetAddress</a></div><div class="ttdeci">virtual uint8_t GetAddress()</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00107">adk.h:107</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a14f24ca8246c5b6126a5aa72cf6ee120"><div class="ttname"><a href="class_a_d_k.html#a14f24ca8246c5b6126a5aa72cf6ee120">ADK::ConfigureDevice</a></div><div class="ttdeci">uint8_t ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed)</div><div class="ttdef"><b>Definition:</b> <a href="adk_8cpp_source.html#l00059">adk.cpp:59</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a6ffc693d731ddeb9499c11e893fc467d"><div class="ttname"><a href="class_a_d_k.html#a6ffc693d731ddeb9499c11e893fc467d">ADK::epInfo</a></div><div class="ttdeci">EpInfo epInfo[ADK_MAX_ENDPOINTS]</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00081">adk.h:81</a></div></div>
<div class="ttc" id="astruct_ep_info_html"><div class="ttname"><a href="struct_ep_info.html">EpInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="address_8h_source.html#l00039">address.h:39</a></div></div>
<div class="ttc" id="aadk_8h_html_ac39da606ffc273bd855152107297d6a1"><div class="ttname"><a href="adk_8h.html#ac39da606ffc273bd855152107297d6a1">ADK_MAX_ENDPOINTS</a></div><div class="ttdeci">#define ADK_MAX_ENDPOINTS</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00049">adk.h:49</a></div></div>
<div class="ttc" id="aclass_u_s_b_html_a636695a5c3d35cd6b9e31c54edfacd7c"><div class="ttname"><a href="class_u_s_b.html#a636695a5c3d35cd6b9e31c54edfacd7c">USB::ctrlReq</a></div><div class="ttdeci">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 total, uint16_t nbytes, uint8_t *dataptr, USBReadParser *p)</div><div class="ttdef"><b>Definition:</b> <a href="_usb_8cpp_source.html#l00126">Usb.cpp:126</a></div></div>
<div class="ttc" id="aclass_a_d_k_html"><div class="ttname"><a href="class_a_d_k.html">ADK</a></div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00053">adk.h:53</a></div></div>
<div class="ttc" id="aclass_u_s_b_html"><div class="ttname"><a href="class_u_s_b.html">USB</a></div><div class="ttdef"><b>Definition:</b> <a href="_usb_core_8h_source.html#l00210">UsbCore.h:210</a></div></div>
<div class="ttc" id="aadk_8h_html_a4ab0e7e3adbc8bfc1bcdf29887c9a455"><div class="ttname"><a href="adk_8h.html#a4ab0e7e3adbc8bfc1bcdf29887c9a455">ADK_SENDSTR</a></div><div class="ttdeci">#define ADK_SENDSTR</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00036">adk.h:36</a></div></div>
<div class="ttc" id="aadk_8h_html_a6ebdba027fb7072f681e6445a385e8f2"><div class="ttname"><a href="adk_8h.html#a6ebdba027fb7072f681e6445a385e8f2">ADK_ACCSTART</a></div><div class="ttdeci">#define ADK_ACCSTART</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00037">adk.h:37</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a8c5c2e212c748966ccd863499d202063"><div class="ttname"><a href="class_a_d_k.html#a8c5c2e212c748966ccd863499d202063">ADK::Init</a></div><div class="ttdeci">uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)</div><div class="ttdef"><b>Definition:</b> <a href="adk_8cpp_source.html#l00064">adk.cpp:64</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_acfc5a7e45f15bba7ff8cd42552796624"><div class="ttname"><a href="class_a_d_k.html#acfc5a7e45f15bba7ff8cd42552796624">ADK::epDataOutIndex</a></div><div class="ttdeci">static const uint8_t epDataOutIndex</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00070">adk.h:70</a></div></div>
<div class="ttc" id="aadk_8h_html_a355cd5e5557b754645d4e1bfffabbf99"><div class="ttname"><a href="adk_8h.html#a355cd5e5557b754645d4e1bfffabbf99">ADB_PID</a></div><div class="ttdeci">#define ADB_PID</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00027">adk.h:27</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_adf969d306da15baecd5c59bbb568053e"><div class="ttname"><a href="class_a_d_k.html#adf969d306da15baecd5c59bbb568053e">ADK::bNumEP</a></div><div class="ttdeci">uint8_t bNumEP</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00077">adk.h:77</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_ac4bd3303b99921289c3f59e2df219e50"><div class="ttname"><a href="class_a_d_k.html#ac4bd3303b99921289c3f59e2df219e50">ADK::PrintEndpointDescriptor</a></div><div class="ttdeci">void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR *ep_ptr)</div><div class="ttdef"><b>Definition:</b> <a href="adk_8cpp_source.html#l00357">adk.cpp:357</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a9ad9aa3153c4cd1e083251bf42ab536f"><div class="ttname"><a href="class_a_d_k.html#a9ad9aa3153c4cd1e083251bf42ab536f">ADK::VIDPIDOK</a></div><div class="ttdeci">virtual bool VIDPIDOK(uint16_t vid, uint16_t pid)</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00115">adk.h:115</a></div></div>
<div class="ttc" id="a_usb_8h_html"><div class="ttname"><a href="_usb_8h.html">Usb.h</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_ae8fcc6a6fccab61116cea10dd1f17738"><div class="ttname"><a href="class_a_d_k.html#ae8fcc6a6fccab61116cea10dd1f17738">ADK::bConfNum</a></div><div class="ttdeci">uint8_t bConfNum</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00075">adk.h:75</a></div></div>
<div class="ttc" id="aclass_a_d_k_html_a135db75b9e8cdd59b89f46c44dd83dd4"><div class="ttname"><a href="class_a_d_k.html#a135db75b9e8cdd59b89f46c44dd83dd4">ADK::ready</a></div><div class="ttdeci">bool ready</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00078">adk.h:78</a></div></div>
<div class="ttc" id="aadk_8h_html_a37223416b6c1bba6b86ab17211bc9af2"><div class="ttname"><a href="adk_8h.html#a37223416b6c1bba6b86ab17211bc9af2">ADK_VID</a></div><div class="ttdeci">#define ADK_VID</div><div class="ttdef"><b>Definition:</b> <a href="adk_8h_source.html#l00025">adk.h:25</a></div></div>
2013-01-30 22:00:18 +01:00
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
2013-01-30 22:00:18 +01:00
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
2013-01-30 22:00:18 +01:00
</small></address>
</body>
</html>