edit the docs

This commit is contained in:
ZennDev1337 2023-10-11 18:41:22 +02:00
parent ffb6d42f10
commit 3d5d8ccf49
65 changed files with 178 additions and 128 deletions

View file

@ -119,19 +119,19 @@
}
<span class="kw">impl </span>ButtonSet {
<span class="kw">pub unsafe fn </span>pressed(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
<span class="kw">crate</span>::libraries::arduboy2_library::binding::pressed(<span class="self">self</span>.flag_set)
<span class="kw">pub fn </span>pressed(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
<span class="kw">unsafe </span>{ <span class="kw">crate</span>::libraries::arduboy2_library::binding::pressed(<span class="self">self</span>.flag_set) }
}
<span class="kw">pub unsafe fn </span>just_pressed(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
<span class="kw">crate</span>::libraries::arduboy2_library::binding::just_pressed(<span class="self">self</span>.flag_set)
<span class="kw">pub fn </span>just_pressed(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
<span class="kw">unsafe </span>{ <span class="kw">crate</span>::libraries::arduboy2_library::binding::just_pressed(<span class="self">self</span>.flag_set) }
}
<span class="kw">pub unsafe fn </span>just_released(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
<span class="kw">crate</span>::libraries::arduboy2_library::binding::just_released(<span class="self">self</span>.flag_set)
<span class="kw">pub fn </span>just_released(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
<span class="kw">unsafe </span>{ <span class="kw">crate</span>::libraries::arduboy2_library::binding::just_released(<span class="self">self</span>.flag_set) }
}
<span class="kw">pub unsafe fn </span>not_pressed(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
<span class="kw">crate</span>::libraries::arduboy2_library::binding::not_pressed(<span class="self">self</span>.flag_set)
<span class="kw">pub fn </span>not_pressed(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
<span class="kw">unsafe </span>{ <span class="kw">crate</span>::libraries::arduboy2_library::binding::not_pressed(<span class="self">self</span>.flag_set) }
}
}

View file

@ -46,9 +46,9 @@
//! use arduboy_rust::prelude::*;
//! ```
//! ### Disable C++ libraries
//! Inside the root directory is a file named `import_config.h`
//! Inside the project directory is a file named `config.toml`
//!
//! You can disable C++ libraries in the `import_config.h` file.
//! You can disable C++ libraries in the `config.toml` file.
//! Just comment the unused library definition out.
//!
//! Be careful with disabling libraries because:

View file

@ -1018,7 +1018,7 @@
///- ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.
///
///
/// ## Example
/// ### Example
/// ```
/// #![allow(non_upper_case_globals)]
/// use arduboy_rust::prelude::*;

View file

@ -151,11 +151,13 @@
<a href="#151" id="151">151</a>
<a href="#152" id="152">152</a>
<a href="#153" id="153">153</a>
<a href="#154" id="154">154</a>
<a href="#155" id="155">155</a>
</pre></div><pre class="rust"><code><span class="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.
/// You will need to uncomment the ArduboyTones in the config.toml file.
</span><span class="kw">pub struct </span>ArduboyTones {}
<span class="kw">impl </span>ArduboyTones {
@ -163,6 +165,7 @@
/// ## Example
/// ```
/// use arduboy_rust::prelude::*;
/// #[allow(non_upper_case_globals)]
/// const sound: ArduboyTones = ArduboyTones::new();
/// ```
</span><span class="kw">pub const fn </span>new() -&gt; ArduboyTones {
@ -220,6 +223,7 @@
/// Example:
/// ```
/// use arduboy_rust::prelude::*;
/// #[allow(non_upper_case_globals)]
/// const sound: ArduboyTones = ArduboyTones::new();
/// progmem!(
/// static sound1: [u8; _] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END];
@ -258,7 +262,7 @@
///
/// ```
/// use arduboy_rust::prelude::*;
/// use arduboy_tones::tones_pitch::*;
/// use 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

View file

@ -8,7 +8,7 @@
<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.
//! You will need to uncomment the ArduboyTones in the config.toml file.
</span><span class="attr">#[doc(hidden)]
</span><span class="kw">mod </span>arduboy_tones;
<span class="kw">pub mod </span>tones_pitch;

View file

@ -146,10 +146,10 @@
//! use arduboy_rust::prelude::*;
//!
//! fn setup() {
//! FX::begin()
//! fx::begin()
//! }
//! ```
//! You will need to uncomment the ArduboyFX_Library in the import_config.h file.
//! You will need to uncomment the ArduboyFX in the config.toml 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;

View file

@ -11,7 +11,7 @@
<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.
//! You will need to uncomment the ArduboyFX in the config.toml file.
</span><span class="kw">mod </span>drawable_number;
<span class="kw">pub mod </span>fx_consts;
<span class="attr">#[doc(hidden)]

View file

@ -165,6 +165,9 @@
<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>
</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};
@ -185,18 +188,21 @@
<span class="doccomment">///This is the struct to store and read structs objects to/from eeprom memory.
/// ## Example
/// ```
/// use arduboy_rust::prelude::*;
/// #[allow(non_upper_case_globals)]
/// static e: EEPROM = EEPROM::new(10);
/// struct Scorebord {
/// player1: u16,
/// text: &amp;&#39;static str,
/// }
/// #[allow(non_upper_case_globals)]
/// static mut s: Scorebord = Scorebord {
/// player1: 0,
/// text: &quot;lol\0&quot;,
/// };
///
/// // init inside of the setup function
/// e.init(&amp;mut s);
/// unsafe { e.init(&amp;mut s) };
/// ```
</span><span class="kw">pub struct </span>EEPROM {
start_c1: i16,

View file

@ -141,11 +141,16 @@
<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>
</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
/// ```
/// use arduboy_rust::prelude::*;
/// //for text
/// progmem!(
/// static text: [u8; _] = *b&quot;I&#39;m a PROGMEM Text\0&quot;;
@ -262,6 +267,9 @@
/// This automatically saves the given text to the Progmem.
/// ## Example
/// ```
/// use arduboy_rust::prelude::*;
/// #[allow(non_upper_case_globals)]
/// const arduboy: Arduboy2 = Arduboy2::new();
/// arduboy.print(f!(b&quot;Random text to print\0&quot;))
/// ```
</span><span class="attr">#[macro_export]

View file

@ -418,7 +418,7 @@
<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.
//! You will need to uncomment the Serial in the config.toml 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};

View file

@ -42,7 +42,7 @@
<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.
//! You will need to uncomment the ArdVoice in the config.toml file.
</span><span class="kw">use </span>core::ffi::{c_float, c_uchar, c_ulong};

View file

@ -5,7 +5,7 @@
<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.
//! You will need to uncomment the ArdVoice in the config.toml file.
</span><span class="kw">mod </span>ardvoice;
<span class="kw">pub use </span>ardvoice::ArdVoice;
</code></pre></div></section></main></body></html>