340 lines
17 KiB
HTML
340 lines
17 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="X-UA-Compatible" content="IE=Edge" />
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
<title>interface_handler module — APED (API-Documentation) V2.1 documentation</title>
|
||
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||
<script type="text/javascript" src="_static/language_data.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
|
||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||
|
||
</head><body>
|
||
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="module-interface_handler">
|
||
<span id="interface-handler-module"></span><h1>interface_handler module<a class="headerlink" href="#module-interface_handler" title="Permalink to this headline">¶</a></h1>
|
||
<dl class="class">
|
||
<dt id="interface_handler.Interface_handler">
|
||
<em class="property">class </em><code class="descclassname">interface_handler.</code><code class="descname">Interface_handler</code><span class="sig-paren">(</span><em>xml_reader: xml_reader.Xml_reader</em><span class="sig-paren">)</span><a class="headerlink" href="#interface_handler.Interface_handler" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||
<p>handles the access to the various interfaces (e.g. GPIO)</p>
|
||
<dl class="class">
|
||
<dt id="interface_handler.Interface_handler.Pin">
|
||
<em class="property">class </em><code class="descname">Pin</code><a class="headerlink" href="#interface_handler.Interface_handler.Pin" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">enum.Enum</span></code></p>
|
||
<p>list of all usable pins</p>
|
||
<p>enables restricting methods to these pins</p>
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_10">
|
||
<code class="descname">GPIO_10</code><em class="property"> = 19</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_10" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_11">
|
||
<code class="descname">GPIO_11</code><em class="property"> = 23</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_11" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_12">
|
||
<code class="descname">GPIO_12</code><em class="property"> = 32</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_12" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_13">
|
||
<code class="descname">GPIO_13</code><em class="property"> = 33</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_13" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_14">
|
||
<code class="descname">GPIO_14</code><em class="property"> = 8</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_14" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_15">
|
||
<code class="descname">GPIO_15</code><em class="property"> = 10</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_15" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_16">
|
||
<code class="descname">GPIO_16</code><em class="property"> = 36</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_16" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_17">
|
||
<code class="descname">GPIO_17</code><em class="property"> = 11</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_17" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_18">
|
||
<code class="descname">GPIO_18</code><em class="property"> = 12</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_18" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_19">
|
||
<code class="descname">GPIO_19</code><em class="property"> = 35</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_19" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_2">
|
||
<code class="descname">GPIO_2</code><em class="property"> = 3</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_2" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_20">
|
||
<code class="descname">GPIO_20</code><em class="property"> = 38</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_20" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_21">
|
||
<code class="descname">GPIO_21</code><em class="property"> = 40</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_21" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_22">
|
||
<code class="descname">GPIO_22</code><em class="property"> = 15</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_22" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_23">
|
||
<code class="descname">GPIO_23</code><em class="property"> = 16</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_23" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_24">
|
||
<code class="descname">GPIO_24</code><em class="property"> = 18</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_24" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_25">
|
||
<code class="descname">GPIO_25</code><em class="property"> = 22</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_25" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_26">
|
||
<code class="descname">GPIO_26</code><em class="property"> = 37</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_26" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_27">
|
||
<code class="descname">GPIO_27</code><em class="property"> = 13</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_27" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_3">
|
||
<code class="descname">GPIO_3</code><em class="property"> = 5</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_3" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_4">
|
||
<code class="descname">GPIO_4</code><em class="property"> = 7</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_4" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_5">
|
||
<code class="descname">GPIO_5</code><em class="property"> = 29</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_5" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_6">
|
||
<code class="descname">GPIO_6</code><em class="property"> = 31</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_6" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_7">
|
||
<code class="descname">GPIO_7</code><em class="property"> = 26</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_7" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_8">
|
||
<code class="descname">GPIO_8</code><em class="property"> = 24</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_8" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="attribute">
|
||
<dt id="interface_handler.Interface_handler.Pin.GPIO_9">
|
||
<code class="descname">GPIO_9</code><em class="property"> = 21</em><a class="headerlink" href="#interface_handler.Interface_handler.Pin.GPIO_9" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="interface_handler.Interface_handler.buffering">
|
||
<code class="descname">buffering</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#interface_handler.Interface_handler.buffering" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>method that buffers the device outputs</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="interface_handler.Interface_handler.init_buffer">
|
||
<code class="descname">init_buffer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#interface_handler.Interface_handler.init_buffer" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>initializes the buffer thread</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="interface_handler.Interface_handler.init_gpio">
|
||
<code class="descname">init_gpio</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#interface_handler.Interface_handler.init_gpio" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>initializes the GPIO pins</p>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="interface_handler.Interface_handler.read">
|
||
<code class="descname">read</code><span class="sig-paren">(</span><em>device_name: str</em><span class="sig-paren">)</span> → dict<a class="headerlink" href="#interface_handler.Interface_handler.read" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>reads the current value from the pins of one device</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>device_name</strong> (<em>string</em>) – the name of the device</p>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first simple">
|
||
<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">NameError</span></code> – the device cannot be found in the config.xml</li>
|
||
<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code> – the device does not support reading</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">{‘pin’: ‘value’}</p>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">dict</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="interface_handler.Interface_handler.read_buffer">
|
||
<code class="descname">read_buffer</code><span class="sig-paren">(</span><em>device_name: str</em><span class="sig-paren">)</span> → dict<a class="headerlink" href="#interface_handler.Interface_handler.read_buffer" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>reads the current buffer content for a given device</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>device_name</strong> (<em>str</em>) – the name of the device</p>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first simple">
|
||
<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">NameError</span></code> – the device cannot be found in the config.xml</li>
|
||
<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code> – the device has no buffer</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">the buffer of the device</p>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">dict</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
<dl class="method">
|
||
<dt id="interface_handler.Interface_handler.write">
|
||
<code class="descname">write</code><span class="sig-paren">(</span><em>device_name: str</em>, <em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#interface_handler.Interface_handler.write" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>writes an output to a given device</p>
|
||
<table class="docutils field-list" frame="void" rules="none">
|
||
<col class="field-name" />
|
||
<col class="field-body" />
|
||
<tbody valign="top">
|
||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||
<li><strong>device_name</strong> (<em>str</em>) – the name of the relevant device</li>
|
||
<li><strong>value</strong> (<em><type depends on protocol></em>) – the value to be written</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first simple">
|
||
<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">NameError</span></code> – the device name could not be found in the config.xml</li>
|
||
<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code> – the given Value has the wrong type for the protocol</li>
|
||
<li><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code> – the value cannot be written to the device</li>
|
||
</ul>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">value if everything worked correctly</p>
|
||
</td>
|
||
</tr>
|
||
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><type depends on protocol></p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</dd></dl>
|
||
|
||
</dd></dl>
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<h1 class="logo"><a href="index.html">APED (API-Documentation)</a></h1>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3>Navigation</h3>
|
||
|
||
<div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="index.html">Documentation overview</a><ul>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3>Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="search.html" method="get">
|
||
<input type="text" name="q" />
|
||
<input type="submit" value="Go" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="footer">
|
||
©2021, Paul Lödige.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.4</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
|
||
|
||
|
|
||
<a href="_sources/interface_handler.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |