new docs and new readme
This commit is contained in:
parent
a54fa90edc
commit
a2889273dd
1588 changed files with 3011 additions and 23670 deletions
|
@ -1,4 +1,4 @@
|
|||
<!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>
|
||||
<!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-fa3bb1812debf86c.css"><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.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.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>
|
||||
|
@ -120,18 +120,18 @@
|
|||
|
||||
<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">crate</span>::libraries::arduboy2_library::binding::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">crate</span>::libraries::arduboy2_library::binding::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">crate</span>::libraries::arduboy2_library::binding::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">crate</span>::libraries::arduboy2_library::binding::not_pressed(<span class="self">self</span>.flag_set)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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>
|
||||
<!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-fa3bb1812debf86c.css"><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.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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>
|
||||
<!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-fa3bb1812debf86c.css"><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.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.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.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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>
|
||||
<!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-fa3bb1812debf86c.css"><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.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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>
|
||||
|
@ -35,10 +35,6 @@
|
|||
<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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![cfg(target_arch = <span class="string">"avr"</span>)]
|
||||
#![no_std]
|
||||
#![feature(c_size_t)]
|
||||
|
@ -68,16 +64,12 @@
|
|||
|
||||
</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">mod </span>libraries;
|
||||
<span class="kw">pub mod </span>prelude;
|
||||
<span class="kw">mod </span>print;
|
||||
|
||||
<span class="attr">#[doc(inline)]
|
||||
</span><span class="kw">pub extern crate </span>heapless;
|
||||
<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_tones::{<span class="self">self</span>, ArduboyTones};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::ardvoice::{<span class="self">self</span>, ArdVoice};
|
||||
<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::{arduino, c, sprites};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduboyfx::{<span class="self">self</span>};
|
||||
<span class="kw">pub mod </span>serial_print;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::{
|
||||
arduboy2_library, arduboy_tones_library, arduboyfx_library, arduino_system, ardvoice_library,
|
||||
};
|
||||
</code></pre></div></section></main></body></html>
|
File diff suppressed because it is too large
Load diff
|
@ -1,311 +0,0 @@
|
|||
<!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>
|
||||
<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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//!This is the Module to interact in a save way with the ArduboyTones C++ library.
|
||||
//!
|
||||
//! You will need to uncomment the ArduboyTones_Library in the import_config.h file.
|
||||
</span><span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy_tone_pitch;
|
||||
<span class="kw">pub mod </span>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 ArduboyTones C++ library.
|
||||
///
|
||||
/// You will need to uncomment the ArduboyTones_Library in the import_config.h file.
|
||||
</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>
|
|
@ -1,501 +0,0 @@
|
|||
<!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\tone_pitch.rs`."><title>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>
|
|
@ -1,501 +0,0 @@
|
|||
<!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>
|
|
@ -1,315 +0,0 @@
|
|||
<!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_tones.rs`."><title>arduboy_tones.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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//!This is the Module to interact in a save way with the ArduboyTones C++ library.
|
||||
//!
|
||||
//! You will need to uncomment the ArduboyTones_Library in the import_config.h file.
|
||||
</span><span class="kw">pub mod </span>tones_pitch;
|
||||
|
||||
<span class="kw">use </span>core::ffi::{c_uchar, c_uint, c_ulong};
|
||||
|
||||
<span class="doccomment">///This is the struct to interact in a save way with the ArduboyTones C++ library.
|
||||
///
|
||||
/// You will need to uncomment the ArduboyTones_Library in the import_config.h file.
|
||||
</span><span class="kw">pub struct </span>ArduboyTones {}
|
||||
<span class="kw">impl </span>ArduboyTones {
|
||||
<span class="doccomment">///Get a new instance of [ArduboyTones]
|
||||
/// ## Example
|
||||
/// ```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// 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:
|
||||
/// ```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// const sound:ArduboyTones=ArduboyTones::new();
|
||||
/// progmem!(
|
||||
/// static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END];
|
||||
/// );
|
||||
///
|
||||
/// sound.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:
|
||||
///
|
||||
/// ```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// use arduboy_tones::tones_pitch::*;
|
||||
/// 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) }
|
||||
}
|
||||
}
|
||||
<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);
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,501 +0,0 @@
|
|||
<!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_tones\tone_pitch.rs`."><title>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>
|
|
@ -1,501 +0,0 @@
|
|||
<!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_tones\tones_pitch.rs`."><title>tones_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>
|
|
@ -1,19 +0,0 @@
|
|||
<!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\arduboyfx.rs`."><title>arduboyfx.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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the Module to interact in a save way with the ArduboyFX C++ library.
|
||||
//!
|
||||
//! You will need to uncomment the ArduboyFX_Library in the import_config.h file.
|
||||
</span><span class="kw">pub mod </span>fx_consts;
|
||||
<span class="kw">mod </span>drawable_number;
|
||||
<span class="kw">pub use </span>drawable_number::DrawableNumber;
|
||||
<span class="kw">mod </span>drawable_string;
|
||||
<span class="kw">pub use </span>drawable_string::DrawableString;
|
||||
<span class="kw">pub mod </span>fx;
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,97 +0,0 @@
|
|||
<!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\arduboyfx\arduboyfx_consts.rs`."><title>arduboyfx_consts.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>
|
||||
</pre></div><pre class="rust"><code><span class="kw">pub const </span>dbfWhiteBlack: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbfInvert: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbfBlack: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbfReverseBlack: u8 = <span class="number">3</span>;
|
||||
<span class="kw">pub const </span>dbfMasked: u8 = <span class="number">4</span>;
|
||||
<span class="kw">pub const </span>dbfFlip: u8 = <span class="number">5</span>;
|
||||
<span class="kw">pub const </span>dbfExtraRow: u8 = <span class="number">7</span>;
|
||||
<span class="kw">pub const </span>dbfEndFrame: u8 = <span class="number">6</span>;
|
||||
<span class="kw">pub const </span>dbfLastFrame: u8 = <span class="number">7</span>;
|
||||
<span class="kw">pub const </span>dbmBlack: u8 = (<span class="number">1 </span><< dbfReverseBlack) | (<span class="number">1 </span><< dbfBlack) | (<span class="number">1 </span><< dbfWhiteBlack);
|
||||
<span class="kw">pub const </span>dbmWhite: u8 = (<span class="number">1 </span><< dbfWhiteBlack);
|
||||
<span class="kw">pub const </span>dbmInvert: u8 = (<span class="number">1 </span><< dbfInvert);
|
||||
<span class="kw">pub const </span>dbmFlip: u8 = (<span class="number">1 </span><< dbfFlip);
|
||||
<span class="kw">pub const </span>dbmNormal: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbmOverwrite: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbmReverse: u8 = (<span class="number">1 </span><< dbfReverseBlack);
|
||||
<span class="kw">pub const </span>dbmMasked: u8 = (<span class="number">1 </span><< dbfMasked);
|
||||
<span class="kw">pub const </span>dbmEndFrame: u8 = (<span class="number">1 </span><< dbfEndFrame);
|
||||
<span class="kw">pub const </span>dbmLastFrame: u8 = (<span class="number">1 </span><< dbfLastFrame);
|
||||
<span class="kw">pub const </span>dcfWhiteBlack: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dcfInvert: u8 = <span class="number">1</span>;
|
||||
<span class="kw">pub const </span>dcfBlack: u8 = <span class="number">2</span>;
|
||||
<span class="kw">pub const </span>dcfReverseBlack: u8 = <span class="number">3</span>;
|
||||
<span class="kw">pub const </span>dcfMasked: u8 = <span class="number">4</span>;
|
||||
<span class="kw">pub const </span>dcfProportional: u8 = <span class="number">5</span>;
|
||||
<span class="kw">pub const </span>dcmBlack: u8 = (<span class="number">1 </span><< dcfReverseBlack) | (<span class="number">1 </span><< dcfBlack) | (<span class="number">1 </span><< dcfWhiteBlack);
|
||||
<span class="kw">pub const </span>dcmWhite: u8 = (<span class="number">1 </span><< dcfWhiteBlack);
|
||||
<span class="kw">pub const </span>dcmInvert: u8 = (<span class="number">1 </span><< dcfInvert);
|
||||
<span class="kw">pub const </span>dcmNormal: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dcmOverwrite: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dcmReverse: u8 = (<span class="number">1 </span><< dcfReverseBlack);
|
||||
<span class="kw">pub const </span>dcmMasked: u8 = (<span class="number">1 </span><< dcfMasked);
|
||||
<span class="kw">pub const </span>dcmProportional: u8 = (<span class="number">1 </span><< dcfProportional);
|
||||
<span class="kw">pub const </span>FX_VECTOR_KEY_VALUE: u16 = <span class="number">0x9518</span>;
|
||||
<span class="kw">pub const </span>FX_DATA_VECTOR_KEY_POINTER: u16 = <span class="number">0x0014</span>;
|
||||
<span class="kw">pub const </span>FX_DATA_VECTOR_PAGE_POINTER: u16 = <span class="number">0x0016</span>;
|
||||
<span class="kw">pub const </span>FX_SAVE_VECTOR_KEY_POINTER: u16 = <span class="number">0x0018</span>;
|
||||
<span class="kw">pub const </span>FX_SAVE_VECTOR_PAGE_POINTER: u16 = <span class="number">0x001A</span>;
|
||||
<span class="kw">pub const </span>SFC_JEDEC_ID: u8 = <span class="number">0x9F</span>;
|
||||
<span class="kw">pub const </span>SFC_READSTATUS1: u8 = <span class="number">0x05</span>;
|
||||
<span class="kw">pub const </span>SFC_READSTATUS2: u8 = <span class="number">0x35</span>;
|
||||
<span class="kw">pub const </span>SFC_READSTATUS3: u8 = <span class="number">0x15</span>;
|
||||
<span class="kw">pub const </span>SFC_READ: u8 = <span class="number">0x03</span>;
|
||||
<span class="kw">pub const </span>SFC_WRITE_ENABLE: u8 = <span class="number">0x06</span>;
|
||||
<span class="kw">pub const </span>SFC_WRITE: u8 = <span class="number">0x02</span>;
|
||||
<span class="kw">pub const </span>SFC_ERASE: u8 = <span class="number">0x20</span>;
|
||||
<span class="kw">pub const </span>SFC_RELEASE_POWERDOWN: u8 = <span class="number">0xAB</span>;
|
||||
<span class="kw">pub const </span>SFC_POWERDOWN: u8 = <span class="number">0xB9</span>;
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,77 +0,0 @@
|
|||
<!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\arduboyfx\drawable_number.rs`."><title>drawable_number.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>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>core::ffi::{c_char, c_int, c_long, c_uint, c_ulong};
|
||||
<span class="kw">pub trait </span>DrawableNumber
|
||||
<span class="kw">where
|
||||
</span><span class="self">Self</span>: Sized,
|
||||
{
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>, digits: i8);
|
||||
}
|
||||
<span class="kw">impl </span>DrawableNumber <span class="kw">for </span>i16 {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>, digits: i8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_draw_number_i16(<span class="self">self</span>, digits) }
|
||||
}
|
||||
}
|
||||
<span class="kw">impl </span>DrawableNumber <span class="kw">for </span>u16 {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>, digits: i8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_draw_number_u16(<span class="self">self</span>, digits) }
|
||||
}
|
||||
}
|
||||
<span class="kw">impl </span>DrawableNumber <span class="kw">for </span>i32 {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>, digits: i8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_draw_number_i32(<span class="self">self</span>, digits) }
|
||||
}
|
||||
}
|
||||
<span class="kw">impl </span>DrawableNumber <span class="kw">for </span>u32 {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>, digits: i8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_draw_number_u32(<span class="self">self</span>, digits) }
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_number_i16"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_number_i16(n: c_int, digits: c_char);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_number_u16"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_number_u16(n: c_uint, digits: c_char);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_number_i32"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_number_i32(n: c_long, digits: c_char);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_number_u32"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_number_u32(n: c_ulong, digits: c_char);
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,107 +0,0 @@
|
|||
<!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\arduboyfx\drawable_string.rs`."><title>drawable_string.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>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use </span>core::ffi::{c_char, c_uchar, c_ulong};
|
||||
<span class="kw">use </span><span class="kw">crate</span>::library::progmem::Pstring;
|
||||
|
||||
<span class="kw">pub trait </span>DrawableString
|
||||
<span class="kw">where
|
||||
</span><span class="self">Self</span>: Sized,
|
||||
{
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>);
|
||||
}
|
||||
<span class="kw">impl </span>DrawableString <span class="kw">for </span><span class="kw-2">&</span>[u8] {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>) {
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboyfx_draw_string(<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">impl </span>DrawableString <span class="kw">for </span><span class="kw-2">&</span>str {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>) {
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboyfx_draw_string(<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">impl</span><<span class="kw">const </span>N: usize> DrawableString <span class="kw">for </span><span class="kw">crate</span>::heapless::String<N> {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>) {
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboyfx_draw_string(<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">impl </span>DrawableString <span class="kw">for </span>Pstring {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>) {
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboyfx_draw_string_buffer(<span class="self">self</span>.pointer <span class="kw">as </span><span class="kw-2">*const </span>u8);
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="kw">impl </span>DrawableString <span class="kw">for </span>u32 {
|
||||
<span class="kw">fn </span>draw(<span class="self">self</span>) {
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboyfx_draw_string_fx(<span class="self">self</span>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_string_fx"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_string_fx(address: c_ulong);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_string_buffer"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_string_buffer(buffer: <span class="kw-2">*const </span>c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_string"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_string(cstr: <span class="kw-2">*const </span>c_char);
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,283 +0,0 @@
|
|||
<!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\arduboyfx\fx.rs`."><title>fx.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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! Functions given by the ArduboyFX library.
|
||||
//!
|
||||
//! You can use the 'FX::' module to access the functions after the import of the prelude
|
||||
//! ```
|
||||
//! use arduboy_rust::prelude::*;
|
||||
//!
|
||||
//! fn setup() {
|
||||
//! FX::begin()
|
||||
//! }
|
||||
//! ```
|
||||
//! You will need to uncomment the ArduboyFX_Library in the import_config.h file.
|
||||
</span><span class="attr">#![allow(non_upper_case_globals)]
|
||||
</span><span class="kw">use </span><span class="kw">super</span>::drawable_number::DrawableNumber;
|
||||
<span class="kw">use </span><span class="kw">super</span>::drawable_string::DrawableString;
|
||||
<span class="kw">use </span>core::ffi::{c_int, c_size_t, c_uchar, c_uint, c_ulong};
|
||||
<span class="kw">pub fn </span>begin() {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_begin() }
|
||||
}
|
||||
<span class="kw">pub fn </span>begin_data(datapage: u16) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_begin_data(datapage) }
|
||||
}
|
||||
<span class="kw">pub fn </span>begin_data_save(datapage: u16, savepage: u16) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_begin_data_save(datapage, savepage) }
|
||||
}
|
||||
<span class="kw">pub fn </span>display() {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_display() }
|
||||
}
|
||||
<span class="kw">pub fn </span>display_clear() {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_display_clear() }
|
||||
}
|
||||
<span class="kw">pub fn </span>draw_number(n: <span class="kw">impl </span>DrawableNumber, digits: i8) {
|
||||
n.draw(digits)
|
||||
}
|
||||
<span class="kw">pub fn </span>draw_string(string: <span class="kw">impl </span>DrawableString) {
|
||||
string.draw()
|
||||
}
|
||||
<span class="kw">pub fn </span>draw_char(c: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_draw_char(c) }
|
||||
}
|
||||
<span class="kw">pub fn </span>draw_bitmap(x: i16, y: i16, address: u32, frame: u8, mode: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_draw_bitmap(x, y, address, frame, mode) }
|
||||
}
|
||||
<span class="kw">pub fn </span>draw_frame(address: u32) -> u32 {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_draw_frame(address) }
|
||||
}
|
||||
<span class="kw">pub fn </span>draw_loaded_frame() -> u8 {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_draw_loaded_frame() }
|
||||
}
|
||||
<span class="kw">pub fn </span>set_frame(frame: u32, repeat: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_set_frame(frame, repeat) }
|
||||
}
|
||||
<span class="kw">pub fn </span>read_data_array(
|
||||
address: u32,
|
||||
index: u8,
|
||||
offset: u8,
|
||||
element_size: u8,
|
||||
buffer: <span class="kw-2">*const </span>u8,
|
||||
length: usize,
|
||||
) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_read_data_array(address, index, offset, element_size, buffer, length) }
|
||||
}
|
||||
<span class="kw">pub fn </span>set_cursor(x: i16, y: i16) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_set_cursor(x, y) }
|
||||
}
|
||||
<span class="kw">pub fn </span>set_cursor_x(x: i16) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_set_cursor_x(x) }
|
||||
}
|
||||
<span class="kw">pub fn </span>set_cursor_y(y: i16) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_set_cursor_y(y) }
|
||||
}
|
||||
<span class="kw">pub fn </span>set_cursor_range(left: i16, wrap: i16) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_set_cursor_range(left, wrap) }
|
||||
}
|
||||
<span class="kw">pub fn </span>set_font(address: u32, mode: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_set_font(address, mode) }
|
||||
}
|
||||
<span class="kw">pub fn </span>set_font_mode(mode: u8) {
|
||||
<span class="kw">unsafe </span>{ arduboyfx_set_font_mode(mode) };
|
||||
}
|
||||
<span class="kw">pub fn </span>load_game_state<T>(your_struct: <span class="kw-2">&mut </span>T) -> u8 {
|
||||
<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>{ arduboyfx_load_game_state(object_pointer, object_size) }
|
||||
}
|
||||
<span class="kw">pub fn </span>save_game_state<T>(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>{ arduboyfx_save_game_state(object_pointer, object_size) }
|
||||
}
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_begin"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_begin();
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_begin_data"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_begin_data(datapage: c_uint);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_begin_data_save"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_begin_data_save(datapage: c_uint, savepage: c_uint);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_display"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_display();
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_display_clear"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_display_clear();
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_read_data_array"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_read_data_array(
|
||||
address: c_ulong,
|
||||
index: c_uchar,
|
||||
offset: c_uchar,
|
||||
element_size: c_uchar,
|
||||
buffer: <span class="kw-2">*const </span>c_uchar,
|
||||
length: c_size_t,
|
||||
);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_bitmap"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_bitmap(x: c_int, y: c_int, address: c_ulong, frame: c_uchar, mode: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_set_frame"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_set_frame(frame: c_ulong, repeat: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_frame"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_frame(address: c_ulong) -> c_ulong;
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_loaded_frame"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_loaded_frame() -> c_uchar;
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_set_cursor"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_set_cursor(x: c_int, y: c_int);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_set_cursor_x"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_set_cursor_x(x: c_int);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_set_cursor_y"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_set_cursor_y(y: c_int);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_set_font"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_set_font(address: c_ulong, mode: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_set_font_mode"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_set_font_mode(mode: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_set_cursor_range"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_set_cursor_range(left: c_int, wrap: c_int);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_draw_char"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_draw_char(c: c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_load_game_state"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_load_game_state(object: <span class="kw-2">*mut </span>u8, size: usize) -> u8;
|
||||
<span class="attr">#[link_name = <span class="string">"arduboyfx_save_game_state"</span>]
|
||||
</span><span class="kw">fn </span>arduboyfx_save_game_state(object: <span class="kw-2">*const </span>u8, size: usize);
|
||||
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,123 +0,0 @@
|
|||
<!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\arduboyfx\fx_consts.rs`."><title>fx_consts.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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! Consts given by the ArduboyFX library.
|
||||
//!
|
||||
//! You can use the `use arduboyfx::fx_consts::*;` module to access the consts.
|
||||
//! ```
|
||||
//! use arduboy_rust::prelude::*;
|
||||
//! use arduboyfx::fx_consts::*;
|
||||
//!
|
||||
//! fn setup(){
|
||||
//! let demo = dbmBlack;
|
||||
//! }
|
||||
//!
|
||||
//! ```
|
||||
</span><span class="attr">#![allow(non_upper_case_globals)]
|
||||
</span><span class="kw">pub const </span>dbfWhiteBlack: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbfInvert: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbfBlack: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbfReverseBlack: u8 = <span class="number">3</span>;
|
||||
<span class="kw">pub const </span>dbfMasked: u8 = <span class="number">4</span>;
|
||||
<span class="kw">pub const </span>dbfFlip: u8 = <span class="number">5</span>;
|
||||
<span class="kw">pub const </span>dbfExtraRow: u8 = <span class="number">7</span>;
|
||||
<span class="kw">pub const </span>dbfEndFrame: u8 = <span class="number">6</span>;
|
||||
<span class="kw">pub const </span>dbfLastFrame: u8 = <span class="number">7</span>;
|
||||
<span class="kw">pub const </span>dbmBlack: u8 = (<span class="number">1 </span><< dbfReverseBlack) | (<span class="number">1 </span><< dbfBlack) | (<span class="number">1 </span><< dbfWhiteBlack);
|
||||
<span class="kw">pub const </span>dbmWhite: u8 = <span class="number">1 </span><< dbfWhiteBlack;
|
||||
<span class="kw">pub const </span>dbmInvert: u8 = <span class="number">1 </span><< dbfInvert;
|
||||
<span class="kw">pub const </span>dbmFlip: u8 = <span class="number">1 </span><< dbfFlip;
|
||||
<span class="kw">pub const </span>dbmNormal: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbmOverwrite: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dbmReverse: u8 = <span class="number">1 </span><< dbfReverseBlack;
|
||||
<span class="kw">pub const </span>dbmMasked: u8 = <span class="number">1 </span><< dbfMasked;
|
||||
<span class="kw">pub const </span>dbmEndFrame: u8 = <span class="number">1 </span><< dbfEndFrame;
|
||||
<span class="kw">pub const </span>dbmLastFrame: u8 = <span class="number">1 </span><< dbfLastFrame;
|
||||
<span class="kw">pub const </span>dcfWhiteBlack: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dcfInvert: u8 = <span class="number">1</span>;
|
||||
<span class="kw">pub const </span>dcfBlack: u8 = <span class="number">2</span>;
|
||||
<span class="kw">pub const </span>dcfReverseBlack: u8 = <span class="number">3</span>;
|
||||
<span class="kw">pub const </span>dcfMasked: u8 = <span class="number">4</span>;
|
||||
<span class="kw">pub const </span>dcfProportional: u8 = <span class="number">5</span>;
|
||||
<span class="kw">pub const </span>dcmBlack: u8 = (<span class="number">1 </span><< dcfReverseBlack) | (<span class="number">1 </span><< dcfBlack) | (<span class="number">1 </span><< dcfWhiteBlack);
|
||||
<span class="kw">pub const </span>dcmWhite: u8 = <span class="number">1 </span><< dcfWhiteBlack;
|
||||
<span class="kw">pub const </span>dcmInvert: u8 = <span class="number">1 </span><< dcfInvert;
|
||||
<span class="kw">pub const </span>dcmNormal: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dcmOverwrite: u8 = <span class="number">0</span>;
|
||||
<span class="kw">pub const </span>dcmReverse: u8 = <span class="number">1 </span><< dcfReverseBlack;
|
||||
<span class="kw">pub const </span>dcmMasked: u8 = <span class="number">1 </span><< dcfMasked;
|
||||
<span class="kw">pub const </span>dcmProportional: u8 = <span class="number">1 </span><< dcfProportional;
|
||||
<span class="kw">pub const </span>FX_VECTOR_KEY_VALUE: u16 = <span class="number">0x9518</span>;
|
||||
<span class="kw">pub const </span>FX_DATA_VECTOR_KEY_POINTER: u16 = <span class="number">0x0014</span>;
|
||||
<span class="kw">pub const </span>FX_DATA_VECTOR_PAGE_POINTER: u16 = <span class="number">0x0016</span>;
|
||||
<span class="kw">pub const </span>FX_SAVE_VECTOR_KEY_POINTER: u16 = <span class="number">0x0018</span>;
|
||||
<span class="kw">pub const </span>FX_SAVE_VECTOR_PAGE_POINTER: u16 = <span class="number">0x001A</span>;
|
||||
<span class="kw">pub const </span>SFC_JEDEC_ID: u8 = <span class="number">0x9F</span>;
|
||||
<span class="kw">pub const </span>SFC_READSTATUS1: u8 = <span class="number">0x05</span>;
|
||||
<span class="kw">pub const </span>SFC_READSTATUS2: u8 = <span class="number">0x35</span>;
|
||||
<span class="kw">pub const </span>SFC_READSTATUS3: u8 = <span class="number">0x15</span>;
|
||||
<span class="kw">pub const </span>SFC_READ: u8 = <span class="number">0x03</span>;
|
||||
<span class="kw">pub const </span>SFC_WRITE_ENABLE: u8 = <span class="number">0x06</span>;
|
||||
<span class="kw">pub const </span>SFC_WRITE: u8 = <span class="number">0x02</span>;
|
||||
<span class="kw">pub const </span>SFC_ERASE: u8 = <span class="number">0x20</span>;
|
||||
<span class="kw">pub const </span>SFC_RELEASE_POWERDOWN: u8 = <span class="number">0xAB</span>;
|
||||
<span class="kw">pub const </span>SFC_POWERDOWN: u8 = <span class="number">0xB9</span>;
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,55 +0,0 @@
|
|||
<!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>
|
||||
<a href="#27" id="27">27</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the Module to interact in a save way with the Arduino C++ library.
|
||||
</span><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>
|
|
@ -1,85 +0,0 @@
|
|||
<!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\ardvoice.rs`."><title>ardvoice.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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the Module to interact in a save way with the ArdVoice C++ library.
|
||||
//!
|
||||
//! You will need to uncomment the ArdVoice_Library in the import_config.h file.
|
||||
|
||||
</span><span class="kw">use </span>core::ffi::{c_float, c_uchar, c_ulong};
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"ardvoice_play_voice"</span>]
|
||||
</span><span class="kw">fn </span>ardvoice_play_voice_raw(audio: <span class="kw-2">*const </span>c_uchar);
|
||||
<span class="attr">#[link_name = <span class="string">"ardvoice_play_voice_complex"</span>]
|
||||
</span><span class="kw">fn </span>ardvoice_play_voice_complex_raw(
|
||||
audio: <span class="kw-2">*const </span>c_uchar,
|
||||
startTime: c_ulong,
|
||||
endTime: c_ulong,
|
||||
speed: c_float,
|
||||
);
|
||||
<span class="attr">#[link_name = <span class="string">"ardvoice_stop_voice"</span>]
|
||||
</span><span class="kw">fn </span>ardvoice_stop_voice_raw();
|
||||
<span class="attr">#[link_name = <span class="string">"ardvoice_is_voice_playing"</span>]
|
||||
</span><span class="kw">fn </span>ardvoice_is_voice_playing_raw() -> bool;
|
||||
}
|
||||
<span class="doccomment">///This is the struct to interact in a save way with the ArdVoice C++ library.
|
||||
///
|
||||
///You will need to uncomment the ArdVoice_Library in the import_config.h file.
|
||||
</span><span class="kw">pub struct </span>ArdVoice {}
|
||||
<span class="kw">impl </span>ArdVoice {
|
||||
<span class="kw">pub const fn </span>new() -> <span class="self">Self </span>{
|
||||
ArdVoice {}
|
||||
}
|
||||
<span class="kw">pub fn </span>play_voice(<span class="kw-2">&</span><span class="self">self</span>, audio: <span class="kw-2">*const </span>u8) {
|
||||
<span class="kw">unsafe </span>{ ardvoice_play_voice_raw(audio) }
|
||||
}
|
||||
<span class="kw">pub fn </span>play_voice_complex(<span class="kw-2">&</span><span class="self">self</span>, audio: <span class="kw-2">*const </span>u8, start_time: u32, end_time: u32, speed: f32) {
|
||||
<span class="kw">unsafe </span>{ ardvoice_play_voice_complex_raw(audio, start_time, end_time, speed) }
|
||||
}
|
||||
<span class="kw">pub fn </span>stop_voice(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
<span class="kw">unsafe </span>{ ardvoice_stop_voice_raw() }
|
||||
}
|
||||
<span class="kw">pub fn </span>is_voice_playing(<span class="kw-2">&</span><span class="self">self</span>) -> bool {
|
||||
<span class="kw">unsafe </span>{ ardvoice_is_voice_playing_raw() }
|
||||
}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,23 +0,0 @@
|
|||
<!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>
|
|
@ -1,333 +0,0 @@
|
|||
<!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>
|
||||
<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>
|
||||
</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 is the struct to store and read structs objects to/from 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) }
|
||||
}
|
||||
}
|
||||
|
||||
<span class="doccomment">///Use this struct to store and read single bytes to/from eeprom memory without using a check digit.
|
||||
///
|
||||
///Unlike the other eeprom structs, this does not need to be initialised.
|
||||
</span><span class="kw">pub struct </span>EEPROMBYTECHECKLESS {
|
||||
idx: i16,
|
||||
}
|
||||
<span class="kw">impl </span>EEPROMBYTECHECKLESS {
|
||||
<span class="kw">pub const fn </span>new(<span class="kw-2">mut </span>idx: i16) -> EEPROMBYTECHECKLESS {
|
||||
<span class="kw">if </span>idx > <span class="number">1010 </span>{
|
||||
idx = <span class="number">0
|
||||
</span>}
|
||||
EEPROMBYTECHECKLESS {
|
||||
idx: EEPROM_STORAGE_SPACE_START + 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">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>
|
|
@ -1,18 +0,0 @@
|
|||
<!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>
|
||||
<a href="#9" id="9">9</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">pub mod </span>arduboy2;
|
||||
<span class="kw">pub mod </span>arduboy_tones;
|
||||
<span class="kw">pub mod </span>arduino;
|
||||
<span class="kw">pub mod </span>ardvoice;
|
||||
<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;
|
||||
<span class="kw">pub mod </span>arduboyfx;</code></pre></div></section></main></body></html>
|
|
@ -1,285 +0,0 @@
|
|||
<!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>
|
||||
<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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![allow(unused_imports)]
|
||||
</span><span class="doccomment">/// Create a space for Progmem 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];
|
||||
/// );
|
||||
///
|
||||
/// // for a Vector
|
||||
/// progmem!(
|
||||
/// static mut walls: Vec<Player, 100> = Vec::new();
|
||||
/// );
|
||||
/// ```
|
||||
</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="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="kw-2">mut </span><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 </span><span class="kw-2">mut </span><span class="macro-nonterminal">$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="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="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>;
|
||||
<span class="macro-nonterminal">$</span><span class="macro">crate::progmem!</span>{
|
||||
$(<span class="macro-nonterminal">$rest</span>)*
|
||||
}
|
||||
};
|
||||
(
|
||||
$( <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="kw-2">mut </span><span class="macro-nonterminal">$name</span>:ident: <span class="macro-nonterminal">$ty</span>:ty = <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 </span><span class="kw-2">mut </span><span class="macro-nonterminal">$name</span>: <span class="macro-nonterminal">$ty </span>= <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="kw">unsafe </span>{ <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 ardvoice tone as u8, without creating an intermediate reference.
|
||||
</span><span class="attr">#[macro_export]
|
||||
</span><span class="macro">macro_rules! </span>get_ardvoice_tone_addr {
|
||||
( <span class="macro-nonterminal">$s</span>:expr ) => {
|
||||
<span class="kw">unsafe </span>{ <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_ardvoice_tone_addr;
|
||||
<span class="doccomment">///Create a `const` raw pointer to a tone sequenze 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="kw">unsafe </span>{ <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="kw">unsafe </span>{ <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\0"))
|
||||
/// ```
|
||||
</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>
|
|
@ -1,359 +0,0 @@
|
|||
<!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>
|
|
@ -1,4 +1,4 @@
|
|||
<!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>
|
||||
<!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-fa3bb1812debf86c.css"><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.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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>
|
||||
|
@ -32,10 +32,6 @@
|
|||
<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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the important one to use this library effective in your project
|
||||
//!
|
||||
//! Import the module:
|
||||
|
@ -43,23 +39,19 @@
|
|||
//! use arduboy_rust::prelude::*;
|
||||
//! ```
|
||||
</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><span class="kw">pub use </span><span class="kw">crate</span>::hardware::buttons::<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><span class="kw">pub use </span><span class="kw">crate</span>::hardware::led::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::heapless::{LinearMap, String, Vec};
|
||||
<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_tones::{<span class="self">self</span>, ArduboyTones};
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduboyfx::{<span class="self">self</span>, fx};
|
||||
<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::ardvoice::{<span class="self">self</span>, ArdVoice};
|
||||
<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, EEPROMBYTECHECKLESS};
|
||||
<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="attr">#[doc(inline)]
|
||||
</span><span class="kw">pub use </span><span class="kw">crate</span>::serial_print <span class="kw">as </span>serial;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::arduboy2_library::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::arduboy_tones_library::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::arduboyfx_library::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::arduino_system::arduino::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::arduino_system::c::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::arduino_system::eeprom::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::arduino_system::progmem::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::arduino_system::serial_print <span class="kw">as </span>serial;
|
||||
<span class="kw">pub use </span><span class="kw">crate</span>::libraries::ardvoice_library::ArdVoice;
|
||||
<span class="kw">pub use crate</span>::{
|
||||
f, get_ardvoice_tone_addr, get_sprite_addr, get_string_addr, get_tones_addr, progmem,
|
||||
};
|
||||
|
|
|
@ -1,255 +0,0 @@
|
|||
<!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>
|
||||
<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>
|
||||
</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><<span class="kw">const </span>N: usize> Printable <span class="kw">for </span><span class="kw">crate</span>::heapless::String<N> {
|
||||
<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>
|
|
@ -1,357 +0,0 @@
|
|||
<!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_serial.rs`."><title>print_serial.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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the Module to interact in a save way with the Arduino Serial C++ library.
|
||||
|
||||
</span><span class="kw">use </span><span class="kw">crate</span>::prelude::Pstring;
|
||||
<span class="kw">use </span>core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong};
|
||||
|
||||
<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">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_serial_begin"</span>]
|
||||
</span><span class="kw">fn </span>serial_begin(serial: c_ulong);
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_serial_println_chars"</span>]
|
||||
</span><span class="kw">fn </span>print_chars(cstr: <span class="kw-2">*const </span>c_char);
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_println_chars_progmem"</span>]
|
||||
</span><span class="kw">fn </span>print_chars_progmem(pstring: <span class="kw-2">*const </span>c_char);
|
||||
<span class="comment">// #[link_name = "arduino_serial_print_char"]
|
||||
// fn print_char(c: c_char) -> c_size_t;
|
||||
</span><span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_int"</span>]
|
||||
</span><span class="kw">fn </span>print_int(n: c_int, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_long"</span>]
|
||||
</span><span class="kw">fn </span>print_long(n: c_long, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_unsigned_char"</span>]
|
||||
</span><span class="kw">fn </span>print_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_unsigned_int"</span>]
|
||||
</span><span class="kw">fn </span>print_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_unsigned_long"</span>]
|
||||
</span><span class="kw">fn </span>print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
|
||||
}
|
||||
<span class="doccomment">///The Arduino Serial Print class is available for writing text to the screen buffer.
|
||||
///
|
||||
///In the same manner as the Arduino arduboy.print(), etc., functions.
|
||||
///
|
||||
///
|
||||
///Example
|
||||
/// ```
|
||||
/// let value: i16 = 42;
|
||||
///
|
||||
/// serial.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
|
||||
/// // text cursor to the start of the next line
|
||||
/// serial.print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
|
||||
/// serial.print(value); // Prints "42"
|
||||
/// serial.print("\n\0"); // Sets the text cursor to the start of the next line
|
||||
/// serial.print("hello world") // Prints normal [&str]
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>print(x: <span class="kw">impl </span>Printable) {
|
||||
x.print()
|
||||
}
|
||||
<span class="doccomment">/// Set the Baud rate for the serial monitor
|
||||
</span><span class="kw">pub fn </span>begin(baud_rates: u32) {
|
||||
<span class="kw">unsafe </span>{ serial_begin(baud_rates) }
|
||||
}
|
||||
<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>{
|
||||
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>{
|
||||
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>{
|
||||
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>{
|
||||
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>{
|
||||
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>{
|
||||
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><<span class="kw">const </span>N: usize> Printable <span class="kw">for </span><span class="kw">crate</span>::heapless::String<N> {
|
||||
<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>{
|
||||
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>{
|
||||
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>
|
|
@ -1,837 +0,0 @@
|
|||
<!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\serial_print.rs`."><title>serial_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>
|
||||
<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>
|
||||
<a href="#251" id="251">251</a>
|
||||
<a href="#252" id="252">252</a>
|
||||
<a href="#253" id="253">253</a>
|
||||
<a href="#254" id="254">254</a>
|
||||
<a href="#255" id="255">255</a>
|
||||
<a href="#256" id="256">256</a>
|
||||
<a href="#257" id="257">257</a>
|
||||
<a href="#258" id="258">258</a>
|
||||
<a href="#259" id="259">259</a>
|
||||
<a href="#260" id="260">260</a>
|
||||
<a href="#261" id="261">261</a>
|
||||
<a href="#262" id="262">262</a>
|
||||
<a href="#263" id="263">263</a>
|
||||
<a href="#264" id="264">264</a>
|
||||
<a href="#265" id="265">265</a>
|
||||
<a href="#266" id="266">266</a>
|
||||
<a href="#267" id="267">267</a>
|
||||
<a href="#268" id="268">268</a>
|
||||
<a href="#269" id="269">269</a>
|
||||
<a href="#270" id="270">270</a>
|
||||
<a href="#271" id="271">271</a>
|
||||
<a href="#272" id="272">272</a>
|
||||
<a href="#273" id="273">273</a>
|
||||
<a href="#274" id="274">274</a>
|
||||
<a href="#275" id="275">275</a>
|
||||
<a href="#276" id="276">276</a>
|
||||
<a href="#277" id="277">277</a>
|
||||
<a href="#278" id="278">278</a>
|
||||
<a href="#279" id="279">279</a>
|
||||
<a href="#280" id="280">280</a>
|
||||
<a href="#281" id="281">281</a>
|
||||
<a href="#282" id="282">282</a>
|
||||
<a href="#283" id="283">283</a>
|
||||
<a href="#284" id="284">284</a>
|
||||
<a href="#285" id="285">285</a>
|
||||
<a href="#286" id="286">286</a>
|
||||
<a href="#287" id="287">287</a>
|
||||
<a href="#288" id="288">288</a>
|
||||
<a href="#289" id="289">289</a>
|
||||
<a href="#290" id="290">290</a>
|
||||
<a href="#291" id="291">291</a>
|
||||
<a href="#292" id="292">292</a>
|
||||
<a href="#293" id="293">293</a>
|
||||
<a href="#294" id="294">294</a>
|
||||
<a href="#295" id="295">295</a>
|
||||
<a href="#296" id="296">296</a>
|
||||
<a href="#297" id="297">297</a>
|
||||
<a href="#298" id="298">298</a>
|
||||
<a href="#299" id="299">299</a>
|
||||
<a href="#300" id="300">300</a>
|
||||
<a href="#301" id="301">301</a>
|
||||
<a href="#302" id="302">302</a>
|
||||
<a href="#303" id="303">303</a>
|
||||
<a href="#304" id="304">304</a>
|
||||
<a href="#305" id="305">305</a>
|
||||
<a href="#306" id="306">306</a>
|
||||
<a href="#307" id="307">307</a>
|
||||
<a href="#308" id="308">308</a>
|
||||
<a href="#309" id="309">309</a>
|
||||
<a href="#310" id="310">310</a>
|
||||
<a href="#311" id="311">311</a>
|
||||
<a href="#312" id="312">312</a>
|
||||
<a href="#313" id="313">313</a>
|
||||
<a href="#314" id="314">314</a>
|
||||
<a href="#315" id="315">315</a>
|
||||
<a href="#316" id="316">316</a>
|
||||
<a href="#317" id="317">317</a>
|
||||
<a href="#318" id="318">318</a>
|
||||
<a href="#319" id="319">319</a>
|
||||
<a href="#320" id="320">320</a>
|
||||
<a href="#321" id="321">321</a>
|
||||
<a href="#322" id="322">322</a>
|
||||
<a href="#323" id="323">323</a>
|
||||
<a href="#324" id="324">324</a>
|
||||
<a href="#325" id="325">325</a>
|
||||
<a href="#326" id="326">326</a>
|
||||
<a href="#327" id="327">327</a>
|
||||
<a href="#328" id="328">328</a>
|
||||
<a href="#329" id="329">329</a>
|
||||
<a href="#330" id="330">330</a>
|
||||
<a href="#331" id="331">331</a>
|
||||
<a href="#332" id="332">332</a>
|
||||
<a href="#333" id="333">333</a>
|
||||
<a href="#334" id="334">334</a>
|
||||
<a href="#335" id="335">335</a>
|
||||
<a href="#336" id="336">336</a>
|
||||
<a href="#337" id="337">337</a>
|
||||
<a href="#338" id="338">338</a>
|
||||
<a href="#339" id="339">339</a>
|
||||
<a href="#340" id="340">340</a>
|
||||
<a href="#341" id="341">341</a>
|
||||
<a href="#342" id="342">342</a>
|
||||
<a href="#343" id="343">343</a>
|
||||
<a href="#344" id="344">344</a>
|
||||
<a href="#345" id="345">345</a>
|
||||
<a href="#346" id="346">346</a>
|
||||
<a href="#347" id="347">347</a>
|
||||
<a href="#348" id="348">348</a>
|
||||
<a href="#349" id="349">349</a>
|
||||
<a href="#350" id="350">350</a>
|
||||
<a href="#351" id="351">351</a>
|
||||
<a href="#352" id="352">352</a>
|
||||
<a href="#353" id="353">353</a>
|
||||
<a href="#354" id="354">354</a>
|
||||
<a href="#355" id="355">355</a>
|
||||
<a href="#356" id="356">356</a>
|
||||
<a href="#357" id="357">357</a>
|
||||
<a href="#358" id="358">358</a>
|
||||
<a href="#359" id="359">359</a>
|
||||
<a href="#360" id="360">360</a>
|
||||
<a href="#361" id="361">361</a>
|
||||
<a href="#362" id="362">362</a>
|
||||
<a href="#363" id="363">363</a>
|
||||
<a href="#364" id="364">364</a>
|
||||
<a href="#365" id="365">365</a>
|
||||
<a href="#366" id="366">366</a>
|
||||
<a href="#367" id="367">367</a>
|
||||
<a href="#368" id="368">368</a>
|
||||
<a href="#369" id="369">369</a>
|
||||
<a href="#370" id="370">370</a>
|
||||
<a href="#371" id="371">371</a>
|
||||
<a href="#372" id="372">372</a>
|
||||
<a href="#373" id="373">373</a>
|
||||
<a href="#374" id="374">374</a>
|
||||
<a href="#375" id="375">375</a>
|
||||
<a href="#376" id="376">376</a>
|
||||
<a href="#377" id="377">377</a>
|
||||
<a href="#378" id="378">378</a>
|
||||
<a href="#379" id="379">379</a>
|
||||
<a href="#380" id="380">380</a>
|
||||
<a href="#381" id="381">381</a>
|
||||
<a href="#382" id="382">382</a>
|
||||
<a href="#383" id="383">383</a>
|
||||
<a href="#384" id="384">384</a>
|
||||
<a href="#385" id="385">385</a>
|
||||
<a href="#386" id="386">386</a>
|
||||
<a href="#387" id="387">387</a>
|
||||
<a href="#388" id="388">388</a>
|
||||
<a href="#389" id="389">389</a>
|
||||
<a href="#390" id="390">390</a>
|
||||
<a href="#391" id="391">391</a>
|
||||
<a href="#392" id="392">392</a>
|
||||
<a href="#393" id="393">393</a>
|
||||
<a href="#394" id="394">394</a>
|
||||
<a href="#395" id="395">395</a>
|
||||
<a href="#396" id="396">396</a>
|
||||
<a href="#397" id="397">397</a>
|
||||
<a href="#398" id="398">398</a>
|
||||
<a href="#399" id="399">399</a>
|
||||
<a href="#400" id="400">400</a>
|
||||
<a href="#401" id="401">401</a>
|
||||
<a href="#402" id="402">402</a>
|
||||
<a href="#403" id="403">403</a>
|
||||
<a href="#404" id="404">404</a>
|
||||
<a href="#405" id="405">405</a>
|
||||
<a href="#406" id="406">406</a>
|
||||
<a href="#407" id="407">407</a>
|
||||
<a href="#408" id="408">408</a>
|
||||
<a href="#409" id="409">409</a>
|
||||
<a href="#410" id="410">410</a>
|
||||
<a href="#411" id="411">411</a>
|
||||
<a href="#412" id="412">412</a>
|
||||
<a href="#413" id="413">413</a>
|
||||
<a href="#414" id="414">414</a>
|
||||
<a href="#415" id="415">415</a>
|
||||
<a href="#416" id="416">416</a>
|
||||
<a href="#417" id="417">417</a>
|
||||
<a href="#418" id="418">418</a>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the Module to interact in a save way with the Arduino Serial C++ library.
|
||||
//!
|
||||
//! You will need to uncomment the Arduino_Serial_Library in the import_config.h file.
|
||||
</span><span class="kw">use </span><span class="kw">crate</span>::prelude::Pstring;
|
||||
<span class="kw">use </span>core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong};
|
||||
|
||||
<span class="kw">use </span><span class="kw">crate</span>::print::Base;
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_serial_begin"</span>]
|
||||
</span><span class="kw">fn </span>serial_begin(serial: c_ulong);
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_serial_end"</span>]
|
||||
</span><span class="kw">fn </span>serial_end();
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_serial_available"</span>]
|
||||
</span><span class="kw">fn </span>serial_available() -> c_int;
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_serial_read"</span>]
|
||||
</span><span class="kw">fn </span>serial_read() -> c_int;
|
||||
}
|
||||
|
||||
<span class="doccomment">///The Arduino Serial Print class is available for writing text to the screen buffer.
|
||||
///
|
||||
///In the same manner as the Arduino arduboy.print(), etc., functions.
|
||||
///
|
||||
///
|
||||
///Example
|
||||
/// ```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// let value: i16 = 42;
|
||||
///
|
||||
/// serial::print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
|
||||
/// // text cursor to the start of the next line
|
||||
/// serial::print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
|
||||
/// serial::print(value); // Prints "42"
|
||||
/// serial::print("\n\0"); // Sets the text cursor to the start of the next line
|
||||
/// serial::print("hello world") // Prints normal [&str]
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>print(x: <span class="kw">impl </span>Serialprintable) {
|
||||
x.print()
|
||||
}
|
||||
<span class="doccomment">///The Arduino Serial Print class is available for writing text to the screen buffer.
|
||||
///
|
||||
///In the same manner as the Arduino arduboy.print(), etc., functions.
|
||||
///
|
||||
///
|
||||
///Example
|
||||
/// ```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// let value: i16 = 42;
|
||||
///
|
||||
/// serial::print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
|
||||
/// // text cursor to the start of the next line
|
||||
/// serial::print(f!(b"Hello World\n")); // Prints "Hello World" but does not use the 2kb ram
|
||||
/// serial::print(value); // Prints "42"
|
||||
/// serial::print("\n\0"); // Sets the text cursor to the start of the next line
|
||||
/// serial::print("hello world") // Prints normal [&str]
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>println(x: <span class="kw">impl </span>Serialprintlnable) {
|
||||
x.println()
|
||||
}
|
||||
<span class="doccomment">/// Sets the data rate in bits per second (baud) for serial data transmission. For communicating with Serial Monitor, make sure to use one of the baud rates listed in the menu at the bottom right corner of its screen. You can, however, specify other rates - for example, to communicate over pins 0 and 1 with a component that requires a particular baud rate.
|
||||
///
|
||||
/// ### Example
|
||||
/// ```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// serial::begin(9600)
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>begin(baud_rates: u32) {
|
||||
<span class="kw">unsafe </span>{ serial_begin(baud_rates) }
|
||||
}
|
||||
<span class="doccomment">/// Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call [begin()].
|
||||
</span><span class="kw">pub fn </span>end() {
|
||||
<span class="kw">unsafe </span>{ serial_end() }
|
||||
}
|
||||
<span class="doccomment">/// Reads incoming serial data.
|
||||
/// Use only inside of [available()]:
|
||||
///```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// if serial::available() > 0 {
|
||||
/// // read the incoming byte:
|
||||
/// let incoming_byte: i16 = serial::read();
|
||||
///
|
||||
/// // say what you got:
|
||||
/// serial::print("I received: ");
|
||||
/// serial::println(incoming_byte);
|
||||
/// }
|
||||
/// ```
|
||||
/// ### Returns
|
||||
///
|
||||
///The first byte of incoming serial data available (or -1 if no data is available). Data type: int.
|
||||
</span><span class="kw">pub fn </span>read() -> i16 {
|
||||
<span class="kw">unsafe </span>{ serial_read() }
|
||||
}
|
||||
<span class="doccomment">/// Reads incoming serial data.
|
||||
///
|
||||
/// Use only inside of [available()]:
|
||||
/// ```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// if serial::available() > 0 {
|
||||
/// // read the incoming byte:
|
||||
/// let incoming_byte: &str = serial::read_as_utf8_str();
|
||||
///
|
||||
/// // say what you got:
|
||||
/// serial::print("I received: ");
|
||||
/// serial::println(incoming_byte);
|
||||
/// }
|
||||
/// ```
|
||||
/// ### Returns
|
||||
///
|
||||
///The first byte of incoming serial data available (or -1 if no data is available). Data type: &str.
|
||||
</span><span class="kw">pub fn </span>read_as_utf8_str() -> <span class="kw-2">&</span><span class="lifetime">'static </span>str {
|
||||
<span class="kw">let </span>incoming_byte = <span class="kw">unsafe </span>{ serial_read() };
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>L: [u8; <span class="number">2</span>] = [<span class="number">0</span>, <span class="number">0</span>];
|
||||
<span class="kw">unsafe </span>{
|
||||
L[<span class="number">0</span>] = incoming_byte <span class="kw">as </span>u8;
|
||||
}
|
||||
<span class="kw">unsafe </span>{ core::str::from_utf8(<span class="kw-2">&</span>L).unwrap() }
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Get the number of bytes (characters) available for reading from the serial port. This is data that’s already arrived and stored in the serial receive buffer (which holds 64 bytes).
|
||||
/// ### Example
|
||||
/// ```
|
||||
/// use arduboy_rust::prelude::*;
|
||||
/// if serial::available() > 0 {
|
||||
/// // read the incoming byte:
|
||||
/// let incoming_byte = serial::read();
|
||||
///
|
||||
/// // say what you got:
|
||||
/// serial::print("I received: ");
|
||||
/// serial::println(incoming_byte);
|
||||
/// }
|
||||
/// ```
|
||||
</span><span class="kw">pub fn </span>available() -> i16 {
|
||||
<span class="kw">unsafe </span>{ serial_available() }
|
||||
}
|
||||
<span class="kw">pub trait </span>Serialprintlnable
|
||||
<span class="kw">where
|
||||
</span><span class="self">Self</span>: Sized,
|
||||
{
|
||||
<span class="kw">type </span>Parameters;
|
||||
|
||||
<span class="kw">fn </span>println_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>println(<span class="self">self</span>) {
|
||||
<span class="self">self</span>.println_2(<span class="self">Self</span>::default_parameters());
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Serialprintlnable <span class="kw">for </span>i16 {
|
||||
<span class="kw">type </span>Parameters = Base;
|
||||
|
||||
<span class="kw">fn </span>println_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
println_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>Serialprintlnable <span class="kw">for </span>u16 {
|
||||
<span class="kw">type </span>Parameters = Base;
|
||||
|
||||
<span class="kw">fn </span>println_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
println_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>Serialprintlnable <span class="kw">for </span>i32 {
|
||||
<span class="kw">type </span>Parameters = Base;
|
||||
|
||||
<span class="kw">fn </span>println_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
println_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>Serialprintlnable <span class="kw">for </span>u32 {
|
||||
<span class="kw">type </span>Parameters = Base;
|
||||
|
||||
<span class="kw">fn </span>println_2(<span class="self">self</span>, params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
println_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>Serialprintlnable <span class="kw">for </span><span class="kw-2">&</span>[u8] {
|
||||
<span class="kw">type </span>Parameters = ();
|
||||
|
||||
<span class="kw">fn </span>println_2(<span class="self">self</span>, _params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
println_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>Serialprintlnable <span class="kw">for </span><span class="kw-2">&</span>str {
|
||||
<span class="kw">type </span>Parameters = ();
|
||||
|
||||
<span class="kw">fn </span>println_2(<span class="self">self</span>, _params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
println_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><<span class="kw">const </span>N: usize> Serialprintlnable <span class="kw">for </span>heapless::String<N> {
|
||||
<span class="kw">type </span>Parameters = ();
|
||||
|
||||
<span class="kw">fn </span>println_2(<span class="self">self</span>, _params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
println_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>Serialprintlnable <span class="kw">for </span>Pstring {
|
||||
<span class="kw">type </span>Parameters = ();
|
||||
|
||||
<span class="kw">fn </span>println_2(<span class="self">self</span>, _params: <span class="self">Self</span>::Parameters) {
|
||||
<span class="kw">unsafe </span>{
|
||||
println_chars_progmem(<span class="self">self</span>.pointer);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {}
|
||||
}
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_serial_println_chars"</span>]
|
||||
</span><span class="kw">fn </span>println_chars(cstr: <span class="kw-2">*const </span>c_char);
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_println_chars_progmem"</span>]
|
||||
</span><span class="kw">fn </span>println_chars_progmem(pstring: <span class="kw-2">*const </span>c_char);
|
||||
<span class="comment">// #[link_name = "arduino_serial_println_char"]
|
||||
// fn println_char(c: c_char) -> c_size_t;
|
||||
</span><span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_println_int"</span>]
|
||||
</span><span class="kw">fn </span>println_int(n: c_int, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_println_long"</span>]
|
||||
</span><span class="kw">fn </span>println_long(n: c_long, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[allow(dead_code)]
|
||||
#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_println_unsigned_char"</span>]
|
||||
</span><span class="kw">fn </span>println_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_println_unsigned_int"</span>]
|
||||
</span><span class="kw">fn </span>println_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_println_unsigned_long"</span>]
|
||||
</span><span class="kw">fn </span>println_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
|
||||
}
|
||||
|
||||
<span class="kw">pub trait </span>Serialprintable
|
||||
<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>Serialprintable <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>{
|
||||
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>Serialprintable <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>{
|
||||
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>Serialprintable <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>{
|
||||
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>Serialprintable <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>{
|
||||
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>Serialprintable <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>{
|
||||
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>Serialprintable <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>{
|
||||
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><<span class="kw">const </span>N: usize> Serialprintable <span class="kw">for </span>heapless::String<N> {
|
||||
<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>{
|
||||
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>Serialprintable <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>{
|
||||
print_chars_progmem(<span class="self">self</span>.pointer);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>default_parameters() -> <span class="self">Self</span>::Parameters {}
|
||||
}
|
||||
|
||||
<span class="kw">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduino_serial_print_chars"</span>]
|
||||
</span><span class="kw">fn </span>print_chars(cstr: <span class="kw-2">*const </span>c_char);
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_chars_progmem"</span>]
|
||||
</span><span class="kw">fn </span>print_chars_progmem(pstring: <span class="kw-2">*const </span>c_char);
|
||||
<span class="comment">// #[link_name = "arduino_serial_print_char"]
|
||||
// fn print_char(c: c_char) -> c_size_t;
|
||||
</span><span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_int"</span>]
|
||||
</span><span class="kw">fn </span>print_int(n: c_int, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_long"</span>]
|
||||
</span><span class="kw">fn </span>print_long(n: c_long, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[allow(dead_code)]
|
||||
#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_unsigned_char"</span>]
|
||||
</span><span class="kw">fn </span>print_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_unsigned_int"</span>]
|
||||
</span><span class="kw">fn </span>print_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
#[link_name = <span class="string">"arduino_serial_print_unsigned_long"</span>]
|
||||
</span><span class="kw">fn </span>print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
<!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\atomic-polyfill-0.1.11\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="atomic_polyfill" 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="../../atomic_polyfill/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>
|
||||
<!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\atomic-polyfill-0.1.11\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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="atomic_polyfill" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../atomic_polyfill/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\byteorder-1.4.3\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="byteorder" 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="../../byteorder/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>
|
||||
<!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\byteorder-1.4.3\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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="byteorder" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../byteorder/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\critical-section-1.1.2\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="critical_section" 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="../../critical_section/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>
|
||||
<!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\critical-section-1.1.2\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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="critical_section" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../critical_section/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\critical-section-1.1.2\src\mutex.rs`."><title>mutex.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="critical_section" 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="../../critical_section/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>
|
||||
<!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\critical-section-1.1.2\src\mutex.rs`."><title>mutex.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="critical_section" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../critical_section/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>
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\demo2\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="demo2" 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="../../demo2/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Holmes is cool!\0"</span>));
|
||||
arduboy.display();
|
||||
}
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,81 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\demo3\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="demo3" 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="../../demo3/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//Initialize our counter variable
|
||||
|
||||
</span><span class="kw">static </span><span class="kw-2">mut </span>counter: c_int = <span class="number">0</span>;
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">//Start the Arduboy properly and display the Arduboy logo
|
||||
</span>arduboy.begin();
|
||||
<span class="comment">//Get rid of the Arduboy logo and clear the screen
|
||||
</span>arduboy.clear();
|
||||
<span class="comment">//Assign our counter variable to be equal to 0
|
||||
</span>counter = <span class="number">0</span>;
|
||||
<span class="comment">//Set framerate to 30
|
||||
</span>arduboy.set_frame_rate(<span class="number">30</span>);
|
||||
}
|
||||
<span class="comment">//The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">//Skip cycles not in the framerate
|
||||
</span><span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="comment">//Clear whatever is printed on the screen
|
||||
</span>arduboy.clear();
|
||||
<span class="comment">//Move the cursor to the position 30, 30 of the screen
|
||||
</span>arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
<span class="comment">//Increase counter's value by 1
|
||||
</span>counter += <span class="number">1</span>;
|
||||
<span class="comment">//Print out the value of counter
|
||||
</span>arduboy.print(counter);
|
||||
<span class="comment">//Refresh the screen to show whatever's printed to it
|
||||
</span>arduboy.display();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,111 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\demo4\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="demo4" 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="../../demo4/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//Initialize our counter variable
|
||||
|
||||
</span><span class="kw">static </span><span class="kw-2">mut </span>counter: c_int = <span class="number">0</span>;
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">//Start the Arduboy properly and display the Arduboy logo
|
||||
</span>arduboy.begin();
|
||||
<span class="comment">//Get rid of the Arduboy logo and clear the screen
|
||||
</span>arduboy.clear();
|
||||
<span class="comment">//Assign our counter variable to be equal to 0
|
||||
</span>counter = <span class="number">0</span>;
|
||||
<span class="comment">//Set framerate to 10
|
||||
</span>arduboy.set_frame_rate(<span class="number">10</span>);
|
||||
}
|
||||
<span class="comment">//The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">//Skip cycles not in the framerate
|
||||
</span><span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="comment">//Clear whatever is printed on the screen
|
||||
</span>arduboy.clear();
|
||||
<span class="comment">//Check if the UP_BUTTON is being pressed
|
||||
</span><span class="kw">if </span>UP.pressed() {
|
||||
<span class="comment">//Increase counter by 1
|
||||
</span>counter = counter + <span class="number">1</span>;
|
||||
}
|
||||
<span class="comment">//Check if the DOWN_BUTTON is being pressed
|
||||
</span><span class="kw">if </span>DOWN.pressed() {
|
||||
<span class="comment">//Decrease counter
|
||||
</span>counter = counter - <span class="number">1</span>;
|
||||
}
|
||||
<span class="comment">//Check if counter is equal to 36
|
||||
</span><span class="kw">if </span>counter == <span class="number">36 </span>{
|
||||
<span class="comment">//Move the cursor to the position 30, 30 of the screen
|
||||
</span>arduboy.set_cursor(<span class="number">30</span>, <span class="number">30</span>);
|
||||
<span class="comment">//Printing the yay (important always put the \0 at the end for &str)
|
||||
</span>arduboy.print(<span class="macro">f!</span>(<span class="string">b"Yay!\0"</span>));
|
||||
}
|
||||
<span class="comment">//Move the cursor back to the top-left of the screen
|
||||
</span>arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
<span class="comment">//Print out the value of counter
|
||||
</span>arduboy.print(counter);
|
||||
<span class="comment">//Refresh the screen to show whatever's printed to it
|
||||
</span>arduboy.display();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,193 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\demo5\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="demo5" 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="../../demo5/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
|
||||
<span class="comment">//Initialize variables used in this game
|
||||
</span><span class="kw">static </span><span class="kw-2">mut </span>playerwin: c_int = <span class="number">0</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>attempts: c_int = <span class="number">0</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>guessednumber: c_int = <span class="number">0</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>randomnumber: c_int = <span class="number">0</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>lastguess: c_int = <span class="number">0</span>;
|
||||
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.init_random_seed();
|
||||
randomnumber = random_between(<span class="number">1</span>, <span class="number">101</span>) <span class="kw">as </span>i16;
|
||||
}
|
||||
<span class="comment">//The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>arduboy.clear();
|
||||
arduboy.poll_buttons();
|
||||
<span class="kw">if </span>playerwin == <span class="number">0 </span>{
|
||||
<span class="comment">//Ask the player for a number and play the game
|
||||
</span><span class="kw">if </span>attempts == <span class="number">7 </span>{
|
||||
<span class="comment">//Game Over screen
|
||||
</span>arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"You lost!\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Correct Number: \0"</span>));
|
||||
arduboy.print(randomnumber);
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
randomnumber = random_between(<span class="number">1</span>, <span class="number">101</span>) <span class="kw">as </span>i16;
|
||||
attempts = <span class="number">0</span>;
|
||||
playerwin = <span class="number">0</span>;
|
||||
}
|
||||
} <span class="kw">else </span>{
|
||||
<span class="comment">//Player has more attempts
|
||||
</span><span class="kw">if </span>UP.just_pressed() {
|
||||
guessednumber += <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>DOWN.just_pressed() {
|
||||
guessednumber -= <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
<span class="kw">if </span>guessednumber == randomnumber {
|
||||
playerwin += <span class="number">1</span>;
|
||||
} <span class="kw">else </span>{
|
||||
attempts += <span class="number">1</span>;
|
||||
lastguess = guessednumber
|
||||
}
|
||||
}
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Attempt: \0"</span>));
|
||||
arduboy.print(attempts);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Number to guess: \0"</span>));
|
||||
arduboy.print(guessednumber);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\0"</span>));
|
||||
<span class="kw">if </span>attempts == <span class="number">0 </span>{
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Good luck!\0"</span>));
|
||||
} <span class="kw">else </span>{
|
||||
arduboy.print(lastguess);
|
||||
<span class="kw">if </span>lastguess > randomnumber {
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b" is too high!\0"</span>));
|
||||
}
|
||||
<span class="kw">if </span>lastguess < randomnumber {
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b" is too low!\0"</span>));
|
||||
}
|
||||
}
|
||||
}
|
||||
} <span class="kw">else </span>{
|
||||
<span class="comment">//Tell the player that they won!
|
||||
</span>arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"You won!\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Correct Number: \0"</span>));
|
||||
arduboy.print(randomnumber);
|
||||
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
randomnumber = random_between(<span class="number">1</span>, <span class="number">101</span>) <span class="kw">as </span>c_int;
|
||||
attempts = <span class="number">0</span>;
|
||||
playerwin = <span class="number">0</span>;
|
||||
}
|
||||
}
|
||||
arduboy.display();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,155 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\demo6\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="demo6" 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="../../demo6/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="attr">#[allow(unused_imports)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
|
||||
<span class="attr">#[link_section = <span class="string">".progmem.data"</span>]
|
||||
</span><span class="kw">static </span>background_sprite: [u8; <span class="number">10</span>] = [<span class="number">8</span>, <span class="number">8</span>, <span class="number">0x81</span>, <span class="number">0x00</span>, <span class="number">0x12</span>, <span class="number">0x40</span>, <span class="number">0x04</span>, <span class="number">0x11</span>, <span class="number">0x00</span>, <span class="number">0x04</span>];
|
||||
<span class="attr">#[link_section = <span class="string">".progmem.data"</span>]
|
||||
</span><span class="kw">static </span>player_sprite1: [u8; <span class="number">34</span>] = [
|
||||
<span class="number">16</span>, <span class="number">16</span>, <span class="number">0xfe</span>, <span class="number">0x01</span>, <span class="number">0x3d</span>, <span class="number">0x25</span>, <span class="number">0x25</span>, <span class="number">0x3d</span>, <span class="number">0x01</span>, <span class="number">0x01</span>, <span class="number">0xc1</span>, <span class="number">0x01</span>, <span class="number">0x3d</span>, <span class="number">0x25</span>, <span class="number">0x25</span>, <span class="number">0x3d</span>,
|
||||
<span class="number">0x01</span>, <span class="number">0xfe</span>, <span class="number">0x7f</span>, <span class="number">0x80</span>, <span class="number">0x9c</span>, <span class="number">0xbc</span>, <span class="number">0xb0</span>, <span class="number">0xb0</span>, <span class="number">0xb2</span>, <span class="number">0xb2</span>, <span class="number">0xb3</span>, <span class="number">0xb0</span>, <span class="number">0xb0</span>, <span class="number">0xb0</span>, <span class="number">0xbc</span>, <span class="number">0x9c</span>,
|
||||
<span class="number">0x80</span>, <span class="number">0x7f</span>,
|
||||
];
|
||||
<span class="attr">#[link_section = <span class="string">".progmem.data"</span>]
|
||||
</span><span class="kw">static </span>player_sprite2: [u8; <span class="number">34</span>] = [
|
||||
<span class="number">16</span>, <span class="number">16</span>, <span class="number">0xfc</span>, <span class="number">0x02</span>, <span class="number">0x19</span>, <span class="number">0x25</span>, <span class="number">0x25</span>, <span class="number">0x19</span>, <span class="number">0x01</span>, <span class="number">0x01</span>, <span class="number">0x01</span>, <span class="number">0x01</span>, <span class="number">0x19</span>, <span class="number">0x25</span>, <span class="number">0x25</span>, <span class="number">0x19</span>,
|
||||
<span class="number">0x02</span>, <span class="number">0xfc</span>, <span class="number">0x3f</span>, <span class="number">0x40</span>, <span class="number">0x80</span>, <span class="number">0x98</span>, <span class="number">0x8c</span>, <span class="number">0x86</span>, <span class="number">0x82</span>, <span class="number">0x82</span>, <span class="number">0x82</span>, <span class="number">0x82</span>, <span class="number">0x86</span>, <span class="number">0x8c</span>, <span class="number">0x98</span>, <span class="number">0x80</span>,
|
||||
<span class="number">0x40</span>, <span class="number">0x3f</span>,
|
||||
];
|
||||
|
||||
<span class="comment">// Put your variables here
|
||||
</span><span class="kw">static </span><span class="kw-2">mut </span>playerx: c_int = <span class="number">5</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>playery: c_int = <span class="number">10</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>playermode: bool = <span class="bool-val">false</span>;
|
||||
<span class="comment">// The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.set_frame_rate(<span class="number">60</span>);
|
||||
}
|
||||
<span class="comment">// The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>arduboy.clear();
|
||||
arduboy.poll_buttons();
|
||||
|
||||
<span class="kw">if </span>arduboy.pressed(LEFT) {
|
||||
playerx -= <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(RIGHT) {
|
||||
playerx += <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(UP) {
|
||||
playery -= <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(DOWN) {
|
||||
playery += <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.just_pressed(A) {
|
||||
playermode = !playermode
|
||||
}
|
||||
|
||||
<span class="kw">for </span>i <span class="kw">in </span>(<span class="number">0</span>..WIDTH).step_by(<span class="number">8</span>) {
|
||||
<span class="kw">for </span>j <span class="kw">in </span>(<span class="number">0</span>..HEIGHT).step_by(<span class="number">8</span>) {
|
||||
sprites::draw_override(i.into(), j.into(), <span class="macro">get_sprite_addr!</span>(background_sprite), <span class="number">0</span>)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">if </span>playermode {
|
||||
sprites::draw_override(playerx, playery, <span class="macro">get_sprite_addr!</span>(player_sprite1), <span class="number">0</span>);
|
||||
} <span class="kw">else </span>{
|
||||
sprites::draw_override(playerx, playery, <span class="macro">get_sprite_addr!</span>(player_sprite2), <span class="number">0</span>);
|
||||
}
|
||||
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.display();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,465 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\demo7\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="demo7" 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="../../demo7/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
|
||||
<span class="attr">#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
|
||||
</span><span class="kw">enum </span>GameState {
|
||||
Title,
|
||||
Gameplay,
|
||||
Win,
|
||||
Lose,
|
||||
}
|
||||
|
||||
<span class="kw">struct </span>Ball {
|
||||
x: i16,
|
||||
y: i16,
|
||||
size: u8,
|
||||
right: bool,
|
||||
down: bool,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Ball {
|
||||
<span class="kw">unsafe fn </span>draw(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
arduboy.fill_rect(<span class="self">self</span>.x.into(), <span class="self">self</span>.y.into(), <span class="self">self</span>.size, <span class="self">self</span>.size, Color::White);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">struct </span>Paddle {
|
||||
x: i16,
|
||||
y: i16,
|
||||
width: u8,
|
||||
height: u8,
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>Paddle {
|
||||
<span class="kw">unsafe fn </span>draw(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
arduboy.fill_rect(<span class="self">self</span>.x.into(), <span class="self">self</span>.y.into(), <span class="self">self</span>.width, <span class="self">self</span>.height, Color::White);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>G: Globals = Globals {
|
||||
game_state: GameState::Title,
|
||||
player_score: <span class="number">0</span>,
|
||||
ai_score: <span class="number">0</span>,
|
||||
ball: Ball {
|
||||
x: <span class="number">62</span>,
|
||||
y: <span class="number">1</span>,
|
||||
size: <span class="number">4</span>,
|
||||
right: <span class="bool-val">true</span>,
|
||||
down: <span class="bool-val">true</span>,
|
||||
},
|
||||
player: Paddle {
|
||||
x: <span class="number">0</span>,
|
||||
y: <span class="number">50</span>,
|
||||
width: <span class="number">2</span>,
|
||||
height: <span class="number">12</span>,
|
||||
},
|
||||
ai: Paddle {
|
||||
x: (WIDTH - <span class="number">4</span>) <span class="kw">as </span>i16,
|
||||
y: <span class="number">50</span>,
|
||||
width: <span class="number">2</span>,
|
||||
height: <span class="number">12</span>,
|
||||
},
|
||||
};
|
||||
|
||||
<span class="kw">struct </span>Globals {
|
||||
game_state: GameState,
|
||||
player_score: u8,
|
||||
ai_score: u8,
|
||||
ball: Ball,
|
||||
player: Paddle,
|
||||
ai: Paddle,
|
||||
}
|
||||
|
||||
<span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
arduboy.begin();
|
||||
arduboy.init_random_seed();
|
||||
arduboy.set_frame_rate(<span class="number">60</span>);
|
||||
}
|
||||
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
|
||||
arduboy.poll_buttons();
|
||||
|
||||
arduboy.clear();
|
||||
<span class="kw">match </span>G.game_state {
|
||||
GameState::Title => {
|
||||
arduboy.set_cursor(<span class="number">52</span>, <span class="number">10</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"PONG\0"</span>));
|
||||
arduboy.set_cursor(<span class="number">16</span>, <span class="number">22</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Press A to start\0"</span>));
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
G.game_state = GameState::Gameplay;
|
||||
}
|
||||
}
|
||||
GameState::Gameplay => {
|
||||
gameplay();
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
reset_game();
|
||||
}
|
||||
}
|
||||
GameState::Win => {
|
||||
arduboy.set_cursor(<span class="number">40</span>, <span class="number">10</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"You Win!\0"</span>));
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
reset_game();
|
||||
}
|
||||
}
|
||||
GameState::Lose => {
|
||||
arduboy.set_cursor(<span class="number">37</span>, <span class="number">10</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Game Over\0"</span>));
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
reset_game();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
arduboy.display();
|
||||
}
|
||||
|
||||
<span class="kw">unsafe fn </span>reset_game() {
|
||||
G.game_state = GameState::Title;
|
||||
G.ball.x = (WIDTH / <span class="number">2</span>) <span class="kw">as </span>i16;
|
||||
G.player_score = <span class="number">0</span>;
|
||||
G.ai_score = <span class="number">0</span>;
|
||||
}
|
||||
|
||||
<span class="kw">unsafe fn </span>gameplay() {
|
||||
<span class="comment">//
|
||||
// Player movement
|
||||
//
|
||||
|
||||
</span><span class="kw">if </span>UP.pressed() && G.player.y > <span class="number">0 </span>{
|
||||
G.player.y -= <span class="number">1</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>DOWN.pressed() && G.player.y + (G.player.height <span class="kw">as </span>i16) < (HEIGHT - <span class="number">1</span>) <span class="kw">as </span>i16 {
|
||||
G.player.y += <span class="number">1</span>;
|
||||
}
|
||||
|
||||
<span class="comment">//
|
||||
// AI movement
|
||||
//
|
||||
|
||||
</span><span class="kw">if </span>G.ball.x > <span class="number">115 </span>|| random_between(<span class="number">0</span>, <span class="number">20</span>) == <span class="number">0 </span>{
|
||||
<span class="kw">if </span>G.ball.y < G.ai.y {
|
||||
G.ai.y -= <span class="number">1</span>;
|
||||
} <span class="kw">else if </span>G.ball.y + (G.ball.size <span class="kw">as </span>i16) > G.ai.y + G.ai.height <span class="kw">as </span>i16 {
|
||||
G.ai.y += <span class="number">1</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">//
|
||||
// Ball movement
|
||||
//
|
||||
|
||||
</span><span class="kw">if </span>G.ball.y == <span class="number">1 </span>{
|
||||
G.ball.down = <span class="bool-val">true</span>;
|
||||
} <span class="kw">else if </span>G.ball.y + G.ball.size <span class="kw">as </span>i16 == (HEIGHT - <span class="number">1</span>) <span class="kw">as </span>i16 {
|
||||
G.ball.down = <span class="bool-val">false</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>G.ball.x == G.player.x + G.player.width <span class="kw">as </span>i16
|
||||
&& G.ball.y + G.ball.size <span class="kw">as </span>i16 > G.player.y
|
||||
&& G.ball.y < G.player.y + G.player.height <span class="kw">as </span>i16
|
||||
{
|
||||
G.ball.right = <span class="bool-val">true</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>G.ball.x + G.ball.size <span class="kw">as </span>i16 == G.ai.x
|
||||
&& G.ball.y + G.ball.size <span class="kw">as </span>i16 > G.ai.y
|
||||
&& G.ball.y < G.ai.y + G.ai.height <span class="kw">as </span>i16
|
||||
{
|
||||
G.ball.right = <span class="bool-val">false</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>G.ball.right {
|
||||
G.ball.x += <span class="number">1</span>;
|
||||
} <span class="kw">else </span>{
|
||||
G.ball.x -= <span class="number">1</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>G.ball.down {
|
||||
G.ball.y += <span class="number">1</span>;
|
||||
} <span class="kw">else </span>{
|
||||
G.ball.y -= <span class="number">1</span>;
|
||||
}
|
||||
|
||||
<span class="comment">//
|
||||
//
|
||||
|
||||
// Scoring
|
||||
</span><span class="kw">if </span>G.ball.x + G.ball.size <span class="kw">as </span>i16 == -<span class="number">10 </span>{
|
||||
G.ai_score += <span class="number">1</span>;
|
||||
G.ball.x = (WIDTH / <span class="number">2</span>) <span class="kw">as </span>i16;
|
||||
G.ball.right = <span class="bool-val">true</span>;
|
||||
} <span class="kw">else if </span>G.ball.x == (WIDTH + <span class="number">10</span>) <span class="kw">as </span>i16 {
|
||||
G.player_score += <span class="number">1</span>;
|
||||
G.ball.x = (WIDTH / <span class="number">2</span>) <span class="kw">as </span>i16;
|
||||
G.ball.right = <span class="bool-val">false</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>G.player_score == <span class="number">5 </span>{
|
||||
G.game_state = GameState::Win;
|
||||
} <span class="kw">else if </span>G.ai_score == <span class="number">5 </span>{
|
||||
G.game_state = GameState::Lose;
|
||||
}
|
||||
|
||||
<span class="comment">//
|
||||
// Drawing
|
||||
//
|
||||
|
||||
</span>arduboy.set_cursor(<span class="number">20</span>, <span class="number">2</span>);
|
||||
arduboy.print(G.player_score <span class="kw">as </span>u16);
|
||||
|
||||
arduboy.set_cursor(<span class="number">101</span>, <span class="number">2</span>);
|
||||
arduboy.print(G.ai_score <span class="kw">as </span>u16);
|
||||
|
||||
arduboy.draw_fast_hline(<span class="number">0</span>, <span class="number">0</span>, WIDTH, Color::White);
|
||||
arduboy.draw_fast_hline(<span class="number">0</span>, (HEIGHT - <span class="number">1</span>) <span class="kw">as </span>i16, WIDTH, Color::White);
|
||||
|
||||
G.player.draw();
|
||||
G.ai.draw();
|
||||
G.ball.draw();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,415 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\demo9\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="demo9" 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="../../demo9/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
</span><span class="attr">#[allow(unused_imports)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="attr">#[allow(dead_code)]
|
||||
</span><span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="kw">const </span>WORLD_WIDTH: usize = <span class="number">14</span>;
|
||||
<span class="kw">const </span>WORLD_HEIGHT: usize = <span class="number">7</span>;
|
||||
<span class="kw">const </span>PLAYER_SIZE: i16 = <span class="number">16</span>;
|
||||
<span class="kw">const </span>PLAYER_X_OFFSET: i16 = WIDTH <span class="kw">as </span>i16 / <span class="number">2 </span>- PLAYER_SIZE / <span class="number">2</span>;
|
||||
<span class="kw">const </span>PLAYER_Y_OFFSET: i16 = HEIGHT <span class="kw">as </span>i16 / <span class="number">2 </span>- PLAYER_SIZE / <span class="number">2</span>;
|
||||
<span class="kw">const </span>TILE_SIZE: u8 = <span class="number">16</span>;
|
||||
<span class="kw">const </span>GRASS: u8 = <span class="number">0</span>;
|
||||
<span class="kw">const </span>WATER: u8 = <span class="number">1</span>;
|
||||
<span class="kw">const </span>TREES: u8 = <span class="number">2</span>;
|
||||
<span class="kw">const </span>STONE: u8 = <span class="number">3</span>;
|
||||
<span class="kw">const </span>world: [[u8; WORLD_WIDTH]; WORLD_HEIGHT] = [
|
||||
[
|
||||
TREES, GRASS, GRASS, WATER, GRASS, GRASS, GRASS, TREES, GRASS, GRASS, GRASS, GRASS, GRASS,
|
||||
TREES,
|
||||
],
|
||||
[
|
||||
GRASS, WATER, WATER, WATER, GRASS, WATER, GRASS, GRASS, GRASS, GRASS, GRASS, STONE, GRASS,
|
||||
GRASS,
|
||||
],
|
||||
[
|
||||
GRASS, GRASS, GRASS, GRASS, GRASS, WATER, STONE, GRASS, GRASS, GRASS, TREES, GRASS, GRASS,
|
||||
GRASS,
|
||||
],
|
||||
[
|
||||
STONE, GRASS, GRASS, STONE, TREES, WATER, WATER, WATER, GRASS, WATER, WATER, GRASS, TREES,
|
||||
GRASS,
|
||||
],
|
||||
[
|
||||
GRASS, GRASS, GRASS, GRASS, TREES, GRASS, GRASS, GRASS, TREES, WATER, GRASS, GRASS, STONE,
|
||||
TREES,
|
||||
],
|
||||
[
|
||||
GRASS, GRASS, GRASS, WATER, STONE, GRASS, GRASS, TREES, TREES, TREES, GRASS, GRASS, WATER,
|
||||
WATER,
|
||||
],
|
||||
[
|
||||
GRASS, WATER, WATER, TREES, GRASS, WATER, WATER, TREES, TREES, GRASS, GRASS, GRASS, GRASS,
|
||||
STONE,
|
||||
],
|
||||
];
|
||||
<span class="attr">#[derive(Copy, Clone)]
|
||||
</span><span class="kw">enum </span>Gamestate {
|
||||
GameTitle,
|
||||
GamePlay,
|
||||
GameOver,
|
||||
GameHigh,
|
||||
}
|
||||
<span class="kw">impl </span>Gamestate {
|
||||
<span class="kw">fn </span>update(<span class="kw-2">&mut </span><span class="self">self</span>, new_state: Gamestate) {
|
||||
<span class="kw-2">*</span><span class="self">self </span>= new_state;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// Progmem data
|
||||
</span><span class="macro">progmem!</span>(
|
||||
<span class="kw">static </span>tiles: [u8; <span class="kw">_</span>] = [
|
||||
<span class="number">16</span>, <span class="number">16</span>, <span class="comment">// width, height,
|
||||
//Grass
|
||||
</span><span class="number">0xff</span>, <span class="number">0x7f</span>, <span class="number">0xfb</span>, <span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xbf</span>, <span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xf7</span>, <span class="number">0xff</span>, <span class="number">0xfd</span>, <span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xf7</span>, <span class="number">0x7f</span>,
|
||||
<span class="number">0xff</span>, <span class="number">0xdf</span>, <span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xfb</span>, <span class="number">0x7f</span>, <span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xef</span>, <span class="number">0xfe</span>, <span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xfb</span>, <span class="number">0xff</span>,
|
||||
<span class="number">0x7f</span>, <span class="number">0xff</span>, <span class="comment">//Water
|
||||
</span><span class="number">0x08</span>, <span class="number">0x10</span>, <span class="number">0x10</span>, <span class="number">0x08</span>, <span class="number">0x10</span>, <span class="number">0x08</span>, <span class="number">0x10</span>, <span class="number">0x10</span>, <span class="number">0x10</span>, <span class="number">0x08</span>, <span class="number">0x00</span>, <span class="number">0x00</span>, <span class="number">0x00</span>, <span class="number">0x00</span>, <span class="number">0x00</span>,
|
||||
<span class="number">0x00</span>, <span class="number">0x20</span>, <span class="number">0x40</span>, <span class="number">0x40</span>, <span class="number">0x20</span>, <span class="number">0x00</span>, <span class="number">0x01</span>, <span class="number">0x02</span>, <span class="number">0x02</span>, <span class="number">0x01</span>, <span class="number">0x02</span>, <span class="number">0x02</span>, <span class="number">0x01</span>, <span class="number">0x02</span>, <span class="number">0x21</span>,
|
||||
<span class="number">0x40</span>, <span class="number">0x40</span>, <span class="comment">//Tree
|
||||
</span><span class="number">0xff</span>, <span class="number">0x1f</span>, <span class="number">0x5b</span>, <span class="number">0x3f</span>, <span class="number">0xeb</span>, <span class="number">0xdd</span>, <span class="number">0xff</span>, <span class="number">0xf7</span>, <span class="number">0xbb</span>, <span class="number">0xef</span>, <span class="number">0xfd</span>, <span class="number">0x7f</span>, <span class="number">0xe3</span>, <span class="number">0xcb</span>, <span class="number">0xe3</span>,
|
||||
<span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xc7</span>, <span class="number">0x96</span>, <span class="number">0xc7</span>, <span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xef</span>, <span class="number">0xfd</span>, <span class="number">0xff</span>, <span class="number">0xe3</span>, <span class="number">0xcb</span>, <span class="number">0xe3</span>, <span class="number">0xff</span>, <span class="number">0xff</span>,
|
||||
<span class="number">0x7b</span>, <span class="number">0xff</span>, <span class="comment">//Stone
|
||||
</span><span class="number">0xff</span>, <span class="number">0xdf</span>, <span class="number">0x7b</span>, <span class="number">0x3f</span>, <span class="number">0x9f</span>, <span class="number">0x6f</span>, <span class="number">0x77</span>, <span class="number">0xab</span>, <span class="number">0xdb</span>, <span class="number">0xd7</span>, <span class="number">0xcd</span>, <span class="number">0x5f</span>, <span class="number">0xbf</span>, <span class="number">0x77</span>, <span class="number">0xff</span>,
|
||||
<span class="number">0xff</span>, <span class="number">0xff</span>, <span class="number">0xc1</span>, <span class="number">0xdc</span>, <span class="number">0xd3</span>, <span class="number">0xaf</span>, <span class="number">0x9f</span>, <span class="number">0xae</span>, <span class="number">0xb0</span>, <span class="number">0xbb</span>, <span class="number">0xbd</span>, <span class="number">0xbd</span>, <span class="number">0xba</span>, <span class="number">0xd7</span>, <span class="number">0xcc</span>,
|
||||
<span class="number">0x63</span>, <span class="number">0xff</span>,
|
||||
];
|
||||
);
|
||||
|
||||
<span class="comment">// dynamic ram variables
|
||||
</span><span class="kw">static </span><span class="kw-2">mut </span>gamestate: Gamestate = Gamestate::GameTitle;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>mapx: i16 = <span class="number">0</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>mapy: i16 = <span class="number">0</span>;
|
||||
<span class="comment">// The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.set_frame_rate(<span class="number">45</span>);
|
||||
arduboy.display();
|
||||
arduboy.init_random_seed();
|
||||
arduboy.clear();
|
||||
}
|
||||
|
||||
<span class="comment">// The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span><span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
arduboy.poll_buttons();
|
||||
arduboy.clear();
|
||||
gameloop();
|
||||
arduboy.display();
|
||||
}
|
||||
<span class="kw">unsafe fn </span>draw_player() {
|
||||
arduboy.fill_rect(
|
||||
PLAYER_X_OFFSET,
|
||||
PLAYER_Y_OFFSET,
|
||||
PLAYER_SIZE <span class="kw">as </span>u8,
|
||||
PLAYER_SIZE <span class="kw">as </span>u8,
|
||||
Color::Black,
|
||||
)
|
||||
}
|
||||
|
||||
<span class="kw">unsafe fn </span>draw_world() {
|
||||
<span class="kw">let </span>tileswide: u8 = WIDTH / TILE_SIZE + <span class="number">1</span>;
|
||||
<span class="kw">let </span>tilestall: u8 = HEIGHT / TILE_SIZE + <span class="number">1</span>;
|
||||
<span class="kw">for </span>y <span class="kw">in </span><span class="number">0</span>..tilestall <span class="kw">as </span>i16 {
|
||||
<span class="kw">for </span>x <span class="kw">in </span><span class="number">0</span>..tileswide <span class="kw">as </span>i16 {
|
||||
<span class="kw">let </span>tilesx: i16 = x - mapx / TILE_SIZE <span class="kw">as </span>i16;
|
||||
<span class="kw">let </span>tilesy: i16 = y - mapy / TILE_SIZE <span class="kw">as </span>i16;
|
||||
<span class="kw">if </span>tilesx >= <span class="number">0
|
||||
</span>&& tilesy >= <span class="number">0
|
||||
</span>&& tilesx < WORLD_WIDTH <span class="kw">as </span>i16
|
||||
&& tilesy < WORLD_HEIGHT <span class="kw">as </span>i16
|
||||
{
|
||||
sprites::draw_override(
|
||||
x * TILE_SIZE <span class="kw">as </span>i16 + mapx % TILE_SIZE <span class="kw">as </span>i16,
|
||||
y * TILE_SIZE <span class="kw">as </span>i16 + mapy % TILE_SIZE <span class="kw">as </span>i16,
|
||||
<span class="macro">get_sprite_addr!</span>(tiles),
|
||||
world[tilesy <span class="kw">as </span>usize][tilesx <span class="kw">as </span>usize],
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
arduboy.fill_rect(<span class="number">0</span>, <span class="number">0</span>, <span class="number">48</span>, <span class="number">8</span>, Color::Black);
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.print(<span class="number">0 </span>- mapx / TILE_SIZE <span class="kw">as </span>i16);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b",\0"</span>));
|
||||
arduboy.print(<span class="number">0 </span>- mapy / TILE_SIZE <span class="kw">as </span>i16)
|
||||
}
|
||||
<span class="kw">fn </span>titlescreen() {
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Title Screen\n\0"</span>));
|
||||
<span class="kw">if </span>arduboy.just_pressed(A_BUTTON) {
|
||||
<span class="kw">unsafe </span>{ gamestate.update(Gamestate::GamePlay) }
|
||||
}
|
||||
}
|
||||
<span class="kw">unsafe fn </span>player_input() {
|
||||
<span class="kw">if </span>arduboy.pressed(UP) {
|
||||
<span class="kw">if </span>mapy < PLAYER_Y_OFFSET {
|
||||
mapy += <span class="number">1
|
||||
</span>}
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(DOWN) {
|
||||
<span class="kw">if </span>PLAYER_Y_OFFSET + PLAYER_SIZE < mapy + TILE_SIZE <span class="kw">as </span>i16 * WORLD_HEIGHT <span class="kw">as </span>i16 {
|
||||
mapy -= <span class="number">1
|
||||
</span>}
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(LEFT) {
|
||||
<span class="kw">if </span>mapx < PLAYER_X_OFFSET {
|
||||
mapx += <span class="number">1
|
||||
</span>}
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(RIGHT) {
|
||||
<span class="kw">if </span>PLAYER_X_OFFSET + PLAYER_SIZE < mapx + TILE_SIZE <span class="kw">as </span>i16 * WORLD_WIDTH <span class="kw">as </span>i16 {
|
||||
mapx -= <span class="number">1
|
||||
</span>}
|
||||
}
|
||||
}
|
||||
<span class="kw">unsafe fn </span>gameplay() {
|
||||
player_input();
|
||||
draw_world();
|
||||
draw_player();
|
||||
<span class="kw">if </span>arduboy.just_pressed(A_BUTTON) {
|
||||
<span class="kw">unsafe </span>{ gamestate.update(Gamestate::GameOver) }
|
||||
}
|
||||
}
|
||||
<span class="kw">fn </span>gameover_screen() {
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Game Over Screen\n\0"</span>));
|
||||
<span class="kw">if </span>arduboy.just_pressed(A_BUTTON) {
|
||||
<span class="kw">unsafe </span>{ gamestate.update(Gamestate::GameHigh) }
|
||||
}
|
||||
}
|
||||
<span class="kw">fn </span>highscore_screen() {
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"High Score Screen\n\0"</span>));
|
||||
<span class="kw">if </span>arduboy.just_pressed(A_BUTTON) {
|
||||
<span class="kw">unsafe </span>{ gamestate.update(Gamestate::GameTitle) }
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">unsafe fn </span>gameloop() {
|
||||
<span class="kw">match unsafe </span>{ gamestate } {
|
||||
Gamestate::GameTitle => titlescreen(),
|
||||
Gamestate::GamePlay => gameplay(),
|
||||
Gamestate::GameOver => gameover_screen(),
|
||||
Gamestate::GameHigh => highscore_screen(),
|
||||
}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,261 +0,0 @@
|
|||
<!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 `Examples\drboy\src\gameloop.rs`."><title>gameloop.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="drboy" 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="../../drboy/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>
|
||||
</pre></div><pre class="rust"><code><span class="kw">use crate</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">pub unsafe fn </span>gameloop() {
|
||||
arduboy.set_cursor(<span class="number">70</span>, <span class="number">0</span>);
|
||||
arduboy.set_text_size(<span class="number">1</span>);
|
||||
arduboy.print(<span class="macro">get_string_addr!</span>(overlay_score));
|
||||
arduboy.print(p.counter <span class="kw">as </span>i16);
|
||||
<span class="kw">match </span>p.live {
|
||||
<span class="number">3 </span>=> sprites::draw_override(<span class="number">0</span>, <span class="number">0</span>, <span class="macro">get_sprite_addr!</span>(overlay_3hearts), <span class="number">0</span>),
|
||||
<span class="number">2 </span>=> sprites::draw_override(<span class="number">0</span>, <span class="number">0</span>, <span class="macro">get_sprite_addr!</span>(overlay_2hearts), <span class="number">0</span>),
|
||||
<span class="number">1 </span>=> sprites::draw_override(<span class="number">0</span>, <span class="number">0</span>, <span class="macro">get_sprite_addr!</span>(overlay_1heart), <span class="number">0</span>),
|
||||
<span class="kw">_ </span>=> (),
|
||||
}
|
||||
<span class="kw">if </span>p.active {
|
||||
sprites::draw_override(p.rect.x, p.rect.y, p.bitmap, p.bitmap_frame <span class="kw">as </span>u8);
|
||||
}
|
||||
|
||||
<span class="kw">if </span>p.immortal {
|
||||
p.immortal_frame_count += <span class="number">1</span>;
|
||||
<span class="kw">if </span>arduboy.every_x_frames(<span class="number">10</span>) {
|
||||
p.active = !p.active
|
||||
}
|
||||
<span class="kw">if </span>p.immortal_frame_count == <span class="number">60 </span>{
|
||||
p.immortal_frame_count = <span class="number">0</span>;
|
||||
p.immortal = <span class="bool-val">false</span>;
|
||||
p.active = <span class="bool-val">true
|
||||
</span>}
|
||||
}
|
||||
|
||||
vec_enemies.iter_mut().for_each(|f| {
|
||||
<span class="kw">if </span>f.active {
|
||||
sprites::draw_override(f.rect.x * <span class="number">8</span>, f.rect.y * <span class="number">8</span>, f.bitmap, f.bitmap_frame);
|
||||
}
|
||||
|
||||
<span class="kw">if </span>arduboy.every_x_frames(p.speed <span class="kw">as </span>u8) && f.active {
|
||||
f.move_down();
|
||||
<span class="kw">if </span>f.rect.x < <span class="number">0 </span>{
|
||||
f.active = <span class="bool-val">false</span>;
|
||||
p.live -= <span class="number">1</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">let </span>frect = Rect {
|
||||
x: f.rect.x * <span class="number">8</span>,
|
||||
y: f.rect.y * <span class="number">8</span>,
|
||||
width: <span class="number">8</span>,
|
||||
height: <span class="number">8</span>,
|
||||
};
|
||||
<span class="kw">if </span>!p.immortal && f.active {
|
||||
<span class="kw">if </span>arduboy.collide_rect(p.rect, frect) {
|
||||
<span class="kw">if </span>p.bitmap_frame <span class="kw">as </span>u8 == f.bitmap_frame {
|
||||
f.active = <span class="bool-val">false</span>;
|
||||
p.speed_change = <span class="bool-val">false</span>;
|
||||
p.counter += <span class="number">1</span>;
|
||||
} <span class="kw">else </span>{
|
||||
p.live -= <span class="number">1</span>;
|
||||
p.immortal = <span class="bool-val">true</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
<span class="kw">if </span>arduboy.every_x_frames((p.speed * <span class="number">2</span>) <span class="kw">as </span>u8) {
|
||||
<span class="kw">if </span>enemy_count > <span class="number">8 </span>{
|
||||
<span class="kw">let _ </span>= vec_enemies.remove(<span class="number">0</span>);
|
||||
}
|
||||
vec_enemies
|
||||
.push(Enemy {
|
||||
active: <span class="bool-val">true</span>,
|
||||
bitmap: <span class="macro">get_sprite_addr!</span>(enemies),
|
||||
bitmap_frame: random_less_than(<span class="number">3</span>) <span class="kw">as </span>u8,
|
||||
rect: Rect {
|
||||
x: random_between(<span class="number">15</span>, <span class="number">16</span>) <span class="kw">as </span>i16,
|
||||
y: random_between(<span class="number">1</span>, <span class="number">8</span>) <span class="kw">as </span>i16,
|
||||
width: <span class="number">8</span>,
|
||||
height: <span class="number">8</span>,
|
||||
},
|
||||
})
|
||||
.unwrap();
|
||||
enemy_count += <span class="number">1
|
||||
</span>}
|
||||
<span class="kw">if </span>p.live == <span class="number">0 </span>{
|
||||
<span class="kw">let </span>score = scorebord.check_score(p.counter);
|
||||
<span class="kw">if </span>score > <span class="number">0 </span>{
|
||||
scorebord.update_score(p.counter, <span class="kw-2">&</span>eeprom)
|
||||
}
|
||||
p.gamemode = GameMode::Losescreen;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(UP) {
|
||||
<span class="kw">if </span>p.rect.y > <span class="number">7 </span>{
|
||||
p.rect.y -= <span class="number">1</span>;
|
||||
}
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(DOWN) {
|
||||
<span class="kw">if </span>p.rect.y < <span class="number">56 </span>{
|
||||
p.rect.y += <span class="number">1</span>;
|
||||
}
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(LEFT) {
|
||||
<span class="kw">if </span>p.rect.x > <span class="number">0 </span>{
|
||||
p.rect.x -= <span class="number">1</span>;
|
||||
}
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(RIGHT) {
|
||||
<span class="kw">if </span>p.rect.x < <span class="number">120 </span>{
|
||||
p.rect.x += <span class="number">1</span>;
|
||||
}
|
||||
}
|
||||
<span class="kw">if </span>arduboy.just_pressed(A) {
|
||||
p.bitmap_frame += <span class="number">1</span>;
|
||||
<span class="kw">if </span>p.bitmap_frame > <span class="number">2 </span>{
|
||||
p.bitmap_frame = <span class="number">0
|
||||
</span>}
|
||||
}
|
||||
<span class="kw">if </span>arduboy.just_pressed(B) {
|
||||
p.bitmap_frame -= <span class="number">1</span>;
|
||||
<span class="kw">if </span>p.bitmap_frame < <span class="number">0 </span>{
|
||||
p.bitmap_frame = <span class="number">2
|
||||
</span>}
|
||||
}
|
||||
<span class="kw">if </span>p.counter % <span class="number">5 </span>== <span class="number">0 </span>&& p.counter != <span class="number">0 </span>&& !p.speed_change {
|
||||
p.speed_change = <span class="bool-val">true</span>;
|
||||
p.speed -= <span class="number">1
|
||||
</span>}
|
||||
<span class="comment">// if p.counter == 30 {
|
||||
// p.level += 1;
|
||||
// p.gamemode = GameMode::Winscreen;
|
||||
// }
|
||||
</span>}
|
||||
|
||||
<span class="macro">progmem!</span>();
|
||||
</code></pre></div></section></main></body></html>
|
File diff suppressed because it is too large
Load diff
|
@ -1,151 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\eeprom\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="eeprom" 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="../../eeprom/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
</span><span class="attr">#[allow(unused_imports)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
|
||||
<span class="comment">// Progmem data
|
||||
|
||||
// dynamic ram variables
|
||||
</span><span class="kw">static </span>e: EEPROM = EEPROM::new(<span class="number">10</span>);
|
||||
<span class="kw">struct </span>Scorebord {
|
||||
player1: u16,
|
||||
text: <span class="kw-2">&</span><span class="lifetime">'static </span>str,
|
||||
}
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>s: Scorebord = Scorebord {
|
||||
player1: <span class="number">0</span>,
|
||||
text: <span class="string">"lol\0"</span>,
|
||||
};
|
||||
|
||||
<span class="comment">// The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.set_frame_rate(<span class="number">1</span>);
|
||||
arduboy.clear();
|
||||
e.init(<span class="kw-2">&mut </span>s);
|
||||
}
|
||||
|
||||
<span class="comment">// The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span><span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
arduboy.poll_buttons();
|
||||
<span class="kw">if </span>arduboy.just_pressed(B) {
|
||||
s.player1 += <span class="number">1</span>;
|
||||
e.put(<span class="kw-2">&</span>s);
|
||||
}
|
||||
<span class="kw">if </span>arduboy.just_pressed(DOWN) {
|
||||
s.player1 -= <span class="number">1</span>;
|
||||
e.put(<span class="kw-2">&</span>s);
|
||||
}
|
||||
<span class="kw">if </span>arduboy.just_pressed(A) {
|
||||
s.player1 += <span class="number">1</span>;
|
||||
e.get(<span class="kw-2">&mut </span>s);
|
||||
}
|
||||
arduboy.clear();
|
||||
<span class="kw">if </span>s.player1 == <span class="number">5 </span>{
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"lolxd\0"</span>));
|
||||
s.text = <span class="string">"it works!!!\0"</span>;
|
||||
e.put(<span class="kw-2">&</span>s)
|
||||
} <span class="kw">else </span>{
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"nope\0"</span>));
|
||||
s.text = <span class="string">"lol\0"</span>;
|
||||
e.put(<span class="kw-2">&</span>s)
|
||||
}
|
||||
|
||||
<span class="comment">//e.get(&mut s);
|
||||
</span>arduboy.print(<span class="string">"\n\0"</span>);
|
||||
arduboy.print(<span class="string">"eeprom save: \0"</span>);
|
||||
<span class="kw">let </span>ss: Scorebord = e.get_direct();
|
||||
arduboy.print(ss.player1);
|
||||
arduboy.print(<span class="string">"\nscore save: \0"</span>);
|
||||
arduboy.print(s.player1);
|
||||
arduboy.print(<span class="string">"\n \0"</span>);
|
||||
arduboy.print(s.text);
|
||||
|
||||
arduboy.display();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,113 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\eeprom-byte\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="eeprom_byte" 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="../../eeprom_byte/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="attr">#[allow(unused_imports)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
|
||||
<span class="comment">// #[link_section = ".progmem.data"]
|
||||
|
||||
// Setup eeprom memory
|
||||
</span><span class="kw">static </span><span class="kw-2">mut </span>eeprom: EEPROMBYTE = EEPROMBYTE::new(<span class="number">10</span>);
|
||||
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>count: u8 = <span class="number">0</span>;
|
||||
|
||||
<span class="comment">// The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
eeprom.init();
|
||||
arduboy.clear();
|
||||
arduboy.set_frame_rate(<span class="number">30</span>);
|
||||
}
|
||||
<span class="comment">// The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span><span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
arduboy.clear();
|
||||
arduboy.poll_buttons();
|
||||
<span class="kw">if </span>arduboy.just_pressed(UP) {
|
||||
count += <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.just_pressed(DOWN) {
|
||||
count -= <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.just_pressed(A) {
|
||||
eeprom.update(count)
|
||||
}
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.print(count <span class="kw">as </span>u16);
|
||||
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">30</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Counter:\0"</span>));
|
||||
arduboy.print(count <span class="kw">as </span>u16);
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">40</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"eeprom:\0"</span>));
|
||||
|
||||
<span class="comment">//arduboy.print(eeprom.read() as u16);
|
||||
|
||||
</span>arduboy.display();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,41 +0,0 @@
|
|||
<!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 `Examples\ArduboyFX\fxbasicexample\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="fxbasicexample" 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="../../fxbasicexample/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Holmes is cool!\0"</span>));
|
||||
arduboy.display();
|
||||
}
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,41 +0,0 @@
|
|||
<!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 `Examples\ArduboyFX\fxchompies\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="fxchompies" 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="../../fxchompies/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Holmes is cool!\0"</span>));
|
||||
arduboy.display();
|
||||
}
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,41 +0,0 @@
|
|||
<!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 `Examples\ArduboyFX\fxdrawballs\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="fxdrawballs" 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="../../fxdrawballs/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Holmes is cool!\0"</span>));
|
||||
arduboy.display();
|
||||
}
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,41 +0,0 @@
|
|||
<!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 `Examples\ArduboyFX\fxdrawframes\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="fxdrawframes" 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="../../fxdrawframes/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Holmes is cool!\0"</span>));
|
||||
arduboy.display();
|
||||
}
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,41 +0,0 @@
|
|||
<!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 `Examples\ArduboyFX\fxhelloworld\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="fxhelloworld" 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="../../fxhelloworld/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Holmes is cool!\0"</span>));
|
||||
arduboy.display();
|
||||
}
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,41 +0,0 @@
|
|||
<!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 `Examples\ArduboyFX\fxloadgamestate\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="fxloadgamestate" 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="../../fxloadgamestate/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="comment">//The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Holmes is cool!\0"</span>));
|
||||
arduboy.display();
|
||||
}
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span>}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,101 +0,0 @@
|
|||
<!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 `Project\game\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="game" 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="../../game/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
</span><span class="attr">#[allow(unused_imports)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="attr">#[allow(dead_code)]
|
||||
</span><span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
|
||||
<span class="comment">// Progmem data
|
||||
|
||||
// dynamic ram variables
|
||||
</span><span class="kw">const </span>FX_DATA_PAGE: u16 = <span class="number">0xffff</span>;
|
||||
<span class="kw">const </span>FX_DATA_BYTES: u32 = <span class="number">234</span>;
|
||||
<span class="kw">const </span>FXlogo: u32 = <span class="number">0x000000</span>;
|
||||
<span class="kw">const </span>FXlogoWith: i16 = <span class="number">115</span>;
|
||||
<span class="kw">const </span>FXlogoHeight: i16 = <span class="number">16</span>;
|
||||
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>x: i16 = (WIDTH - FXlogoWith) / <span class="number">2</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>y: i16 = <span class="number">25</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>xDir: i8 = <span class="number">1</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>yDir: i8 = <span class="number">1</span>;
|
||||
<span class="comment">// The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.set_frame_rate(<span class="number">30</span>);
|
||||
FX::begin_data(FX_DATA_PAGE);
|
||||
}
|
||||
<span class="comment">// The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span><span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
FX::draw_bitmap(x, y, FXlogo, <span class="number">0</span>, <span class="number">0</span>);
|
||||
x += xDir <span class="kw">as </span>i16;
|
||||
y += yDir <span class="kw">as </span>i16;
|
||||
<span class="kw">if </span>x == <span class="number">0 </span>|| x == WIDTH - FXlogoWith {
|
||||
xDir = -xDir;
|
||||
}
|
||||
<span class="kw">if </span>y == <span class="number">0 </span>|| y == HEIGHT - FXlogoHeight {
|
||||
yDir = -yDir;
|
||||
}
|
||||
FX::display_clear()
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,4 +1,4 @@
|
|||
<!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\hash32-0.2.1\src\fnv.rs`."><title>fnv.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="hash32" 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="../../hash32/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>
|
||||
<!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\hash32-0.2.1\src\fnv.rs`."><title>fnv.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="hash32" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../hash32/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\hash32-0.2.1\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="hash32" 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="../../hash32/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>
|
||||
<!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\hash32-0.2.1\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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="hash32" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../hash32/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\hash32-0.2.1\src\murmur3.rs`."><title>murmur3.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="hash32" 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="../../hash32/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>
|
||||
<!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\hash32-0.2.1\src\murmur3.rs`."><title>murmur3.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="hash32" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../hash32/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\binary_heap.rs`."><title>binary_heap.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\binary_heap.rs`."><title>binary_heap.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\deque.rs`."><title>deque.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\deque.rs`."><title>deque.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\histbuf.rs`."><title>histbuf.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\histbuf.rs`."><title>histbuf.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\indexmap.rs`."><title>indexmap.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\indexmap.rs`."><title>indexmap.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\indexset.rs`."><title>indexset.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\indexset.rs`."><title>indexset.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\linear_map.rs`."><title>linear_map.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\linear_map.rs`."><title>linear_map.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\sealed.rs`."><title>sealed.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\sealed.rs`."><title>sealed.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\sorted_linked_list.rs`."><title>sorted_linked_list.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\sorted_linked_list.rs`."><title>sorted_linked_list.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\string.rs`."><title>string.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\string.rs`."><title>string.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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\heapless-0.7.16\src\vec.rs`."><title>vec.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="heapless" 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="../../heapless/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>
|
||||
<!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\heapless-0.7.16\src\vec.rs`."><title>vec.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="heapless" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../heapless/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>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!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>
|
||||
<!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-fa3bb1812debf86c.css"><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.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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>
|
||||
|
|
|
@ -1,227 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\progmem\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="progmem" 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="../../progmem/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![feature(const_trait_impl)]
|
||||
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">use </span>arduboy_tones::tones_pitch::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="kw">const </span>sound: ArduboyTones = ArduboyTones::new();
|
||||
<span class="comment">// Progmem data
|
||||
</span><span class="macro">progmem!</span>(
|
||||
<span class="kw">static </span>text1: [u8; <span class="kw">_</span>] = <span class="kw-2">*</span><span class="string">b"I'm a PROGMEM Text\0"</span>;
|
||||
<span class="kw">static </span>player_sprite1: [u8; <span class="kw">_</span>] = [
|
||||
<span class="number">16</span>, <span class="number">16</span>, <span class="number">0xfe</span>, <span class="number">0x01</span>, <span class="number">0x3d</span>, <span class="number">0x25</span>, <span class="number">0x25</span>, <span class="number">0x3d</span>, <span class="number">0x01</span>, <span class="number">0x01</span>, <span class="number">0xc1</span>, <span class="number">0x01</span>, <span class="number">0x3d</span>, <span class="number">0x25</span>, <span class="number">0x25</span>, <span class="number">0x3d</span>,
|
||||
<span class="number">0x01</span>, <span class="number">0xfe</span>, <span class="number">0x7f</span>, <span class="number">0x80</span>, <span class="number">0x9c</span>, <span class="number">0xbc</span>, <span class="number">0xb0</span>, <span class="number">0xb0</span>, <span class="number">0xb2</span>, <span class="number">0xb2</span>, <span class="number">0xb3</span>, <span class="number">0xb0</span>, <span class="number">0xb0</span>, <span class="number">0xb0</span>, <span class="number">0xbc</span>,
|
||||
<span class="number">0x9c</span>, <span class="number">0x80</span>, <span class="number">0x7f</span>,
|
||||
];
|
||||
<span class="kw">static </span>tones: [u16; <span class="kw">_</span>] = [
|
||||
NOTE_E4,
|
||||
<span class="number">400</span>,
|
||||
NOTE_D4,
|
||||
<span class="number">200</span>,
|
||||
NOTE_C4,
|
||||
<span class="number">400</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">200</span>,
|
||||
NOTE_D4,
|
||||
<span class="number">200</span>,
|
||||
NOTE_C4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_C4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_E4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_G4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_F4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_A4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_D5H,
|
||||
<span class="number">200</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">200</span>,
|
||||
NOTE_D5H,
|
||||
<span class="number">200</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">1500</span>,
|
||||
TONES_REPEAT,
|
||||
];
|
||||
);
|
||||
|
||||
<span class="comment">// dynamic ram variables
|
||||
</span><span class="kw">static </span><span class="kw-2">mut </span>playerx: c_int = <span class="number">5</span>;
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>playery: c_int = <span class="number">10</span>;
|
||||
|
||||
<span class="comment">// The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.clear();
|
||||
arduboy.set_frame_rate(<span class="number">60</span>);
|
||||
<span class="comment">// load sound sequence from progmem
|
||||
</span>sound.tones(<span class="macro">get_tones_addr!</span>(tones));
|
||||
}
|
||||
<span class="comment">// The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span><span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
arduboy.poll_buttons();
|
||||
<span class="kw">if </span>arduboy.pressed(LEFT) {
|
||||
playerx -= <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(RIGHT) {
|
||||
playerx += <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(UP) {
|
||||
playery -= <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(DOWN) {
|
||||
playery += <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>arduboy.just_pressed(A) {
|
||||
<span class="kw">if </span>arduboy.audio_enabled() {
|
||||
arduboy.audio_off()
|
||||
} <span class="kw">else </span>{
|
||||
arduboy.audio_on()
|
||||
}
|
||||
}
|
||||
arduboy.clear();
|
||||
arduboy.set_cursor((WIDTH <span class="kw">as </span>i16 / <span class="number">2</span>) - (text1.len() <span class="kw">as </span>i16 * FONT_SIZE <span class="kw">as </span>i16 / <span class="number">2</span>), <span class="number">10</span>);
|
||||
arduboy.print(<span class="macro">get_string_addr!</span>(text1));
|
||||
sprites::draw_override(playerx, playery, <span class="macro">get_sprite_addr!</span>(player_sprite1), <span class="number">0</span>);
|
||||
arduboy.display();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,155 +0,0 @@
|
|||
<!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 `Examples\rustacean\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="rustacean" 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="../../rustacean/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![feature(c_size_t)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="kw">const </span>sound: ArduboyTones = ArduboyTones::new();
|
||||
|
||||
<span class="kw">const </span>BOTTOM: u8 = <span class="number">64</span>;
|
||||
<span class="kw">const </span>RIGHT_END: u8 = <span class="number">128</span>;
|
||||
|
||||
<span class="kw">const </span>CHAR_WIDTH: u8 = <span class="number">6</span>;
|
||||
<span class="kw">const </span>CHAR_HEIGHT: u8 = <span class="number">8</span>;
|
||||
|
||||
<span class="kw">const </span>MSG: <span class="kw-2">&</span>str = <span class="string">" I'm now a \0"</span>;
|
||||
<span class="kw">const </span>MSG2: <span class="kw-2">&</span>str = <span class="string">"Rustacean <3\0"</span>;
|
||||
|
||||
<span class="kw">struct </span>Environment {
|
||||
x: u8,
|
||||
y: u8,
|
||||
msg_len: u8,
|
||||
}
|
||||
<span class="kw">impl </span>Environment {
|
||||
<span class="kw">unsafe fn </span>setup(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
arduboy.begin();
|
||||
arduboy.set_frame_rate(<span class="number">60</span>);
|
||||
<span class="kw">let </span>msg_len = MSG.len();
|
||||
<span class="macro">debug_assert!</span>(msg_len <= (core::u8::MAX <span class="kw">as </span>c_size_t));
|
||||
<span class="self">self</span>.msg_len = msg_len <span class="kw">as </span>u8;
|
||||
}
|
||||
|
||||
<span class="kw">unsafe fn </span>loop_(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>UP.pressed() && <span class="self">self</span>.y > <span class="number">0 </span>{
|
||||
<span class="self">self</span>.y -= <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>RIGHT.pressed() && <span class="self">self</span>.x < RIGHT_END - CHAR_WIDTH * <span class="self">self</span>.msg_len {
|
||||
<span class="self">self</span>.x += <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>LEFT.pressed() && <span class="self">self</span>.x > <span class="number">0 </span>{
|
||||
<span class="self">self</span>.x -= <span class="number">1</span>;
|
||||
}
|
||||
<span class="kw">if </span>DOWN.pressed() && <span class="self">self</span>.y < BOTTOM - CHAR_HEIGHT * <span class="number">2 </span>{
|
||||
<span class="self">self</span>.y += <span class="number">1</span>;
|
||||
}
|
||||
|
||||
<span class="kw">if </span>(A | B).pressed() {
|
||||
sound.tone(<span class="number">0xff</span>, <span class="number">0x3f</span>);
|
||||
}
|
||||
|
||||
arduboy.clear();
|
||||
arduboy.set_cursor(<span class="self">self</span>.x.into(), <span class="self">self</span>.y.into());
|
||||
arduboy.print(MSG);
|
||||
arduboy.set_cursor(<span class="self">self</span>.x.into(), (<span class="self">self</span>.y + <span class="number">9</span>).into());
|
||||
arduboy.print(MSG2);
|
||||
arduboy.display();
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>E: Environment = Environment {
|
||||
x: <span class="number">0</span>,
|
||||
y: <span class="number">0</span>,
|
||||
msg_len: <span class="number">0</span>,
|
||||
};
|
||||
|
||||
<span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
E.setup();
|
||||
}
|
||||
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
E.loop_();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,89 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\serial\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="serial" 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="../../serial/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>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
</span><span class="attr">#[allow(unused_imports)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="attr">#[allow(dead_code)]
|
||||
</span><span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
|
||||
<span class="comment">// Progmem data
|
||||
|
||||
// dynamic ram variables
|
||||
|
||||
// The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.set_frame_rate(<span class="number">30</span>);
|
||||
arduboy.clear();
|
||||
serial::begin(<span class="number">9600</span>)
|
||||
}
|
||||
|
||||
<span class="comment">// The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span><span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="kw">if </span>serial::available() > <span class="number">0 </span>{
|
||||
<span class="kw">let </span>incoming_byte = serial::read_as_utf8_str();
|
||||
serial::print(<span class="string">"I received: \0"</span>);
|
||||
|
||||
serial::println(incoming_byte);
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(A) {
|
||||
serial::println(<span class="string">"kekw\0"</span>)
|
||||
}
|
||||
|
||||
arduboy.display();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,633 +0,0 @@
|
|||
<!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 `Examples\snake\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="snake" 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="../../snake/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>
|
||||
<a href="#251" id="251">251</a>
|
||||
<a href="#252" id="252">252</a>
|
||||
<a href="#253" id="253">253</a>
|
||||
<a href="#254" id="254">254</a>
|
||||
<a href="#255" id="255">255</a>
|
||||
<a href="#256" id="256">256</a>
|
||||
<a href="#257" id="257">257</a>
|
||||
<a href="#258" id="258">258</a>
|
||||
<a href="#259" id="259">259</a>
|
||||
<a href="#260" id="260">260</a>
|
||||
<a href="#261" id="261">261</a>
|
||||
<a href="#262" id="262">262</a>
|
||||
<a href="#263" id="263">263</a>
|
||||
<a href="#264" id="264">264</a>
|
||||
<a href="#265" id="265">265</a>
|
||||
<a href="#266" id="266">266</a>
|
||||
<a href="#267" id="267">267</a>
|
||||
<a href="#268" id="268">268</a>
|
||||
<a href="#269" id="269">269</a>
|
||||
<a href="#270" id="270">270</a>
|
||||
<a href="#271" id="271">271</a>
|
||||
<a href="#272" id="272">272</a>
|
||||
<a href="#273" id="273">273</a>
|
||||
<a href="#274" id="274">274</a>
|
||||
<a href="#275" id="275">275</a>
|
||||
<a href="#276" id="276">276</a>
|
||||
<a href="#277" id="277">277</a>
|
||||
<a href="#278" id="278">278</a>
|
||||
<a href="#279" id="279">279</a>
|
||||
<a href="#280" id="280">280</a>
|
||||
<a href="#281" id="281">281</a>
|
||||
<a href="#282" id="282">282</a>
|
||||
<a href="#283" id="283">283</a>
|
||||
<a href="#284" id="284">284</a>
|
||||
<a href="#285" id="285">285</a>
|
||||
<a href="#286" id="286">286</a>
|
||||
<a href="#287" id="287">287</a>
|
||||
<a href="#288" id="288">288</a>
|
||||
<a href="#289" id="289">289</a>
|
||||
<a href="#290" id="290">290</a>
|
||||
<a href="#291" id="291">291</a>
|
||||
<a href="#292" id="292">292</a>
|
||||
<a href="#293" id="293">293</a>
|
||||
<a href="#294" id="294">294</a>
|
||||
<a href="#295" id="295">295</a>
|
||||
<a href="#296" id="296">296</a>
|
||||
<a href="#297" id="297">297</a>
|
||||
<a href="#298" id="298">298</a>
|
||||
<a href="#299" id="299">299</a>
|
||||
<a href="#300" id="300">300</a>
|
||||
<a href="#301" id="301">301</a>
|
||||
<a href="#302" id="302">302</a>
|
||||
<a href="#303" id="303">303</a>
|
||||
<a href="#304" id="304">304</a>
|
||||
<a href="#305" id="305">305</a>
|
||||
<a href="#306" id="306">306</a>
|
||||
<a href="#307" id="307">307</a>
|
||||
<a href="#308" id="308">308</a>
|
||||
<a href="#309" id="309">309</a>
|
||||
<a href="#310" id="310">310</a>
|
||||
<a href="#311" id="311">311</a>
|
||||
<a href="#312" id="312">312</a>
|
||||
<a href="#313" id="313">313</a>
|
||||
<a href="#314" id="314">314</a>
|
||||
<a href="#315" id="315">315</a>
|
||||
<a href="#316" id="316">316</a>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="kw">const </span>sound: ArduboyTones = ArduboyTones::new();
|
||||
<span class="attr">#[allow(dead_code)]
|
||||
#[repr(C)]
|
||||
</span><span class="kw">struct </span>Scorebord {
|
||||
places: [u16; <span class="number">3</span>],
|
||||
}
|
||||
<span class="kw">impl </span>Scorebord {
|
||||
<span class="kw">fn </span>check_score(<span class="kw-2">&</span><span class="self">self</span>, score: u16) -> bool {
|
||||
<span class="self">self</span>.places[<span class="number">2</span>] < score
|
||||
}
|
||||
<span class="kw">fn </span>update_score(<span class="kw-2">&mut </span><span class="self">self</span>, score: u16) {
|
||||
<span class="kw">match </span>score {
|
||||
s <span class="kw">if </span><span class="self">self</span>.places[<span class="number">0</span>] < s => {
|
||||
<span class="self">self</span>.places[<span class="number">2</span>] = <span class="self">self</span>.places[<span class="number">1</span>];
|
||||
<span class="self">self</span>.places[<span class="number">1</span>] = <span class="self">self</span>.places[<span class="number">0</span>];
|
||||
<span class="self">self</span>.places[<span class="number">0</span>] = s
|
||||
}
|
||||
s <span class="kw">if </span><span class="self">self</span>.places[<span class="number">1</span>] < s => {
|
||||
<span class="self">self</span>.places[<span class="number">2</span>] = <span class="self">self</span>.places[<span class="number">1</span>];
|
||||
<span class="self">self</span>.places[<span class="number">1</span>] = s
|
||||
}
|
||||
s <span class="kw">if </span><span class="self">self</span>.places[<span class="number">2</span>] < s => <span class="self">self</span>.places[<span class="number">2</span>] = s,
|
||||
<span class="kw">_ </span>=> (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>scoreboard: Scorebord = Scorebord { places: [<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>] };
|
||||
<span class="kw">static </span>eeprom: EEPROM = EEPROM::new(<span class="number">101</span>);
|
||||
<span class="kw">const </span>WORLD_WIDTH: u8 = <span class="number">32</span>;
|
||||
<span class="kw">const </span>WORLD_HEIGHT: u8 = <span class="number">16</span>;
|
||||
<span class="kw">const </span>SCALE_FACTOR: u8 = <span class="number">4</span>;
|
||||
<span class="attr">#[allow(dead_code)]
|
||||
</span><span class="kw">enum </span>State {
|
||||
Title,
|
||||
Game,
|
||||
Win,
|
||||
Scorebord,
|
||||
GameOver,
|
||||
Reset,
|
||||
Pause,
|
||||
}
|
||||
<span class="attr">#[derive(PartialEq, Copy, Clone)]
|
||||
</span><span class="kw">enum </span>Direction {
|
||||
Up,
|
||||
Left,
|
||||
Down,
|
||||
Right,
|
||||
}
|
||||
<span class="kw">struct </span>Snake {
|
||||
game_state: State,
|
||||
points: u16,
|
||||
len: u8,
|
||||
pos: [(u8, u8); <span class="number">255 </span><span class="kw">as </span>usize],
|
||||
next_food: (u8, u8),
|
||||
delta_time: u8,
|
||||
direction: Direction,
|
||||
last_direction: Direction,
|
||||
}
|
||||
<span class="kw">impl </span>Snake {
|
||||
<span class="kw">fn </span>movement(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize {
|
||||
<span class="self">self</span>.pos[i] = <span class="self">self</span>.pos[i + <span class="number">1</span>];
|
||||
}
|
||||
<span class="kw">let </span>(x, y) = <span class="self">self</span>.pos[(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize];
|
||||
<span class="kw">match </span><span class="self">self</span>.direction {
|
||||
Direction::Up => {
|
||||
<span class="self">self</span>.pos[(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize] = (x, y - <span class="number">1</span>);
|
||||
}
|
||||
Direction::Left => {
|
||||
<span class="self">self</span>.pos[(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize] = (x - <span class="number">1</span>, y);
|
||||
}
|
||||
Direction::Down => {
|
||||
<span class="self">self</span>.pos[(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize] = (x, y + <span class="number">1</span>);
|
||||
}
|
||||
Direction::Right => {
|
||||
<span class="self">self</span>.pos[(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize] = (x + <span class="number">1</span>, y);
|
||||
}
|
||||
}
|
||||
<span class="self">self</span>.last_direction = <span class="self">self</span>.direction;
|
||||
}
|
||||
<span class="kw">unsafe fn </span>get_new_dir(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<span class="kw">if </span>UP.just_pressed() && <span class="self">self</span>.last_direction != Direction::Down {
|
||||
<span class="self">self</span>.direction = Direction::Up
|
||||
}
|
||||
<span class="kw">if </span>LEFT.just_pressed() && <span class="self">self</span>.last_direction != Direction::Right {
|
||||
<span class="self">self</span>.direction = Direction::Left
|
||||
}
|
||||
<span class="kw">if </span>DOWN.just_pressed() && <span class="self">self</span>.last_direction != Direction::Up {
|
||||
<span class="self">self</span>.direction = Direction::Down
|
||||
}
|
||||
<span class="kw">if </span>RIGHT.just_pressed() && <span class="self">self</span>.last_direction != Direction::Left {
|
||||
<span class="self">self</span>.direction = Direction::Right
|
||||
}
|
||||
}
|
||||
<span class="kw">fn </span>new_food(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<span class="self">self</span>.next_food.<span class="number">0 </span>= <span class="number">0</span>;
|
||||
<span class="self">self</span>.next_food.<span class="number">1 </span>= <span class="number">0</span>;
|
||||
<span class="kw">while </span><span class="self">self</span>.next_food.<span class="number">0 </span>== <span class="number">0 </span>&& <span class="self">self</span>.next_food.<span class="number">1 </span>== <span class="number">0 </span>{
|
||||
<span class="self">self</span>.next_food.<span class="number">0 </span>= random_between(<span class="number">2</span>, (WORLD_WIDTH - <span class="number">2</span>).into()) <span class="kw">as </span>u8;
|
||||
<span class="self">self</span>.next_food.<span class="number">1 </span>= random_between(<span class="number">2</span>, (WORLD_HEIGHT - <span class="number">2</span>).into()) <span class="kw">as </span>u8;
|
||||
<span class="kw">for </span>i <span class="kw">in </span><span class="number">0</span>..(<span class="self">self</span>.len) <span class="kw">as </span>usize {
|
||||
<span class="kw">if </span><span class="self">self</span>.pos[i] == <span class="self">self</span>.next_food {
|
||||
<span class="self">self</span>.next_food.<span class="number">0 </span>= <span class="number">0</span>;
|
||||
<span class="self">self</span>.next_food.<span class="number">1 </span>= <span class="number">0</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="kw">unsafe fn </span>render(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
arduboy.draw_circle(
|
||||
((<span class="self">self</span>.next_food.<span class="number">0 </span>* SCALE_FACTOR) + SCALE_FACTOR / <span class="number">4</span>)
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
((<span class="self">self</span>.next_food.<span class="number">1 </span>* SCALE_FACTOR) + SCALE_FACTOR / <span class="number">4</span>)
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
SCALE_FACTOR / <span class="number">4</span>,
|
||||
Color::White,
|
||||
);
|
||||
|
||||
<span class="self">self</span>.pos.iter().enumerate().for_each(|(i, p)| {
|
||||
<span class="kw">if </span>i == (<span class="self">self</span>.len) <span class="kw">as </span>usize {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="kw">if </span><span class="kw-2">*</span>p == (<span class="number">0</span>, <span class="number">0</span>) {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
arduboy.fill_rect(
|
||||
(p.<span class="number">0 </span><span class="kw">as </span>u8 * SCALE_FACTOR).try_into().unwrap(),
|
||||
(p.<span class="number">1 </span><span class="kw">as </span>u8 * SCALE_FACTOR).try_into().unwrap(),
|
||||
SCALE_FACTOR / <span class="number">2</span>,
|
||||
SCALE_FACTOR / <span class="number">2</span>,
|
||||
Color::White,
|
||||
);
|
||||
});
|
||||
}
|
||||
<span class="kw">unsafe fn </span>init(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<span class="self">self</span>.points = <span class="number">0</span>;
|
||||
<span class="self">self</span>.len = <span class="number">3</span>;
|
||||
<span class="self">self</span>.direction = Direction::Right;
|
||||
<span class="self">self</span>.last_direction = Direction::Left;
|
||||
<span class="self">self</span>.pos = [(<span class="number">0</span>, <span class="number">0</span>); <span class="number">255 </span><span class="kw">as </span>usize];
|
||||
<span class="self">self</span>.pos[<span class="number">0</span>] = (<span class="number">3</span>, <span class="number">4</span>);
|
||||
<span class="self">self</span>.pos[<span class="number">1</span>] = (<span class="number">4</span>, <span class="number">4</span>);
|
||||
<span class="self">self</span>.pos[<span class="number">2</span>] = (<span class="number">5</span>, <span class="number">4</span>);
|
||||
}
|
||||
<span class="kw">unsafe fn </span>boarder(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
<span class="kw">for </span>x <span class="kw">in </span><span class="number">0</span>..WORLD_WIDTH <span class="kw">as </span>usize {
|
||||
<span class="kw">for </span>y <span class="kw">in </span><span class="number">0</span>..WORLD_HEIGHT <span class="kw">as </span>usize {
|
||||
<span class="kw">if </span>x == <span class="number">0
|
||||
</span>|| y == <span class="number">0
|
||||
</span>|| x == (WORLD_WIDTH - <span class="number">1</span>) <span class="kw">as </span>usize
|
||||
|| y == (WORLD_HEIGHT - <span class="number">1</span>) <span class="kw">as </span>usize
|
||||
{
|
||||
<span class="kw">let </span>scale: u8 = <span class="number">2</span>;
|
||||
<span class="kw">if </span><span class="self">self</span>.delta_time % <span class="number">20 </span>== <span class="number">0 </span>{
|
||||
<span class="comment">//scale = 1;
|
||||
</span>};
|
||||
arduboy.fill_rect(
|
||||
(x <span class="kw">as </span>u8 * SCALE_FACTOR + scale / <span class="number">2</span>).try_into().unwrap(),
|
||||
(y <span class="kw">as </span>u8 * SCALE_FACTOR + scale / <span class="number">2</span>).try_into().unwrap(),
|
||||
SCALE_FACTOR / scale,
|
||||
SCALE_FACTOR / scale,
|
||||
Color::White,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="kw">fn </span>collision_check(<span class="kw-2">&mut </span><span class="self">self</span>) {
|
||||
<span class="kw">let </span>(x, y) = <span class="self">self</span>.pos[(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize];
|
||||
<span class="kw">if </span>x == <span class="number">0 </span>|| x == <span class="number">31 </span>|| y == <span class="number">0 </span>|| y == <span class="number">15 </span>{
|
||||
<span class="self">self</span>.game_state = State::GameOver;
|
||||
}
|
||||
<span class="self">self</span>.pos.iter().enumerate().for_each(|(i, p)| {
|
||||
<span class="kw">if </span>p == <span class="kw-2">&</span>(x, y) && i != (<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize {
|
||||
<span class="self">self</span>.game_state = State::GameOver;
|
||||
}
|
||||
});
|
||||
<span class="kw">if </span><span class="self">self</span>.pos[(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize] == <span class="self">self</span>.next_food {
|
||||
<span class="self">self</span>.points += <span class="number">1</span>;
|
||||
<span class="self">self</span>.new_food();
|
||||
<span class="self">self</span>.pos[<span class="self">self</span>.len <span class="kw">as </span>usize] = <span class="self">self</span>.pos[(<span class="self">self</span>.len - <span class="number">1</span>) <span class="kw">as </span>usize];
|
||||
<span class="self">self</span>.len += <span class="number">1</span>;
|
||||
sound.tone(<span class="number">0xff</span>, <span class="number">0x3f</span>);
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="attr">#[allow(non_upper_case_globals)]
|
||||
</span><span class="kw">static </span><span class="kw-2">mut </span>snake: Snake = Snake {
|
||||
game_state: State::Reset,
|
||||
len: <span class="number">3</span>,
|
||||
points: <span class="number">0</span>,
|
||||
pos: [(<span class="number">0</span>, <span class="number">0</span>); <span class="number">255 </span><span class="kw">as </span>usize],
|
||||
next_food: (<span class="number">0</span>, <span class="number">0</span>),
|
||||
delta_time: <span class="number">0</span>,
|
||||
direction: Direction::Right,
|
||||
last_direction: Direction::Left,
|
||||
};
|
||||
|
||||
<span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
arduboy.begin();
|
||||
eeprom.init(<span class="kw-2">&mut </span>scoreboard);
|
||||
arduboy.init_random_seed();
|
||||
arduboy.set_frame_rate(<span class="number">60</span>);
|
||||
arduboy.clear();
|
||||
}
|
||||
|
||||
<span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="kw">if </span>!arduboy.next_frame() {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
arduboy.poll_buttons();
|
||||
arduboy.clear();
|
||||
<span class="kw">match </span>snake.game_state {
|
||||
State::Reset => {
|
||||
snake.init();
|
||||
snake.new_food();
|
||||
snake.game_state = State::Title;
|
||||
}
|
||||
State::Title => {
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
arduboy.set_text_size(<span class="number">2</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"RustySnake\n\0"</span>));
|
||||
arduboy.set_text_size(<span class="number">1</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\nControls: \nB Pause / A&B reset\n\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Press B for Scorebord\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\nZennDev 2023\n\0"</span>));
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
snake.game_state = State::Game;
|
||||
}
|
||||
<span class="kw">if </span>B.just_pressed() {
|
||||
snake.game_state = State::Scorebord;
|
||||
}
|
||||
}
|
||||
State::Game => {
|
||||
snake.get_new_dir();
|
||||
<span class="kw">if </span>snake.delta_time % <span class="number">10 </span>== <span class="number">0 </span>{
|
||||
snake.movement();
|
||||
snake.collision_check();
|
||||
};
|
||||
snake.render();
|
||||
snake.boarder();
|
||||
<span class="kw">if </span>B.just_pressed() {
|
||||
sound.tone(<span class="number">800</span>, <span class="number">100</span>);
|
||||
snake.game_state = State::Pause;
|
||||
}
|
||||
}
|
||||
State::Win => (),
|
||||
State::Pause => {
|
||||
<span class="kw">let </span>msg = <span class="string">"[ Break ]\0"</span>;
|
||||
<span class="kw">let </span>l = msg.len() <span class="kw">as </span>u8 * FONT_SIZE / <span class="number">2</span>;
|
||||
arduboy.set_cursor(
|
||||
((WIDTH / <span class="number">2</span>) <span class="kw">as </span>u16 - l <span class="kw">as </span>u16).try_into().unwrap(),
|
||||
((HEIGHT / <span class="number">2</span>) <span class="kw">as </span>u16).try_into().unwrap(),
|
||||
);
|
||||
snake.render();
|
||||
snake.boarder();
|
||||
arduboy.print(msg);
|
||||
<span class="kw">if </span>B.just_pressed() {
|
||||
snake.game_state = State::Game;
|
||||
sound.tone(<span class="number">800</span>, <span class="number">100</span>);
|
||||
}
|
||||
}
|
||||
State::GameOver => {
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">0</span>);
|
||||
<span class="kw">if </span>scoreboard.check_score(snake.points) {
|
||||
eeprom.put(<span class="kw-2">&</span>scoreboard);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"New Highscore!\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\nYou are under the\ntop three player\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\nYour Score: \0"</span>));
|
||||
arduboy.print(snake.points <span class="kw">as </span>u16);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\nPress A to save the \nscore and play again\0"</span>));
|
||||
} <span class="kw">else </span>{
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Game Over!\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\n\0"</span>));
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Score: \0"</span>));
|
||||
arduboy.print(snake.points <span class="kw">as </span>u16);
|
||||
}
|
||||
<span class="kw">if </span>A.just_pressed() {
|
||||
scoreboard.update_score(snake.points);
|
||||
snake.game_state = State::Reset;
|
||||
}
|
||||
}
|
||||
State::Scorebord => {
|
||||
arduboy.set_cursor(<span class="number">0</span>, <span class="number">10</span>);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"1 place: \0"</span>));
|
||||
arduboy.print(scoreboard.places[<span class="number">0</span>]);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\n2 place: \0"</span>));
|
||||
arduboy.print(scoreboard.places[<span class="number">1</span>]);
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\n3 place: \0"</span>));
|
||||
arduboy.print(scoreboard.places[<span class="number">2</span>]);
|
||||
<span class="kw">if </span>A.just_pressed() || B.just_pressed() {
|
||||
snake.game_state = State::Title;
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="kw">if </span>(A | B).pressed() {
|
||||
snake.game_state = State::Reset;
|
||||
}
|
||||
arduboy.display();
|
||||
<span class="kw">if </span>snake.delta_time == <span class="number">60 </span>{
|
||||
snake.delta_time = <span class="number">1
|
||||
</span>} <span class="kw">else </span>{
|
||||
snake.delta_time += <span class="number">1</span>;
|
||||
}
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -1,4 +1,4 @@
|
|||
<!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\stable_deref_trait-1.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="stable_deref_trait" 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="../../stable_deref_trait/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>
|
||||
<!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\stable_deref_trait-1.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-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="stable_deref_trait" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.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-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.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="../../stable_deref_trait/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>
|
||||
|
|
|
@ -1,995 +0,0 @@
|
|||
<!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 `Examples\Arduboy-Tutorials\tone\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="tone" 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="../../tone/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>
|
||||
<a href="#251" id="251">251</a>
|
||||
<a href="#252" id="252">252</a>
|
||||
<a href="#253" id="253">253</a>
|
||||
<a href="#254" id="254">254</a>
|
||||
<a href="#255" id="255">255</a>
|
||||
<a href="#256" id="256">256</a>
|
||||
<a href="#257" id="257">257</a>
|
||||
<a href="#258" id="258">258</a>
|
||||
<a href="#259" id="259">259</a>
|
||||
<a href="#260" id="260">260</a>
|
||||
<a href="#261" id="261">261</a>
|
||||
<a href="#262" id="262">262</a>
|
||||
<a href="#263" id="263">263</a>
|
||||
<a href="#264" id="264">264</a>
|
||||
<a href="#265" id="265">265</a>
|
||||
<a href="#266" id="266">266</a>
|
||||
<a href="#267" id="267">267</a>
|
||||
<a href="#268" id="268">268</a>
|
||||
<a href="#269" id="269">269</a>
|
||||
<a href="#270" id="270">270</a>
|
||||
<a href="#271" id="271">271</a>
|
||||
<a href="#272" id="272">272</a>
|
||||
<a href="#273" id="273">273</a>
|
||||
<a href="#274" id="274">274</a>
|
||||
<a href="#275" id="275">275</a>
|
||||
<a href="#276" id="276">276</a>
|
||||
<a href="#277" id="277">277</a>
|
||||
<a href="#278" id="278">278</a>
|
||||
<a href="#279" id="279">279</a>
|
||||
<a href="#280" id="280">280</a>
|
||||
<a href="#281" id="281">281</a>
|
||||
<a href="#282" id="282">282</a>
|
||||
<a href="#283" id="283">283</a>
|
||||
<a href="#284" id="284">284</a>
|
||||
<a href="#285" id="285">285</a>
|
||||
<a href="#286" id="286">286</a>
|
||||
<a href="#287" id="287">287</a>
|
||||
<a href="#288" id="288">288</a>
|
||||
<a href="#289" id="289">289</a>
|
||||
<a href="#290" id="290">290</a>
|
||||
<a href="#291" id="291">291</a>
|
||||
<a href="#292" id="292">292</a>
|
||||
<a href="#293" id="293">293</a>
|
||||
<a href="#294" id="294">294</a>
|
||||
<a href="#295" id="295">295</a>
|
||||
<a href="#296" id="296">296</a>
|
||||
<a href="#297" id="297">297</a>
|
||||
<a href="#298" id="298">298</a>
|
||||
<a href="#299" id="299">299</a>
|
||||
<a href="#300" id="300">300</a>
|
||||
<a href="#301" id="301">301</a>
|
||||
<a href="#302" id="302">302</a>
|
||||
<a href="#303" id="303">303</a>
|
||||
<a href="#304" id="304">304</a>
|
||||
<a href="#305" id="305">305</a>
|
||||
<a href="#306" id="306">306</a>
|
||||
<a href="#307" id="307">307</a>
|
||||
<a href="#308" id="308">308</a>
|
||||
<a href="#309" id="309">309</a>
|
||||
<a href="#310" id="310">310</a>
|
||||
<a href="#311" id="311">311</a>
|
||||
<a href="#312" id="312">312</a>
|
||||
<a href="#313" id="313">313</a>
|
||||
<a href="#314" id="314">314</a>
|
||||
<a href="#315" id="315">315</a>
|
||||
<a href="#316" id="316">316</a>
|
||||
<a href="#317" id="317">317</a>
|
||||
<a href="#318" id="318">318</a>
|
||||
<a href="#319" id="319">319</a>
|
||||
<a href="#320" id="320">320</a>
|
||||
<a href="#321" id="321">321</a>
|
||||
<a href="#322" id="322">322</a>
|
||||
<a href="#323" id="323">323</a>
|
||||
<a href="#324" id="324">324</a>
|
||||
<a href="#325" id="325">325</a>
|
||||
<a href="#326" id="326">326</a>
|
||||
<a href="#327" id="327">327</a>
|
||||
<a href="#328" id="328">328</a>
|
||||
<a href="#329" id="329">329</a>
|
||||
<a href="#330" id="330">330</a>
|
||||
<a href="#331" id="331">331</a>
|
||||
<a href="#332" id="332">332</a>
|
||||
<a href="#333" id="333">333</a>
|
||||
<a href="#334" id="334">334</a>
|
||||
<a href="#335" id="335">335</a>
|
||||
<a href="#336" id="336">336</a>
|
||||
<a href="#337" id="337">337</a>
|
||||
<a href="#338" id="338">338</a>
|
||||
<a href="#339" id="339">339</a>
|
||||
<a href="#340" id="340">340</a>
|
||||
<a href="#341" id="341">341</a>
|
||||
<a href="#342" id="342">342</a>
|
||||
<a href="#343" id="343">343</a>
|
||||
<a href="#344" id="344">344</a>
|
||||
<a href="#345" id="345">345</a>
|
||||
<a href="#346" id="346">346</a>
|
||||
<a href="#347" id="347">347</a>
|
||||
<a href="#348" id="348">348</a>
|
||||
<a href="#349" id="349">349</a>
|
||||
<a href="#350" id="350">350</a>
|
||||
<a href="#351" id="351">351</a>
|
||||
<a href="#352" id="352">352</a>
|
||||
<a href="#353" id="353">353</a>
|
||||
<a href="#354" id="354">354</a>
|
||||
<a href="#355" id="355">355</a>
|
||||
<a href="#356" id="356">356</a>
|
||||
<a href="#357" id="357">357</a>
|
||||
<a href="#358" id="358">358</a>
|
||||
<a href="#359" id="359">359</a>
|
||||
<a href="#360" id="360">360</a>
|
||||
<a href="#361" id="361">361</a>
|
||||
<a href="#362" id="362">362</a>
|
||||
<a href="#363" id="363">363</a>
|
||||
<a href="#364" id="364">364</a>
|
||||
<a href="#365" id="365">365</a>
|
||||
<a href="#366" id="366">366</a>
|
||||
<a href="#367" id="367">367</a>
|
||||
<a href="#368" id="368">368</a>
|
||||
<a href="#369" id="369">369</a>
|
||||
<a href="#370" id="370">370</a>
|
||||
<a href="#371" id="371">371</a>
|
||||
<a href="#372" id="372">372</a>
|
||||
<a href="#373" id="373">373</a>
|
||||
<a href="#374" id="374">374</a>
|
||||
<a href="#375" id="375">375</a>
|
||||
<a href="#376" id="376">376</a>
|
||||
<a href="#377" id="377">377</a>
|
||||
<a href="#378" id="378">378</a>
|
||||
<a href="#379" id="379">379</a>
|
||||
<a href="#380" id="380">380</a>
|
||||
<a href="#381" id="381">381</a>
|
||||
<a href="#382" id="382">382</a>
|
||||
<a href="#383" id="383">383</a>
|
||||
<a href="#384" id="384">384</a>
|
||||
<a href="#385" id="385">385</a>
|
||||
<a href="#386" id="386">386</a>
|
||||
<a href="#387" id="387">387</a>
|
||||
<a href="#388" id="388">388</a>
|
||||
<a href="#389" id="389">389</a>
|
||||
<a href="#390" id="390">390</a>
|
||||
<a href="#391" id="391">391</a>
|
||||
<a href="#392" id="392">392</a>
|
||||
<a href="#393" id="393">393</a>
|
||||
<a href="#394" id="394">394</a>
|
||||
<a href="#395" id="395">395</a>
|
||||
<a href="#396" id="396">396</a>
|
||||
<a href="#397" id="397">397</a>
|
||||
<a href="#398" id="398">398</a>
|
||||
<a href="#399" id="399">399</a>
|
||||
<a href="#400" id="400">400</a>
|
||||
<a href="#401" id="401">401</a>
|
||||
<a href="#402" id="402">402</a>
|
||||
<a href="#403" id="403">403</a>
|
||||
<a href="#404" id="404">404</a>
|
||||
<a href="#405" id="405">405</a>
|
||||
<a href="#406" id="406">406</a>
|
||||
<a href="#407" id="407">407</a>
|
||||
<a href="#408" id="408">408</a>
|
||||
<a href="#409" id="409">409</a>
|
||||
<a href="#410" id="410">410</a>
|
||||
<a href="#411" id="411">411</a>
|
||||
<a href="#412" id="412">412</a>
|
||||
<a href="#413" id="413">413</a>
|
||||
<a href="#414" id="414">414</a>
|
||||
<a href="#415" id="415">415</a>
|
||||
<a href="#416" id="416">416</a>
|
||||
<a href="#417" id="417">417</a>
|
||||
<a href="#418" id="418">418</a>
|
||||
<a href="#419" id="419">419</a>
|
||||
<a href="#420" id="420">420</a>
|
||||
<a href="#421" id="421">421</a>
|
||||
<a href="#422" id="422">422</a>
|
||||
<a href="#423" id="423">423</a>
|
||||
<a href="#424" id="424">424</a>
|
||||
<a href="#425" id="425">425</a>
|
||||
<a href="#426" id="426">426</a>
|
||||
<a href="#427" id="427">427</a>
|
||||
<a href="#428" id="428">428</a>
|
||||
<a href="#429" id="429">429</a>
|
||||
<a href="#430" id="430">430</a>
|
||||
<a href="#431" id="431">431</a>
|
||||
<a href="#432" id="432">432</a>
|
||||
<a href="#433" id="433">433</a>
|
||||
<a href="#434" id="434">434</a>
|
||||
<a href="#435" id="435">435</a>
|
||||
<a href="#436" id="436">436</a>
|
||||
<a href="#437" id="437">437</a>
|
||||
<a href="#438" id="438">438</a>
|
||||
<a href="#439" id="439">439</a>
|
||||
<a href="#440" id="440">440</a>
|
||||
<a href="#441" id="441">441</a>
|
||||
<a href="#442" id="442">442</a>
|
||||
<a href="#443" id="443">443</a>
|
||||
<a href="#444" id="444">444</a>
|
||||
<a href="#445" id="445">445</a>
|
||||
<a href="#446" id="446">446</a>
|
||||
<a href="#447" id="447">447</a>
|
||||
<a href="#448" id="448">448</a>
|
||||
<a href="#449" id="449">449</a>
|
||||
<a href="#450" id="450">450</a>
|
||||
<a href="#451" id="451">451</a>
|
||||
<a href="#452" id="452">452</a>
|
||||
<a href="#453" id="453">453</a>
|
||||
<a href="#454" id="454">454</a>
|
||||
<a href="#455" id="455">455</a>
|
||||
<a href="#456" id="456">456</a>
|
||||
<a href="#457" id="457">457</a>
|
||||
<a href="#458" id="458">458</a>
|
||||
<a href="#459" id="459">459</a>
|
||||
<a href="#460" id="460">460</a>
|
||||
<a href="#461" id="461">461</a>
|
||||
<a href="#462" id="462">462</a>
|
||||
<a href="#463" id="463">463</a>
|
||||
<a href="#464" id="464">464</a>
|
||||
<a href="#465" id="465">465</a>
|
||||
<a href="#466" id="466">466</a>
|
||||
<a href="#467" id="467">467</a>
|
||||
<a href="#468" id="468">468</a>
|
||||
<a href="#469" id="469">469</a>
|
||||
<a href="#470" id="470">470</a>
|
||||
<a href="#471" id="471">471</a>
|
||||
<a href="#472" id="472">472</a>
|
||||
<a href="#473" id="473">473</a>
|
||||
<a href="#474" id="474">474</a>
|
||||
<a href="#475" id="475">475</a>
|
||||
<a href="#476" id="476">476</a>
|
||||
<a href="#477" id="477">477</a>
|
||||
<a href="#478" id="478">478</a>
|
||||
<a href="#479" id="479">479</a>
|
||||
<a href="#480" id="480">480</a>
|
||||
<a href="#481" id="481">481</a>
|
||||
<a href="#482" id="482">482</a>
|
||||
<a href="#483" id="483">483</a>
|
||||
<a href="#484" id="484">484</a>
|
||||
<a href="#485" id="485">485</a>
|
||||
<a href="#486" id="486">486</a>
|
||||
<a href="#487" id="487">487</a>
|
||||
<a href="#488" id="488">488</a>
|
||||
<a href="#489" id="489">489</a>
|
||||
<a href="#490" id="490">490</a>
|
||||
<a href="#491" id="491">491</a>
|
||||
<a href="#492" id="492">492</a>
|
||||
<a href="#493" id="493">493</a>
|
||||
<a href="#494" id="494">494</a>
|
||||
<a href="#495" id="495">495</a>
|
||||
<a href="#496" id="496">496</a>
|
||||
<a href="#497" id="497">497</a>
|
||||
</pre></div><pre class="rust"><code><span class="attr">#![no_std]
|
||||
#![allow(non_upper_case_globals)]
|
||||
</span><span class="comment">//Include the Arduboy Library
|
||||
//Initialize the arduboy object
|
||||
</span><span class="attr">#[allow(unused_imports)]
|
||||
</span><span class="kw">use </span>arduboy_rust::prelude::<span class="kw-2">*</span>;
|
||||
<span class="kw">use </span>arduboy_tones::tones_pitch::<span class="kw-2">*</span>;
|
||||
<span class="kw">const </span>arduboy: Arduboy2 = Arduboy2::new();
|
||||
<span class="kw">const </span>sound: ArduboyTones = ArduboyTones::new();
|
||||
<span class="kw">const </span>NDUR: u16 = <span class="number">100</span>;
|
||||
|
||||
<span class="macro">progmem!</span>(
|
||||
<span class="kw">static </span>allNotes: [u16; <span class="kw">_</span>] = [
|
||||
NOTE_C0H,
|
||||
NDUR,
|
||||
NOTE_CS0,
|
||||
NDUR,
|
||||
NOTE_D0,
|
||||
NDUR,
|
||||
NOTE_DS0,
|
||||
NDUR,
|
||||
NOTE_E0,
|
||||
NDUR,
|
||||
NOTE_F0,
|
||||
NDUR,
|
||||
NOTE_FS0,
|
||||
NDUR,
|
||||
NOTE_G0,
|
||||
NDUR,
|
||||
NOTE_GS0,
|
||||
NDUR,
|
||||
NOTE_A0,
|
||||
NDUR,
|
||||
NOTE_AS0,
|
||||
NDUR,
|
||||
NOTE_B0,
|
||||
NDUR,
|
||||
NOTE_C1H,
|
||||
NDUR,
|
||||
NOTE_CS1,
|
||||
NDUR,
|
||||
NOTE_D1,
|
||||
NDUR,
|
||||
NOTE_DS1,
|
||||
NDUR,
|
||||
NOTE_E1,
|
||||
NDUR,
|
||||
NOTE_F1,
|
||||
NDUR,
|
||||
NOTE_FS1,
|
||||
NDUR,
|
||||
NOTE_G1,
|
||||
NDUR,
|
||||
NOTE_GS1,
|
||||
NDUR,
|
||||
NOTE_A1,
|
||||
NDUR,
|
||||
NOTE_AS1,
|
||||
NDUR,
|
||||
NOTE_B1,
|
||||
NDUR,
|
||||
NOTE_C2H,
|
||||
NDUR,
|
||||
NOTE_CS2,
|
||||
NDUR,
|
||||
NOTE_D2,
|
||||
NDUR,
|
||||
NOTE_DS2,
|
||||
NDUR,
|
||||
NOTE_E2,
|
||||
NDUR,
|
||||
NOTE_F2,
|
||||
NDUR,
|
||||
NOTE_FS2,
|
||||
NDUR,
|
||||
NOTE_G2,
|
||||
NDUR,
|
||||
NOTE_GS2,
|
||||
NDUR,
|
||||
NOTE_A2,
|
||||
NDUR,
|
||||
NOTE_AS2,
|
||||
NDUR,
|
||||
NOTE_B2,
|
||||
NDUR,
|
||||
NOTE_C3H,
|
||||
NDUR,
|
||||
NOTE_CS3,
|
||||
NDUR,
|
||||
NOTE_D3,
|
||||
NDUR,
|
||||
NOTE_DS3,
|
||||
NDUR,
|
||||
NOTE_E3,
|
||||
NDUR,
|
||||
NOTE_F3,
|
||||
NDUR,
|
||||
NOTE_FS3,
|
||||
NDUR,
|
||||
NOTE_G3,
|
||||
NDUR,
|
||||
NOTE_GS3,
|
||||
NDUR,
|
||||
NOTE_A3,
|
||||
NDUR,
|
||||
NOTE_AS3,
|
||||
NDUR,
|
||||
NOTE_B3,
|
||||
NDUR,
|
||||
NOTE_C4H,
|
||||
NDUR,
|
||||
NOTE_CS4,
|
||||
NDUR,
|
||||
NOTE_D4,
|
||||
NDUR,
|
||||
NOTE_DS4,
|
||||
NDUR,
|
||||
NOTE_E4,
|
||||
NDUR,
|
||||
NOTE_F4,
|
||||
NDUR,
|
||||
NOTE_FS4,
|
||||
NDUR,
|
||||
NOTE_G4,
|
||||
NDUR,
|
||||
NOTE_GS4,
|
||||
NDUR,
|
||||
NOTE_A4,
|
||||
NDUR,
|
||||
NOTE_AS4,
|
||||
NDUR,
|
||||
NOTE_B4,
|
||||
NDUR,
|
||||
NOTE_C5H,
|
||||
NDUR,
|
||||
NOTE_CS5,
|
||||
NDUR,
|
||||
NOTE_D5,
|
||||
NDUR,
|
||||
NOTE_DS5,
|
||||
NDUR,
|
||||
NOTE_E5,
|
||||
NDUR,
|
||||
NOTE_F5,
|
||||
NDUR,
|
||||
NOTE_FS5,
|
||||
NDUR,
|
||||
NOTE_G5,
|
||||
NDUR,
|
||||
NOTE_GS5,
|
||||
NDUR,
|
||||
NOTE_A5,
|
||||
NDUR,
|
||||
NOTE_AS5,
|
||||
NDUR,
|
||||
NOTE_B5,
|
||||
NDUR,
|
||||
NOTE_C6H,
|
||||
NDUR,
|
||||
NOTE_CS6,
|
||||
NDUR,
|
||||
NOTE_D6,
|
||||
NDUR,
|
||||
NOTE_DS6,
|
||||
NDUR,
|
||||
NOTE_E6,
|
||||
NDUR,
|
||||
NOTE_F6,
|
||||
NDUR,
|
||||
NOTE_FS6,
|
||||
NDUR,
|
||||
NOTE_G6,
|
||||
NDUR,
|
||||
NOTE_GS6,
|
||||
NDUR,
|
||||
NOTE_A6,
|
||||
NDUR,
|
||||
NOTE_AS6,
|
||||
NDUR,
|
||||
NOTE_B6,
|
||||
NDUR,
|
||||
NOTE_C7H,
|
||||
NDUR,
|
||||
NOTE_CS7,
|
||||
NDUR,
|
||||
NOTE_D7,
|
||||
NDUR,
|
||||
NOTE_DS7,
|
||||
NDUR,
|
||||
NOTE_E7,
|
||||
NDUR,
|
||||
NOTE_F7,
|
||||
NDUR,
|
||||
NOTE_FS7,
|
||||
NDUR,
|
||||
NOTE_G7,
|
||||
NDUR,
|
||||
NOTE_GS7,
|
||||
NDUR,
|
||||
NOTE_A7,
|
||||
NDUR,
|
||||
NOTE_AS7,
|
||||
NDUR,
|
||||
NOTE_B7,
|
||||
NDUR,
|
||||
NOTE_C8H,
|
||||
NDUR,
|
||||
NOTE_CS8,
|
||||
NDUR,
|
||||
NOTE_D8,
|
||||
NDUR,
|
||||
NOTE_DS8,
|
||||
NDUR,
|
||||
NOTE_E8,
|
||||
NDUR,
|
||||
NOTE_F8,
|
||||
NDUR,
|
||||
NOTE_FS8,
|
||||
NDUR,
|
||||
NOTE_G8,
|
||||
NDUR,
|
||||
NOTE_GS8,
|
||||
NDUR,
|
||||
NOTE_A8,
|
||||
NDUR,
|
||||
NOTE_AS8,
|
||||
NDUR,
|
||||
NOTE_B8,
|
||||
NDUR,
|
||||
NOTE_C9H,
|
||||
NDUR,
|
||||
NOTE_CS9,
|
||||
NDUR,
|
||||
NOTE_D9,
|
||||
NDUR,
|
||||
NOTE_DS9,
|
||||
NDUR,
|
||||
NOTE_E9,
|
||||
NDUR,
|
||||
NOTE_F9,
|
||||
NDUR,
|
||||
NOTE_FS9,
|
||||
NDUR,
|
||||
NOTE_G9,
|
||||
NDUR,
|
||||
NOTE_GS9,
|
||||
NDUR,
|
||||
NOTE_A9,
|
||||
NDUR,
|
||||
NOTE_AS9,
|
||||
NDUR,
|
||||
NOTE_B9,
|
||||
NDUR,
|
||||
TONES_REPEAT,
|
||||
];
|
||||
|
||||
<span class="kw">static </span>sound1: [u16; <span class="kw">_</span>] = [
|
||||
NOTE_C1, <span class="number">500</span>, NOTE_C1H, <span class="number">500</span>, NOTE_G1, <span class="number">500</span>, NOTE_G1H, <span class="number">500</span>, NOTE_C2, <span class="number">500</span>, NOTE_C2H, <span class="number">500</span>,
|
||||
NOTE_G2, <span class="number">500</span>, NOTE_G2H, <span class="number">500</span>, NOTE_C3, <span class="number">500</span>, NOTE_C3H, <span class="number">500</span>, NOTE_G3, <span class="number">500</span>, NOTE_G3H, <span class="number">500</span>,
|
||||
NOTE_C4, <span class="number">500</span>, NOTE_C4H, <span class="number">500</span>, NOTE_G4, <span class="number">500</span>, NOTE_G4H, <span class="number">500</span>, NOTE_C5, <span class="number">500</span>, NOTE_C5H, <span class="number">500</span>,
|
||||
NOTE_G5, <span class="number">500</span>, NOTE_G5H, <span class="number">500</span>, NOTE_C6, <span class="number">500</span>, NOTE_C6H, <span class="number">500</span>, NOTE_G6, <span class="number">500</span>, NOTE_G6H, <span class="number">500</span>,
|
||||
NOTE_C7, <span class="number">500</span>, NOTE_C7H, <span class="number">500</span>, NOTE_G7, <span class="number">500</span>, NOTE_G7H, <span class="number">500</span>, NOTE_C8, <span class="number">500</span>, NOTE_C8H, <span class="number">500</span>,
|
||||
NOTE_G8, <span class="number">500</span>, NOTE_G8H, <span class="number">500</span>, NOTE_C9, <span class="number">500</span>, NOTE_C9H, <span class="number">500</span>, NOTE_G9, <span class="number">500</span>, NOTE_G9H, <span class="number">500</span>,
|
||||
TONES_END,
|
||||
];
|
||||
);
|
||||
|
||||
<span class="kw">static </span><span class="kw-2">mut </span>circle_pos: i16 = <span class="number">7</span>;
|
||||
<span class="kw">const </span>BUTTON_DELAY: u32 = <span class="number">200</span>;
|
||||
|
||||
<span class="comment">// The setup() function runs once when you turn your Arduboy on
|
||||
</span><span class="attr">#[no_mangle]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>setup() {
|
||||
<span class="comment">// put your setup code here, to run once:
|
||||
</span>arduboy.begin();
|
||||
arduboy.audio_on();
|
||||
arduboy.audio_save_on_off()
|
||||
}
|
||||
<span class="comment">// The loop() function repeats forever after setup() is done
|
||||
</span><span class="attr">#[no_mangle]
|
||||
#[export_name = <span class="string">"loop"</span>]
|
||||
</span><span class="kw">pub unsafe extern </span><span class="string">"C" </span><span class="kw">fn </span>loop_() {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>in_ram: [u16; <span class="number">43</span>] = [
|
||||
NOTE_E4,
|
||||
<span class="number">400</span>,
|
||||
NOTE_D4,
|
||||
<span class="number">200</span>,
|
||||
NOTE_C4,
|
||||
<span class="number">400</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">200</span>,
|
||||
NOTE_D4,
|
||||
<span class="number">200</span>,
|
||||
NOTE_C4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_C4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_E4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_G4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_F4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_A4,
|
||||
<span class="number">300</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">100</span>,
|
||||
NOTE_D5H,
|
||||
<span class="number">200</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">200</span>,
|
||||
NOTE_D5H,
|
||||
<span class="number">200</span>,
|
||||
NOTE_REST,
|
||||
<span class="number">1500</span>,
|
||||
TONES_REPEAT,
|
||||
];
|
||||
<span class="comment">// put your main code here, to run repeatedly:
|
||||
</span><span class="kw">let </span><span class="kw-2">mut </span>new_notes: bool;
|
||||
display_audio();
|
||||
<span class="kw">loop </span>{
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(UP) {
|
||||
arduboy.audio_on();
|
||||
display_audio();
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(DOWN) {
|
||||
arduboy.audio_off();
|
||||
display_audio();
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(B) {
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
sound.tone(<span class="number">1000</span>, <span class="number">0</span>);
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"tone(1000)\n\nB: no_tone()\n delay(1000)\n break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(B_BUTTON) {
|
||||
sound.no_tone();
|
||||
delay(<span class="number">1000</span>);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
sound.tone(<span class="number">500</span>, <span class="number">4000</span>);
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"tone(500, 4000)\n\nB: break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(B_BUTTON) {
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
sound.tone2(NOTE_C4, <span class="number">500</span>, NOTE_C5H, <span class="number">5000</span>);
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"tone(C4,500,C5H,5000)\n\nB: no_tone(), break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(B_BUTTON) {
|
||||
sound.no_tone();
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
sound.tone3(NOTE_C7H, <span class="number">500</span>, NOTE_REST, <span class="number">1000</span>, NOTE_C6, <span class="number">5000</span>);
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"tone(C7H,500,\n REST,1000,\n C6,6000)\n\nB: no_tone(), break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(B_BUTTON) {
|
||||
sound.no_tone();
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
sound.tones(<span class="macro">get_tones_addr!</span>(allNotes));
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"tones(allNotes)\n\nA: no_tone(), again\nUP: again\nB: break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(A_BUTTON) {
|
||||
sound.no_tone();
|
||||
sound.tones(<span class="macro">get_tones_addr!</span>(allNotes));
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(UP_BUTTON) {
|
||||
sound.tones(<span class="macro">get_tones_addr!</span>(allNotes));
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(B_BUTTON) {
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
new_notes = <span class="bool-val">false</span>;
|
||||
sound.tones_in_ram(<span class="macro">get_tones_addr!</span>(in_ram) <span class="kw">as </span><span class="kw-2">*mut </span>u32);
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"tonesInRAM(inRAM)\n\nA: change notes\nB: break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(A_BUTTON) {
|
||||
new_notes = !new_notes;
|
||||
<span class="kw">if </span>new_notes {
|
||||
in_ram[<span class="number">34</span>] = in_ram[<span class="number">38</span>];
|
||||
in_ram[<span class="number">38</span>] = NOTE_C5H;
|
||||
} <span class="kw">else </span>{
|
||||
in_ram[<span class="number">34</span>] = in_ram[<span class="number">38</span>];
|
||||
in_ram[<span class="number">38</span>] = NOTE_D5H;
|
||||
}
|
||||
delay(BUTTON_DELAY);
|
||||
}
|
||||
<span class="kw">if </span>arduboy.pressed(B) {
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
sound.tones(<span class="macro">get_tones_addr!</span>(sound1));
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"volume_mode(IN_TONES)\ntones(sound1)\n\nB: break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(B) {
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
sound.volume_mode(VOLUME_ALWAYS_NORMAL);
|
||||
sound.tones(<span class="macro">get_tones_addr!</span>(sound1));
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"volume_mode(NORMAL)\ntones(sound1)\n\nB: no_tone(), break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(B) {
|
||||
sound.no_tone();
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
|
||||
sound.volume_mode(VOLUME_ALWAYS_HIGH);
|
||||
sound.tones(<span class="macro">get_tones_addr!</span>(sound1));
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"volume_mode(HIGH)\ntones(sound1)\n\nB: break\0"</span>));
|
||||
<span class="kw">while </span>sound.playing() {
|
||||
move_circle();
|
||||
<span class="kw">if </span>arduboy.pressed(B) {
|
||||
delay(BUTTON_DELAY);
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
}
|
||||
sound.volume_mode(VOLUME_IN_TONE);
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>move_circle() {
|
||||
<span class="kw">unsafe </span>{
|
||||
arduboy.fill_circle(circle_pos, <span class="number">54</span>, <span class="number">7</span>, Color::Black);
|
||||
circle_pos += <span class="number">8</span>;
|
||||
<span class="kw">if </span>circle_pos > <span class="number">119 </span>{
|
||||
circle_pos = <span class="number">7</span>;
|
||||
}
|
||||
arduboy.fill_circle(circle_pos, <span class="number">54</span>, <span class="number">7</span>, Color::White);
|
||||
}
|
||||
arduboy.display();
|
||||
delay(<span class="number">100</span>);
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>display_audio() {
|
||||
arduboy.clear();
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"Audio enabled: \0"</span>));
|
||||
<span class="kw">if </span>arduboy.audio_enabled() {
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"YES\0"</span>));
|
||||
} <span class="kw">else </span>{
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"NO\0"</span>))
|
||||
}
|
||||
|
||||
arduboy.print(<span class="macro">f!</span>(<span class="string">b"\n\nUP: enable\nDOWN: disable\nB: break\0"</span>));
|
||||
arduboy.invert(!arduboy.audio_enabled());
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
Loading…
Add table
Add a link
Reference in a new issue