added docs and change the lib structure

This commit is contained in:
ZennDev1337 2023-09-12 22:01:54 +02:00
parent d033160657
commit 063ed9301f
28 changed files with 155 additions and 63 deletions

View file

@ -36,6 +36,7 @@
<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>
</pre></div><pre class="rust"><code><span class="attr">#![cfg(target_arch = <span class="string">&quot;avr&quot;</span>)]
#![no_std]
#![feature(c_size_t)]
@ -72,6 +73,7 @@
</span><span class="kw">pub extern crate </span>heapless;
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy2::{<span class="self">self</span>, Arduboy2, Color, FONT_SIZE, HEIGHT, WIDTH};
<span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy_tone::{<span class="self">self</span>, ArduboyTones};
<span class="kw">pub use </span><span class="kw">crate</span>::library::ardvoice::{<span class="self">self</span>, ArdVoice};
<span class="kw">pub use </span><span class="kw">crate</span>::library::eeprom::{EEPROM, EEPROMBYTE};
<span class="kw">pub use </span><span class="kw">crate</span>::library::{arduino, c, sprites};
</code></pre></div></section></main></body></html>

View file

@ -146,7 +146,10 @@
<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>
</pre></div><pre class="rust"><code><span class="doccomment">//!This is the Module to interact in a save way with the ArduboyTones C++ library.
//! You will need to uncomment the ArduboyTones_Library in the import_config.h file.
</span><span class="kw">pub use </span><span class="kw">crate</span>::library::arduboy_tone_pitch;
<span class="kw">use </span>core::ffi::{c_uchar, c_uint, c_ulong};
<span class="kw">extern </span><span class="string">&quot;C&quot; </span>{
@ -181,6 +184,7 @@
}
<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]

View file

@ -34,7 +34,14 @@
<a href="#34" id="34">34</a>
<a href="#35" id="35">35</a>
<a href="#36" id="36">36</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>core::ffi::{c_float, c_uchar, c_ulong};
<a href="#37" id="37">37</a>
<a href="#38" id="38">38</a>
<a href="#39" id="39">39</a>
<a href="#40" id="40">40</a>
</pre></div><pre class="rust"><code><span class="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">&quot;C&quot; </span>{
<span class="attr">#[link_name = <span class="string">&quot;ardvoice_play_voice&quot;</span>]
@ -51,8 +58,9 @@
<span class="attr">#[link_name = <span class="string">&quot;ardvoice_is_voice_playing&quot;</span>]
</span><span class="kw">fn </span>ardvoice_is_voice_playing_raw() -&gt; bool;
}
<span class="kw">pub struct </span>ArdVoice {}
<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() -&gt; <span class="self">Self </span>{
ArdVoice {}

View file

@ -235,7 +235,7 @@
};
}
<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 sprite as u16, without creating an intermediate reference.
<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 ) =&gt; {