Files
gbdk-2020/docs/api/laptop__io_8h_source.html
2025-05-09 23:47:16 -07:00

261 lines
35 KiB
HTML

<!-- HTML header for doxygen 1.8.14-->
<!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="cache-control" content="max-age=86400"/>
<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.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/duck/laptop_io.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.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 id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GBDK 2020 Docs
&#160;<span id="projectnumber">4.4.0</span>
</div>
<div id="projectbrief">API Documentation for GBDK 2020</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</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 -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('laptop__io_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">laptop_io.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="laptop__io_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="preprocessor">#include &lt;<a class="code" href="platform_8h.html">gbdk/platform.h</a>&gt;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="stdint_8h.html">stdint.h</a>&gt;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="stdbool_8h.html">stdbool.h</a>&gt;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#ifndef _MEGADUCK_LAPTOP_IO_H</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a4a3361568d0c8ca82bcfe8ddfeacf0e5"> 27</a></span>&#160;<span class="preprocessor">#define _MEGADUCK_LAPTOP_IO_H</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment">// Commands sent via serial IO to the Duck laptop peripheral hardware</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#ad92c78a25f1c8de2615722c7eddfe1da"> 31</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_INIT_START 0x00u </span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a48d85e878da85076ef25868769130cf8"> 32</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_GET_KEYS 0x00u </span></div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a5731dbc5b3308811e62c457fee15c5c9"> 33</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_DONE_OR_OK 0x01u</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="comment">// #define DUCK_IO_CMD_DONE_OR_OK_AND_SOMETHING 0x81u</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a460c1f9f52da868754ec07af8f023f33"> 35</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_ABORT_OR_FAIL 0x04u</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#acbb9af8b76fecc11b2ec9e18fbafef58"> 36</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_PLAY_SPEECH 0x05u</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#aaaab111d8fc65d794669405084543262"> 37</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_RUN_CART_IN_SLOT 0x08u</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a2baed3d9ef122b1a7a4ffe30377a3e27"> 38</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_PRINT_INIT_MAYBE_EXT_IO 0x09u </span></div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a1bc3d136e99b659b1b922fa26c48dd77"> 39</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_SET_RTC 0x0Bu </span></div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a775c30331ca2f05cfd7545280bb6ee4b"> 40</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_GET_RTC 0x0Cu </span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#ade3655df70d9a5941df058f89c9a729c"> 41</a></span>&#160;<span class="preprocessor">#define DUCK_IO_CMD_PRINT_SEND_BYTES 0x11u </span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment">// #define FF60_REG_BEFORE_XFER 0x00u</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a0da1638f5b490460a1be9f94f1f38e65"> 45</a></span>&#160;<span class="preprocessor">#define DUCK_IO_REPLY_BOOT_UNSET 0x00u</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#aee6403897985744863802a20b91f9c14"> 46</a></span>&#160;<span class="preprocessor">#define DUCK_IO_REPLY_BOOT_FAIL 0x01u</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#ac2d016278278f0ea33ac8533806f59e5"> 47</a></span>&#160;<span class="preprocessor">#define DUCK_IO_REPLY_BUFFER_XFER_OK 0x01u</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#ad168ef8090079547a4ada35706f384bb"> 48</a></span>&#160;<span class="preprocessor">#define DUCK_IO_REPLY_SEND_BUFFER_OK 0x03u</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment">// #define DUCK_IO_REPLY_READ_FAIL_MAYBE 0x00u</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#ade7d1856bcbe36407518bdb5bb2b4c9f"> 50</a></span>&#160;<span class="preprocessor">#define DUCK_IO_REPLY_BOOT_OK 0x01u</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#abcb564896ac715b4717728266821c96e"> 52</a></span>&#160;<span class="preprocessor">#define DUCK_IO_LEN_KBD_GET 2u </span></div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a90509c967b3604dee5a0844ddda41a4d"> 53</a></span>&#160;<span class="preprocessor">#define DUCK_IO_LEN_RTC_GET 8u </span></div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a516cd69eb7a05edf91d8333113e1b6d2"> 54</a></span>&#160;<span class="preprocessor">#define DUCK_IO_LEN_RTC_SET 8u </span></div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a4bb0196d8cedf4a924c207c7f7700a4d"> 55</a></span>&#160;<span class="preprocessor">#define DUCK_IO_LEN_PLAY_SPEECH 1u </span></div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a3514314114c0e69a470cb06bb01e33a2"> 57</a></span>&#160;<span class="preprocessor">#define DUCK_IO_REPLY_NO_CART_IN_SLOT 06u</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="comment">// #define MEGADUCK_KBD_BYTE_1_EXPECT 0x0Eu</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="comment">// #define MEGADUCK_SIO_BOOT_OK 0x01u</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a982b6bb2c328b8cacb28b90bee72fd4d"> 62</a></span>&#160;<span class="preprocessor">#define DUCK_IO_LEN_RX_MAX 14u </span><span class="comment">// 13 data bytes + 1 checksum byte max reply length?</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a2cd86d57ca4966dfabd7a29ba2af11ab"> 63</a></span>&#160;<span class="preprocessor">#define DUCK_IO_LEN_TX_MAX 14u </span><span class="comment">// 13 data bytes + 1 checksum byte max reply length?</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#aa63652e66d320392db092b4f955e60e9"> 65</a></span>&#160;<span class="preprocessor">#define DUCK_IO_TIMEOUT_2_MSEC 2u </span><span class="comment">// Used for hardware init counter sequence</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a7f30620df7e08a7f3f271b8f466dc380"> 66</a></span>&#160;<span class="preprocessor">#define DUCK_IO_TIMEOUT_100_MSEC 100u</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a5068c50f653cf59e1d387508531917f5"> 67</a></span>&#160;<span class="preprocessor">#define DUCK_IO_TIMEOUT_200_MSEC 200u</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="comment">// Pre-recorded Speech Samples for playback</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a899b2697839b3a8a55cf85621597cbf0"> 71</a></span>&#160;<span class="preprocessor">#define DUCK_IO_SPEECH_CMD_MIN 1</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#aea7e67628fee0f78e1ee8c58a8ab4838"> 72</a></span>&#160;<span class="preprocessor">#define DUCK_IO_SPEECH_CMD_MAX 6</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; </div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;<span class="comment">// RTC packet byte ordering (all in BCD format)</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a4db3f8545ffd0175ca4324996aa5c2e6"> 76</a></span>&#160;<span class="preprocessor">#define DUCK_IO_RTC_YEAR 0u</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a857559af69293d831281a818c7f72c09"> 77</a></span>&#160;<span class="preprocessor">#define DUCK_IO_RTC_MON 1u</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#aadf9abfa3e53075cbd96d7fec66bdaf5"> 78</a></span>&#160;<span class="preprocessor">#define DUCK_IO_RTC_DAY 2u</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#ae323435deb6eda66a32250c6e6e63fee"> 79</a></span>&#160;<span class="preprocessor">#define DUCK_IO_RTC_WEEKDAY 3u</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a59740f5e694194e70a625e2133dbec87"> 80</a></span>&#160;<span class="preprocessor">#define DUCK_IO_RTC_AMPM 4u</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#afafff8113bc22605b11c1eae6afd7624"> 81</a></span>&#160;<span class="preprocessor">#define DUCK_IO_RTC_HOUR 5u</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a8aeecfc49960d348cc0956719849d529"> 82</a></span>&#160;<span class="preprocessor">#define DUCK_IO_RTC_MIN 6u</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a41085549e434d7896cba04376d0e5703"> 83</a></span>&#160;<span class="preprocessor">#define DUCK_IO_RTC_SEC 7u</span></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; </div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="comment">// Keyboard packet byte ordering (all in BCD format)</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a93c53ae7a897998a40f640631baee6d4"> 87</a></span>&#160;<span class="preprocessor">#define DUCK_IO_KBD_FLAGS 0u</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#af366714812f9067a555c52ea6eff2d67"> 88</a></span>&#160;<span class="preprocessor">#define DUCK_IO_KBD_KEYCODE 1u</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;<span class="comment">// Printer init reply related</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="comment">// Init Reply Bit.0</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a4c3cc7352c2873d11e82dca46c4a9a7f"> 93</a></span>&#160;<span class="preprocessor">#define DUCK_IO_PRINTER_INIT_MASK 0x01u </span><span class="comment">// Bit.0</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a200d07d257129821374c64a64f5126ac"> 94</a></span>&#160;<span class="preprocessor">#define DUCK_IO_PRINTER_INIT_OK 0x01u</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#abc1d5cad1930852f03919f9093eec4a5"> 95</a></span>&#160;<span class="preprocessor">#define DUCK_IO_PRINTER_INIT_FAIL 0x00u</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="comment">// Init Reply Bit.1</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#aa495208fb87146f1e75c9e41c72eb8dd"> 98</a></span>&#160;<span class="preprocessor">#define DUCK_IO_PRINTER_TYPE_MASK 0x02u </span><span class="comment">// Bit.1</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a19d0df507afbe887d6cd2623365fa2a4"> 99</a></span>&#160;<span class="preprocessor">#define DUCK_IO_PRINTER_TYPE_2_PASS 0x00u </span><span class="comment">// Bit.1 = 0 // 13 x 12 byte packets + 1 x 5 or 6 byte packet (with CR and/or LF)</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a7b13395ce3ba12e26ae4abe578e9c7d9"> 100</a></span>&#160;<span class="preprocessor">#define DUCK_IO_PRINTER_TYPE_1_PASS 0x02u </span><span class="comment">// Bit.1 = 1 // 3 x 12 byte packets + 118 non-packet bytes</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;<span class="keyword">extern</span> <span class="keyword">volatile</span> <span class="keywordtype">bool</span> <a class="code" href="laptop__io_8h.html#aa513d5139b0ac1f882f9b251cdf413e5">duck_io_rx_byte_done</a>;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="keyword">extern</span> <span class="keyword">volatile</span> <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="laptop__io_8h.html#afd02c3b9793b5de14d828c8f4dd781f6">duck_io_rx_byte</a>;</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; </div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="comment">// TODO: change these to user supplied buffers?</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="keyword">extern</span> <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="laptop__io_8h.html#a4650eb6ec83d91ed9a73c23dfc734f27">duck_io_rx_buf</a>[<a class="code" href="laptop__io_8h.html#a982b6bb2c328b8cacb28b90bee72fd4d">DUCK_IO_LEN_RX_MAX</a>];</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="keyword">extern</span> <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="laptop__io_8h.html#a9dcdcc9bb6fab0018a0a986e618dae3a">duck_io_rx_buf_len</a>;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;<span class="keyword">extern</span> <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="laptop__io_8h.html#a963e60419ff150b2cc5d7ada262901f8">duck_io_tx_buf</a>[<a class="code" href="laptop__io_8h.html#a2cd86d57ca4966dfabd7a29ba2af11ab">DUCK_IO_LEN_TX_MAX</a>];</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="keyword">extern</span> <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="laptop__io_8h.html#ab00abe42f5e98e41a4f6bf09890c7030">duck_io_tx_buf_len</a>;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="comment">// ===== Low level helper IO functions =====</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="comment">// TODO: No longer in use(?)</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="comment">// Waits for a serial transfer to complete with a timeout</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="comment">// @param timeout_len_ms Unit size is in msec (100 is about ~ 103 msec or 6.14 frames)</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="comment">// Serial ISR populates status var if anything was received</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="comment">// void duck_io_wait_done_with_timeout(uint8_t timeout_len_ms);</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a1b49f54604e82217cd4f5cd614f749e4"> 135</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="laptop__io_8h.html#a1b49f54604e82217cd4f5cd614f749e4">duck_io_send_byte</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> tx_byte);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; </div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a80b681ac57a1dbf5e52bd12dc1ce3b48"> 144</a></span>&#160;<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="laptop__io_8h.html#a80b681ac57a1dbf5e52bd12dc1ce3b48">duck_io_read_byte_no_timeout</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; </div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a4732e7f2b0ba1690443e4e7f86c5c1fd"> 155</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="laptop__io_8h.html#a4732e7f2b0ba1690443e4e7f86c5c1fd">duck_io_enable_read_byte</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589"> 168</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589">duck_io_laptop_init</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; </div>
<div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a6e11278ebd2a981030285ba8999c9a60"> 177</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="laptop__io_8h.html#a6e11278ebd2a981030285ba8999c9a60">duck_io_printer_detected</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a76b5721cbacbc00638246572e34030b1"> 188</a></span>&#160;<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> <a class="code" href="laptop__io_8h.html#a76b5721cbacbc00638246572e34030b1">duck_io_printer_type</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; </div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; </div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;<span class="comment">// ===== Higher level IO functions =====</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; </div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#ac1254526e1e5e39e56957ec6c3eec9a3"> 202</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="laptop__io_8h.html#ac1254526e1e5e39e56957ec6c3eec9a3">duck_io_read_byte_with_msecs_timeout</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> timeout_len_ms);</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; </div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; </div>
<div class="line"><a name="l00215"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a0b5c7803c1733dd05f896b7c9cbbd7f5"> 215</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="laptop__io_8h.html#a0b5c7803c1733dd05f896b7c9cbbd7f5">duck_io_send_byte_and_check_ack_msecs_timeout</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> tx_byte, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> timeout_len_ms, <a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> expected_reply);</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; </div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a6a95edc2f6ab9b8611de1b685de6a34f"> 230</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="laptop__io_8h.html#a6a95edc2f6ab9b8611de1b685de6a34f">duck_io_send_cmd_and_buffer</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> io_cmd);</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; </div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; </div>
<div class="line"><a name="l00245"></a><span class="lineno"><a class="line" href="laptop__io_8h.html#a1d82653ae8b60f4350f58320db1b9706"> 245</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="laptop__io_8h.html#a1d82653ae8b60f4350f58320db1b9706">duck_io_send_cmd_and_receive_buffer</a>(<a class="code" href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> io_cmd);</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; </div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// _MEGADUCK_LAPTOP_IO_H</span></div>
<div class="ttc" id="alaptop__io_8h_html_a0b5c7803c1733dd05f896b7c9cbbd7f5"><div class="ttname"><a href="laptop__io_8h.html#a0b5c7803c1733dd05f896b7c9cbbd7f5">duck_io_send_byte_and_check_ack_msecs_timeout</a></div><div class="ttdeci">bool duck_io_send_byte_and_check_ack_msecs_timeout(uint8_t tx_byte, uint8_t timeout_len_ms, uint8_t expected_reply)</div></div>
<div class="ttc" id="alaptop__io_8h_html_a1b49f54604e82217cd4f5cd614f749e4"><div class="ttname"><a href="laptop__io_8h.html#a1b49f54604e82217cd4f5cd614f749e4">duck_io_send_byte</a></div><div class="ttdeci">void duck_io_send_byte(uint8_t tx_byte)</div></div>
<div class="ttc" id="alaptop__io_8h_html_a1d82653ae8b60f4350f58320db1b9706"><div class="ttname"><a href="laptop__io_8h.html#a1d82653ae8b60f4350f58320db1b9706">duck_io_send_cmd_and_receive_buffer</a></div><div class="ttdeci">bool duck_io_send_cmd_and_receive_buffer(uint8_t io_cmd)</div></div>
<div class="ttc" id="alaptop__io_8h_html_a2cd86d57ca4966dfabd7a29ba2af11ab"><div class="ttname"><a href="laptop__io_8h.html#a2cd86d57ca4966dfabd7a29ba2af11ab">DUCK_IO_LEN_TX_MAX</a></div><div class="ttdeci">#define DUCK_IO_LEN_TX_MAX</div><div class="ttdef"><b>Definition:</b> laptop_io.h:63</div></div>
<div class="ttc" id="alaptop__io_8h_html_a4650eb6ec83d91ed9a73c23dfc734f27"><div class="ttname"><a href="laptop__io_8h.html#a4650eb6ec83d91ed9a73c23dfc734f27">duck_io_rx_buf</a></div><div class="ttdeci">uint8_t duck_io_rx_buf[DUCK_IO_LEN_RX_MAX]</div></div>
<div class="ttc" id="alaptop__io_8h_html_a4732e7f2b0ba1690443e4e7f86c5c1fd"><div class="ttname"><a href="laptop__io_8h.html#a4732e7f2b0ba1690443e4e7f86c5c1fd">duck_io_enable_read_byte</a></div><div class="ttdeci">void duck_io_enable_read_byte(void)</div></div>
<div class="ttc" id="alaptop__io_8h_html_a6a95edc2f6ab9b8611de1b685de6a34f"><div class="ttname"><a href="laptop__io_8h.html#a6a95edc2f6ab9b8611de1b685de6a34f">duck_io_send_cmd_and_buffer</a></div><div class="ttdeci">bool duck_io_send_cmd_and_buffer(uint8_t io_cmd)</div></div>
<div class="ttc" id="alaptop__io_8h_html_a6e11278ebd2a981030285ba8999c9a60"><div class="ttname"><a href="laptop__io_8h.html#a6e11278ebd2a981030285ba8999c9a60">duck_io_printer_detected</a></div><div class="ttdeci">bool duck_io_printer_detected(void)</div></div>
<div class="ttc" id="alaptop__io_8h_html_a76b5721cbacbc00638246572e34030b1"><div class="ttname"><a href="laptop__io_8h.html#a76b5721cbacbc00638246572e34030b1">duck_io_printer_type</a></div><div class="ttdeci">uint8_t duck_io_printer_type(void)</div></div>
<div class="ttc" id="alaptop__io_8h_html_a80b681ac57a1dbf5e52bd12dc1ce3b48"><div class="ttname"><a href="laptop__io_8h.html#a80b681ac57a1dbf5e52bd12dc1ce3b48">duck_io_read_byte_no_timeout</a></div><div class="ttdeci">uint8_t duck_io_read_byte_no_timeout(void)</div></div>
<div class="ttc" id="alaptop__io_8h_html_a963e60419ff150b2cc5d7ada262901f8"><div class="ttname"><a href="laptop__io_8h.html#a963e60419ff150b2cc5d7ada262901f8">duck_io_tx_buf</a></div><div class="ttdeci">uint8_t duck_io_tx_buf[DUCK_IO_LEN_TX_MAX]</div></div>
<div class="ttc" id="alaptop__io_8h_html_a982b6bb2c328b8cacb28b90bee72fd4d"><div class="ttname"><a href="laptop__io_8h.html#a982b6bb2c328b8cacb28b90bee72fd4d">DUCK_IO_LEN_RX_MAX</a></div><div class="ttdeci">#define DUCK_IO_LEN_RX_MAX</div><div class="ttdef"><b>Definition:</b> laptop_io.h:62</div></div>
<div class="ttc" id="alaptop__io_8h_html_a9dcdcc9bb6fab0018a0a986e618dae3a"><div class="ttname"><a href="laptop__io_8h.html#a9dcdcc9bb6fab0018a0a986e618dae3a">duck_io_rx_buf_len</a></div><div class="ttdeci">uint8_t duck_io_rx_buf_len</div></div>
<div class="ttc" id="alaptop__io_8h_html_aa513d5139b0ac1f882f9b251cdf413e5"><div class="ttname"><a href="laptop__io_8h.html#aa513d5139b0ac1f882f9b251cdf413e5">duck_io_rx_byte_done</a></div><div class="ttdeci">volatile bool duck_io_rx_byte_done</div></div>
<div class="ttc" id="alaptop__io_8h_html_ab00abe42f5e98e41a4f6bf09890c7030"><div class="ttname"><a href="laptop__io_8h.html#ab00abe42f5e98e41a4f6bf09890c7030">duck_io_tx_buf_len</a></div><div class="ttdeci">uint8_t duck_io_tx_buf_len</div></div>
<div class="ttc" id="alaptop__io_8h_html_abb11bd7e4cd420d04e39433b9cc47589"><div class="ttname"><a href="laptop__io_8h.html#abb11bd7e4cd420d04e39433b9cc47589">duck_io_laptop_init</a></div><div class="ttdeci">bool duck_io_laptop_init(void)</div></div>
<div class="ttc" id="alaptop__io_8h_html_ac1254526e1e5e39e56957ec6c3eec9a3"><div class="ttname"><a href="laptop__io_8h.html#ac1254526e1e5e39e56957ec6c3eec9a3">duck_io_read_byte_with_msecs_timeout</a></div><div class="ttdeci">bool duck_io_read_byte_with_msecs_timeout(uint8_t timeout_len_ms)</div></div>
<div class="ttc" id="alaptop__io_8h_html_afd02c3b9793b5de14d828c8f4dd781f6"><div class="ttname"><a href="laptop__io_8h.html#afd02c3b9793b5de14d828c8f4dd781f6">duck_io_rx_byte</a></div><div class="ttdeci">volatile uint8_t duck_io_rx_byte</div></div>
<div class="ttc" id="aplatform_8h_html"><div class="ttname"><a href="platform_8h.html">platform.h</a></div></div>
<div class="ttc" id="astdbool_8h_html"><div class="ttname"><a href="stdbool_8h.html">stdbool.h</a></div></div>
<div class="ttc" id="astdint_8h_html"><div class="ttname"><a href="stdint_8h.html">stdint.h</a></div></div>
<div class="ttc" id="astdint_8h_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="stdint_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition:</b> stdint.h:51</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>