reordering the crate and addind more documentation and added the docs to the same repo
This commit is contained in:
parent
6fb155dff3
commit
34c781e882
1035 changed files with 11041 additions and 18 deletions
139
docs/doc/src/arduboy_rust/hardware/buttons.rs.html
Normal file
139
docs/doc/src/arduboy_rust/hardware/buttons.rs.html
Normal file
|
@ -0,0 +1,139 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\hardware\buttons.rs`."><title>buttons.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! A list of all six buttons available on the Arduboy
|
||||
/// Just a `const` for the UP button
|
||||
</span><span class="kw">pub const </span>UP: ButtonSet = ButtonSet {
|
||||
flag_set: <span class="number">0b10000000</span>,
|
||||
};
|
||||
<span class="doccomment">/// Just a `const` for the RIGHT button
|
||||
</span><span class="kw">pub const </span>RIGHT: ButtonSet = ButtonSet {
|
||||
flag_set: <span class="number">0b01000000</span>,
|
||||
};
|
||||
<span class="doccomment">/// Just a `const` for the LEFT button
|
||||
</span><span class="kw">pub const </span>LEFT: ButtonSet = ButtonSet {
|
||||
flag_set: <span class="number">0b00100000</span>,
|
||||
};
|
||||
<span class="doccomment">/// Just a `const` for the DOWN button
|
||||
</span><span class="kw">pub const </span>DOWN: ButtonSet = ButtonSet {
|
||||
flag_set: <span class="number">0b00010000</span>,
|
||||
};
|
||||
<span class="doccomment">/// Just a `const` for the A button
|
||||
</span><span class="kw">pub const </span>A: ButtonSet = ButtonSet {
|
||||
flag_set: <span class="number">0b00001000</span>,
|
||||
};
|
||||
<span class="doccomment">/// Just a `const` for the B button
|
||||
</span><span class="kw">pub const </span>B: ButtonSet = ButtonSet {
|
||||
flag_set: <span class="number">0b00000100</span>,
|
||||
};
|
||||
<span class="doccomment">/// Just a `const` for the UP button
|
||||
</span><span class="kw">pub const </span>UP_BUTTON: ButtonSet = UP;
|
||||
<span class="doccomment">/// Just a `const` for the RIGHT button
|
||||
</span><span class="kw">pub const </span>RIGHT_BUTTON: ButtonSet = RIGHT;
|
||||
<span class="doccomment">/// Just a `const` for the DOWN button
|
||||
</span><span class="kw">pub const </span>DOWN_BUTTON: ButtonSet = DOWN;
|
||||
<span class="doccomment">/// Just a `const` for the LEFT button
|
||||
</span><span class="kw">pub const </span>LEFT_BUTTON: ButtonSet = LEFT;
|
||||
<span class="doccomment">/// Just a `const` for the A button
|
||||
</span><span class="kw">pub const </span>A_BUTTON: ButtonSet = A;
|
||||
<span class="doccomment">/// Just a `const` for the B button
|
||||
</span><span class="kw">pub const </span>B_BUTTON: ButtonSet = B;
|
||||
<span class="doccomment">///This struct gives the library a understanding what Buttons on the Arduboy are.
|
||||
</span><span class="attr">#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
|
||||
</span><span class="kw">pub struct </span>ButtonSet {
|
||||
<span class="kw">pub </span>flag_set: u8,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>ButtonSet {
|
||||
<span class="kw">pub unsafe fn </span>pressed(<span class="kw-2">&</span><span class="self">self</span>) -> bool {
|
||||
<span class="kw">crate</span>::library::arduboy2::pressed(<span class="self">self</span>.flag_set)
|
||||
}
|
||||
|
||||
<span class="kw">pub unsafe fn </span>just_pressed(<span class="kw-2">&</span><span class="self">self</span>) -> bool {
|
||||
<span class="kw">crate</span>::library::arduboy2::just_pressed(<span class="self">self</span>.flag_set)
|
||||
}
|
||||
|
||||
<span class="kw">pub unsafe fn </span>just_released(<span class="kw-2">&</span><span class="self">self</span>) -> bool {
|
||||
<span class="kw">crate</span>::library::arduboy2::just_released(<span class="self">self</span>.flag_set)
|
||||
}
|
||||
<span class="kw">pub unsafe fn </span>not_pressed(<span class="kw-2">&</span><span class="self">self</span>) -> bool {
|
||||
<span class="kw">crate</span>::library::arduboy2::not_pressed(<span class="self">self</span>.flag_set)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>core::ops::BitOr <span class="kw">for </span>ButtonSet {
|
||||
<span class="kw">type </span>Output = <span class="self">Self</span>;
|
||||
|
||||
<span class="kw">fn </span>bitor(<span class="self">self</span>, other: <span class="self">Self</span>) -> <span class="self">Self </span>{
|
||||
<span class="self">Self </span>{
|
||||
flag_set: <span class="self">self</span>.flag_set | other.flag_set,
|
||||
}
|
||||
}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
23
docs/doc/src/arduboy_rust/hardware/led.rs.html
Normal file
23
docs/doc/src/arduboy_rust/hardware/led.rs.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\hardware\led.rs`."><title>led.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! A list of all LED variables available
|
||||
///Just a `const` for the red led
|
||||
</span><span class="kw">pub const </span>RED_LED: u8 = <span class="number">10</span>;
|
||||
<span class="doccomment">///Just a `const` for the green led
|
||||
</span><span class="kw">pub const </span>GREEN_LED: u8 = <span class="number">11</span>;
|
||||
<span class="doccomment">///Just a `const` for the blue led
|
||||
</span><span class="kw">pub const </span>BLUE_LED: u8 = <span class="number">9</span>;
|
||||
<span class="doccomment">///Just a `const` for led on
|
||||
</span><span class="kw">pub const </span>RGB_ON: u8 = <span class="number">1</span>;
|
||||
<span class="doccomment">///Just a `const` for led off
|
||||
</span><span class="kw">pub const </span>RGB_OFF: u8 = <span class="number">0</span>;
|
||||
</code></pre></div></section></main></body></html>
|
7
docs/doc/src/arduboy_rust/hardware/mod.rs.html
Normal file
7
docs/doc/src/arduboy_rust/hardware/mod.rs.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\hardware\mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the Module to interact in a save way with the Arduboy hardware.
|
||||
</span><span class="kw">pub mod </span>buttons;
|
||||
<span class="kw">pub mod </span>led;
|
||||
</code></pre></div></section></main></body></html>
|
27
docs/doc/src/arduboy_rust/lib.rs.html
Normal file
27
docs/doc/src/arduboy_rust/lib.rs.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\lib.rs`."><title>lib.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![cfg(target_arch = <span class="string">"avr"</span>)]
|
||||
#![no_std]
|
||||
#![feature(c_size_t)]
|
||||
|
||||
</span><span class="kw">extern crate </span>panic_halt;
|
||||
<span class="kw">pub mod </span>hardware;
|
||||
<span class="kw">mod </span>library;
|
||||
<span class="kw">pub mod </span>prelude;
|
||||
<span class="kw">mod </span>print;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy2::{<span class="self">self</span>, Arduboy2, Color, FONT_SIZE, HEIGHT, WIDTH};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy_tone::{<span class="self">self</span>, ArduboyTones};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::eeprom::{EEPROM, EEPROMBYTE};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::{c, sprites};
|
||||
</code></pre></div></section></main></body></html>
|
1591
docs/doc/src/arduboy_rust/library/arduboy2.rs.html
Normal file
1591
docs/doc/src/arduboy_rust/library/arduboy2.rs.html
Normal file
File diff suppressed because it is too large
Load diff
297
docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html
Normal file
297
docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html
Normal file
|
@ -0,0 +1,297 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\library\arduboy_tone.rs`."><title>arduboy_tone.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
<a href="#115" id="115">115</a>
|
||||
<a href="#116" id="116">116</a>
|
||||
<a href="#117" id="117">117</a>
|
||||
<a href="#118" id="118">118</a>
|
||||
<a href="#119" id="119">119</a>
|
||||
<a href="#120" id="120">120</a>
|
||||
<a href="#121" id="121">121</a>
|
||||
<a href="#122" id="122">122</a>
|
||||
<a href="#123" id="123">123</a>
|
||||
<a href="#124" id="124">124</a>
|
||||
<a href="#125" id="125">125</a>
|
||||
<a href="#126" id="126">126</a>
|
||||
<a href="#127" id="127">127</a>
|
||||
<a href="#128" id="128">128</a>
|
||||
<a href="#129" id="129">129</a>
|
||||
<a href="#130" id="130">130</a>
|
||||
<a href="#131" id="131">131</a>
|
||||
<a href="#132" id="132">132</a>
|
||||
<a href="#133" id="133">133</a>
|
||||
<a href="#134" id="134">134</a>
|
||||
<a href="#135" id="135">135</a>
|
||||
<a href="#136" id="136">136</a>
|
||||
<a href="#137" id="137">137</a>
|
||||
<a href="#138" id="138">138</a>
|
||||
<a href="#139" id="139">139</a>
|
||||
<a href="#140" id="140">140</a>
|
||||
<a href="#141" id="141">141</a>
|
||||
<a href="#142" id="142">142</a>
|
||||
<a href="#143" id="143">143</a>
|
||||
<a href="#144" id="144">144</a>
|
||||
<a href="#145" id="145">145</a>
|
||||
<a href="#146" id="146">146</a>
|
||||
<a href="#147" id="147">147</a>
|
||||
<a href="#148" id="148">148</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//!This is the Module to interact in a save way with the ArduboyTones C++ library.
|
||||
</span><span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy_tone_pitch;
|
||||
<span class="kw">use </span>core::ffi::{c_uchar, c_uint, c_ulong};
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"sound_tone"</span>]
|
||||
</span><span class="kw">fn </span>sound_tone(frequency: c_uint, duration: c_ulong);
|
||||
<span class="attr">#[link_name = <span class="string">"sound_tone2"</span>]
|
||||
</span><span class="kw">fn </span>sound_tone2(frequency1: c_uint, duration1: c_ulong, frequency2: c_uint, duration2: c_ulong);
|
||||
<span class="attr">#[link_name = <span class="string">"sound_tone3"</span>]
|
||||
</span><span class="kw">fn </span>sound_tone3(
|
||||
frequency1: c_uint,
|
||||
duration1: c_ulong,
|
||||
frequency2: c_uint,
|
||||
duration2: c_ulong,
|
||||
frequency3: c_uint,
|
||||
duration3: c_ulong,
|
||||
);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"sound_tones"</span>]
|
||||
</span><span class="kw">fn </span>sound_tones(tones: <span class="kw-2">*const </span>c_uint);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"sound_no_tone"</span>]
|
||||
</span><span class="kw">fn </span>sound_no_tone();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"sound_playing"</span>]
|
||||
</span><span class="kw">fn </span>sound_playing() -> bool;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"sound_tones_in_ram"</span>]
|
||||
</span><span class="kw">fn </span>sound_tones_in_ram(tones: <span class="kw-2">*mut </span>c_ulong);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"sound_volume_mode"</span>]
|
||||
</span><span class="kw">fn </span>sound_volume_mode(mode: c_uchar);
|
||||
|
||||
}
|
||||
<span class="doccomment">///This is the struct to interact in a save way with the Arduboy2Audio C++ library.
|
||||
</span><span class="kw">pub struct </span>ArduboyTones {}
|
||||
<span class="kw">impl </span>ArduboyTones {
|
||||
<span class="doccomment">///Get a new instance of [ArduboyTones]
|
||||
/// ## Example
|
||||
/// ```
|
||||
/// const sound: ArduboyTones = ArduboyTones::new();
|
||||
/// ```
|
||||
</span><span class="kw">pub const fn </span>new() -> ArduboyTones {
|
||||
ArduboyTones {}
|
||||
}
|
||||
<span class="doccomment">///Play a single tone.
|
||||
///
|
||||
///- freq The frequency of the tone, in hertz.
|
||||
///- dur The duration to play the tone for, in 1024ths of a
|
||||
///second (very close to milliseconds). A duration of 0, or if not provided,
|
||||
///means play forever, or until `noTone()` is called or a new tone or
|
||||
///sequence is started.
|
||||
</span><span class="kw">pub fn </span>tone(<span class="kw-2">&</span><span class="self">self</span>, frequency: u16, duration: u32) {
|
||||
<span class="kw">unsafe </span>{ sound_tone(frequency, duration) }
|
||||
}
|
||||
<span class="doccomment">/// Play two tones in sequence.
|
||||
///
|
||||
/// - freq1,freq2 The frequency of the tone in hertz.
|
||||
/// - dur1,dur2 The duration to play the tone for, in 1024ths of a
|
||||
/// second (very close to milliseconds).
|
||||
</span><span class="kw">pub fn </span>tone2(<span class="kw-2">&</span><span class="self">self</span>, frequency1: u16, duration1: u32, frequency2: u16, duration2: u32) {
|
||||
<span class="kw">unsafe </span>{ sound_tone2(frequency1, duration1, frequency2, duration2) }
|
||||
}
|
||||
<span class="doccomment">/// Play three tones in sequence.
|
||||
///
|
||||
/// - freq1,freq2,freq3 The frequency of the tone, in hertz.
|
||||
/// - dur1,dur2,dur3 The duration to play the tone for, in 1024ths of a
|
||||
/// second (very close to milliseconds).
|
||||
</span><span class="kw">pub fn </span>tone3(
|
||||
<span class="kw-2">&</span><span class="self">self</span>,
|
||||
frequency1: u16,
|
||||
duration1: u32,
|
||||
frequency2: u16,
|
||||
duration2: u32,
|
||||
frequency3: u16,
|
||||
duration3: u32,
|
||||
) {
|
||||
<span class="kw">unsafe </span>{ sound_tone3(frequency1, duration1, frequency2, duration2, frequency3, duration3) }
|
||||
}
|
||||
<span class="doccomment">/// Play a tone sequence from frequency/duration pairs in a PROGMEM array.
|
||||
///
|
||||
/// - tones A pointer to an array of frequency/duration pairs.
|
||||
///
|
||||
/// The array must be placed in code space using `PROGMEM`.
|
||||
///
|
||||
/// See the `tone()` function for details on the frequency and duration values.
|
||||
/// A frequency of 0 for any tone means silence (a musical rest).
|
||||
///
|
||||
/// The last element of the array must be `TONES_END` or `TONES_REPEAT`.
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
/// progmem!(
|
||||
/// static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END]
|
||||
/// );
|
||||
///
|
||||
/// tones(get_tones_addr!(sound1));
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>tones(<span class="kw-2">&</span><span class="self">self</span>, tones: <span class="kw-2">*const </span>u16) {
|
||||
<span class="kw">unsafe </span>{ sound_tones(tones) }
|
||||
}
|
||||
<span class="doccomment">/// Stop playing the tone or sequence.
|
||||
///
|
||||
/// If a tone or sequence is playing, it will stop. If nothing
|
||||
/// is playing, this function will do nothing.
|
||||
</span><span class="kw">pub fn </span>no_tone(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
<span class="kw">unsafe </span>{ sound_no_tone() }
|
||||
}
|
||||
<span class="doccomment">/// Check if a tone or tone sequence is playing.
|
||||
///
|
||||
/// - return boolean `true` if playing (even if sound is muted).
|
||||
</span><span class="kw">pub fn </span>playing(<span class="kw-2">&</span><span class="self">self</span>) -> bool {
|
||||
<span class="kw">unsafe </span>{ sound_playing() }
|
||||
}
|
||||
<span class="doccomment">/// Play a tone sequence from frequency/duration pairs in an array in RAM.
|
||||
///
|
||||
/// - tones A pointer to an array of frequency/duration pairs.
|
||||
///
|
||||
/// The array must be located in RAM.
|
||||
///
|
||||
/// See the `tone()` function for details on the frequency and duration values.
|
||||
/// A frequency of 0 for any tone means silence (a musical rest).
|
||||
///
|
||||
/// The last element of the array must be `TONES_END` or `TONES_REPEAT`.
|
||||
///
|
||||
/// Example:
|
||||
///
|
||||
/// ```
|
||||
/// let sound2: [u16; 9] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END];
|
||||
/// ```
|
||||
/// Using `tones()`, with the data in PROGMEM, is normally a better
|
||||
/// choice. The only reason to use tonesInRAM() would be if dynamically
|
||||
/// altering the contents of the array is required.
|
||||
</span><span class="kw">pub fn </span>tones_in_ram(<span class="kw-2">&</span><span class="self">self</span>, tones: <span class="kw-2">*mut </span>u32) {
|
||||
<span class="kw">unsafe </span>{ sound_tones_in_ram(tones) }
|
||||
}
|
||||
<span class="doccomment">/// Set the volume to always normal, always high, or tone controlled.
|
||||
///
|
||||
/// One of the following values should be used:
|
||||
///
|
||||
/// - `VOLUME_IN_TONE` The volume of each tone will be specified in the tone
|
||||
/// itself.
|
||||
/// - `VOLUME_ALWAYS_NORMAL` All tones will play at the normal volume level.
|
||||
/// - `VOLUME_ALWAYS_HIGH` All tones will play at the high volume level.
|
||||
</span><span class="kw">pub fn </span>volume_mode(<span class="kw-2">&</span><span class="self">self</span>, mode: u8) {
|
||||
<span class="kw">unsafe </span>{ sound_volume_mode(mode) }
|
||||
}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
501
docs/doc/src/arduboy_rust/library/arduboy_tone_pitch.rs.html
Normal file
501
docs/doc/src/arduboy_rust/library/arduboy_tone_pitch.rs.html
Normal file
|
@ -0,0 +1,501 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\library\arduboy_tone_pitch.rs`."><title>arduboy_tone_pitch.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
<a href="#115" id="115">115</a>
|
||||
<a href="#116" id="116">116</a>
|
||||
<a href="#117" id="117">117</a>
|
||||
<a href="#118" id="118">118</a>
|
||||
<a href="#119" id="119">119</a>
|
||||
<a href="#120" id="120">120</a>
|
||||
<a href="#121" id="121">121</a>
|
||||
<a href="#122" id="122">122</a>
|
||||
<a href="#123" id="123">123</a>
|
||||
<a href="#124" id="124">124</a>
|
||||
<a href="#125" id="125">125</a>
|
||||
<a href="#126" id="126">126</a>
|
||||
<a href="#127" id="127">127</a>
|
||||
<a href="#128" id="128">128</a>
|
||||
<a href="#129" id="129">129</a>
|
||||
<a href="#130" id="130">130</a>
|
||||
<a href="#131" id="131">131</a>
|
||||
<a href="#132" id="132">132</a>
|
||||
<a href="#133" id="133">133</a>
|
||||
<a href="#134" id="134">134</a>
|
||||
<a href="#135" id="135">135</a>
|
||||
<a href="#136" id="136">136</a>
|
||||
<a href="#137" id="137">137</a>
|
||||
<a href="#138" id="138">138</a>
|
||||
<a href="#139" id="139">139</a>
|
||||
<a href="#140" id="140">140</a>
|
||||
<a href="#141" id="141">141</a>
|
||||
<a href="#142" id="142">142</a>
|
||||
<a href="#143" id="143">143</a>
|
||||
<a href="#144" id="144">144</a>
|
||||
<a href="#145" id="145">145</a>
|
||||
<a href="#146" id="146">146</a>
|
||||
<a href="#147" id="147">147</a>
|
||||
<a href="#148" id="148">148</a>
|
||||
<a href="#149" id="149">149</a>
|
||||
<a href="#150" id="150">150</a>
|
||||
<a href="#151" id="151">151</a>
|
||||
<a href="#152" id="152">152</a>
|
||||
<a href="#153" id="153">153</a>
|
||||
<a href="#154" id="154">154</a>
|
||||
<a href="#155" id="155">155</a>
|
||||
<a href="#156" id="156">156</a>
|
||||
<a href="#157" id="157">157</a>
|
||||
<a href="#158" id="158">158</a>
|
||||
<a href="#159" id="159">159</a>
|
||||
<a href="#160" id="160">160</a>
|
||||
<a href="#161" id="161">161</a>
|
||||
<a href="#162" id="162">162</a>
|
||||
<a href="#163" id="163">163</a>
|
||||
<a href="#164" id="164">164</a>
|
||||
<a href="#165" id="165">165</a>
|
||||
<a href="#166" id="166">166</a>
|
||||
<a href="#167" id="167">167</a>
|
||||
<a href="#168" id="168">168</a>
|
||||
<a href="#169" id="169">169</a>
|
||||
<a href="#170" id="170">170</a>
|
||||
<a href="#171" id="171">171</a>
|
||||
<a href="#172" id="172">172</a>
|
||||
<a href="#173" id="173">173</a>
|
||||
<a href="#174" id="174">174</a>
|
||||
<a href="#175" id="175">175</a>
|
||||
<a href="#176" id="176">176</a>
|
||||
<a href="#177" id="177">177</a>
|
||||
<a href="#178" id="178">178</a>
|
||||
<a href="#179" id="179">179</a>
|
||||
<a href="#180" id="180">180</a>
|
||||
<a href="#181" id="181">181</a>
|
||||
<a href="#182" id="182">182</a>
|
||||
<a href="#183" id="183">183</a>
|
||||
<a href="#184" id="184">184</a>
|
||||
<a href="#185" id="185">185</a>
|
||||
<a href="#186" id="186">186</a>
|
||||
<a href="#187" id="187">187</a>
|
||||
<a href="#188" id="188">188</a>
|
||||
<a href="#189" id="189">189</a>
|
||||
<a href="#190" id="190">190</a>
|
||||
<a href="#191" id="191">191</a>
|
||||
<a href="#192" id="192">192</a>
|
||||
<a href="#193" id="193">193</a>
|
||||
<a href="#194" id="194">194</a>
|
||||
<a href="#195" id="195">195</a>
|
||||
<a href="#196" id="196">196</a>
|
||||
<a href="#197" id="197">197</a>
|
||||
<a href="#198" id="198">198</a>
|
||||
<a href="#199" id="199">199</a>
|
||||
<a href="#200" id="200">200</a>
|
||||
<a href="#201" id="201">201</a>
|
||||
<a href="#202" id="202">202</a>
|
||||
<a href="#203" id="203">203</a>
|
||||
<a href="#204" id="204">204</a>
|
||||
<a href="#205" id="205">205</a>
|
||||
<a href="#206" id="206">206</a>
|
||||
<a href="#207" id="207">207</a>
|
||||
<a href="#208" id="208">208</a>
|
||||
<a href="#209" id="209">209</a>
|
||||
<a href="#210" id="210">210</a>
|
||||
<a href="#211" id="211">211</a>
|
||||
<a href="#212" id="212">212</a>
|
||||
<a href="#213" id="213">213</a>
|
||||
<a href="#214" id="214">214</a>
|
||||
<a href="#215" id="215">215</a>
|
||||
<a href="#216" id="216">216</a>
|
||||
<a href="#217" id="217">217</a>
|
||||
<a href="#218" id="218">218</a>
|
||||
<a href="#219" id="219">219</a>
|
||||
<a href="#220" id="220">220</a>
|
||||
<a href="#221" id="221">221</a>
|
||||
<a href="#222" id="222">222</a>
|
||||
<a href="#223" id="223">223</a>
|
||||
<a href="#224" id="224">224</a>
|
||||
<a href="#225" id="225">225</a>
|
||||
<a href="#226" id="226">226</a>
|
||||
<a href="#227" id="227">227</a>
|
||||
<a href="#228" id="228">228</a>
|
||||
<a href="#229" id="229">229</a>
|
||||
<a href="#230" id="230">230</a>
|
||||
<a href="#231" id="231">231</a>
|
||||
<a href="#232" id="232">232</a>
|
||||
<a href="#233" id="233">233</a>
|
||||
<a href="#234" id="234">234</a>
|
||||
<a href="#235" id="235">235</a>
|
||||
<a href="#236" id="236">236</a>
|
||||
<a href="#237" id="237">237</a>
|
||||
<a href="#238" id="238">238</a>
|
||||
<a href="#239" id="239">239</a>
|
||||
<a href="#240" id="240">240</a>
|
||||
<a href="#241" id="241">241</a>
|
||||
<a href="#242" id="242">242</a>
|
||||
<a href="#243" id="243">243</a>
|
||||
<a href="#244" id="244">244</a>
|
||||
<a href="#245" id="245">245</a>
|
||||
<a href="#246" id="246">246</a>
|
||||
<a href="#247" id="247">247</a>
|
||||
<a href="#248" id="248">248</a>
|
||||
<a href="#249" id="249">249</a>
|
||||
<a href="#250" id="250">250</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! A list of all tones available and used by the Sounds library Arduboy2Tones
|
||||
</span><span class="kw">pub const </span>TONES_END: u16 = <span class="number">0x8000</span>;
|
||||
<span class="kw">pub const </span>TONES_REPEAT: u16 = <span class="number">0x8001</span>;
|
||||
<span class="kw">pub const </span>TONE_HIGH_VOLUME: u16 = <span class="number">0x8000</span>;
|
||||
<span class="kw">pub const </span>VOLUME_IN_TONE: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>VOLUME_ALWAYS_NORMAL: u8 = <span class="number">1</span>;
|
||||
<span class="kw">pub const </span>VOLUME_ALWAYS_HIGH: u8 = <span class="number">2</span>;
|
||||
|
||||
<span class="kw">pub const </span>NOTE_REST: u16 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>NOTE_C0: u16 = <span class="number">16</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS0: u16 = <span class="number">17</span>;
|
||||
<span class="kw">pub const </span>NOTE_D0: u16 = <span class="number">18</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS0: u16 = <span class="number">19</span>;
|
||||
<span class="kw">pub const </span>NOTE_E0: u16 = <span class="number">21</span>;
|
||||
<span class="kw">pub const </span>NOTE_F0: u16 = <span class="number">22</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS0: u16 = <span class="number">23</span>;
|
||||
<span class="kw">pub const </span>NOTE_G0: u16 = <span class="number">25</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS0: u16 = <span class="number">26</span>;
|
||||
<span class="kw">pub const </span>NOTE_A0: u16 = <span class="number">28</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS0: u16 = <span class="number">29</span>;
|
||||
<span class="kw">pub const </span>NOTE_B0: u16 = <span class="number">31</span>;
|
||||
<span class="kw">pub const </span>NOTE_C1: u16 = <span class="number">33</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS1: u16 = <span class="number">35</span>;
|
||||
<span class="kw">pub const </span>NOTE_D1: u16 = <span class="number">37</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS1: u16 = <span class="number">39</span>;
|
||||
<span class="kw">pub const </span>NOTE_E1: u16 = <span class="number">41</span>;
|
||||
<span class="kw">pub const </span>NOTE_F1: u16 = <span class="number">44</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS1: u16 = <span class="number">46</span>;
|
||||
<span class="kw">pub const </span>NOTE_G1: u16 = <span class="number">49</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS1: u16 = <span class="number">52</span>;
|
||||
<span class="kw">pub const </span>NOTE_A1: u16 = <span class="number">55</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS1: u16 = <span class="number">58</span>;
|
||||
<span class="kw">pub const </span>NOTE_B1: u16 = <span class="number">62</span>;
|
||||
<span class="kw">pub const </span>NOTE_C2: u16 = <span class="number">65</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS2: u16 = <span class="number">69</span>;
|
||||
<span class="kw">pub const </span>NOTE_D2: u16 = <span class="number">73</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS2: u16 = <span class="number">78</span>;
|
||||
<span class="kw">pub const </span>NOTE_E2: u16 = <span class="number">82</span>;
|
||||
<span class="kw">pub const </span>NOTE_F2: u16 = <span class="number">87</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS2: u16 = <span class="number">93</span>;
|
||||
<span class="kw">pub const </span>NOTE_G2: u16 = <span class="number">98</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS2: u16 = <span class="number">104</span>;
|
||||
<span class="kw">pub const </span>NOTE_A2: u16 = <span class="number">110</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS2: u16 = <span class="number">117</span>;
|
||||
<span class="kw">pub const </span>NOTE_B2: u16 = <span class="number">123</span>;
|
||||
<span class="kw">pub const </span>NOTE_C3: u16 = <span class="number">131</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS3: u16 = <span class="number">139</span>;
|
||||
<span class="kw">pub const </span>NOTE_D3: u16 = <span class="number">147</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS3: u16 = <span class="number">156</span>;
|
||||
<span class="kw">pub const </span>NOTE_E3: u16 = <span class="number">165</span>;
|
||||
<span class="kw">pub const </span>NOTE_F3: u16 = <span class="number">175</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS3: u16 = <span class="number">185</span>;
|
||||
<span class="kw">pub const </span>NOTE_G3: u16 = <span class="number">196</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS3: u16 = <span class="number">208</span>;
|
||||
<span class="kw">pub const </span>NOTE_A3: u16 = <span class="number">220</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS3: u16 = <span class="number">233</span>;
|
||||
<span class="kw">pub const </span>NOTE_B3: u16 = <span class="number">247</span>;
|
||||
<span class="kw">pub const </span>NOTE_C4: u16 = <span class="number">262</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS4: u16 = <span class="number">277</span>;
|
||||
<span class="kw">pub const </span>NOTE_D4: u16 = <span class="number">294</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS4: u16 = <span class="number">311</span>;
|
||||
<span class="kw">pub const </span>NOTE_E4: u16 = <span class="number">330</span>;
|
||||
<span class="kw">pub const </span>NOTE_F4: u16 = <span class="number">349</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS4: u16 = <span class="number">370</span>;
|
||||
<span class="kw">pub const </span>NOTE_G4: u16 = <span class="number">392</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS4: u16 = <span class="number">415</span>;
|
||||
<span class="kw">pub const </span>NOTE_A4: u16 = <span class="number">440</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS4: u16 = <span class="number">466</span>;
|
||||
<span class="kw">pub const </span>NOTE_B4: u16 = <span class="number">494</span>;
|
||||
<span class="kw">pub const </span>NOTE_C5: u16 = <span class="number">523</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS5: u16 = <span class="number">554</span>;
|
||||
<span class="kw">pub const </span>NOTE_D5: u16 = <span class="number">587</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS5: u16 = <span class="number">622</span>;
|
||||
<span class="kw">pub const </span>NOTE_E5: u16 = <span class="number">659</span>;
|
||||
<span class="kw">pub const </span>NOTE_F5: u16 = <span class="number">698</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS5: u16 = <span class="number">740</span>;
|
||||
<span class="kw">pub const </span>NOTE_G5: u16 = <span class="number">784</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS5: u16 = <span class="number">831</span>;
|
||||
<span class="kw">pub const </span>NOTE_A5: u16 = <span class="number">880</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS5: u16 = <span class="number">932</span>;
|
||||
<span class="kw">pub const </span>NOTE_B5: u16 = <span class="number">988</span>;
|
||||
<span class="kw">pub const </span>NOTE_C6: u16 = <span class="number">1047</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS6: u16 = <span class="number">1109</span>;
|
||||
<span class="kw">pub const </span>NOTE_D6: u16 = <span class="number">1175</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS6: u16 = <span class="number">1245</span>;
|
||||
<span class="kw">pub const </span>NOTE_E6: u16 = <span class="number">1319</span>;
|
||||
<span class="kw">pub const </span>NOTE_F6: u16 = <span class="number">1397</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS6: u16 = <span class="number">1480</span>;
|
||||
<span class="kw">pub const </span>NOTE_G6: u16 = <span class="number">1568</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS6: u16 = <span class="number">1661</span>;
|
||||
<span class="kw">pub const </span>NOTE_A6: u16 = <span class="number">1760</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS6: u16 = <span class="number">1865</span>;
|
||||
<span class="kw">pub const </span>NOTE_B6: u16 = <span class="number">1976</span>;
|
||||
<span class="kw">pub const </span>NOTE_C7: u16 = <span class="number">2093</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS7: u16 = <span class="number">2218</span>;
|
||||
<span class="kw">pub const </span>NOTE_D7: u16 = <span class="number">2349</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS7: u16 = <span class="number">2489</span>;
|
||||
<span class="kw">pub const </span>NOTE_E7: u16 = <span class="number">2637</span>;
|
||||
<span class="kw">pub const </span>NOTE_F7: u16 = <span class="number">2794</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS7: u16 = <span class="number">2960</span>;
|
||||
<span class="kw">pub const </span>NOTE_G7: u16 = <span class="number">3136</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS7: u16 = <span class="number">3322</span>;
|
||||
<span class="kw">pub const </span>NOTE_A7: u16 = <span class="number">3520</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS7: u16 = <span class="number">3729</span>;
|
||||
<span class="kw">pub const </span>NOTE_B7: u16 = <span class="number">3951</span>;
|
||||
<span class="kw">pub const </span>NOTE_C8: u16 = <span class="number">4186</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS8: u16 = <span class="number">4435</span>;
|
||||
<span class="kw">pub const </span>NOTE_D8: u16 = <span class="number">4699</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS8: u16 = <span class="number">4978</span>;
|
||||
<span class="kw">pub const </span>NOTE_E8: u16 = <span class="number">5274</span>;
|
||||
<span class="kw">pub const </span>NOTE_F8: u16 = <span class="number">5588</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS8: u16 = <span class="number">5920</span>;
|
||||
<span class="kw">pub const </span>NOTE_G8: u16 = <span class="number">6272</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS8: u16 = <span class="number">6645</span>;
|
||||
<span class="kw">pub const </span>NOTE_A8: u16 = <span class="number">7040</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS8: u16 = <span class="number">7459</span>;
|
||||
<span class="kw">pub const </span>NOTE_B8: u16 = <span class="number">7902</span>;
|
||||
<span class="kw">pub const </span>NOTE_C9: u16 = <span class="number">8372</span>;
|
||||
<span class="kw">pub const </span>NOTE_CS9: u16 = <span class="number">8870</span>;
|
||||
<span class="kw">pub const </span>NOTE_D9: u16 = <span class="number">9397</span>;
|
||||
<span class="kw">pub const </span>NOTE_DS9: u16 = <span class="number">9956</span>;
|
||||
<span class="kw">pub const </span>NOTE_E9: u16 = <span class="number">10548</span>;
|
||||
<span class="kw">pub const </span>NOTE_F9: u16 = <span class="number">11175</span>;
|
||||
<span class="kw">pub const </span>NOTE_FS9: u16 = <span class="number">11840</span>;
|
||||
<span class="kw">pub const </span>NOTE_G9: u16 = <span class="number">12544</span>;
|
||||
<span class="kw">pub const </span>NOTE_GS9: u16 = <span class="number">13290</span>;
|
||||
<span class="kw">pub const </span>NOTE_A9: u16 = <span class="number">14080</span>;
|
||||
<span class="kw">pub const </span>NOTE_AS9: u16 = <span class="number">14917</span>;
|
||||
<span class="kw">pub const </span>NOTE_B9: u16 = <span class="number">15804</span>;
|
||||
|
||||
<span class="kw">pub const </span>NOTE_C0H: u16 = NOTE_C0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS0H: u16 = NOTE_CS0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D0H: u16 = NOTE_D0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS0H: u16 = NOTE_DS0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E0H: u16 = NOTE_E0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F0H: u16 = NOTE_F0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS0H: u16 = NOTE_FS0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G0H: u16 = NOTE_G0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS0H: u16 = NOTE_GS0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A0H: u16 = NOTE_A0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS0H: u16 = NOTE_AS0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B0H: u16 = NOTE_B0 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C1H: u16 = NOTE_C1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS1H: u16 = NOTE_CS1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D1H: u16 = NOTE_D1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS1H: u16 = NOTE_DS1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E1H: u16 = NOTE_E1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F1H: u16 = NOTE_F1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS1H: u16 = NOTE_FS1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G1H: u16 = NOTE_G1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS1H: u16 = NOTE_GS1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A1H: u16 = NOTE_A1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS1H: u16 = NOTE_AS1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B1H: u16 = NOTE_B1 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C2H: u16 = NOTE_C2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS2H: u16 = NOTE_CS2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D2H: u16 = NOTE_D2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS2H: u16 = NOTE_DS2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E2H: u16 = NOTE_E2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F2H: u16 = NOTE_F2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS2H: u16 = NOTE_FS2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G2H: u16 = NOTE_G2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS2H: u16 = NOTE_GS2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A2H: u16 = NOTE_A2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS2H: u16 = NOTE_AS2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B2H: u16 = NOTE_B2 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C3H: u16 = NOTE_C3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS3H: u16 = NOTE_CS3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D3H: u16 = NOTE_D3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS3H: u16 = NOTE_DS3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E3H: u16 = NOTE_E3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F3H: u16 = NOTE_F3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS3H: u16 = NOTE_F3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G3H: u16 = NOTE_G3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS3H: u16 = NOTE_GS3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A3H: u16 = NOTE_A3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS3H: u16 = NOTE_AS3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B3H: u16 = NOTE_B3 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C4H: u16 = NOTE_C4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS4H: u16 = NOTE_CS4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D4H: u16 = NOTE_D4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS4H: u16 = NOTE_DS4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E4H: u16 = NOTE_E4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F4H: u16 = NOTE_F4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS4H: u16 = NOTE_FS4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G4H: u16 = NOTE_G4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS4H: u16 = NOTE_GS4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A4H: u16 = NOTE_A4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS4H: u16 = NOTE_AS4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B4H: u16 = NOTE_B4 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C5H: u16 = NOTE_C5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS5H: u16 = NOTE_CS5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D5H: u16 = NOTE_D5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS5H: u16 = NOTE_DS5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E5H: u16 = NOTE_E5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F5H: u16 = NOTE_F5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS5H: u16 = NOTE_FS5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G5H: u16 = NOTE_G5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS5H: u16 = NOTE_GS5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A5H: u16 = NOTE_A5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS5H: u16 = NOTE_AS5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B5H: u16 = NOTE_B5 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C6H: u16 = NOTE_C6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS6H: u16 = NOTE_CS6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D6H: u16 = NOTE_D6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS6H: u16 = NOTE_DS6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E6H: u16 = NOTE_E6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F6H: u16 = NOTE_F6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS6H: u16 = NOTE_FS6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G6H: u16 = NOTE_G6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS6H: u16 = NOTE_GS6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A6H: u16 = NOTE_A6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS6H: u16 = NOTE_AS6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B6H: u16 = NOTE_B6 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C7H: u16 = NOTE_C7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS7H: u16 = NOTE_CS7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D7H: u16 = NOTE_D7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS7H: u16 = NOTE_DS7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E7H: u16 = NOTE_E7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F7H: u16 = NOTE_F7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS7H: u16 = NOTE_FS7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G7H: u16 = NOTE_G7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS7H: u16 = NOTE_GS7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A7H: u16 = NOTE_A7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS7H: u16 = NOTE_AS7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B7H: u16 = NOTE_B7 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C8H: u16 = NOTE_C8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS8H: u16 = NOTE_CS8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D8H: u16 = NOTE_D8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS8H: u16 = NOTE_DS8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E8H: u16 = NOTE_E8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F8H: u16 = NOTE_F8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS8H: u16 = NOTE_FS8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G8H: u16 = NOTE_G8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS8H: u16 = NOTE_GS8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A8H: u16 = NOTE_A8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS8H: u16 = NOTE_AS8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B8H: u16 = NOTE_B8 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_C9H: u16 = NOTE_C9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_CS9H: u16 = NOTE_CS9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_D9H: u16 = NOTE_D9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_DS9H: u16 = NOTE_DS9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_E9H: u16 = NOTE_E9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_F9H: u16 = NOTE_F9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_FS9H: u16 = NOTE_FS9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_G9H: u16 = NOTE_G9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_GS9H: u16 = NOTE_GS9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_A9H: u16 = NOTE_A9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_AS9H: u16 = NOTE_AS9 + TONE_HIGH_VOLUME;
|
||||
<span class="kw">pub const </span>NOTE_B9H: u16 = NOTE_B9 + TONE_HIGH_VOLUME;
|
||||
</code></pre></div></section></main></body></html>
|
53
docs/doc/src/arduboy_rust/library/arduino.rs.html
Normal file
53
docs/doc/src/arduboy_rust/library/arduino.rs.html
Normal file
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\library\arduino.rs`."><title>arduino.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>core::ffi::{c_long, c_ulong};
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_random_between"</span>]
|
||||
</span><span class="kw">fn </span>arduino_random_between_raw(min: c_long, max: c_long) -> c_long;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_random_less_than"</span>]
|
||||
</span><span class="kw">fn </span>arduino_random_less_than_raw(max: c_long) -> c_long;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_delay"</span>]
|
||||
</span><span class="kw">fn </span>arduino_delay(ms: c_ulong);
|
||||
}
|
||||
<span class="doccomment">/// A Arduino function to get a random number between 2 numbers
|
||||
/// seed based
|
||||
</span><span class="kw">pub fn </span>random_between(min: i32, max: i32) -> i32 {
|
||||
<span class="kw">unsafe </span>{ arduino_random_between_raw(min, max) }
|
||||
}
|
||||
<span class="doccomment">/// A Arduino function to get a random number smaller than the number given
|
||||
/// seed based
|
||||
</span><span class="kw">pub fn </span>random_less_than(max: i32) -> i32 {
|
||||
<span class="kw">unsafe </span>{ arduino_random_less_than_raw(max) }
|
||||
}
|
||||
<span class="doccomment">/// A Arduino function to pause the cpu circles for a given amount of ms
|
||||
</span><span class="kw">pub fn </span>delay(ms: u32) {
|
||||
<span class="kw">unsafe </span>{ arduino_delay(ms) }
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
23
docs/doc/src/arduboy_rust/library/c.rs.html
Normal file
23
docs/doc/src/arduboy_rust/library/c.rs.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\library\c.rs`."><title>c.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! Clib functions you can use on the Arduboy
|
||||
</span><span class="kw">use </span>core::ffi::{c_char, c_size_t};
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"strlen"</span>]
|
||||
</span><span class="kw">fn </span>c_strlen(cstr: <span class="kw-2">*const </span>c_char) -> c_size_t;
|
||||
}
|
||||
<span class="doccomment">/// A C function to get the length of a string
|
||||
</span><span class="kw">pub fn </span>strlen(cstr: <span class="kw-2">*const </span>i8) -> usize {
|
||||
<span class="kw">unsafe </span>{ c_strlen(cstr) }
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
281
docs/doc/src/arduboy_rust/library/eeprom.rs.html
Normal file
281
docs/doc/src/arduboy_rust/library/eeprom.rs.html
Normal file
|
@ -0,0 +1,281 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\library\eeprom.rs`."><title>eeprom.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
<a href="#115" id="115">115</a>
|
||||
<a href="#116" id="116">116</a>
|
||||
<a href="#117" id="117">117</a>
|
||||
<a href="#118" id="118">118</a>
|
||||
<a href="#119" id="119">119</a>
|
||||
<a href="#120" id="120">120</a>
|
||||
<a href="#121" id="121">121</a>
|
||||
<a href="#122" id="122">122</a>
|
||||
<a href="#123" id="123">123</a>
|
||||
<a href="#124" id="124">124</a>
|
||||
<a href="#125" id="125">125</a>
|
||||
<a href="#126" id="126">126</a>
|
||||
<a href="#127" id="127">127</a>
|
||||
<a href="#128" id="128">128</a>
|
||||
<a href="#129" id="129">129</a>
|
||||
<a href="#130" id="130">130</a>
|
||||
<a href="#131" id="131">131</a>
|
||||
<a href="#132" id="132">132</a>
|
||||
<a href="#133" id="133">133</a>
|
||||
<a href="#134" id="134">134</a>
|
||||
<a href="#135" id="135">135</a>
|
||||
<a href="#136" id="136">136</a>
|
||||
<a href="#137" id="137">137</a>
|
||||
<a href="#138" id="138">138</a>
|
||||
<a href="#139" id="139">139</a>
|
||||
<a href="#140" id="140">140</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>core::ffi::{c_int, c_uchar};
|
||||
|
||||
<span class="kw">pub const </span>EEPROM_STORAGE_SPACE_START: i16 = <span class="number">16</span>;
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_eeprom_read"</span>]
|
||||
</span><span class="kw">fn </span>arduboy_eeprom_read_raw(idx: c_int) -> c_uchar;
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_eeprom_update"</span>]
|
||||
</span><span class="kw">fn </span>arduboy_eeprom_update_raw(idx: c_int, val: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_eeprom_write"</span>]
|
||||
</span><span class="kw">fn </span>arduboy_eeprom_write_raw(idx: c_int, val: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_eeprom_get"</span>]
|
||||
</span><span class="kw">fn </span>arduboy_eeprom_get_raw(idx: c_int, object: <span class="kw-2">*mut </span>u8, size: usize);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_eeprom_put"</span>]
|
||||
</span><span class="kw">fn </span>arduboy_eeprom_put_raw(idx: c_int, object: <span class="kw-2">*const </span>u8, size: usize);
|
||||
}
|
||||
<span class="doccomment">///This struct to store and read structs objects to eeprom memory.
|
||||
/// ## Example
|
||||
/// ```
|
||||
/// static e: EEPROM = EEPROM::new(10);
|
||||
/// struct Scorebord {
|
||||
/// player1: u16,
|
||||
/// text: &'static str,
|
||||
/// }
|
||||
/// static mut s: Scorebord = Scorebord {
|
||||
/// player1: 0,
|
||||
/// text: "lol\0",
|
||||
/// };
|
||||
///
|
||||
/// // init inside of the setup function
|
||||
/// e.init(&mut s);
|
||||
/// ```
|
||||
</span><span class="kw">pub struct </span>EEPROM {
|
||||
start_c1: i16,
|
||||
start_c2: i16,
|
||||
idx: i16,
|
||||
}
|
||||
<span class="kw">impl </span>EEPROM {
|
||||
<span class="kw">pub const fn </span>new(<span class="kw-2">mut </span>idx: i16) -> EEPROM {
|
||||
<span class="kw">if </span>idx > <span class="number">950 </span>{
|
||||
idx = <span class="number">0
|
||||
</span>}
|
||||
EEPROM {
|
||||
start_c1: EEPROM_STORAGE_SPACE_START + idx,
|
||||
start_c2: EEPROM_STORAGE_SPACE_START + idx + <span class="number">1</span>,
|
||||
idx: EEPROM_STORAGE_SPACE_START + idx + <span class="number">2</span>,
|
||||
}
|
||||
}
|
||||
<span class="kw">pub fn </span>init<T>(<span class="kw-2">&</span><span class="self">self</span>, your_struct: <span class="kw-2">&mut </span>T) {
|
||||
<span class="kw">let </span>c1 = <span class="self">self</span>.read(<span class="self">self</span>.start_c1);
|
||||
<span class="kw">let </span>c2 = <span class="self">self</span>.read(<span class="self">self</span>.start_c2);
|
||||
|
||||
<span class="kw">if </span>c1 != <span class="string">b'Z' </span>|| c2 != <span class="string">b'D' </span>{
|
||||
<span class="self">self</span>.update(<span class="self">self</span>.start_c1, <span class="string">b'Z'</span>);
|
||||
<span class="self">self</span>.update(<span class="self">self</span>.start_c2, <span class="string">b'D'</span>);
|
||||
<span class="self">self</span>.put(your_struct);
|
||||
};
|
||||
<span class="self">self</span>.get(your_struct)
|
||||
}
|
||||
<span class="kw">fn </span>read(<span class="kw-2">&</span><span class="self">self</span>, idx: i16) -> u8 {
|
||||
<span class="kw">unsafe </span>{ arduboy_eeprom_read_raw(idx) }
|
||||
}
|
||||
<span class="kw">fn </span>update(<span class="kw-2">&</span><span class="self">self</span>, idx: i16, val: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboy_eeprom_update_raw(idx, val) }
|
||||
}
|
||||
<span class="kw">pub fn </span>get<T>(<span class="kw-2">&</span><span class="self">self</span>, your_struct: <span class="kw-2">&mut </span>T) {
|
||||
<span class="kw">let </span>pointer = your_struct <span class="kw">as </span><span class="kw-2">*mut </span>T;
|
||||
<span class="kw">let </span>object_pointer = pointer <span class="kw">as </span><span class="kw-2">*mut </span>u8;
|
||||
<span class="kw">let </span>object_size = core::mem::size_of::<T>();
|
||||
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboy_eeprom_get_raw(<span class="self">self</span>.idx, object_pointer, object_size);
|
||||
};
|
||||
}
|
||||
<span class="kw">pub fn </span>get_direct<T>(<span class="kw-2">&</span><span class="self">self</span>) -> T {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>buffer = core::mem::MaybeUninit::<T>::uninit();
|
||||
|
||||
<span class="kw">let </span>pointer = buffer.as_mut_ptr();
|
||||
<span class="kw">let </span>object_pointer = pointer <span class="kw">as </span><span class="kw-2">*mut </span>u8;
|
||||
<span class="kw">let </span>object_size = core::mem::size_of::<T>();
|
||||
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboy_eeprom_get_raw(<span class="self">self</span>.idx, object_pointer, object_size);
|
||||
};
|
||||
|
||||
<span class="kw">return unsafe </span>{ buffer.assume_init() };
|
||||
}
|
||||
<span class="kw">pub fn </span>put<T>(<span class="kw-2">&</span><span class="self">self</span>, your_struct: <span class="kw-2">&</span>T) {
|
||||
<span class="kw">let </span>pointer = your_struct <span class="kw">as </span><span class="kw-2">*const </span>T;
|
||||
<span class="kw">let </span>object_pointer = pointer <span class="kw">as </span><span class="kw-2">*const </span>u8;
|
||||
<span class="kw">let </span>object_size = core::mem::size_of::<T>();
|
||||
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboy_eeprom_put_raw(<span class="self">self</span>.idx, object_pointer, object_size);
|
||||
};
|
||||
}
|
||||
}
|
||||
<span class="doccomment">///Use this struct to store and read single bytes to/from eeprom memory.
|
||||
</span><span class="kw">pub struct </span>EEPROMBYTE {
|
||||
start_c1: i16,
|
||||
start_c2: i16,
|
||||
idx: i16,
|
||||
}
|
||||
<span class="kw">impl </span>EEPROMBYTE {
|
||||
<span class="kw">pub const fn </span>new(<span class="kw-2">mut </span>idx: i16) -> EEPROMBYTE {
|
||||
<span class="kw">if </span>idx > <span class="number">1010 </span>{
|
||||
idx = <span class="number">0
|
||||
</span>}
|
||||
EEPROMBYTE {
|
||||
start_c1: EEPROM_STORAGE_SPACE_START + idx,
|
||||
start_c2: EEPROM_STORAGE_SPACE_START + idx + <span class="number">1</span>,
|
||||
idx: EEPROM_STORAGE_SPACE_START + idx + <span class="number">2</span>,
|
||||
}
|
||||
}
|
||||
<span class="kw">pub fn </span>init(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
<span class="kw">let </span>c1 = <span class="self">self</span>.read_intern(<span class="self">self</span>.start_c1);
|
||||
<span class="kw">let </span>c2 = <span class="self">self</span>.read_intern(<span class="self">self</span>.start_c2);
|
||||
|
||||
<span class="kw">if </span>c1 != <span class="string">b'Z' </span>|| c2 != <span class="string">b'D' </span>{
|
||||
<span class="self">self</span>.update_intern(<span class="self">self</span>.start_c1, <span class="string">b'Z'</span>);
|
||||
<span class="self">self</span>.update_intern(<span class="self">self</span>.start_c2, <span class="string">b'D'</span>);
|
||||
<span class="self">self</span>.update(<span class="number">0</span>);
|
||||
};
|
||||
}
|
||||
<span class="kw">fn </span>read_intern(<span class="kw-2">&</span><span class="self">self</span>, idx: i16) -> u8 {
|
||||
<span class="kw">unsafe </span>{ arduboy_eeprom_read_raw(idx) }
|
||||
}
|
||||
<span class="kw">pub fn </span>read(<span class="kw-2">&</span><span class="self">self</span>) -> u8 {
|
||||
<span class="kw">unsafe </span>{ arduboy_eeprom_read_raw(<span class="self">self</span>.idx) }
|
||||
}
|
||||
<span class="kw">fn </span>update_intern(<span class="kw-2">&</span><span class="self">self</span>, idx: i16, val: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboy_eeprom_update_raw(idx, val) }
|
||||
}
|
||||
<span class="kw">pub fn </span>update(<span class="kw-2">&</span><span class="self">self</span>, val: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboy_eeprom_update_raw(<span class="self">self</span>.idx, val) }
|
||||
}
|
||||
<span class="kw">pub fn </span>write(<span class="kw-2">&</span><span class="self">self</span>, val: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboy_eeprom_write_raw(<span class="self">self</span>.idx, val) }
|
||||
}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
17
docs/doc/src/arduboy_rust/library/mod.rs.html
Normal file
17
docs/doc/src/arduboy_rust/library/mod.rs.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\library\mod.rs`."><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">pub mod </span>arduboy2;
|
||||
<span class="kw">pub mod </span>arduboy_tone;
|
||||
<span class="kw">pub mod </span>arduboy_tone_pitch;
|
||||
<span class="kw">pub mod </span>arduino;
|
||||
<span class="kw">pub mod </span>c;
|
||||
<span class="kw">pub mod </span>eeprom;
|
||||
<span class="kw">pub mod </span>progmem;
|
||||
<span class="kw">pub mod </span>sprites;
|
||||
</code></pre></div></section></main></body></html>
|
187
docs/doc/src/arduboy_rust/library/progmem.rs.html
Normal file
187
docs/doc/src/arduboy_rust/library/progmem.rs.html
Normal file
|
@ -0,0 +1,187 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\library\progmem.rs`."><title>progmem.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![allow(unused_imports)]
|
||||
</span><span class="doccomment">/// Create a space for Progrem variable
|
||||
/// ## Example
|
||||
/// ```
|
||||
/// //for text
|
||||
/// progmem!(
|
||||
/// static text: [u8; _] = *b"I'm a PROGMEM Text\0";
|
||||
/// );
|
||||
/// //for tone sequence
|
||||
/// progmem!(
|
||||
/// static tone: [u16; _] = [
|
||||
/// NOTE_E4, 400, NOTE_D4, 200, NOTE_C4, 400, NOTE_D4, 200, NOTE_C4, 300, NOTE_REST,
|
||||
/// ];
|
||||
/// );
|
||||
/// //for for bitmap
|
||||
/// progmem!(
|
||||
/// static image: [u8; _] = [8, 8, 0x81, 0x00, 0x12, 0x40, 0x04, 0x11, 0x00, 0x04];
|
||||
/// );
|
||||
/// ```
|
||||
</span><span class="attr">#[macro_export]
|
||||
</span><span class="macro">macro_rules! </span>progmem {
|
||||
(
|
||||
$( <span class="attr">#[<span class="macro-nonterminal">$attr</span>:meta] </span>)*
|
||||
<span class="macro-nonterminal">$v</span>:vis <span class="macro-nonterminal">$id</span>:ident <span class="macro-nonterminal">$name</span>:ident: [<span class="macro-nonterminal">$ty</span>:ty; <span class="kw">_</span>] = <span class="macro-nonterminal">$value</span>:expr;
|
||||
$(<span class="macro-nonterminal">$rest</span>:tt)*
|
||||
) => {
|
||||
$( <span class="attr">#[<span class="macro-nonterminal">$attr</span>] </span>)*
|
||||
<span class="attr">#[link_section = <span class="string">".progmem.data"</span>]
|
||||
</span><span class="macro-nonterminal">$v $id $name</span>: [<span class="macro-nonterminal">$ty</span>; <span class="macro-nonterminal">$value</span>.len()] = <span class="macro-nonterminal">$value</span>;
|
||||
<span class="macro-nonterminal">$</span><span class="macro">crate::progmem!</span>{
|
||||
$(<span class="macro-nonterminal">$rest</span>)*
|
||||
}
|
||||
};
|
||||
() => ()
|
||||
}
|
||||
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">use </span>progmem;
|
||||
<span class="doccomment">///Create a `const` raw pointer to a sprite as u8, without creating an intermediate reference.
|
||||
</span><span class="attr">#[macro_export]
|
||||
</span><span class="macro">macro_rules! </span>get_sprite_addr {
|
||||
( <span class="macro-nonterminal">$s</span>:expr ) => {
|
||||
<span class="macro">addr_of!</span>(<span class="macro-nonterminal">$s</span>) <span class="kw">as </span><span class="kw-2">*const </span>u8
|
||||
};
|
||||
}
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">use </span>get_sprite_addr;
|
||||
|
||||
<span class="doccomment">///Create a `const` raw pointer to a sprite as u16, without creating an intermediate reference.
|
||||
</span><span class="attr">#[macro_export]
|
||||
</span><span class="macro">macro_rules! </span>get_tones_addr {
|
||||
( <span class="macro-nonterminal">$s</span>:expr ) => {
|
||||
<span class="macro">addr_of!</span>(<span class="macro-nonterminal">$s</span>) <span class="kw">as </span><span class="kw-2">*const </span>u16
|
||||
};
|
||||
}
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">use </span>get_tones_addr;
|
||||
|
||||
<span class="doccomment">///Create a `const` raw pointer to a \[u8;_] that saves text, without creating an intermediate reference.
|
||||
</span><span class="attr">#[macro_export]
|
||||
</span><span class="macro">macro_rules! </span>get_string_addr {
|
||||
( <span class="macro-nonterminal">$s</span>:expr ) => {
|
||||
Pstring {
|
||||
pointer: <span class="macro">addr_of!</span>(<span class="macro-nonterminal">$s</span>) <span class="kw">as </span><span class="kw-2">*const </span>i8,
|
||||
}
|
||||
};
|
||||
}
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">use </span>get_string_addr;
|
||||
<span class="doccomment">///This is the way to go if you want print some random text
|
||||
///
|
||||
/// This doesn't waste the 2kb ram it saves to progmem (28kb)
|
||||
/// This automatically saves the given text to the Progmem.
|
||||
/// ## Example
|
||||
/// ```
|
||||
/// arduboy.print(f!(b"Random text to print"))
|
||||
/// ```
|
||||
</span><span class="attr">#[macro_export]
|
||||
</span><span class="macro">macro_rules! </span>f {
|
||||
(<span class="macro-nonterminal">$string_literal</span>:literal) => {{
|
||||
<span class="macro">progmem!</span>(
|
||||
<span class="kw">static </span>local: [u8; <span class="kw">_</span>] = <span class="kw-2">*</span><span class="macro-nonterminal">$string_literal</span>;
|
||||
);
|
||||
|
||||
<span class="macro">get_string_addr!</span>(local)
|
||||
}};
|
||||
}
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">use </span>f;
|
||||
|
||||
<span class="doccomment">/// This struct is important for the Progmem functionality.
|
||||
///
|
||||
/// Typically you will never use this by your self.
|
||||
/// It will be used by the get_string_addr macro in combination with a print command.
|
||||
</span><span class="attr">#[derive(Copy, Clone)]
|
||||
</span><span class="kw">pub struct </span>Pstring {
|
||||
<span class="kw">pub </span>pointer: <span class="kw-2">*const </span>i8,
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
359
docs/doc/src/arduboy_rust/library/sprites.rs.html
Normal file
359
docs/doc/src/arduboy_rust/library/sprites.rs.html
Normal file
|
@ -0,0 +1,359 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\library\sprites.rs`."><title>sprites.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../../src-files.js"></script><script defer src="../../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
<a href="#115" id="115">115</a>
|
||||
<a href="#116" id="116">116</a>
|
||||
<a href="#117" id="117">117</a>
|
||||
<a href="#118" id="118">118</a>
|
||||
<a href="#119" id="119">119</a>
|
||||
<a href="#120" id="120">120</a>
|
||||
<a href="#121" id="121">121</a>
|
||||
<a href="#122" id="122">122</a>
|
||||
<a href="#123" id="123">123</a>
|
||||
<a href="#124" id="124">124</a>
|
||||
<a href="#125" id="125">125</a>
|
||||
<a href="#126" id="126">126</a>
|
||||
<a href="#127" id="127">127</a>
|
||||
<a href="#128" id="128">128</a>
|
||||
<a href="#129" id="129">129</a>
|
||||
<a href="#130" id="130">130</a>
|
||||
<a href="#131" id="131">131</a>
|
||||
<a href="#132" id="132">132</a>
|
||||
<a href="#133" id="133">133</a>
|
||||
<a href="#134" id="134">134</a>
|
||||
<a href="#135" id="135">135</a>
|
||||
<a href="#136" id="136">136</a>
|
||||
<a href="#137" id="137">137</a>
|
||||
<a href="#138" id="138">138</a>
|
||||
<a href="#139" id="139">139</a>
|
||||
<a href="#140" id="140">140</a>
|
||||
<a href="#141" id="141">141</a>
|
||||
<a href="#142" id="142">142</a>
|
||||
<a href="#143" id="143">143</a>
|
||||
<a href="#144" id="144">144</a>
|
||||
<a href="#145" id="145">145</a>
|
||||
<a href="#146" id="146">146</a>
|
||||
<a href="#147" id="147">147</a>
|
||||
<a href="#148" id="148">148</a>
|
||||
<a href="#149" id="149">149</a>
|
||||
<a href="#150" id="150">150</a>
|
||||
<a href="#151" id="151">151</a>
|
||||
<a href="#152" id="152">152</a>
|
||||
<a href="#153" id="153">153</a>
|
||||
<a href="#154" id="154">154</a>
|
||||
<a href="#155" id="155">155</a>
|
||||
<a href="#156" id="156">156</a>
|
||||
<a href="#157" id="157">157</a>
|
||||
<a href="#158" id="158">158</a>
|
||||
<a href="#159" id="159">159</a>
|
||||
<a href="#160" id="160">160</a>
|
||||
<a href="#161" id="161">161</a>
|
||||
<a href="#162" id="162">162</a>
|
||||
<a href="#163" id="163">163</a>
|
||||
<a href="#164" id="164">164</a>
|
||||
<a href="#165" id="165">165</a>
|
||||
<a href="#166" id="166">166</a>
|
||||
<a href="#167" id="167">167</a>
|
||||
<a href="#168" id="168">168</a>
|
||||
<a href="#169" id="169">169</a>
|
||||
<a href="#170" id="170">170</a>
|
||||
<a href="#171" id="171">171</a>
|
||||
<a href="#172" id="172">172</a>
|
||||
<a href="#173" id="173">173</a>
|
||||
<a href="#174" id="174">174</a>
|
||||
<a href="#175" id="175">175</a>
|
||||
<a href="#176" id="176">176</a>
|
||||
<a href="#177" id="177">177</a>
|
||||
<a href="#178" id="178">178</a>
|
||||
<a href="#179" id="179">179</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//!This is the module to interact in a save way with the Sprites C++ library.
|
||||
</span><span class="kw">use </span>core::ffi::{c_int, c_uchar};
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_draw_override"</span>]
|
||||
</span><span class="kw">fn </span>arduino_draw_override_raw(x: c_int, y: c_int, bitmap: <span class="kw-2">*const </span>c_uchar, frame: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_draw_external_mask"</span>]
|
||||
</span><span class="kw">fn </span>arduino_draw_external_mask_raw(
|
||||
x: c_int,
|
||||
y: c_int,
|
||||
bitmap: <span class="kw-2">*const </span>c_uchar,
|
||||
mask: <span class="kw-2">*const </span>c_uchar,
|
||||
frame: c_uchar,
|
||||
mask_frame: c_uchar,
|
||||
);
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_draw_plus_mask"</span>]
|
||||
</span><span class="kw">fn </span>arduino_draw_plus_mask_raw(x: c_int, y: c_int, bitmap: <span class="kw-2">*const </span>c_uchar, frame: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_draw_erase"</span>]
|
||||
</span><span class="kw">fn </span>arduino_draw_erase_raw(x: c_int, y: c_int, bitmap: <span class="kw-2">*const </span>c_uchar, frame: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_draw_self_masked"</span>]
|
||||
</span><span class="kw">fn </span>arduino_draw_self_masked_raw(x: c_int, y: c_int, bitmap: <span class="kw-2">*const </span>c_uchar, frame: c_uchar);
|
||||
|
||||
}
|
||||
<span class="doccomment">/// Draw a sprite by replacing the existing content completely.
|
||||
///
|
||||
/// ### Parameters
|
||||
///
|
||||
/// - x,y The coordinates of the top left pixel location.
|
||||
/// - bitmap A pointer to the array containing the image frames.
|
||||
/// - frame The frame number of the image to draw.
|
||||
///
|
||||
/// A sprite is drawn by overwriting the pixels in the buffer with the data from the specified frame in the array. No masking is done. A bit set to 1 in the frame will set the pixel to 1 in the buffer, and a 0 in the array will set a 0 in the buffer.
|
||||
///```text
|
||||
/// image before after (# = 1, - = 0)
|
||||
///
|
||||
/// ----- ----- -----
|
||||
/// --#-- ----- --#--
|
||||
/// ##-## ----- ##-##
|
||||
/// --#-- ----- --#--
|
||||
/// ----- ----- -----
|
||||
///
|
||||
/// image before after
|
||||
///
|
||||
/// ----- ##### -----
|
||||
/// --#-- ##### --#--
|
||||
/// ##-## ##### ##-##
|
||||
/// --#-- ##### --#--
|
||||
/// ----- ##### -----
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>draw_override(x: i16, y: i16, bitmap: <span class="kw-2">*const </span>u8, frame: u8) {
|
||||
<span class="kw">unsafe </span>{ arduino_draw_override_raw(x, y, bitmap, frame) }
|
||||
}
|
||||
<span class="doccomment">///Draw a sprite using a separate image and mask array.
|
||||
///
|
||||
///Parameters
|
||||
///- x,y The coordinates of the top left pixel location.
|
||||
///- bitmap A pointer to the array containing the image frames.
|
||||
///- mask A pointer to the array containing the mask frames.
|
||||
///- frame The frame number of the image to draw.
|
||||
///- mask_frame The frame number for the mask to use (can be different from the image frame number).
|
||||
///
|
||||
///An array containing the image frames, and another array containing corresponding mask frames, are used to draw a sprite.
|
||||
///
|
||||
///For the mask array, the width and height are not included but must contain data of the same dimensions as the corresponding image array.
|
||||
///
|
||||
///Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.
|
||||
///```text
|
||||
/// image mask before after (# = 1, - = 0)
|
||||
///
|
||||
/// ----- -###- ----- -----
|
||||
/// --#-- ##### ----- --#--
|
||||
/// ##-## ##-## ----- ##-##
|
||||
/// --#-- ##### ----- --#--
|
||||
/// ----- -###- ----- -----
|
||||
///
|
||||
/// image mask before after
|
||||
///
|
||||
/// ----- -###- ##### #---#
|
||||
/// --#-- ##### ##### --#--
|
||||
/// ##-## ##### ##### ##-##
|
||||
/// --#-- ##### ##### --#--
|
||||
/// ----- -###- ##### #---#
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>draw_external_mask(
|
||||
x: i16,
|
||||
y: i16,
|
||||
bitmap: <span class="kw-2">*const </span>u8,
|
||||
mask: <span class="kw-2">*const </span>u8,
|
||||
frame: u8,
|
||||
mask_frame: u8,
|
||||
) {
|
||||
<span class="kw">unsafe </span>{ arduino_draw_external_mask_raw(x, y, bitmap, mask, frame, mask_frame) }
|
||||
}
|
||||
<span class="doccomment">///Draw a sprite using an array containing both image and mask values.
|
||||
///
|
||||
///Parameters
|
||||
/// - x,y The coordinates of the top left pixel location.
|
||||
/// - bitmap A pointer to the array containing the image/mask frames.
|
||||
/// - frame The frame number of the image to draw.
|
||||
///
|
||||
///An array containing combined image and mask data is used to draw a sprite. Bytes are given in pairs with the first byte representing the image pixels and the second byte specifying the corresponding mask. The width given in the array still specifies the image width, so each row of image and mask bytes will be twice the width value.
|
||||
///
|
||||
///Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.
|
||||
///
|
||||
///image mask before after (# = 1, - = 0)
|
||||
///```text
|
||||
/// ----- -###- ----- -----
|
||||
/// --#-- ##### ----- --#--
|
||||
/// ##-## ##-## ----- ##-##
|
||||
/// --#-- ##### ----- --#--
|
||||
/// ----- -###- ----- -----
|
||||
///
|
||||
/// image mask before after
|
||||
///
|
||||
/// ----- -###- ##### #---#
|
||||
/// --#-- ##### ##### --#--
|
||||
/// ##-## ##### ##### ##-##
|
||||
/// --#-- ##### ##### --#--
|
||||
/// ----- -###- ##### #---#
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>draw_plus_mask(x: i16, y: i16, bitmap: <span class="kw-2">*const </span>u8, frame: u8) {
|
||||
<span class="kw">unsafe </span>{ arduino_draw_plus_mask_raw(x, y, bitmap, frame) }
|
||||
}
|
||||
<span class="doccomment">///"Erase" a sprite.
|
||||
///
|
||||
///Parameters
|
||||
/// - x,y The coordinates of the top left pixel location.
|
||||
/// - bitmap A pointer to the array containing the image frames.
|
||||
/// - frame The frame number of the image to erase.
|
||||
///
|
||||
///The data from the specified frame in the array is used to erase a sprite. To "erase" a sprite, bits set to 1 in the frame will set the corresponding pixel in the buffer to 0. Frame bits set to 0 will remain unchanged in the buffer.
|
||||
///```text
|
||||
/// image before after (# = 1, - = 0)
|
||||
///
|
||||
/// ----- ----- -----
|
||||
/// --#-- ----- -----
|
||||
/// ##-## ----- -----
|
||||
/// --#-- ----- -----
|
||||
/// ----- ----- -----
|
||||
///
|
||||
/// image before after
|
||||
///
|
||||
/// ----- ##### #####
|
||||
/// --#-- ##### ##-##
|
||||
/// ##-## ##### --#--
|
||||
/// --#-- ##### ##-##
|
||||
/// ----- ##### #####
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>draw_erase(x: i16, y: i16, bitmap: <span class="kw-2">*const </span>u8, frame: u8) {
|
||||
<span class="kw">unsafe </span>{ arduino_draw_erase_raw(x, y, bitmap, frame) }
|
||||
}
|
||||
<span class="doccomment">///Draw a sprite using only the bits set to 1.
|
||||
///
|
||||
///Parameters
|
||||
/// - x,y The coordinates of the top left pixel location.
|
||||
/// - bitmap A pointer to the array containing the image frames.
|
||||
/// - frame The frame number of the image to draw.
|
||||
///
|
||||
///Bits set to 1 in the frame will be used to draw the sprite by setting the corresponding pixel in the buffer to 1. Bits set to 0 in the frame will remain unchanged in the buffer.
|
||||
///```text
|
||||
/// image before after (# = 1, - = 0)
|
||||
///
|
||||
/// ----- ----- -----
|
||||
/// --#-- ----- --#--
|
||||
/// ##-## ----- ##-##
|
||||
/// --#-- ----- --#--
|
||||
/// ----- ----- -----
|
||||
///
|
||||
/// image before after
|
||||
///
|
||||
/// ----- ##### ##### (no change because all pixels were
|
||||
/// --#-- ##### ##### already white)
|
||||
/// ##-## ##### #####
|
||||
/// --#-- ##### #####
|
||||
/// ----- ##### #####
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>draw_self_masked(x: i16, y: i16, bitmap: <span class="kw-2">*const </span>u8, frame: u8) {
|
||||
<span class="kw">unsafe </span>{ arduino_draw_self_masked_raw(x, y, bitmap, frame) }
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
53
docs/doc/src/arduboy_rust/prelude.rs.html
Normal file
53
docs/doc/src/arduboy_rust/prelude.rs.html
Normal file
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\prelude.rs`."><title>prelude.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the important one to use this library effective in your project
|
||||
</span><span class="attr">#[doc(inline)]
|
||||
</span><span class="kw">pub use </span><span class="kw">crate</span>::hardware::buttons::{<span class="self">self</span>, <span class="kw-2">*</span>};
|
||||
<span class="attr">#[doc(inline)]
|
||||
</span><span class="kw">pub use </span><span class="kw">crate</span>::hardware::led::{<span class="self">self</span>, <span class="kw-2">*</span>};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy2::{<span class="self">self</span>, <span class="kw-2">*</span>};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy_tone::{<span class="self">self</span>, ArduboyTones};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduino::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::c::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::eeprom::{EEPROM, EEPROMBYTE};
|
||||
<span class="attr">#[doc(hidden)]
|
||||
</span><span class="kw">pub use </span><span class="kw">crate</span>::library::progmem::Pstring;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::sprites;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::print::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use crate</span>::{f, get_sprite_addr, get_string_addr, get_tones_addr, progmem};
|
||||
<span class="kw">use </span>core::cmp;
|
||||
<span class="kw">pub use </span>core::ffi::{
|
||||
c_char, c_double, c_float, c_int, c_long, c_longlong, c_size_t, c_uchar, c_uint, c_ulong,
|
||||
c_ulonglong,
|
||||
};
|
||||
<span class="attr">#[doc(hidden)]
|
||||
</span><span class="kw">pub use </span>core::ptr::addr_of;
|
||||
|
||||
<span class="kw">pub fn </span>constrain<T: Ord>(x: T, a: T, b: T) -> T {
|
||||
cmp::max(cmp::min(x, b), a)
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
233
docs/doc/src/arduboy_rust/print.rs.html
Normal file
233
docs/doc/src/arduboy_rust/print.rs.html
Normal file
|
@ -0,0 +1,233 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\print.rs`."><title>print.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
<a href="#36" id="36">36</a>
|
||||
<a href="#37" id="37">37</a>
|
||||
<a href="#38" id="38">38</a>
|
||||
<a href="#39" id="39">39</a>
|
||||
<a href="#40" id="40">40</a>
|
||||
<a href="#41" id="41">41</a>
|
||||
<a href="#42" id="42">42</a>
|
||||
<a href="#43" id="43">43</a>
|
||||
<a href="#44" id="44">44</a>
|
||||
<a href="#45" id="45">45</a>
|
||||
<a href="#46" id="46">46</a>
|
||||
<a href="#47" id="47">47</a>
|
||||
<a href="#48" id="48">48</a>
|
||||
<a href="#49" id="49">49</a>
|
||||
<a href="#50" id="50">50</a>
|
||||
<a href="#51" id="51">51</a>
|
||||
<a href="#52" id="52">52</a>
|
||||
<a href="#53" id="53">53</a>
|
||||
<a href="#54" id="54">54</a>
|
||||
<a href="#55" id="55">55</a>
|
||||
<a href="#56" id="56">56</a>
|
||||
<a href="#57" id="57">57</a>
|
||||
<a href="#58" id="58">58</a>
|
||||
<a href="#59" id="59">59</a>
|
||||
<a href="#60" id="60">60</a>
|
||||
<a href="#61" id="61">61</a>
|
||||
<a href="#62" id="62">62</a>
|
||||
<a href="#63" id="63">63</a>
|
||||
<a href="#64" id="64">64</a>
|
||||
<a href="#65" id="65">65</a>
|
||||
<a href="#66" id="66">66</a>
|
||||
<a href="#67" id="67">67</a>
|
||||
<a href="#68" id="68">68</a>
|
||||
<a href="#69" id="69">69</a>
|
||||
<a href="#70" id="70">70</a>
|
||||
<a href="#71" id="71">71</a>
|
||||
<a href="#72" id="72">72</a>
|
||||
<a href="#73" id="73">73</a>
|
||||
<a href="#74" id="74">74</a>
|
||||
<a href="#75" id="75">75</a>
|
||||
<a href="#76" id="76">76</a>
|
||||
<a href="#77" id="77">77</a>
|
||||
<a href="#78" id="78">78</a>
|
||||
<a href="#79" id="79">79</a>
|
||||
<a href="#80" id="80">80</a>
|
||||
<a href="#81" id="81">81</a>
|
||||
<a href="#82" id="82">82</a>
|
||||
<a href="#83" id="83">83</a>
|
||||
<a href="#84" id="84">84</a>
|
||||
<a href="#85" id="85">85</a>
|
||||
<a href="#86" id="86">86</a>
|
||||
<a href="#87" id="87">87</a>
|
||||
<a href="#88" id="88">88</a>
|
||||
<a href="#89" id="89">89</a>
|
||||
<a href="#90" id="90">90</a>
|
||||
<a href="#91" id="91">91</a>
|
||||
<a href="#92" id="92">92</a>
|
||||
<a href="#93" id="93">93</a>
|
||||
<a href="#94" id="94">94</a>
|
||||
<a href="#95" id="95">95</a>
|
||||
<a href="#96" id="96">96</a>
|
||||
<a href="#97" id="97">97</a>
|
||||
<a href="#98" id="98">98</a>
|
||||
<a href="#99" id="99">99</a>
|
||||
<a href="#100" id="100">100</a>
|
||||
<a href="#101" id="101">101</a>
|
||||
<a href="#102" id="102">102</a>
|
||||
<a href="#103" id="103">103</a>
|
||||
<a href="#104" id="104">104</a>
|
||||
<a href="#105" id="105">105</a>
|
||||
<a href="#106" id="106">106</a>
|
||||
<a href="#107" id="107">107</a>
|
||||
<a href="#108" id="108">108</a>
|
||||
<a href="#109" id="109">109</a>
|
||||
<a href="#110" id="110">110</a>
|
||||
<a href="#111" id="111">111</a>
|
||||
<a href="#112" id="112">112</a>
|
||||
<a href="#113" id="113">113</a>
|
||||
<a href="#114" id="114">114</a>
|
||||
<a href="#115" id="115">115</a>
|
||||
<a href="#116" id="116">116</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::prelude::Pstring;
|
||||
<span class="kw">use </span>core::ffi::c_int;
|
||||
|
||||
<span class="attr">#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
|
||||
</span><span class="kw">pub enum </span>Base {
|
||||
Bin = <span class="number">2</span>,
|
||||
Oct = <span class="number">8</span>,
|
||||
Dec = <span class="number">10</span>,
|
||||
Hex = <span class="number">16</span>,
|
||||
}
|
||||
|
||||
<span class="kw">pub trait </span>Printable
|
||||
<span class="kw">where
|
||||
</span><span class="self">Self</span>: Sized,
|
||||
{
|
||||
<span class="kw">type </span>Parameters;
|
||||
|
||||
<span class="kw">fn </span>print_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters);
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters;
|
||||
|
||||
<span class="kw">fn </span>print(<span class="self">self</span>) {
|
||||
<span class="self">self</span>.print_2(<span class="self">Self</span>::default_parameters());
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Printable <span class="kw">for </span>i16 {
|
||||
<span class="kw">type </span>Parameters = Base;
|
||||
|
||||
<span class="kw">fn </span>print_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
<span class="kw">crate</span>::library::arduboy2::print_int(<span class="self">self</span>, params <span class="kw">as </span>c_int);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {
|
||||
Base::Dec
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Printable <span class="kw">for </span>u16 {
|
||||
<span class="kw">type </span>Parameters = Base;
|
||||
|
||||
<span class="kw">fn </span>print_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
<span class="kw">crate</span>::library::arduboy2::print_unsigned_int(<span class="self">self</span>, params <span class="kw">as </span>c_int);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {
|
||||
Base::Dec
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Printable <span class="kw">for </span>i32 {
|
||||
<span class="kw">type </span>Parameters = Base;
|
||||
|
||||
<span class="kw">fn </span>print_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
<span class="kw">crate</span>::library::arduboy2::print_long(<span class="self">self</span>, params <span class="kw">as </span>c_int);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {
|
||||
Base::Dec
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Printable <span class="kw">for </span>u32 {
|
||||
<span class="kw">type </span>Parameters = Base;
|
||||
|
||||
<span class="kw">fn </span>print_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
<span class="kw">crate</span>::library::arduboy2::print_unsigned_long(<span class="self">self</span>, params <span class="kw">as </span>c_int);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {
|
||||
Base::Dec
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Printable <span class="kw">for </span><span class="kw-2">&</span>[u8] {
|
||||
<span class="kw">type </span>Parameters = ();
|
||||
|
||||
<span class="kw">fn </span>print_2(<span class="self">self</span>, _params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
<span class="kw">crate</span>::library::arduboy2::print_chars(<span class="self">self </span><span class="kw">as </span><span class="kw-2">*const </span>[u8] <span class="kw">as </span><span class="kw-2">*const </span>i8);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Printable <span class="kw">for </span><span class="kw-2">&</span>str {
|
||||
<span class="kw">type </span>Parameters = ();
|
||||
|
||||
<span class="kw">fn </span>print_2(<span class="self">self</span>, _params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
<span class="kw">crate</span>::library::arduboy2::print_chars(<span class="self">self</span>.as_bytes() <span class="kw">as </span><span class="kw-2">*const </span>[u8] <span class="kw">as </span><span class="kw-2">*const </span>i8);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Printable <span class="kw">for </span>Pstring {
|
||||
<span class="kw">type </span>Parameters = ();
|
||||
|
||||
<span class="kw">fn </span>print_2(<span class="self">self</span>, _params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
<span class="kw">crate</span>::library::arduboy2::print_chars_progmem(<span class="self">self</span>.pointer);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
71
docs/doc/src/panic_halt/lib.rs.html
Normal file
71
docs/doc/src/panic_halt/lib.rs.html
Normal file
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `C:\Users\zenn\.cargo\registry\src\index.crates.io-6f17d22bba15001f\panic-halt-0.2.0\src\lib.rs`."><title>lib.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="panic_halt" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../static.files/src-script-3280b574d94e47b4.js"></script><script defer src="../../src-files.js"></script><script defer src="../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc src"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"></nav><main><nav class="sub"><a class="sub-logo-container" href="../../panic_halt/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="example-wrap"><div data-nosnippet><pre class="src-line-numbers"><a href="#1" id="1">1</a>
|
||||
<a href="#2" id="2">2</a>
|
||||
<a href="#3" id="3">3</a>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
<a href="#9" id="9">9</a>
|
||||
<a href="#10" id="10">10</a>
|
||||
<a href="#11" id="11">11</a>
|
||||
<a href="#12" id="12">12</a>
|
||||
<a href="#13" id="13">13</a>
|
||||
<a href="#14" id="14">14</a>
|
||||
<a href="#15" id="15">15</a>
|
||||
<a href="#16" id="16">16</a>
|
||||
<a href="#17" id="17">17</a>
|
||||
<a href="#18" id="18">18</a>
|
||||
<a href="#19" id="19">19</a>
|
||||
<a href="#20" id="20">20</a>
|
||||
<a href="#21" id="21">21</a>
|
||||
<a href="#22" id="22">22</a>
|
||||
<a href="#23" id="23">23</a>
|
||||
<a href="#24" id="24">24</a>
|
||||
<a href="#25" id="25">25</a>
|
||||
<a href="#26" id="26">26</a>
|
||||
<a href="#27" id="27">27</a>
|
||||
<a href="#28" id="28">28</a>
|
||||
<a href="#29" id="29">29</a>
|
||||
<a href="#30" id="30">30</a>
|
||||
<a href="#31" id="31">31</a>
|
||||
<a href="#32" id="32">32</a>
|
||||
<a href="#33" id="33">33</a>
|
||||
<a href="#34" id="34">34</a>
|
||||
<a href="#35" id="35">35</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! Set the panicking behavior to halt
|
||||
//!
|
||||
//! This crate contains an implementation of `panic_fmt` that simply halt in an infinite loop.
|
||||
//!
|
||||
//! # Usage
|
||||
//!
|
||||
//! ``` ignore
|
||||
//! #![no_std]
|
||||
//!
|
||||
//! extern crate panic_halt;
|
||||
//!
|
||||
//! fn main() {
|
||||
//! panic!("argument is ignored");
|
||||
//! }
|
||||
//! ```
|
||||
//!
|
||||
//! # Breakable symbols
|
||||
//!
|
||||
//! With the panic handler being `#[inline(never)]` the symbol `rust_begin_unwind` will be
|
||||
//! available to place a breakpoint on to halt when a panic is happening.
|
||||
|
||||
</span><span class="attr">#![deny(missing_docs)]
|
||||
#![deny(warnings)]
|
||||
#![no_std]
|
||||
|
||||
</span><span class="kw">use </span>core::panic::PanicInfo;
|
||||
<span class="kw">use </span>core::sync::atomic::{<span class="self">self</span>, Ordering};
|
||||
|
||||
<span class="attr">#[inline(never)]
|
||||
#[panic_handler]
|
||||
</span><span class="kw">fn </span>panic(_info: <span class="kw-2">&</span>PanicInfo) -> ! {
|
||||
<span class="kw">loop </span>{
|
||||
atomic::compiler_fence(Ordering::SeqCst);
|
||||
}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
Loading…
Add table
Add a link
Reference in a new issue