mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
365 lines
56 KiB
HTML
365 lines
56 KiB
HTML
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||
|
<meta name="generator" content="Doxygen 1.8.3.1"/>
|
||
|
<title>USB_Host_Shield_2.0: /Users/Lauszus/GitHub/USB_Host_Shield_2.0/Wii.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 Page</span></a></li>
|
||
|
<li><a href="pages.html"><span>Related 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 List</span></a></li>
|
||
|
<li><a href="globals.html"><span>File 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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </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">Wii.h</div> </div>
|
||
|
</div><!--header-->
|
||
|
<div class="contents">
|
||
|
<a href="_wii_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> <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> <span class="comment"> </span></div>
|
||
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <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> <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> <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> <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> <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> <span class="comment"> the GPL2 ("Copyleft").</span></div>
|
||
|
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> </span></div>
|
||
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> Contact information</span></div>
|
||
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> -------------------</span></div>
|
||
|
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> </span></div>
|
||
|
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> Kristian Lauszus, TKJ Electronics</span></div>
|
||
|
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> Web : http://www.tkjelectronics.com</span></div>
|
||
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> e-mail : kristianl@tkjelectronics.com</span></div>
|
||
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"></span></div>
|
||
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> IR camera support added by:</span></div>
|
||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> Allan Glover</span></div>
|
||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> adglover9.81@gmail.com</span></div>
|
||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> */</span></div>
|
||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef _wii_h_</span></div>
|
||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor"></span><span class="preprocessor">#define _wii_h_</span></div>
|
||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor"></span></div>
|
||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="_b_t_d_8h.html">BTD.h</a>"</span></div>
|
||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="controller_enums_8h.html">controllerEnums.h</a>"</span></div>
|
||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div>
|
||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment">//#define WIICAMERA //uncomment to enable IR camera</span></div>
|
||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
|
||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <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> <span class="preprocessor">#define L2CAP_WAIT 0</span></div>
|
||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor"></span></div>
|
||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <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> <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> <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> <span class="preprocessor"></span></div>
|
||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <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> <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> <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> <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> <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> <span class="preprocessor">#define L2CAP_INTERRUPT_CONFIG_REQUEST 6</span></div>
|
||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <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> <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> <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> <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> <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> <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> <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> <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> <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> <span class="preprocessor"></span></div>
|
||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <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> <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> <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> <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> <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> <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> <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> <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> <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> <span class="preprocessor"></span></div>
|
||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <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> <span class="preprocessor">#define l2cap_connected_control_flag (l2cap_event_flag & 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> <span class="preprocessor"></span><span class="preprocessor">#define l2cap_connected_interrupt_flag (l2cap_event_flag & 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> <span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_control_flag (l2cap_event_flag & 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> <span class="preprocessor"></span><span class="preprocessor">#define l2cap_config_success_interrupt_flag (l2cap_event_flag & 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> <span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_control_flag (l2cap_event_flag & 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> <span class="preprocessor"></span><span class="preprocessor">#define l2cap_disconnect_response_interrupt_flag (l2cap_event_flag & 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> <span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_control_flag (l2cap_event_flag & 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> <span class="preprocessor"></span><span class="preprocessor">#define l2cap_connection_request_interrupt_flag (l2cap_event_flag & L2CAP_FLAG_CONNECTION_INTERRUPT_REQUEST)</span></div>
|
||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor"></span></div>
|
||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <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> <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> <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> <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> <span class="preprocessor">#define motion_plus_connected_flag (l2cap_event_flag & 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> <span class="preprocessor"></span><span class="preprocessor">#define nunchuck_connected_flag (l2cap_event_flag & WII_FLAG_NUNCHUCK_CONNECTED)</span></div>
|
||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <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> <span class="preprocessor">#define PAIR 1</span></div>
|
||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <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> <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>  <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>  <a class="code" href="_wii_8h.html#a3edd2b2fd262b698309012868fad0be7ae2ac743b5ba1752933e09f1dac48d97b">HatY</a> = 1,</div>
|
||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> };</div>
|
||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div>
|
||
|
<div class="line"><a name="l00087"></a><span class="lineno"><a class="code" href="class_w_i_i.html"> 87</a></span> <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> <span class="keyword">public</span>:</div>
|
||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <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>  </div>
|
||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="comment">// BluetoothService implementation</span></div>
|
||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <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>  <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>  <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>  <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>  </div>
|
||
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="comment">/*</span></div>
|
||
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <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> <span class="comment"> While getButtonClick will only return it once</span></div>
|
||
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <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> <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> <span class="comment"> */</span></div>
|
||
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <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>  <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>  </div>
|
||
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  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> </div>
|
||
|
<div class="line"><a name="l00108"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a748172bd57804856594ea8e21601319e"> 108</a></span>  <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>  <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>  <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>  </div>
|
||
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <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>  <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>  <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>  <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>  <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>  <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>  <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>  <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>  </div>
|
||
|
<div class="line"><a name="l00121"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae25a8ea1b0713801e0209e795b4596fa"> 121</a></span>  <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>  <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>  <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>  </div>
|
||
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <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>  </div>
|
||
|
<div class="line"><a name="l00127"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a304f56df9aae4a756b0ef34fc4aafc60"> 127</a></span>  <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>  <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>  <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>  <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>  </div>
|
||
|
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="class_w_i_i.html#a48bcc2e5c6253d0554d70357625ff3fb"> 132</a></span>  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>  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>  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>  </div>
|
||
|
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <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>  <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>  <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>  <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> </div>
|
||
|
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="class_w_i_i.html#acfb290a86aa9a65dd4ae84d02e3c6ded"> 141</a></span>  <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>  <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>  <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>  </div>
|
||
|
<div class="line"><a name="l00145"></a><span class="lineno"><a class="code" href="class_w_i_i.html#aea6ce6f3222df3e547e9957673c7a07a"> 145</a></span>  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>  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>  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>  </div>
|
||
|
<div class="line"><a name="l00149"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ab813b65548e827f41a5192fcc34056ea"> 149</a></span>  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>  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>  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>  </div>
|
||
|
<div class="line"><a name="l00153"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ad4f0d2456c56414f9b8013b85a1ee7d2"> 153</a></span>  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>  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>  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> </div>
|
||
|
<div class="line"><a name="l00157"></a><span class="lineno"><a class="code" href="class_w_i_i.html#ae946f7d6e9ce89fb083f5f138c0736c2"> 157</a></span>  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>  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> </div>
|
||
|
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="preprocessor">#ifdef WIICAMERA</span></div>
|
||
|
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <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>  <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> </div>
|
||
|
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  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>  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>  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> </div>
|
||
|
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  uint16_t getIRx2() { <span class="keywordflow">return</span> IR_object_x2; };</div>
|
||
|
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  uint16_t getIRy2() { <span class="keywordflow">return</span> IR_object_y2; };</div>
|
||
|
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  uint8_t getIRs2() { <span class="keywordflow">return</span> IR_object_s2; };</div>
|
||
|
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> </div>
|
||
|
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  uint16_t getIRx3() { <span class="keywordflow">return</span> IR_object_x3; };</div>
|
||
|
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  uint16_t getIRy3() { <span class="keywordflow">return</span> IR_object_y3; };</div>
|
||
|
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  uint8_t getIRs3() { <span class="keywordflow">return</span> IR_object_s3; };</div>
|
||
|
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span> </div>
|
||
|
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  uint16_t getIRx4() { <span class="keywordflow">return</span> IR_object_x4; };</div>
|
||
|
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  uint16_t getIRy4() { <span class="keywordflow">return</span> IR_object_y4; };</div>
|
||
|
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  uint8_t getIRs4() { <span class="keywordflow">return</span> IR_object_s4; };</div>
|
||
|
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span> </div>
|
||
|
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordtype">bool</span> isIRCameraEnabled() { <span class="keywordflow">return</span> (wiiState & 0x08); };</div>
|
||
|
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span> <span class="preprocessor">#endif</span></div>
|
||
|
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> <span class="preprocessor"></span> </div>
|
||
|
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span> <span class="keyword">private</span>:</div>
|
||
|
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="comment">/* Mandatory members */</span></div>
|
||
|
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <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>  </div>
|
||
|
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <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>  </div>
|
||
|
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="comment">/* Variables filled from HCI event management */</span></div>
|
||
|
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  uint16_t hci_handle;</div>
|
||
|
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordtype">bool</span> activeConnection; <span class="comment">// Used to indicate if it's already has established a connection</span></div>
|
||
|
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  </div>
|
||
|
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="comment">/* variables used by high level L2CAP task */</span> </div>
|
||
|
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  uint8_t l2cap_state;</div>
|
||
|
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  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>  </div>
|
||
|
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  uint32_t ButtonState;</div>
|
||
|
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  uint32_t OldButtonState;</div>
|
||
|
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  uint32_t ButtonClickState;</div>
|
||
|
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  uint8_t hatValues[2];</div>
|
||
|
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  </div>
|
||
|
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  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>  </div>
|
||
|
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  uint16_t stateCounter;</div>
|
||
|
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordtype">bool</span> unknownExtensionConnected;</div>
|
||
|
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordtype">bool</span> extensionConnected;</div>
|
||
|
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  </div>
|
||
|
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="comment">/* L2CAP Channels */</span></div>
|
||
|
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  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>  uint8_t control_dcid[2]; <span class="comment">// 0x0060</span></div>
|
||
|
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  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>  uint8_t interrupt_dcid[2]; <span class="comment">// 0x0061</span></div>
|
||
|
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  uint8_t identifier; <span class="comment">// Identifier for connection</span></div>
|
||
|
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  </div>
|
||
|
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="comment">/* HID Commands */</span></div>
|
||
|
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <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>  <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>  <span class="keywordtype">void</span> statusRequest();</div>
|
||
|
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  </div>
|
||
|
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <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>  <span class="keywordtype">void</span> initExtension1();</div>
|
||
|
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordtype">void</span> initExtension2();</div>
|
||
|
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  </div>
|
||
|
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <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>  <span class="keywordtype">void</span> readExtensionType();</div>
|
||
|
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordtype">void</span> readCalData();</div>
|
||
|
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  </div>
|
||
|
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <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>  <span class="keywordtype">void</span> initMotionPlus();</div>
|
||
|
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordtype">void</span> activateMotionPlus();</div>
|
||
|
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span> </div>
|
||
|
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <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>  <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>  </div>
|
||
|
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keywordtype">bool</span> activateNunchuck;</div>
|
||
|
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <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>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> timer;</div>
|
||
|
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span> </div>
|
||
|
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  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>  uint8_t batteryLevel;</div>
|
||
|
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  </div>
|
||
|
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span> <span class="preprocessor">#ifdef WIICAMERA</span></div>
|
||
|
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span> <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>  <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>  <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>  <span class="keywordtype">void</span> writeSensitivityBlock1();</div>
|
||
|
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="keywordtype">void</span> writeSensitivityBlock2();</div>
|
||
|
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordtype">void</span> write0x08Value();</div>
|
||
|
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keywordtype">void</span> setWiiModeNumber(uint8_t mode_number);</div>
|
||
|
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  </div>
|
||
|
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  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>  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>  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>  uint16_t IR_object_x2;</div>
|
||
|
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  uint16_t IR_object_y2;</div>
|
||
|
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  uint8_t IR_object_s2;</div>
|
||
|
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  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>  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>  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>  uint16_t IR_object_x4;</div>
|
||
|
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  uint16_t IR_object_y4;</div>
|
||
|
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  uint8_t IR_object_s4;</div>
|
||
|
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span> <span class="preprocessor">#endif</span></div>
|
||
|
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span> <span class="preprocessor"></span>};</div>
|
||
|
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> <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  <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>
|