mirror of
https://github.com/chirimen-oh/node-web-i2c.git
synced 2025-02-22 16:45:57 +00:00
TSDoc (#46)
Ref. #45 Co-authored-by: akihiko kigure <akihiko.kigure@lifewood-m1.local>
This commit is contained in:
parent
7e80b85727
commit
6d341aaaf7
23 changed files with 3069 additions and 272 deletions
0
.github/workflows/build.yml
vendored
Normal file → Executable file
0
.github/workflows/build.yml
vendored
Normal file → Executable file
0
.github/workflows/publish.yml
vendored
Normal file → Executable file
0
.github/workflows/publish.yml
vendored
Normal file → Executable file
1
docs/.nojekyll
Normal file
1
docs/.nojekyll
Normal file
|
@ -0,0 +1 @@
|
||||||
|
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
|
78
docs/assets/highlight.css
Normal file
78
docs/assets/highlight.css
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
:root {
|
||||||
|
--light-hl-0: #0000FF;
|
||||||
|
--dark-hl-0: #569CD6;
|
||||||
|
--light-hl-1: #000000;
|
||||||
|
--dark-hl-1: #D4D4D4;
|
||||||
|
--light-hl-2: #0070C1;
|
||||||
|
--dark-hl-2: #4FC1FF;
|
||||||
|
--light-hl-3: #795E26;
|
||||||
|
--dark-hl-3: #DCDCAA;
|
||||||
|
--light-hl-4: #A31515;
|
||||||
|
--dark-hl-4: #CE9178;
|
||||||
|
--light-hl-5: #098658;
|
||||||
|
--dark-hl-5: #B5CEA8;
|
||||||
|
--light-hl-6: #AF00DB;
|
||||||
|
--dark-hl-6: #C586C0;
|
||||||
|
--light-hl-7: #001080;
|
||||||
|
--dark-hl-7: #9CDCFE;
|
||||||
|
--light-code-background: #FFFFFF;
|
||||||
|
--dark-code-background: #1E1E1E;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) { :root {
|
||||||
|
--hl-0: var(--light-hl-0);
|
||||||
|
--hl-1: var(--light-hl-1);
|
||||||
|
--hl-2: var(--light-hl-2);
|
||||||
|
--hl-3: var(--light-hl-3);
|
||||||
|
--hl-4: var(--light-hl-4);
|
||||||
|
--hl-5: var(--light-hl-5);
|
||||||
|
--hl-6: var(--light-hl-6);
|
||||||
|
--hl-7: var(--light-hl-7);
|
||||||
|
--code-background: var(--light-code-background);
|
||||||
|
} }
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) { :root {
|
||||||
|
--hl-0: var(--dark-hl-0);
|
||||||
|
--hl-1: var(--dark-hl-1);
|
||||||
|
--hl-2: var(--dark-hl-2);
|
||||||
|
--hl-3: var(--dark-hl-3);
|
||||||
|
--hl-4: var(--dark-hl-4);
|
||||||
|
--hl-5: var(--dark-hl-5);
|
||||||
|
--hl-6: var(--dark-hl-6);
|
||||||
|
--hl-7: var(--dark-hl-7);
|
||||||
|
--code-background: var(--dark-code-background);
|
||||||
|
} }
|
||||||
|
|
||||||
|
body.light {
|
||||||
|
--hl-0: var(--light-hl-0);
|
||||||
|
--hl-1: var(--light-hl-1);
|
||||||
|
--hl-2: var(--light-hl-2);
|
||||||
|
--hl-3: var(--light-hl-3);
|
||||||
|
--hl-4: var(--light-hl-4);
|
||||||
|
--hl-5: var(--light-hl-5);
|
||||||
|
--hl-6: var(--light-hl-6);
|
||||||
|
--hl-7: var(--light-hl-7);
|
||||||
|
--code-background: var(--light-code-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
body.dark {
|
||||||
|
--hl-0: var(--dark-hl-0);
|
||||||
|
--hl-1: var(--dark-hl-1);
|
||||||
|
--hl-2: var(--dark-hl-2);
|
||||||
|
--hl-3: var(--dark-hl-3);
|
||||||
|
--hl-4: var(--dark-hl-4);
|
||||||
|
--hl-5: var(--dark-hl-5);
|
||||||
|
--hl-6: var(--dark-hl-6);
|
||||||
|
--hl-7: var(--dark-hl-7);
|
||||||
|
--code-background: var(--dark-code-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hl-0 { color: var(--hl-0); }
|
||||||
|
.hl-1 { color: var(--hl-1); }
|
||||||
|
.hl-2 { color: var(--hl-2); }
|
||||||
|
.hl-3 { color: var(--hl-3); }
|
||||||
|
.hl-4 { color: var(--hl-4); }
|
||||||
|
.hl-5 { color: var(--hl-5); }
|
||||||
|
.hl-6 { color: var(--hl-6); }
|
||||||
|
.hl-7 { color: var(--hl-7); }
|
||||||
|
pre, code { background: var(--code-background); }
|
1043
docs/assets/icons.css
Normal file
1043
docs/assets/icons.css
Normal file
File diff suppressed because it is too large
Load diff
BIN
docs/assets/icons.png
Normal file
BIN
docs/assets/icons.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.4 KiB |
BIN
docs/assets/icons@2x.png
Normal file
BIN
docs/assets/icons@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
52
docs/assets/main.js
Normal file
52
docs/assets/main.js
Normal file
File diff suppressed because one or more lines are too long
1
docs/assets/search.js
Normal file
1
docs/assets/search.js
Normal file
File diff suppressed because one or more lines are too long
1388
docs/assets/style.css
Normal file
1388
docs/assets/style.css
Normal file
File diff suppressed because it is too large
Load diff
BIN
docs/assets/widgets.png
Normal file
BIN
docs/assets/widgets.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 480 B |
BIN
docs/assets/widgets@2x.png
Normal file
BIN
docs/assets/widgets@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 855 B |
10
docs/classes/I2CAccess.html
Normal file
10
docs/classes/I2CAccess.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>I2CAccess | node-web-i2c</title><meta name="description" content="Documentation for node-web-i2c"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">node-web-i2c</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">node-web-i2c</a></li><li><a href="I2CAccess.html">I2CAccess</a></li></ul><h1>Class I2CAccess</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>I2CAccess クラス</p>
|
||||||
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">I2CAccess</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="I2CAccess.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section tsd-is-private tsd-is-private-protected"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="I2CAccess.html#_ports" class="tsd-kind-icon">_ports</a></li></ul></section><section class="tsd-index-section "><h3>Accessors</h3><ul class="tsd-index-list"><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="I2CAccess.html#ports" class="tsd-kind-icon">ports</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>I2CAccess<span class="tsd-signature-symbol">(</span>ports<span class="tsd-signature-symbol">?: </span><a href="I2CPortMap.html" class="tsd-signature-type" data-tsd-kind="Class">I2CPortMap</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="I2CAccess.html" class="tsd-signature-type" data-tsd-kind="Class">I2CAccess</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L43">index.ts:43</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>Creates an instance of GPIOAccess.</p>
|
||||||
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> ports: <a href="I2CPortMap.html" class="tsd-signature-type" data-tsd-kind="Class">I2CPortMap</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>ポート番号</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="I2CAccess.html" class="tsd-signature-type" data-tsd-kind="Class">I2CAccess</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group tsd-is-private tsd-is-private-protected"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="_ports" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> _ports</h3><div class="tsd-signature tsd-kind-icon">_ports<span class="tsd-signature-symbol">:</span> <a href="I2CPortMap.html" class="tsd-signature-type" data-tsd-kind="Class">I2CPortMap</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L37">index.ts:37</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group "><h2>Accessors</h2><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="ports" class="tsd-anchor"></a><h3>ports</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> ports<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="I2CPortMap.html" class="tsd-signature-type" data-tsd-kind="Class">I2CPortMap</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L51">index.ts:51</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>ポート情報取得処理</p>
|
||||||
|
</div></div><h4 class="tsd-returns-title">Returns <a href="I2CPortMap.html" class="tsd-signature-type" data-tsd-kind="Class">I2CPortMap</a></h4><div><p>現在のポート情報</p>
|
||||||
|
</div></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="I2CAccess.html" class="tsd-kind-icon">I2CAccess</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="I2CAccess.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="I2CAccess.html#_ports" class="tsd-kind-icon">_ports</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="I2CAccess.html#ports" class="tsd-kind-icon">ports</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
18
docs/classes/I2CPort.html
Normal file
18
docs/classes/I2CPort.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>I2CPort | node-web-i2c</title><meta name="description" content="Documentation for node-web-i2c"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">node-web-i2c</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">node-web-i2c</a></li><li><a href="I2CPort.html">I2CPort</a></li></ul><h1>Class I2CPort</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>I2CPort クラス</p>
|
||||||
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">I2CPort</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="I2CPort.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section tsd-is-private tsd-is-private-protected"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="I2CPort.html#_portNumber" class="tsd-kind-icon">_port<wbr/>Number</a></li></ul></section><section class="tsd-index-section "><h3>Accessors</h3><ul class="tsd-index-list"><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="I2CPort.html#portName" class="tsd-kind-icon">port<wbr/>Name</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="I2CPort.html#portNumber" class="tsd-kind-icon">port<wbr/>Number</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class"><a href="I2CPort.html#open" class="tsd-kind-icon">open</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">new <wbr/>I2CPort<span class="tsd-signature-symbol">(</span>portNumber<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="I2CPort.html" class="tsd-signature-type" data-tsd-kind="Class">I2CPort</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L74">index.ts:74</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>Creates an instance of GPIOPort.</p>
|
||||||
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>portNumber: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>ポート番号</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="I2CPort.html" class="tsd-signature-type" data-tsd-kind="Class">I2CPort</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group tsd-is-private tsd-is-private-protected"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private"><a id="_portNumber" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagPrivate">Private</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> _port<wbr/>Number</h3><div class="tsd-signature tsd-kind-icon">_port<wbr/>Number<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L68">index.ts:68</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group "><h2>Accessors</h2><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="portName" class="tsd-anchor"></a><h3>port<wbr/>Name</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> portName<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L90">index.ts:90</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>ポート名取得処理</p>
|
||||||
|
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div><p>現在のポート名</p>
|
||||||
|
</div></li></ul></section><section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class"><a id="portNumber" class="tsd-anchor"></a><h3>port<wbr/>Number</h3><ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> portNumber<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L82">index.ts:82</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>ポート番号取得処理</p>
|
||||||
|
</div></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div><p>現在のポート番号</p>
|
||||||
|
</div></li></ul></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="open" class="tsd-anchor"></a><h3>open</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon">open<span class="tsd-signature-symbol">(</span>slaveAddress<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/I2CSlaveDevice.html" class="tsd-signature-type" data-tsd-kind="Interface">I2CSlaveDevice</a><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L99">index.ts:99</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>I2CSlave 接続デバイスオープン処理</p>
|
||||||
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>slaveAddress: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>接続デバイス情報のアドレス</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/I2CSlaveDevice.html" class="tsd-signature-type" data-tsd-kind="Interface">I2CSlaveDevice</a><span class="tsd-signature-symbol">></span></h4><div><p>I2CSlaveDevice インスタンスの生成の完了</p>
|
||||||
|
</div></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="I2CPort.html" class="tsd-kind-icon">I2CPort</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class"><a href="I2CPort.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="I2CPort.html#_portNumber" class="tsd-kind-icon">_port<wbr/>Number</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="I2CPort.html#portName" class="tsd-kind-icon">port<wbr/>Name</a></li><li class="tsd-kind-get-signature tsd-parent-kind-class"><a href="I2CPort.html#portNumber" class="tsd-kind-icon">port<wbr/>Number</a></li><li class="tsd-kind-method tsd-parent-kind-class"><a href="I2CPort.html#open" class="tsd-kind-icon">open</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
11
docs/classes/I2CPortMap.html
Normal file
11
docs/classes/I2CPortMap.html
Normal file
File diff suppressed because one or more lines are too long
12
docs/classes/OperationError.html
Normal file
12
docs/classes/OperationError.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>OperationError | node-web-i2c</title><meta name="description" content="Documentation for node-web-i2c"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">node-web-i2c</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">node-web-i2c</a></li><li><a href="OperationError.html">OperationError</a></li></ul><h1>Class OperationError</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>操作エラー</p>
|
||||||
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">Error</span><ul class="tsd-hierarchy"><li><span class="target">OperationError</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="OperationError.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section tsd-is-inherited tsd-is-external"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="OperationError.html#message" class="tsd-kind-icon">message</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="OperationError.html#name" class="tsd-kind-icon">name</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="OperationError.html#stack" class="tsd-kind-icon">stack</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="OperationError.html#prepareStackTrace" class="tsd-kind-icon">prepare<wbr/>Stack<wbr/>Trace</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="OperationError.html#stackTraceLimit" class="tsd-kind-icon">stack<wbr/>Trace<wbr/>Limit</a></li></ul></section><section class="tsd-index-section tsd-is-inherited tsd-is-external"><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="OperationError.html#captureStackTrace" class="tsd-kind-icon">capture<wbr/>Stack<wbr/>Trace</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><li class="tsd-signature tsd-kind-icon">new <wbr/>Operation<wbr/>Error<span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="OperationError.html" class="tsd-signature-type" data-tsd-kind="Class">OperationError</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Overrides Error.constructor</p><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L290">index.ts:290</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>Creates an instance of OperationError.</p>
|
||||||
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>message: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>エラーメッセージ</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="OperationError.html" class="tsd-signature-type" data-tsd-kind="Class">OperationError</a></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited tsd-is-external"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a id="message" class="tsd-anchor"></a><h3>message</h3><div class="tsd-signature tsd-kind-icon">message<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><p>Inherited from Error.message</p><ul><li>Defined in node_modules/typescript/lib/lib.es5.d.ts:1023</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a id="name" class="tsd-anchor"></a><h3>name</h3><div class="tsd-signature tsd-kind-icon">name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><p>Inherited from Error.name</p><ul><li>Defined in node_modules/typescript/lib/lib.es5.d.ts:1022</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a id="stack" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagOptional">Optional</span> stack</h3><div class="tsd-signature tsd-kind-icon">stack<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><p>Inherited from Error.stack</p><ul><li>Defined in node_modules/typescript/lib/lib.es5.d.ts:1024</li></ul></aside></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="prepareStackTrace" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> <span class="tsd-flag ts-flagOptional">Optional</span> prepare<wbr/>Stack<wbr/>Trace</h3><div class="tsd-signature tsd-kind-icon">prepare<wbr/>Stack<wbr/>Trace<span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">(</span>err<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Error</span>, stackTraces<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">CallSite</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">any</span></div><aside class="tsd-sources"><p>Inherited from Error.prepareStackTrace</p><ul><li>Defined in node_modules/@types/node/globals.d.ts:11</li></ul></aside><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-class"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>err<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Error</span>, stackTraces<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">CallSite</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>Optional override for formatting stack traces</p>
|
||||||
|
</div><dl class="tsd-comment-tags"><dt>see</dt><dd><p><a href="https://v8.dev/docs/stack-trace-api#customizing-stack-traces">https://v8.dev/docs/stack-trace-api#customizing-stack-traces</a></p>
|
||||||
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>err: <span class="tsd-signature-type">Error</span></h5></li><li><h5>stackTraces: <span class="tsd-signature-type">CallSite</span><span class="tsd-signature-symbol">[]</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4></li></ul></li></ul></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="stackTraceLimit" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> stack<wbr/>Trace<wbr/>Limit</h3><div class="tsd-signature tsd-kind-icon">stack<wbr/>Trace<wbr/>Limit<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><p>Inherited from Error.stackTraceLimit</p><ul><li>Defined in node_modules/@types/node/globals.d.ts:13</li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited tsd-is-external"><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a id="captureStackTrace" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> capture<wbr/>Stack<wbr/>Trace</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><li class="tsd-signature tsd-kind-icon">capture<wbr/>Stack<wbr/>Trace<span class="tsd-signature-symbol">(</span>targetObject<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">object</span>, constructorOpt<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from Error.captureStackTrace</p><ul><li>Defined in node_modules/@types/node/globals.d.ts:4</li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>Create .stack property on a target object</p>
|
||||||
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>targetObject: <span class="tsd-signature-type">object</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> constructorOpt: <span class="tsd-signature-type">Function</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class"><a href="OperationError.html" class="tsd-kind-icon">Operation<wbr/>Error</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite"><a href="OperationError.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="OperationError.html#message" class="tsd-kind-icon">message</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="OperationError.html#name" class="tsd-kind-icon">name</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="OperationError.html#stack" class="tsd-kind-icon">stack</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="OperationError.html#prepareStackTrace" class="tsd-kind-icon">prepare<wbr/>Stack<wbr/>Trace</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="OperationError.html#stackTraceLimit" class="tsd-kind-icon">stack<wbr/>Trace<wbr/>Limit</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="OperationError.html#captureStackTrace" class="tsd-kind-icon">capture<wbr/>Stack<wbr/>Trace</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
17
docs/index.html
Normal file
17
docs/index.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>node-web-i2c</title><meta name="description" content="Documentation for node-web-i2c"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">node-web-i2c</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1>node-web-i2c</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><div class="tsd-panel tsd-typography">
|
||||||
|
<a href="#node-web-i2c" id="node-web-i2c" style="color: inherit; text-decoration: none;">
|
||||||
|
<h1>node-web-i2c</h1>
|
||||||
|
</a>
|
||||||
|
<p>I2C access with Node.js</p>
|
||||||
|
|
||||||
|
<a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
|
||||||
|
<h2>Usage</h2>
|
||||||
|
</a>
|
||||||
|
<pre><code class="language-js"><span class="hl-0">const</span><span class="hl-1"> { </span><span class="hl-2">requestI2CAccess</span><span class="hl-1"> } = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">"node-web-i2c"</span><span class="hl-1">);</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">ADT7410</span><span class="hl-1"> = </span><span class="hl-3">require</span><span class="hl-1">(</span><span class="hl-4">"@chirimen/adt7410"</span><span class="hl-1">);</span><br/><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">ADT7410_ADDR</span><span class="hl-1"> = </span><span class="hl-5">0x48</span><span class="hl-1">;</span><br/><br/><span class="hl-0">async</span><span class="hl-1"> </span><span class="hl-0">function</span><span class="hl-1"> </span><span class="hl-3">main</span><span class="hl-1">() {</span><br/><span class="hl-1"> </span><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">i2cAccess</span><span class="hl-1"> = </span><span class="hl-6">await</span><span class="hl-1"> </span><span class="hl-3">requestI2CAccess</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">port</span><span class="hl-1"> = </span><span class="hl-7">i2cAccess</span><span class="hl-1">.</span><span class="hl-7">ports</span><span class="hl-1">.</span><span class="hl-3">get</span><span class="hl-1">(</span><span class="hl-5">1</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">adt7410</span><span class="hl-1"> = </span><span class="hl-0">new</span><span class="hl-1"> </span><span class="hl-3">ADT7410</span><span class="hl-1">(</span><span class="hl-7">port</span><span class="hl-1">, </span><span class="hl-2">ADT7410_ADDR</span><span class="hl-1">);</span><br/><span class="hl-1"> </span><span class="hl-6">await</span><span class="hl-1"> </span><span class="hl-7">adt7410</span><span class="hl-1">.</span><span class="hl-3">init</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">temperature</span><span class="hl-1"> = </span><span class="hl-6">await</span><span class="hl-1"> </span><span class="hl-7">adt7410</span><span class="hl-1">.</span><span class="hl-3">read</span><span class="hl-1">();</span><br/><span class="hl-1"> </span><span class="hl-7">console</span><span class="hl-1">.</span><span class="hl-3">log</span><span class="hl-1">(</span><span class="hl-4">`Temperature: </span><span class="hl-0">${</span><span class="hl-7">temperature</span><span class="hl-0">}</span><span class="hl-4"> ℃`</span><span class="hl-1">);</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">main</span><span class="hl-1">();</span>
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<a href="#document" id="document" style="color: inherit; text-decoration: none;">
|
||||||
|
<h2>Document</h2>
|
||||||
|
</a>
|
||||||
|
<p><a href="http://browserobo.github.io/WebI2C">Web I2C API</a></p>
|
||||||
|
</div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class"><a href="classes/I2CAccess.html" class="tsd-kind-icon">I2CAccess</a></li><li class="tsd-kind-class"><a href="classes/I2CPort.html" class="tsd-kind-icon">I2CPort</a></li><li class="tsd-kind-class"><a href="classes/I2CPortMap.html" class="tsd-kind-icon">I2CPort<wbr/>Map</a></li><li class="tsd-kind-class"><a href="classes/OperationError.html" class="tsd-kind-icon">Operation<wbr/>Error</a></li><li class="tsd-kind-interface"><a href="interfaces/I2CSlaveDevice.html" class="tsd-kind-icon">I2CSlave<wbr/>Device</a></li><li class="tsd-kind-function"><a href="modules.html#requestI2CAccess" class="tsd-kind-icon">request<wbr/>I2CAccess</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>
|
35
docs/interfaces/I2CSlaveDevice.html
Normal file
35
docs/interfaces/I2CSlaveDevice.html
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>I2CSlaveDevice | node-web-i2c</title><meta name="description" content="Documentation for node-web-i2c"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">node-web-i2c</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">node-web-i2c</a></li><li><a href="I2CSlaveDevice.html">I2CSlaveDevice</a></li></ul><h1>Interface I2CSlaveDevice</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>I2CSlaveDevice クラス</p>
|
||||||
|
</div></div></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><span class="target">I2CSlaveDevice</span></li></ul></section><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#slaveAddress" class="tsd-kind-icon">slave<wbr/>Address</a></li></ul></section><section class="tsd-index-section "><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#read16" class="tsd-kind-icon">read16</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#read8" class="tsd-kind-icon">read8</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#readByte" class="tsd-kind-icon">read<wbr/>Byte</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#readBytes" class="tsd-kind-icon">read<wbr/>Bytes</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#write16" class="tsd-kind-icon">write16</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#write8" class="tsd-kind-icon">write8</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#writeByte" class="tsd-kind-icon">write<wbr/>Byte</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#writeBytes" class="tsd-kind-icon">write<wbr/>Bytes</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="slaveAddress" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> slave<wbr/>Address</h3><div class="tsd-signature tsd-kind-icon">slave<wbr/>Address<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L224">index.ts:224</a></li></ul></aside><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>I2C Slave アドレス</p>
|
||||||
|
</div></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="read16" class="tsd-anchor"></a><h3>read16</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">read16<span class="tsd-signature-symbol">(</span>registerNumber<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L237">index.ts:237</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>function</dt><dd><p>I2C 読み取り処理</p>
|
||||||
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>registerNumber: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>読み取りアドレス</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="read8" class="tsd-anchor"></a><h3>read8</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">read8<span class="tsd-signature-symbol">(</span>registerNumber<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L231">index.ts:231</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>function</dt><dd><p>I2C 読み取り処理</p>
|
||||||
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>registerNumber: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>読み取りアドレス</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="readByte" class="tsd-anchor"></a><h3>read<wbr/>Byte</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">read<wbr/>Byte<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L258">index.ts:258</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>function</dt><dd><p>I2c bytes 読み取りバイト処理
|
||||||
|
Different from Web I2C API specification.</p>
|
||||||
|
</dd></dl></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="readBytes" class="tsd-anchor"></a><h3>read<wbr/>Bytes</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">read<wbr/>Bytes<span class="tsd-signature-symbol">(</span>length<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L265">index.ts:265</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>function</dt><dd><p>I2c bytes 読み取りバイト処理
|
||||||
|
Different from Web I2C API specification.</p>
|
||||||
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>length: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>読み取る配列の長さ</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="write16" class="tsd-anchor"></a><h3>write16</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">write16<span class="tsd-signature-symbol">(</span>registerNumber<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L251">index.ts:251</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>function</dt><dd><p>I2c bytes 書き込み処理</p>
|
||||||
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>registerNumber: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>書き込みアドレス</p>
|
||||||
|
</div></div></li><li><h5>value: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>書き込みの値(ワード)</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="write8" class="tsd-anchor"></a><h3>write8</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">write8<span class="tsd-signature-symbol">(</span>registerNumber<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L244">index.ts:244</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>function</dt><dd><p>I2c s/I2c/I2C 書き込み処理</p>
|
||||||
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>registerNumber: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>書き込みアドレス</p>
|
||||||
|
</div></div></li><li><h5>value: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>書き込みの値(バイト)</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="writeByte" class="tsd-anchor"></a><h3>write<wbr/>Byte</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">write<wbr/>Byte<span class="tsd-signature-symbol">(</span>byte<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L272">index.ts:272</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>function</dt><dd><p>I2c bytes 書き込みバイト処理
|
||||||
|
Different from Web I2C API specification.</p>
|
||||||
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>byte: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>書き込みの値</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface"><a id="writeBytes" class="tsd-anchor"></a><h3>write<wbr/>Bytes</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface"><li class="tsd-signature tsd-kind-icon">write<wbr/>Bytes<span class="tsd-signature-symbol">(</span>bytes<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/gurezo/node-web-i2c/blob/6e2ac00/index.ts#L279">index.ts:279</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>function</dt><dd><p>I2c bytes 書き込みバイト配列処理
|
||||||
|
Different from Web I2C API specification.</p>
|
||||||
|
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>bytes: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
||||||
|
<p>書き込みの値の配列</p>
|
||||||
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">></span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-interface"><a href="I2CSlaveDevice.html" class="tsd-kind-icon">I2CSlave<wbr/>Device</a><ul><li class="tsd-kind-property tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#slaveAddress" class="tsd-kind-icon">slave<wbr/>Address</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#read16" class="tsd-kind-icon">read16</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#read8" class="tsd-kind-icon">read8</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#readByte" class="tsd-kind-icon">read<wbr/>Byte</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#readBytes" class="tsd-kind-icon">read<wbr/>Bytes</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#write16" class="tsd-kind-icon">write16</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#write8" class="tsd-kind-icon">write8</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#writeByte" class="tsd-kind-icon">write<wbr/>Byte</a></li><li class="tsd-kind-method tsd-parent-kind-interface"><a href="I2CSlaveDevice.html#writeBytes" class="tsd-kind-icon">write<wbr/>Bytes</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
1
docs/modules.html
Normal file
1
docs/modules.html
Normal file
File diff suppressed because one or more lines are too long
172
index.ts
172
index.ts
|
@ -1,27 +1,53 @@
|
||||||
import { openPromisified } from 'i2c-bus';
|
import { openPromisified } from 'i2c-bus';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* I2C Port Map Max サイズ
|
||||||
|
*/
|
||||||
const I2CPortMapSizeMax = 32;
|
const I2CPortMapSizeMax = 32;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uint16 Max サイズ
|
||||||
|
*/
|
||||||
const Uint16Max = 65535;
|
const Uint16Max = 65535;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Uint16型変換処理
|
||||||
|
* @param parseString 変換文字列
|
||||||
|
* @return Uint16型変換値
|
||||||
|
*/
|
||||||
function parseUint16(parseString: string) {
|
function parseUint16(parseString: string) {
|
||||||
const n = Number.parseInt(parseString, 10);
|
const n = Number.parseInt(parseString, 10);
|
||||||
if (0 <= n && n <= Uint16Max) return n;
|
if (0 <= n && n <= Uint16Max) return n;
|
||||||
else throw new RangeError(`Must be between 0 and ${Uint16Max}.`);
|
else throw new RangeError(`Must be between 0 and ${Uint16Max}.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ポート番号 */
|
||||||
type PortNumber = number;
|
type PortNumber = number;
|
||||||
|
/** ポート名 */
|
||||||
type PortName = string;
|
type PortName = string;
|
||||||
|
|
||||||
|
/** I2C Slave アドレス */
|
||||||
type I2CSlaveAddress = number;
|
type I2CSlaveAddress = number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* I2CAccess クラス
|
||||||
|
*/
|
||||||
export class I2CAccess {
|
export class I2CAccess {
|
||||||
private readonly _ports: I2CPortMap;
|
private readonly _ports: I2CPortMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of GPIOAccess.
|
||||||
|
* @param ports ポート番号
|
||||||
|
*/
|
||||||
constructor(ports?: I2CPortMap) {
|
constructor(ports?: I2CPortMap) {
|
||||||
this._ports = ports == null ? new I2CPortMap() : ports;
|
this._ports = ports == null ? new I2CPortMap() : ports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ポート情報取得処理
|
||||||
|
* @return 現在のポート情報
|
||||||
|
*/
|
||||||
get ports(): I2CPortMap {
|
get ports(): I2CPortMap {
|
||||||
return this._ports;
|
return this._ports;
|
||||||
}
|
}
|
||||||
|
@ -35,21 +61,41 @@ export class I2CPortMap extends Map<PortNumber, I2CPort> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* I2CPort クラス
|
||||||
|
*/
|
||||||
export class I2CPort {
|
export class I2CPort {
|
||||||
private readonly _portNumber: PortNumber;
|
private readonly _portNumber: PortNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of GPIOPort.
|
||||||
|
* @param portNumber ポート番号
|
||||||
|
*/
|
||||||
constructor(portNumber: PortNumber) {
|
constructor(portNumber: PortNumber) {
|
||||||
this._portNumber = parseUint16(portNumber.toString());
|
this._portNumber = parseUint16(portNumber.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ポート番号取得処理
|
||||||
|
* @return 現在のポート番号
|
||||||
|
*/
|
||||||
get portNumber(): PortNumber {
|
get portNumber(): PortNumber {
|
||||||
return this._portNumber;
|
return this._portNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ポート名取得処理
|
||||||
|
* @return 現在のポート名
|
||||||
|
*/
|
||||||
get portName(): string {
|
get portName(): string {
|
||||||
return `i2c-${this.portNumber}`;
|
return `i2c-${this.portNumber}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* I2CSlave 接続デバイスオープン処理
|
||||||
|
* @param slaveAddress 接続デバイス情報のアドレス
|
||||||
|
* @return I2CSlaveDevice インスタンスの生成の完了
|
||||||
|
*/
|
||||||
async open(slaveAddress: I2CSlaveAddress): Promise<I2CSlaveDevice> {
|
async open(slaveAddress: I2CSlaveAddress): Promise<I2CSlaveDevice> {
|
||||||
const bus = await openPromisified(this.portNumber).catch((error) => {
|
const bus = await openPromisified(this.portNumber).catch((error) => {
|
||||||
throw new OperationError(error);
|
throw new OperationError(error);
|
||||||
|
@ -57,32 +103,57 @@ export class I2CPort {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
slaveAddress,
|
slaveAddress,
|
||||||
read8: (cmd) =>
|
/**
|
||||||
bus.readByte(slaveAddress, cmd).catch((error) => {
|
* @function
|
||||||
|
* I2C 読み取り処理
|
||||||
|
* @param registerNumber 読み取りアドレス
|
||||||
|
*/
|
||||||
|
read8: (registerNumber) =>
|
||||||
|
bus.readByte(slaveAddress, registerNumber).catch((error) => {
|
||||||
throw new OperationError(error);
|
throw new OperationError(error);
|
||||||
}),
|
}),
|
||||||
read16: (cmd) =>
|
/**
|
||||||
bus.readWord(slaveAddress, cmd).catch((error) => {
|
* @function
|
||||||
|
* I2C 読み取り処理
|
||||||
|
* @param registerNumber 読み取りアドレス
|
||||||
|
*/
|
||||||
|
read16: (registerNumber) =>
|
||||||
|
bus.readWord(slaveAddress, registerNumber).catch((error) => {
|
||||||
throw new OperationError(error);
|
throw new OperationError(error);
|
||||||
}),
|
}),
|
||||||
write8: async (cmd, byte) => {
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c s/I2c/I2C 書き込み処理
|
||||||
|
* @param registerNumber 書き込みアドレス
|
||||||
|
* @param byte 書き込みの値(バイト)
|
||||||
|
*/
|
||||||
|
write8: async (registerNumber, byte) => {
|
||||||
try {
|
try {
|
||||||
await bus.writeByte(slaveAddress, cmd, byte);
|
await bus.writeByte(slaveAddress, registerNumber, byte);
|
||||||
return byte;
|
return byte;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
throw new OperationError(error);
|
throw new OperationError(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
write16: async (cmd, word) => {
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 書き込み処理
|
||||||
|
* @param registerNumber 書き込みアドレス
|
||||||
|
* @param word 書き込みの値(ワード)
|
||||||
|
*/
|
||||||
|
write16: async (registerNumber, word) => {
|
||||||
try {
|
try {
|
||||||
await bus.writeWord(slaveAddress, cmd, word);
|
await bus.writeWord(slaveAddress, registerNumber, word);
|
||||||
return word;
|
return word;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
throw new OperationError(error);
|
throw new OperationError(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
/** Different from Web I2C API specification. */
|
* @function
|
||||||
|
* I2c bytes 読み取りバイト処理
|
||||||
|
* Different from Web I2C API specification.
|
||||||
|
*/
|
||||||
readByte: async () => {
|
readByte: async () => {
|
||||||
try {
|
try {
|
||||||
const byte = await bus.receiveByte(slaveAddress);
|
const byte = await bus.receiveByte(slaveAddress);
|
||||||
|
@ -91,7 +162,12 @@ export class I2CPort {
|
||||||
throw new OperationError(error);
|
throw new OperationError(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** Different from Web I2C API specification. */
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 読み取りバイト処理
|
||||||
|
* Different from Web I2C API specification.
|
||||||
|
* @param length 読み取る配列の長さ
|
||||||
|
*/
|
||||||
readBytes: async (length) => {
|
readBytes: async (length) => {
|
||||||
try {
|
try {
|
||||||
const { bytesRead, buffer } = await bus.i2cRead(
|
const { bytesRead, buffer } = await bus.i2cRead(
|
||||||
|
@ -104,7 +180,12 @@ export class I2CPort {
|
||||||
throw new OperationError(error);
|
throw new OperationError(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** Different from Web I2C API specification. */
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 書き込みバイト処理
|
||||||
|
* Different from Web I2C API specification.
|
||||||
|
* @param byte 書き込みの値
|
||||||
|
*/
|
||||||
writeByte: async (byte) => {
|
writeByte: async (byte) => {
|
||||||
try {
|
try {
|
||||||
await bus.sendByte(slaveAddress, byte);
|
await bus.sendByte(slaveAddress, byte);
|
||||||
|
@ -113,7 +194,12 @@ export class I2CPort {
|
||||||
throw new OperationError(error);
|
throw new OperationError(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** Different from Web I2C API specification. */
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 書き込み処理
|
||||||
|
* Different from Web I2C API specification.
|
||||||
|
* @param bytes 書き込みの値の配列
|
||||||
|
*/
|
||||||
writeBytes: async (bytes) => {
|
writeBytes: async (bytes) => {
|
||||||
try {
|
try {
|
||||||
const { bytesWritten, buffer } = await bus.i2cWrite(
|
const { bytesWritten, buffer } = await bus.i2cWrite(
|
||||||
|
@ -130,25 +216,77 @@ export class I2CPort {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* I2CSlaveDevice クラス
|
||||||
|
*/
|
||||||
export interface I2CSlaveDevice {
|
export interface I2CSlaveDevice {
|
||||||
|
/** I2C Slave アドレス */
|
||||||
readonly slaveAddress: I2CSlaveAddress;
|
readonly slaveAddress: I2CSlaveAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @function
|
||||||
|
* I2C 読み取り処理
|
||||||
|
* @param registerNumber 読み取りアドレス
|
||||||
|
*/
|
||||||
read8(registerNumber: number): Promise<number>;
|
read8(registerNumber: number): Promise<number>;
|
||||||
|
/**
|
||||||
|
* @function
|
||||||
|
* I2C 読み取り処理
|
||||||
|
* @param registerNumber 読み取りアドレス
|
||||||
|
*/
|
||||||
read16(registerNumber: number): Promise<number>;
|
read16(registerNumber: number): Promise<number>;
|
||||||
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c s/I2c/I2C 書き込み処理
|
||||||
|
* @param registerNumber 書き込みアドレス
|
||||||
|
* @param value 書き込みの値(バイト)
|
||||||
|
*/
|
||||||
write8(registerNumber: number, value: number): Promise<number>;
|
write8(registerNumber: number, value: number): Promise<number>;
|
||||||
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 書き込み処理
|
||||||
|
* @param registerNumber 書き込みアドレス
|
||||||
|
* @param value 書き込みの値(ワード)
|
||||||
|
*/
|
||||||
write16(registerNumber: number, value: number): Promise<number>;
|
write16(registerNumber: number, value: number): Promise<number>;
|
||||||
|
|
||||||
/** Different from Web I2C API specification. */
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 読み取りバイト処理
|
||||||
|
* Different from Web I2C API specification.
|
||||||
|
*/
|
||||||
readByte(): Promise<number>;
|
readByte(): Promise<number>;
|
||||||
/** Different from Web I2C API specification. */
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 読み取りバイト処理
|
||||||
|
* Different from Web I2C API specification.
|
||||||
|
* @param length 読み取る配列の長さ
|
||||||
|
*/
|
||||||
readBytes(length: number): Promise<Uint8Array>;
|
readBytes(length: number): Promise<Uint8Array>;
|
||||||
/** Different from Web I2C API specification. */
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 書き込みバイト処理
|
||||||
|
* Different from Web I2C API specification.
|
||||||
|
* @param byte 書き込みの値
|
||||||
|
*/
|
||||||
writeByte(byte: number): Promise<number>;
|
writeByte(byte: number): Promise<number>;
|
||||||
/** Different from Web I2C API specification. */
|
/**
|
||||||
|
* @function
|
||||||
|
* I2c bytes 書き込みバイト配列処理
|
||||||
|
* Different from Web I2C API specification.
|
||||||
|
* @param bytes 書き込みの値の配列
|
||||||
|
*/
|
||||||
writeBytes(bytes: Array<number>): Promise<Uint8Array>;
|
writeBytes(bytes: Array<number>): Promise<Uint8Array>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作エラー
|
||||||
|
*/
|
||||||
export class OperationError extends Error {
|
export class OperationError extends Error {
|
||||||
|
/**
|
||||||
|
* Creates an instance of OperationError.
|
||||||
|
* @param message エラーメッセージ
|
||||||
|
*/
|
||||||
constructor(message: string) {
|
constructor(message: string) {
|
||||||
super(message);
|
super(message);
|
||||||
this.name = this.constructor.name;
|
this.name = this.constructor.name;
|
||||||
|
|
|
@ -25,13 +25,17 @@
|
||||||
"husky": "^7.0.4",
|
"husky": "^7.0.4",
|
||||||
"lint-staged": "^12.1.2",
|
"lint-staged": "^12.1.2",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
|
"typedoc": "^0.22.10",
|
||||||
"typescript": "^4.2.4"
|
"typescript": "^4.2.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"lint": "eslint index.ts",
|
"lint": "eslint index.ts",
|
||||||
"prepare": "husky install && rm -rf dist && npm run build",
|
"prepare": "husky install && rm -rf dist && npm run build",
|
||||||
"precommit": "lint-staged"
|
"precommit": "lint-staged",
|
||||||
|
"docs": "npm run remove:docs && npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./ README.md",
|
||||||
|
"typedoc": "typedoc",
|
||||||
|
"remove:docs": "rm -rf docs"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"hardware",
|
"hardware",
|
||||||
|
|
4
typedoc.json
Normal file
4
typedoc.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"entryPoints": ["index.ts"],
|
||||||
|
"out": "docs"
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue