new docs and new readme
This commit is contained in:
parent
a2889273dd
commit
86095c714d
1096 changed files with 11320 additions and 0 deletions
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,337 @@
|
|||
<!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\libraries\arduboy2_library\binding.rs`."><title>binding.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>
|
||||
<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>
|
||||
</pre></div><pre class="rust"><code><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">extern </span><span class="string">"C" </span>{
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_begin"</span>]
|
||||
</span><span class="kw">pub fn </span>begin();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_clear"</span>]
|
||||
</span><span class="kw">pub fn </span>clear();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_display"</span>]
|
||||
</span><span class="kw">pub fn </span>display();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_display_and_clear_buffer"</span>]
|
||||
</span><span class="kw">pub fn </span>display_and_clear_buffer();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_draw_fast_hline"</span>]
|
||||
</span><span class="kw">pub fn </span>draw_fast_hline_raw(x: i16, y: i16, w: u8, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_draw_fast_vline"</span>]
|
||||
</span><span class="kw">pub fn </span>draw_fast_vline_raw(x: i16, y: i16, h: u8, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_draw_pixel"</span>]
|
||||
</span><span class="kw">pub fn </span>draw_pixel_raw(x: i16, y: i16, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_draw_circle"</span>]
|
||||
</span><span class="kw">pub fn </span>draw_circle_raw(x: i16, y: i16, r: u8, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_draw_rect"</span>]
|
||||
</span><span class="kw">pub fn </span>draw_rect_raw(x: i16, y: i16, w: u8, h: u8, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_fill_circle"</span>]
|
||||
</span><span class="kw">pub fn </span>fill_circle_raw(x: i16, y: i16, r: u8, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_fill_rect"</span>]
|
||||
</span><span class="kw">pub fn </span>fill_rect_raw(x: i16, y: i16, w: u8, h: u8, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_fill_round_rect"</span>]
|
||||
</span><span class="kw">pub fn </span>fill_round_rect(x: i16, y: i16, w: u8, h: u8, r: u8, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_draw_round_rect"</span>]
|
||||
</span><span class="kw">pub fn </span>draw_round_rect(x: i16, y: i16, w: u8, h: u8, r: u8, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_fill_triangle"</span>]
|
||||
</span><span class="kw">pub fn </span>fill_triangle(x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_draw_triangle"</span>]
|
||||
</span><span class="kw">pub fn </span>draw_triangle(x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16, color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_get_pixel"</span>]
|
||||
</span><span class="kw">pub fn </span>get_pixel_raw(x: u8, y: u8) -> u8;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_init_random_seed"</span>]
|
||||
</span><span class="kw">pub fn </span>init_random_seed();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_just_pressed"</span>]
|
||||
</span><span class="kw">pub fn </span>just_pressed(button: u8) -> bool;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_just_released"</span>]
|
||||
</span><span class="kw">pub fn </span>just_released(button: u8) -> bool;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_not_pressed"</span>]
|
||||
</span><span class="kw">pub fn </span>not_pressed(button: u8) -> bool;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_next_frame"</span>]
|
||||
</span><span class="kw">pub fn </span>next_frame() -> bool;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_poll_buttons"</span>]
|
||||
</span><span class="kw">pub fn </span>poll_buttons();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_pressed"</span>]
|
||||
</span><span class="kw">pub fn </span>pressed(buttons: u8) -> bool;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_print_chars"</span>]
|
||||
</span><span class="kw">pub fn </span>print_chars(cstr: <span class="kw-2">*const </span>c_char);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_print_chars_progmem"</span>]
|
||||
</span><span class="kw">pub fn </span>print_chars_progmem(pstring: <span class="kw-2">*const </span>c_char);
|
||||
|
||||
<span class="comment">// #[link_name = "arduboy_print_char"]
|
||||
// fn print_char(c: c_char) -> c_size_t;
|
||||
|
||||
</span><span class="attr">#[link_name = <span class="string">"arduboy_print_int"</span>]
|
||||
</span><span class="kw">pub fn </span>print_int(n: c_int, base: c_int) -> c_size_t;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_print_long"</span>]
|
||||
</span><span class="kw">pub fn </span>print_long(n: c_long, base: c_int) -> c_size_t;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_print_unsigned_char"</span>]
|
||||
</span><span class="kw">pub fn </span>print_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_print_unsigned_int"</span>]
|
||||
</span><span class="kw">pub fn </span>print_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_print_unsigned_long"</span>]
|
||||
</span><span class="kw">pub fn </span>print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_cursor"</span>]
|
||||
</span><span class="kw">pub fn </span>set_cursor(x: i16, y: i16);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_frame_rate"</span>]
|
||||
</span><span class="kw">pub fn </span>set_frame_rate(rate: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_text_size"</span>]
|
||||
</span><span class="kw">pub fn </span>set_text_size(size: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_audio_on"</span>]
|
||||
</span><span class="kw">pub fn </span>arduboy_audio_on();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_audio_off"</span>]
|
||||
</span><span class="kw">pub fn </span>arduboy_audio_off();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_audio_save_on_off"</span>]
|
||||
</span><span class="kw">pub fn </span>arduboy_audio_save_on_off();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_audio_toggle"</span>]
|
||||
</span><span class="kw">pub fn </span>arduboy_audio_toggle();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_audio_enabled"</span>]
|
||||
</span><span class="kw">pub fn </span>arduboy_audio_enabled() -> bool;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_invert"</span>]
|
||||
</span><span class="kw">pub fn </span>arduboy_invert(inverse: bool);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_every_x_frames"</span>]
|
||||
</span><span class="kw">pub fn </span>every_x_frames(frames: u8) -> bool;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_flip_horizontal"</span>]
|
||||
</span><span class="kw">pub fn </span>flip_horizontal(flipped: bool);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_flip_vertical"</span>]
|
||||
</span><span class="kw">pub fn </span>flip_vertical(flipped: bool);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_text_color"</span>]
|
||||
</span><span class="kw">pub fn </span>set_text_color(color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_text_background_color"</span>]
|
||||
</span><span class="kw">pub fn </span>set_text_background_color(color: u8);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_cursor_x"</span>]
|
||||
</span><span class="kw">pub fn </span>set_cursor_x(x: i16);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_cursor_y"</span>]
|
||||
</span><span class="kw">pub fn </span>set_cursor_y(y: i16);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_text_wrap"</span>]
|
||||
</span><span class="kw">pub fn </span>set_text_wrap(w: bool);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_idle"</span>]
|
||||
</span><span class="kw">pub fn </span>idle();
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_digital_write_rgb_single"</span>]
|
||||
</span><span class="kw">pub fn </span>digital_write_rgb_single(color: c_uchar, val: c_uchar);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_digital_write_rgb"</span>]
|
||||
</span><span class="kw">pub fn </span>digital_write_rgb(red: c_uchar, green: c_uchar, blue: c_uchar);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_rgb_led_single"</span>]
|
||||
</span><span class="kw">pub fn </span>set_rgb_led_single(color: c_uchar, val: c_uchar);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_set_rgb_led"</span>]
|
||||
</span><span class="kw">pub fn </span>set_rgb_led(red: c_uchar, green: c_uchar, blue: c_uchar);
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_buttons_state"</span>]
|
||||
</span><span class="kw">pub fn </span>arduboy_buttons_state() -> u8;
|
||||
|
||||
<span class="attr">#[link_name = <span class="string">"arduboy_exit_to_bootloader"</span>]
|
||||
</span><span class="kw">pub fn </span>arduboy_exit_to_bootloader();
|
||||
}
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -0,0 +1,25 @@
|
|||
<!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\libraries\arduboy2_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-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>
|
||||
<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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//! This is the Module to interact in a save way with the Arduboy2 C++ library.
|
||||
//!
|
||||
//! All of the functions are safe wrapped inside the [Arduboy2] struct.
|
||||
</span><span class="attr">#[doc(hidden)]
|
||||
</span><span class="kw">pub mod </span>arduboy2;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
</span><span class="kw">pub mod </span>binding;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
</span><span class="kw">pub mod </span>print;
|
||||
|
||||
<span class="kw">pub mod </span>sprites;
|
||||
<span class="kw">pub use </span>arduboy2::{Arduboy2, Color, Point, Rect, FONT_HEIGHT, FONT_WIDTH, HEIGHT, WIDTH};
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -0,0 +1,255 @@
|
|||
<!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\libraries\arduboy2_library\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-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>
|
||||
<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>::arduino_system::progmem::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">super</span>::binding::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">super</span>::binding::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">super</span>::binding::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">super</span>::binding::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">super</span>::binding::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">super</span>::binding::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">super</span>::binding::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">super</span>::binding::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>
|
|
@ -0,0 +1,359 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\libraries\arduboy2_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-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>
|
||||
<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>
|
|
@ -0,0 +1,307 @@
|
|||
<!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\libraries\arduboy_tones_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-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>
|
||||
<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>
|
||||
</pre></div><pre class="rust"><code><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>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\libraries\arduboy_tones_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-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>
|
||||
<a href="#5" id="5">5</a>
|
||||
<a href="#6" id="6">6</a>
|
||||
<a href="#7" id="7">7</a>
|
||||
<a href="#8" id="8">8</a>
|
||||
</pre></div><pre class="rust"><code><span class="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="attr">#[doc(hidden)]
|
||||
</span><span class="kw">mod </span>arduboy_tones;
|
||||
<span class="kw">pub mod </span>tones_pitch;
|
||||
|
||||
<span class="kw">pub use </span>arduboy_tones::ArduboyTones;
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -0,0 +1,501 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\libraries\arduboy_tones_library\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-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>
|
||||
<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>
|
|
@ -0,0 +1,77 @@
|
|||
<!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\libraries\arduboyfx_library\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-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>
|
||||
<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>
|
|
@ -0,0 +1,107 @@
|
|||
<!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\libraries\arduboyfx_library\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-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>
|
||||
<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><span class="kw">crate</span>::libraries::arduino_system::progmem::Pstring;
|
||||
<span class="kw">use </span>core::ffi::{c_char, c_uchar, c_ulong};
|
||||
|
||||
<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>
|
283
docs/doc/src/arduboy_rust/libraries/arduboyfx_library/fx.rs.html
Normal file
283
docs/doc/src/arduboy_rust/libraries/arduboyfx_library/fx.rs.html
Normal file
|
@ -0,0 +1,283 @@
|
|||
<!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\libraries\arduboyfx_library\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-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>
|
||||
<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>
|
|
@ -0,0 +1,123 @@
|
|||
<!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\libraries\arduboyfx_library\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-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>
|
||||
<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>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\libraries\arduboyfx_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-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>
|
||||
<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">//! 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">mod </span>drawable_number;
|
||||
<span class="kw">pub mod </span>fx_consts;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
</span><span class="kw">pub use </span>drawable_number::DrawableNumber;
|
||||
<span class="kw">mod </span>drawable_string;
|
||||
<span class="attr">#[doc(hidden)]
|
||||
</span><span class="kw">pub use </span>drawable_string::DrawableString;
|
||||
<span class="kw">pub mod </span>fx;
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -0,0 +1,55 @@
|
|||
<!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\libraries\arduino_system\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-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>
|
||||
<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>
|
23
docs/doc/src/arduboy_rust/libraries/arduino_system/c.rs.html
Normal file
23
docs/doc/src/arduboy_rust/libraries/arduino_system/c.rs.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `arduboy-rust\src\libraries\arduino_system\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-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>
|
||||
<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>
|
|
@ -0,0 +1,335 @@
|
|||
<!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\libraries\arduino_system\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-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>
|
||||
<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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//!This is the module to interact with the eeprom memory
|
||||
</span><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>
|
|
@ -0,0 +1,15 @@
|
|||
<!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\libraries\arduino_system\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>
|
||||
<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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//!This module contains all the Arduino system functions to interact with the hardware.
|
||||
|
||||
</span><span class="kw">pub mod </span>arduino;
|
||||
<span class="kw">pub mod </span>c;
|
||||
<span class="kw">pub mod </span>eeprom;
|
||||
<span class="kw">pub mod </span>progmem;
|
||||
<span class="kw">pub mod </span>serial_print;
|
||||
</code></pre></div></section></main></body></html>
|
|
@ -0,0 +1,287 @@
|
|||
<!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\libraries\arduino_system\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-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>
|
||||
<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>
|
||||
</pre></div><pre class="rust"><code><span class="doccomment">//!This is the module to interact with the progmem memory
|
||||
</span><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>
|
|
@ -0,0 +1,837 @@
|
|||
<!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\libraries\arduino_system\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-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>
|
||||
<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>::arduino_system::progmem::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>::libraries::arduboy2_library::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>
|
|
@ -0,0 +1,85 @@
|
|||
<!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\libraries\ardvoice_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-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>
|
||||
<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>
|
|
@ -0,0 +1,11 @@
|
|||
<!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\libraries\ardvoice_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-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>
|
||||
<a href="#5" id="5">5</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">mod </span>ardvoice;
|
||||
<span class="kw">pub use </span>ardvoice::ArdVoice;
|
||||
</code></pre></div></section></main></body></html>
|
11
docs/doc/src/arduboy_rust/libraries/mod.rs.html
Normal file
11
docs/doc/src/arduboy_rust/libraries/mod.rs.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!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\libraries\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>
|
||||
<a href="#4" id="4">4</a>
|
||||
<a href="#5" id="5">5</a>
|
||||
</pre></div><pre class="rust"><code><span class="kw">pub mod </span>arduboy2_library;
|
||||
<span class="kw">pub mod </span>arduboy_tones_library;
|
||||
<span class="kw">pub mod </span>arduino_system;
|
||||
<span class="kw">pub mod </span>arduboyfx_library;
|
||||
<span class="kw">pub mod </span>ardvoice_library;
|
||||
</code></pre></div></section></main></body></html>
|
Loading…
Add table
Add a link
Reference in a new issue