From 3d5d8ccf4921485793b5c84f661d8d8eae2ff792 Mon Sep 17 00:00:00 2001 From: ZennDev1337 Date: Wed, 11 Oct 2023 18:41:22 +0200 Subject: [PATCH] edit the docs --- .idea/Rust-for-Arduboy.iml | 1 + arduboy-rust/Wrapper-Project/src/main.h | 2 +- arduboy-rust/src/hardware/buttons.rs | 16 +++++------ arduboy-rust/src/lib.rs | 4 +-- .../libraries/arduboy2_library/arduboy2.rs | 2 +- .../arduboy_tones_library/arduboy_tones.rs | 6 ++-- .../libraries/arduboy_tones_library/mod.rs | 2 +- .../src/libraries/arduboyfx_library/fx.rs | 4 +-- .../src/libraries/arduboyfx_library/mod.rs | 2 +- .../src/libraries/arduino_system/eeprom.rs | 5 +++- .../src/libraries/arduino_system/progmem.rs | 4 +++ .../libraries/arduino_system/serial_print.rs | 2 +- .../libraries/ardvoice_library/ardvoice.rs | 2 +- .../src/libraries/ardvoice_library/mod.rs | 2 +- .../arduboy_tones_library/index.html | 2 +- .../struct.ArduboyTones.html | 28 ++++++++++--------- .../arduboyfx_library/fx/index.html | 4 +-- .../arduboy_rust/arduboyfx_library/index.html | 2 +- .../arduino_system/eeprom/index.html | 2 +- .../arduino_system/eeprom/struct.EEPROM.html | 13 +++++---- .../eeprom/struct.EEPROMBYTE.html | 4 +-- .../eeprom/struct.EEPROMBYTECHECKLESS.html | 4 +-- .../arduino_system/progmem/index.html | 2 +- .../arduino_system/progmem/macro.f.html | 7 +++-- .../progmem/macro.get_ardvoice_tone_addr.html | 2 +- .../progmem/macro.get_sprite_addr.html | 2 +- .../progmem/macro.get_string_addr.html | 2 +- .../progmem/macro.get_tones_addr.html | 2 +- .../arduino_system/progmem/macro.progmem.html | 5 ++-- .../progmem/struct.Pstring.html | 4 +-- .../arduino_system/serial_print/index.html | 2 +- .../arduboy_rust/ardvoice_library/index.html | 2 +- .../hardware/buttons/struct.ButtonSet.html | 2 +- docs/doc/arduboy_rust/index.html | 4 +-- docs/doc/arduboy_rust/macro.f.html | 7 +++-- .../macro.get_ardvoice_tone_addr.html | 2 +- .../arduboy_rust/macro.get_sprite_addr.html | 2 +- .../arduboy_rust/macro.get_string_addr.html | 2 +- .../arduboy_rust/macro.get_tones_addr.html | 2 +- docs/doc/arduboy_rust/macro.progmem.html | 5 ++-- docs/doc/arduboy_rust/prelude/macro.f.html | 7 +++-- .../prelude/macro.get_ardvoice_tone_addr.html | 2 +- .../prelude/macro.get_sprite_addr.html | 2 +- .../prelude/macro.get_string_addr.html | 2 +- .../prelude/macro.get_tones_addr.html | 2 +- .../arduboy_rust/prelude/macro.progmem.html | 5 ++-- .../arduboy_rust/prelude/serial/index.html | 2 +- .../prelude/struct.ArduboyTones.html | 28 ++++++++++--------- .../prelude/struct.ButtonSet.html | 2 +- .../arduboy_rust/prelude/struct.EEPROM.html | 13 +++++---- .../prelude/struct.EEPROMBYTE.html | 4 +-- .../prelude/struct.EEPROMBYTECHECKLESS.html | 4 +-- .../arduboy_rust/prelude/struct.Pstring.html | 4 +-- .../src/arduboy_rust/hardware/buttons.rs.html | 16 +++++------ docs/doc/src/arduboy_rust/lib.rs.html | 4 +-- .../arduboy2_library/arduboy2.rs.html | 2 +- .../arduboy_tones.rs.html | 8 ++++-- .../arduboy_tones_library/mod.rs.html | 2 +- .../libraries/arduboyfx_library/fx.rs.html | 4 +-- .../libraries/arduboyfx_library/mod.rs.html | 2 +- .../libraries/arduino_system/eeprom.rs.html | 8 +++++- .../libraries/arduino_system/progmem.rs.html | 8 ++++++ .../arduino_system/serial_print.rs.html | 2 +- .../ardvoice_library/ardvoice.rs.html | 2 +- .../libraries/ardvoice_library/mod.rs.html | 2 +- 65 files changed, 178 insertions(+), 128 deletions(-) diff --git a/.idea/Rust-for-Arduboy.iml b/.idea/Rust-for-Arduboy.iml index b0ca470..eed0bfe 100644 --- a/.idea/Rust-for-Arduboy.iml +++ b/.idea/Rust-for-Arduboy.iml @@ -31,6 +31,7 @@ + diff --git a/arduboy-rust/Wrapper-Project/src/main.h b/arduboy-rust/Wrapper-Project/src/main.h index 7d79d27..ef813bc 100644 --- a/arduboy-rust/Wrapper-Project/src/main.h +++ b/arduboy-rust/Wrapper-Project/src/main.h @@ -33,6 +33,6 @@ ArdVoice ardvoice; #include "./library/arduino/eeprom_export.h" #endif -#if defined(Arduino_Serial_Library) +#if defined(Serial_Library) #include "./library/arduino/arduino_serial_export.h" #endif \ No newline at end of file diff --git a/arduboy-rust/src/hardware/buttons.rs b/arduboy-rust/src/hardware/buttons.rs index 4552102..393b10b 100644 --- a/arduboy-rust/src/hardware/buttons.rs +++ b/arduboy-rust/src/hardware/buttons.rs @@ -46,19 +46,19 @@ pub struct ButtonSet { } impl ButtonSet { - pub unsafe fn pressed(&self) -> bool { - crate::libraries::arduboy2_library::binding::pressed(self.flag_set) + pub fn pressed(&self) -> bool { + unsafe { crate::libraries::arduboy2_library::binding::pressed(self.flag_set) } } - pub unsafe fn just_pressed(&self) -> bool { - crate::libraries::arduboy2_library::binding::just_pressed(self.flag_set) + pub fn just_pressed(&self) -> bool { + unsafe { crate::libraries::arduboy2_library::binding::just_pressed(self.flag_set) } } - pub unsafe fn just_released(&self) -> bool { - crate::libraries::arduboy2_library::binding::just_released(self.flag_set) + pub fn just_released(&self) -> bool { + unsafe { crate::libraries::arduboy2_library::binding::just_released(self.flag_set) } } - pub unsafe fn not_pressed(&self) -> bool { - crate::libraries::arduboy2_library::binding::not_pressed(self.flag_set) + pub fn not_pressed(&self) -> bool { + unsafe { crate::libraries::arduboy2_library::binding::not_pressed(self.flag_set) } } } diff --git a/arduboy-rust/src/lib.rs b/arduboy-rust/src/lib.rs index 904193e..ed854c3 100644 --- a/arduboy-rust/src/lib.rs +++ b/arduboy-rust/src/lib.rs @@ -9,9 +9,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: diff --git a/arduboy-rust/src/libraries/arduboy2_library/arduboy2.rs b/arduboy-rust/src/libraries/arduboy2_library/arduboy2.rs index 85374c4..f588295 100644 --- a/arduboy-rust/src/libraries/arduboy2_library/arduboy2.rs +++ b/arduboy-rust/src/libraries/arduboy2_library/arduboy2.rs @@ -351,7 +351,7 @@ impl Arduboy2 { ///- ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored. /// /// - /// ## Example + /// ### Example /// ``` /// #![allow(non_upper_case_globals)] /// use arduboy_rust::prelude::*; diff --git a/arduboy-rust/src/libraries/arduboy_tones_library/arduboy_tones.rs b/arduboy-rust/src/libraries/arduboy_tones_library/arduboy_tones.rs index b790b40..c626de0 100644 --- a/arduboy-rust/src/libraries/arduboy_tones_library/arduboy_tones.rs +++ b/arduboy-rust/src/libraries/arduboy_tones_library/arduboy_tones.rs @@ -2,7 +2,7 @@ use core::ffi::{c_uchar, c_uint, c_ulong}; ///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. pub struct ArduboyTones {} impl ArduboyTones { @@ -10,6 +10,7 @@ impl ArduboyTones { /// ## Example /// ``` /// use arduboy_rust::prelude::*; + /// #[allow(non_upper_case_globals)] /// const sound: ArduboyTones = ArduboyTones::new(); /// ``` pub const fn new() -> ArduboyTones { @@ -67,6 +68,7 @@ impl ArduboyTones { /// 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]; @@ -105,7 +107,7 @@ impl ArduboyTones { /// /// ``` /// 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 diff --git a/arduboy-rust/src/libraries/arduboy_tones_library/mod.rs b/arduboy-rust/src/libraries/arduboy_tones_library/mod.rs index 1015d44..fb1ef79 100644 --- a/arduboy-rust/src/libraries/arduboy_tones_library/mod.rs +++ b/arduboy-rust/src/libraries/arduboy_tones_library/mod.rs @@ -1,6 +1,6 @@ //!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. #[doc(hidden)] mod arduboy_tones; pub mod tones_pitch; diff --git a/arduboy-rust/src/libraries/arduboyfx_library/fx.rs b/arduboy-rust/src/libraries/arduboyfx_library/fx.rs index bfe39cb..b18d05a 100644 --- a/arduboy-rust/src/libraries/arduboyfx_library/fx.rs +++ b/arduboy-rust/src/libraries/arduboyfx_library/fx.rs @@ -5,10 +5,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. #![allow(non_upper_case_globals)] use super::drawable_number::DrawableNumber; use super::drawable_string::DrawableString; diff --git a/arduboy-rust/src/libraries/arduboyfx_library/mod.rs b/arduboy-rust/src/libraries/arduboyfx_library/mod.rs index 9f59064..1739a8c 100644 --- a/arduboy-rust/src/libraries/arduboyfx_library/mod.rs +++ b/arduboy-rust/src/libraries/arduboyfx_library/mod.rs @@ -1,6 +1,6 @@ //! 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. mod drawable_number; pub mod fx_consts; #[doc(hidden)] diff --git a/arduboy-rust/src/libraries/arduino_system/eeprom.rs b/arduboy-rust/src/libraries/arduino_system/eeprom.rs index 30facca..2f4aff9 100644 --- a/arduboy-rust/src/libraries/arduino_system/eeprom.rs +++ b/arduboy-rust/src/libraries/arduino_system/eeprom.rs @@ -18,18 +18,21 @@ extern "C" { ///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: &'static str, /// } +/// #[allow(non_upper_case_globals)] /// static mut s: Scorebord = Scorebord { /// player1: 0, /// text: "lol\0", /// }; /// /// // init inside of the setup function -/// e.init(&mut s); +/// unsafe { e.init(&mut s) }; /// ``` pub struct EEPROM { start_c1: i16, diff --git a/arduboy-rust/src/libraries/arduino_system/progmem.rs b/arduboy-rust/src/libraries/arduino_system/progmem.rs index 2f30db1..a553838 100644 --- a/arduboy-rust/src/libraries/arduino_system/progmem.rs +++ b/arduboy-rust/src/libraries/arduino_system/progmem.rs @@ -3,6 +3,7 @@ /// Create a space for Progmem variable /// ## Example /// ``` +/// use arduboy_rust::prelude::*; /// //for text /// progmem!( /// static text: [u8; _] = *b"I'm a PROGMEM Text\0"; @@ -119,6 +120,9 @@ pub(super) use get_string_addr; /// 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"Random text to print\0")) /// ``` #[macro_export] diff --git a/arduboy-rust/src/libraries/arduino_system/serial_print.rs b/arduboy-rust/src/libraries/arduino_system/serial_print.rs index 0cb3ea5..ea40df5 100644 --- a/arduboy-rust/src/libraries/arduino_system/serial_print.rs +++ b/arduboy-rust/src/libraries/arduino_system/serial_print.rs @@ -1,6 +1,6 @@ //! 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. use crate::arduino_system::progmem::Pstring; use core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong}; diff --git a/arduboy-rust/src/libraries/ardvoice_library/ardvoice.rs b/arduboy-rust/src/libraries/ardvoice_library/ardvoice.rs index 53d2d61..0e26cba 100644 --- a/arduboy-rust/src/libraries/ardvoice_library/ardvoice.rs +++ b/arduboy-rust/src/libraries/ardvoice_library/ardvoice.rs @@ -1,6 +1,6 @@ //! 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. use core::ffi::{c_float, c_uchar, c_ulong}; diff --git a/arduboy-rust/src/libraries/ardvoice_library/mod.rs b/arduboy-rust/src/libraries/ardvoice_library/mod.rs index 34d4b04..c4737f5 100644 --- a/arduboy-rust/src/libraries/ardvoice_library/mod.rs +++ b/arduboy-rust/src/libraries/ardvoice_library/mod.rs @@ -1,5 +1,5 @@ //! 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. mod ardvoice; pub use ardvoice::ArdVoice; diff --git a/docs/doc/arduboy_rust/arduboy_tones_library/index.html b/docs/doc/arduboy_rust/arduboy_tones_library/index.html index 78efb61..36b7375 100644 --- a/docs/doc/arduboy_rust/arduboy_tones_library/index.html +++ b/docs/doc/arduboy_rust/arduboy_tones_library/index.html @@ -1,3 +1,3 @@ arduboy_rust::arduboy_tones_library - Rust
Expand description

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.

Modules

  • A list of all tones available and used by the Sounds library Arduboy2Tones

Structs

  • This is the struct to interact in a save way with the ArduboyTones C++ library.
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tones_library/struct.ArduboyTones.html b/docs/doc/arduboy_rust/arduboy_tones_library/struct.ArduboyTones.html index d9e9b62..5057049 100644 --- a/docs/doc/arduboy_rust/arduboy_tones_library/struct.ArduboyTones.html +++ b/docs/doc/arduboy_rust/arduboy_tones_library/struct.ArduboyTones.html @@ -1,10 +1,11 @@ ArduboyTones in arduboy_rust::arduboy_tones_library - Rust
pub struct ArduboyTones {}
Expand description

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.

-

Implementations§

source§

impl ArduboyTones

source

pub const fn new() -> ArduboyTones

Get a new instance of ArduboyTones

+

You will need to uncomment the ArduboyTones in the config.toml file.

+

Implementations§

source§

impl ArduboyTones

source

pub const fn new() -> ArduboyTones

Get a new instance of ArduboyTones

Example
use arduboy_rust::prelude::*;
-const sound: ArduboyTones = ArduboyTones::new();
-
source

pub fn tone(&self, frequency: u16, duration: u32)

Play a single tone.

+#[allow(non_upper_case_globals)] +const sound: ArduboyTones = ArduboyTones::new();
+
source

pub fn tone(&self, frequency: u16, duration: u32)

Play a single tone.

  • freq The frequency of the tone, in hertz.
  • dur The duration to play the tone for, in 1024ths of a @@ -12,7 +13,7 @@ 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.
-
source

pub fn tone2( +

source

pub fn tone2( &self, frequency1: u16, duration1: u32, @@ -24,7 +25,7 @@ sequence is started.
  • dur1,dur2 The duration to play the tone for, in 1024ths of a second (very close to milliseconds).
  • -

    source

    pub fn tone3( +

    source

    pub fn tone3( &self, frequency1: u16, duration1: u32, @@ -38,7 +39,7 @@ second (very close to milliseconds).
  • dur1,dur2,dur3 The duration to play the tone for, in 1024ths of a second (very close to milliseconds).
  • -

    source

    pub fn tones(&self, tones: *const u16)

    Play a tone sequence from frequency/duration pairs in a PROGMEM array.

    +
    source

    pub fn tones(&self, tones: *const u16)

    Play a tone sequence from frequency/duration pairs in a PROGMEM array.

    • tones A pointer to an array of frequency/duration pairs.
    @@ -49,20 +50,21 @@ A frequency of 0 for any tone means silence (a musical rest).

    Example:

    use arduboy_rust::prelude::*;
    -const sound: ArduboyTones = ArduboyTones::new();
    +#[allow(non_upper_case_globals)]
    +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));
    -
    source

    pub fn no_tone(&self)

    Stop playing the tone or sequence.

    +
    source

    pub fn no_tone(&self)

    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.

    -
    source

    pub fn playing(&self) -> bool

    Check if a tone or tone sequence is playing.

    +
    source

    pub fn playing(&self) -> bool

    Check if a tone or tone sequence is playing.

    • return boolean true if playing (even if sound is muted).
    -
    source

    pub fn tones_in_ram(&self, tones: *mut u32)

    Play a tone sequence from frequency/duration pairs in an array in RAM.

    +
    source

    pub fn tones_in_ram(&self, tones: *mut u32)

    Play a tone sequence from frequency/duration pairs in an array in RAM.

    • tones A pointer to an array of frequency/duration pairs.
    @@ -73,12 +75,12 @@ A frequency of 0 for any tone means silence (a musical rest).

    Example:

    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 choice. The only reason to use tonesInRAM() would be if dynamically altering the contents of the array is required.

    -
    source

    pub fn volume_mode(&self, mode: u8)

    Set the volume to always normal, always high, or tone controlled.

    +
    source

    pub fn volume_mode(&self, mode: u8)

    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 diff --git a/docs/doc/arduboy_rust/arduboyfx_library/fx/index.html b/docs/doc/arduboy_rust/arduboyfx_library/fx/index.html index ca11c7d..95457dd 100644 --- a/docs/doc/arduboy_rust/arduboyfx_library/fx/index.html +++ b/docs/doc/arduboy_rust/arduboyfx_library/fx/index.html @@ -4,7 +4,7 @@
      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.

    Functions

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboyfx_library/index.html b/docs/doc/arduboy_rust/arduboyfx_library/index.html index fd2bea4..f3c770c 100644 --- a/docs/doc/arduboy_rust/arduboyfx_library/index.html +++ b/docs/doc/arduboy_rust/arduboyfx_library/index.html @@ -1,3 +1,3 @@ arduboy_rust::arduboyfx_library - Rust
    Expand description

    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.

    Modules

    • Functions given by the ArduboyFX library.
    • Consts given by the ArduboyFX library.
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino_system/eeprom/index.html b/docs/doc/arduboy_rust/arduino_system/eeprom/index.html index 1eb1336..ecd79d3 100644 --- a/docs/doc/arduboy_rust/arduino_system/eeprom/index.html +++ b/docs/doc/arduboy_rust/arduino_system/eeprom/index.html @@ -1,2 +1,2 @@ -arduboy_rust::arduino_system::eeprom - Rust
    Expand description

    This is the module to interact with the eeprom memory

    +arduboy_rust::arduino_system::eeprom - Rust
    Expand description

    This is the module to interact with the eeprom memory

    Structs

    • This is the struct to store and read structs objects to/from eeprom memory.
    • Use this struct to store and read single bytes to/from eeprom memory.
    • Use this struct to store and read single bytes to/from eeprom memory without using a check digit.

    Constants

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROM.html b/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROM.html index d6a49a0..79b7547 100644 --- a/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROM.html +++ b/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROM.html @@ -1,18 +1,21 @@ -EEPROM in arduboy_rust::arduino_system::eeprom - Rust
    pub struct EEPROM { /* private fields */ }
    Expand description

    This is the struct to store and read structs objects to/from eeprom memory.

    +EEPROM in arduboy_rust::arduino_system::eeprom - Rust
    pub struct EEPROM { /* private fields */ }
    Expand description

    This is the struct to store and read structs objects to/from eeprom memory.

    Example

    -
    static e: EEPROM = EEPROM::new(10);
    +
    use arduboy_rust::prelude::*;
    +#[allow(non_upper_case_globals)]
    +static e: EEPROM = EEPROM::new(10);
     struct Scorebord {
         player1: u16,
         text: &'static str,
     }
    -static mut s: Scorebord = Scorebord {
    +#[allow(non_upper_case_globals)]
    +static mut s: Scorebord = Scorebord {
         player1: 0,
         text: "lol\0",
     };
     
     // init inside of the setup function
    -e.init(&mut s);
    -

    Implementations§

    source§

    impl EEPROM

    source

    pub const fn new(idx: i16) -> EEPROM

    source

    pub fn init<T>(&self, your_struct: &mut T)

    source

    pub fn get<T>(&self, your_struct: &mut T)

    source

    pub fn get_direct<T>(&self) -> T

    source

    pub fn put<T>(&self, your_struct: &T)

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for EEPROM

    §

    impl Send for EEPROM

    §

    impl Sync for EEPROM

    §

    impl Unpin for EEPROM

    §

    impl UnwindSafe for EEPROM

    Blanket Implementations§

    §

    impl<T> Any for Twhere +unsafe { e.init(&mut s) };

    +

    Implementations§

    source§

    impl EEPROM

    source

    pub const fn new(idx: i16) -> EEPROM

    source

    pub fn init<T>(&self, your_struct: &mut T)

    source

    pub fn get<T>(&self, your_struct: &mut T)

    source

    pub fn get_direct<T>(&self) -> T

    source

    pub fn put<T>(&self, your_struct: &T)

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for EEPROM

    §

    impl Send for EEPROM

    §

    impl Sync for EEPROM

    §

    impl Unpin for EEPROM

    §

    impl UnwindSafe for EEPROM

    Blanket Implementations§

    §

    impl<T> Any for Twhere T: 'static + ?Sized,

    §

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<T> Borrow<T> for Twhere T: ?Sized,

    §

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    §

    impl<T> BorrowMut<T> for Twhere T: ?Sized,

    §

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> From<T> for T

    §

    fn from(t: T) -> T

    Returns the argument unchanged.

    diff --git a/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROMBYTE.html b/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROMBYTE.html index 83b6e45..b48fd2e 100644 --- a/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROMBYTE.html +++ b/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROMBYTE.html @@ -1,5 +1,5 @@ -EEPROMBYTE in arduboy_rust::arduino_system::eeprom - Rust
    pub struct EEPROMBYTE { /* private fields */ }
    Expand description

    Use this struct to store and read single bytes to/from eeprom memory.

    -

    Implementations§

    source§

    impl EEPROMBYTE

    source

    pub const fn new(idx: i16) -> EEPROMBYTE

    source

    pub fn init(&self)

    source

    pub fn read(&self) -> u8

    source

    pub fn update(&self, val: u8)

    source

    pub fn write(&self, val: u8)

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for EEPROMBYTE

    §

    impl Send for EEPROMBYTE

    §

    impl Sync for EEPROMBYTE

    §

    impl Unpin for EEPROMBYTE

    §

    impl UnwindSafe for EEPROMBYTE

    Blanket Implementations§

    §

    impl<T> Any for Twhere +EEPROMBYTE in arduboy_rust::arduino_system::eeprom - Rust
    pub struct EEPROMBYTE { /* private fields */ }
    Expand description

    Use this struct to store and read single bytes to/from eeprom memory.

    +

    Implementations§

    source§

    impl EEPROMBYTE

    source

    pub const fn new(idx: i16) -> EEPROMBYTE

    source

    pub fn init(&self)

    source

    pub fn read(&self) -> u8

    source

    pub fn update(&self, val: u8)

    source

    pub fn write(&self, val: u8)

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for EEPROMBYTE

    §

    impl Send for EEPROMBYTE

    §

    impl Sync for EEPROMBYTE

    §

    impl Unpin for EEPROMBYTE

    §

    impl UnwindSafe for EEPROMBYTE

    Blanket Implementations§

    §

    impl<T> Any for Twhere T: 'static + ?Sized,

    §

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<T> Borrow<T> for Twhere T: ?Sized,

    §

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    §

    impl<T> BorrowMut<T> for Twhere T: ?Sized,

    §

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> From<T> for T

    §

    fn from(t: T) -> T

    Returns the argument unchanged.

    diff --git a/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROMBYTECHECKLESS.html b/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROMBYTECHECKLESS.html index be28583..517590e 100644 --- a/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROMBYTECHECKLESS.html +++ b/docs/doc/arduboy_rust/arduino_system/eeprom/struct.EEPROMBYTECHECKLESS.html @@ -1,6 +1,6 @@ -EEPROMBYTECHECKLESS in arduboy_rust::arduino_system::eeprom - Rust
    pub struct EEPROMBYTECHECKLESS { /* private fields */ }
    Expand description

    Use this struct to store and read single bytes to/from eeprom memory without using a check digit.

    +EEPROMBYTECHECKLESS in arduboy_rust::arduino_system::eeprom - Rust
    pub struct EEPROMBYTECHECKLESS { /* private fields */ }
    Expand description

    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.

    -

    Implementations§

    source§

    impl EEPROMBYTECHECKLESS

    source

    pub const fn new(idx: i16) -> EEPROMBYTECHECKLESS

    source

    pub fn read(&self) -> u8

    source

    pub fn update(&self, val: u8)

    source

    pub fn write(&self, val: u8)

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for EEPROMBYTECHECKLESS

    §

    impl Send for EEPROMBYTECHECKLESS

    §

    impl Sync for EEPROMBYTECHECKLESS

    §

    impl Unpin for EEPROMBYTECHECKLESS

    §

    impl UnwindSafe for EEPROMBYTECHECKLESS

    Blanket Implementations§

    §

    impl<T> Any for Twhere +

    Implementations§

    source§

    impl EEPROMBYTECHECKLESS

    source

    pub const fn new(idx: i16) -> EEPROMBYTECHECKLESS

    source

    pub fn read(&self) -> u8

    source

    pub fn update(&self, val: u8)

    source

    pub fn write(&self, val: u8)

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for EEPROMBYTECHECKLESS

    §

    impl Send for EEPROMBYTECHECKLESS

    §

    impl Sync for EEPROMBYTECHECKLESS

    §

    impl Unpin for EEPROMBYTECHECKLESS

    §

    impl UnwindSafe for EEPROMBYTECHECKLESS

    Blanket Implementations§

    §

    impl<T> Any for Twhere T: 'static + ?Sized,

    §

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<T> Borrow<T> for Twhere T: ?Sized,

    §

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    §

    impl<T> BorrowMut<T> for Twhere T: ?Sized,

    §

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> From<T> for T

    §

    fn from(t: T) -> T

    Returns the argument unchanged.

    diff --git a/docs/doc/arduboy_rust/arduino_system/progmem/index.html b/docs/doc/arduboy_rust/arduino_system/progmem/index.html index 45c9d41..71b446d 100644 --- a/docs/doc/arduboy_rust/arduino_system/progmem/index.html +++ b/docs/doc/arduboy_rust/arduino_system/progmem/index.html @@ -1,2 +1,2 @@ -arduboy_rust::arduino_system::progmem - Rust
    Expand description

    This is the module to interact with the progmem memory

    +arduboy_rust::arduino_system::progmem - Rust
    Expand description

    This is the module to interact with the progmem memory

    Macros

    • This is the way to go if you want print some random text
    • Create a const raw pointer to a ardvoice tone as u8, without creating an intermediate reference.
    • Create a const raw pointer to a sprite as u8, without creating an intermediate reference.
    • Create a const raw pointer to a [u8;_] that saves text, without creating an intermediate reference.
    • Create a const raw pointer to a tone sequenze as u16, without creating an intermediate reference.
    • Create a space for Progmem variable

    Structs

    • This struct is important for the Progmem functionality.
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino_system/progmem/macro.f.html b/docs/doc/arduboy_rust/arduino_system/progmem/macro.f.html index 1a27e8d..8e8a856 100644 --- a/docs/doc/arduboy_rust/arduino_system/progmem/macro.f.html +++ b/docs/doc/arduboy_rust/arduino_system/progmem/macro.f.html @@ -1,8 +1,11 @@ -f in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! f {
    +f in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! f {
         ($string_literal:literal) => { ... };
     }
    Expand description

    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"))
    +
    use arduboy_rust::prelude::*;
    +#[allow(non_upper_case_globals)]
    +const arduboy: Arduboy2 = Arduboy2::new();
    +arduboy.print(f!(b"Random text to print\0"))
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_ardvoice_tone_addr.html b/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_ardvoice_tone_addr.html index 1bdcbb0..cafa28f 100644 --- a/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_ardvoice_tone_addr.html +++ b/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_ardvoice_tone_addr.html @@ -1,4 +1,4 @@ -get_ardvoice_tone_addr in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! get_ardvoice_tone_addr {
    +get_ardvoice_tone_addr in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! get_ardvoice_tone_addr {
         ( $s:expr ) => { ... };
     }
    Expand description

    Create a const raw pointer to a ardvoice tone as u8, without creating an intermediate reference.

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_sprite_addr.html b/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_sprite_addr.html index 27a3b36..7cbaead 100644 --- a/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_sprite_addr.html +++ b/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_sprite_addr.html @@ -1,4 +1,4 @@ -get_sprite_addr in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! get_sprite_addr {
    +get_sprite_addr in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! get_sprite_addr {
         ( $s:expr ) => { ... };
     }
    Expand description

    Create a const raw pointer to a sprite as u8, without creating an intermediate reference.

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_string_addr.html b/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_string_addr.html index b46a6da..38fa226 100644 --- a/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_string_addr.html +++ b/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_string_addr.html @@ -1,4 +1,4 @@ -get_string_addr in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! get_string_addr {
    +get_string_addr in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! get_string_addr {
         ( $s:expr ) => { ... };
     }
    Expand description

    Create a const raw pointer to a [u8;_] that saves text, without creating an intermediate reference.

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_tones_addr.html b/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_tones_addr.html index c975ab5..e3ec542 100644 --- a/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_tones_addr.html +++ b/docs/doc/arduboy_rust/arduino_system/progmem/macro.get_tones_addr.html @@ -1,4 +1,4 @@ -get_tones_addr in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! get_tones_addr {
    +get_tones_addr in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! get_tones_addr {
         ( $s:expr ) => { ... };
     }
    Expand description

    Create a const raw pointer to a tone sequenze as u16, without creating an intermediate reference.

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino_system/progmem/macro.progmem.html b/docs/doc/arduboy_rust/arduino_system/progmem/macro.progmem.html index d01a42f..80e6228 100644 --- a/docs/doc/arduboy_rust/arduino_system/progmem/macro.progmem.html +++ b/docs/doc/arduboy_rust/arduino_system/progmem/macro.progmem.html @@ -1,4 +1,4 @@ -progmem in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! progmem {
    +progmem in arduboy_rust::arduino_system::progmem - Rust
    macro_rules! progmem {
         (
             $( #[$attr:meta] )*
             $v:vis $id:ident $name:ident: [$ty:ty; _] = $value:expr;
    @@ -22,7 +22,8 @@
         () => { ... };
     }
    Expand description

    Create a space for Progmem variable

    Example

    -
    //for text
    +
    use arduboy_rust::prelude::*;
    +//for text
     progmem!(
         static text: [u8; _] = *b"I'm a PROGMEM Text\0";
     );
    diff --git a/docs/doc/arduboy_rust/arduino_system/progmem/struct.Pstring.html b/docs/doc/arduboy_rust/arduino_system/progmem/struct.Pstring.html
    index af712ab..6fd2d7c 100644
    --- a/docs/doc/arduboy_rust/arduino_system/progmem/struct.Pstring.html
    +++ b/docs/doc/arduboy_rust/arduino_system/progmem/struct.Pstring.html
    @@ -1,9 +1,9 @@
    -Pstring in arduboy_rust::arduino_system::progmem - Rust
    pub struct Pstring {
    +Pstring in arduboy_rust::arduino_system::progmem - Rust
    pub struct Pstring {
         pub pointer: *const i8,
     }
    Expand description

    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.

    -

    Fields§

    §pointer: *const i8

    Trait Implementations§

    source§

    impl Clone for Pstring

    source§

    fn clone(&self) -> Pstring

    Returns a copy of the value. Read more
    1.0.0§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Serialprintable for Pstring

    §

    type Parameters = ()

    source§

    fn print_2(self, _params: Self::Parameters)

    source§

    fn default_parameters() -> Self::Parameters

    source§

    fn print(self)

    source§

    impl Serialprintlnable for Pstring

    §

    type Parameters = ()

    source§

    fn println_2(self, _params: Self::Parameters)

    source§

    fn default_parameters() -> Self::Parameters

    source§

    fn println(self)

    source§

    impl Copy for Pstring

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Pstring

    §

    impl !Send for Pstring

    §

    impl !Sync for Pstring

    §

    impl Unpin for Pstring

    §

    impl UnwindSafe for Pstring

    Blanket Implementations§

    §

    impl<T> Any for Twhere +

    Fields§

    §pointer: *const i8

    Trait Implementations§

    source§

    impl Clone for Pstring

    source§

    fn clone(&self) -> Pstring

    Returns a copy of the value. Read more
    1.0.0§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Serialprintable for Pstring

    §

    type Parameters = ()

    source§

    fn print_2(self, _params: Self::Parameters)

    source§

    fn default_parameters() -> Self::Parameters

    source§

    fn print(self)

    source§

    impl Serialprintlnable for Pstring

    §

    type Parameters = ()

    source§

    fn println_2(self, _params: Self::Parameters)

    source§

    fn default_parameters() -> Self::Parameters

    source§

    fn println(self)

    source§

    impl Copy for Pstring

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Pstring

    §

    impl !Send for Pstring

    §

    impl !Sync for Pstring

    §

    impl Unpin for Pstring

    §

    impl UnwindSafe for Pstring

    Blanket Implementations§

    §

    impl<T> Any for Twhere T: 'static + ?Sized,

    §

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<T> Borrow<T> for Twhere T: ?Sized,

    §

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    §

    impl<T> BorrowMut<T> for Twhere T: ?Sized,

    §

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> From<T> for T

    §

    fn from(t: T) -> T

    Returns the argument unchanged.

    diff --git a/docs/doc/arduboy_rust/arduino_system/serial_print/index.html b/docs/doc/arduboy_rust/arduino_system/serial_print/index.html index be22683..645ffcf 100644 --- a/docs/doc/arduboy_rust/arduino_system/serial_print/index.html +++ b/docs/doc/arduboy_rust/arduino_system/serial_print/index.html @@ -1,4 +1,4 @@ arduboy_rust::arduino_system::serial_print - Rust
    Expand description

    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.

    Traits

    Functions

    • 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).
    • 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.
    • Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call begin().
    • The Arduino Serial Print class is available for writing text to the screen buffer.
    • The Arduino Serial Print class is available for writing text to the screen buffer.
    • Reads incoming serial data. Use only inside of available():
    • Reads incoming serial data.
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/ardvoice_library/index.html b/docs/doc/arduboy_rust/ardvoice_library/index.html index 9cb5243..d99482b 100644 --- a/docs/doc/arduboy_rust/ardvoice_library/index.html +++ b/docs/doc/arduboy_rust/ardvoice_library/index.html @@ -1,3 +1,3 @@ arduboy_rust::ardvoice_library - Rust
    Expand description

    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.

    Structs

    • This is the struct to interact in a save way with the ArdVoice C++ library.
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/hardware/buttons/struct.ButtonSet.html b/docs/doc/arduboy_rust/hardware/buttons/struct.ButtonSet.html index 46eb2bc..8e120e3 100644 --- a/docs/doc/arduboy_rust/hardware/buttons/struct.ButtonSet.html +++ b/docs/doc/arduboy_rust/hardware/buttons/struct.ButtonSet.html @@ -1,7 +1,7 @@ ButtonSet in arduboy_rust::hardware::buttons - Rust
    pub struct ButtonSet {
         pub flag_set: u8,
     }
    Expand description

    This struct gives the library a understanding what Buttons on the Arduboy are.

    -

    Fields§

    §flag_set: u8

    Implementations§

    source§

    impl ButtonSet

    source

    pub unsafe fn pressed(&self) -> bool

    source

    pub unsafe fn just_pressed(&self) -> bool

    source

    pub unsafe fn just_released(&self) -> bool

    source

    pub unsafe fn not_pressed(&self) -> bool

    Trait Implementations§

    source§

    impl BitOr<ButtonSet> for ButtonSet

    §

    type Output = ButtonSet

    The resulting type after applying the | operator.
    source§

    fn bitor(self, other: Self) -> Self

    Performs the | operation. Read more
    source§

    impl Clone for ButtonSet

    source§

    fn clone(&self) -> ButtonSet

    Returns a copy of the value. Read more
    1.0.0§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for ButtonSet

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Hash for ButtonSet

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given [Hasher]. Read more
    1.3.0§

    fn hash_slice<H>(data: &[Self], state: &mut H)where +

    Fields§

    §flag_set: u8

    Implementations§

    source§

    impl ButtonSet

    source

    pub fn pressed(&self) -> bool

    source

    pub fn just_pressed(&self) -> bool

    source

    pub fn just_released(&self) -> bool

    source

    pub fn not_pressed(&self) -> bool

    Trait Implementations§

    source§

    impl BitOr<ButtonSet> for ButtonSet

    §

    type Output = ButtonSet

    The resulting type after applying the | operator.
    source§

    fn bitor(self, other: Self) -> Self

    Performs the | operation. Read more
    source§

    impl Clone for ButtonSet

    source§

    fn clone(&self) -> ButtonSet

    Returns a copy of the value. Read more
    1.0.0§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for ButtonSet

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Hash for ButtonSet

    source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given [Hasher]. Read more
    1.3.0§

    fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

    Feeds a slice of this type into the given [Hasher]. Read more
    source§

    impl Ord for ButtonSet

    source§

    fn cmp(&self, other: &ButtonSet) -> Ordering

    This method returns an [Ordering] between self and other. Read more
    1.21.0§

    fn max(self, other: Self) -> Selfwhere Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0§

    fn min(self, other: Self) -> Selfwhere diff --git a/docs/doc/arduboy_rust/index.html b/docs/doc/arduboy_rust/index.html index 758d2ae..e7c7df9 100644 --- a/docs/doc/arduboy_rust/index.html +++ b/docs/doc/arduboy_rust/index.html @@ -4,8 +4,8 @@ To get started import the
    use arduboy_rust::prelude::*;

    Disable C++ libraries

    -

    Inside the root directory is a file named import_config.h

    -

    You can disable C++ libraries in the import_config.h file. +

    Inside the project directory is a file named config.toml

    +

    You can disable C++ libraries in the config.toml file. Just comment the unused library definition out.

    Be careful with disabling libraries because:

      diff --git a/docs/doc/arduboy_rust/macro.f.html b/docs/doc/arduboy_rust/macro.f.html index 53c9dd3..f8f3ac7 100644 --- a/docs/doc/arduboy_rust/macro.f.html +++ b/docs/doc/arduboy_rust/macro.f.html @@ -1,8 +1,11 @@ -f in arduboy_rust - Rust

      Macro arduboy_rust::f

      source ·
      macro_rules! f {
      +f in arduboy_rust - Rust

      Macro arduboy_rust::f

      source ·
      macro_rules! f {
           ($string_literal:literal) => { ... };
       }
      Expand description

      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"))
      +
      use arduboy_rust::prelude::*;
      +#[allow(non_upper_case_globals)]
      +const arduboy: Arduboy2 = Arduboy2::new();
      +arduboy.print(f!(b"Random text to print\0"))
      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr.html b/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr.html index 70a0fdb..71f86ad 100644 --- a/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr.html +++ b/docs/doc/arduboy_rust/macro.get_ardvoice_tone_addr.html @@ -1,4 +1,4 @@ -get_ardvoice_tone_addr in arduboy_rust - Rust
      macro_rules! get_ardvoice_tone_addr {
      +get_ardvoice_tone_addr in arduboy_rust - Rust
      macro_rules! get_ardvoice_tone_addr {
           ( $s:expr ) => { ... };
       }
      Expand description

      Create a const raw pointer to a ardvoice tone as u8, without creating an intermediate reference.

      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_sprite_addr.html b/docs/doc/arduboy_rust/macro.get_sprite_addr.html index 6f7dee5..df97ac5 100644 --- a/docs/doc/arduboy_rust/macro.get_sprite_addr.html +++ b/docs/doc/arduboy_rust/macro.get_sprite_addr.html @@ -1,4 +1,4 @@ -get_sprite_addr in arduboy_rust - Rust
      macro_rules! get_sprite_addr {
      +get_sprite_addr in arduboy_rust - Rust
      macro_rules! get_sprite_addr {
           ( $s:expr ) => { ... };
       }
      Expand description

      Create a const raw pointer to a sprite as u8, without creating an intermediate reference.

      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_string_addr.html b/docs/doc/arduboy_rust/macro.get_string_addr.html index 4c52f0d..359f685 100644 --- a/docs/doc/arduboy_rust/macro.get_string_addr.html +++ b/docs/doc/arduboy_rust/macro.get_string_addr.html @@ -1,4 +1,4 @@ -get_string_addr in arduboy_rust - Rust
      macro_rules! get_string_addr {
      +get_string_addr in arduboy_rust - Rust
      macro_rules! get_string_addr {
           ( $s:expr ) => { ... };
       }
      Expand description

      Create a const raw pointer to a [u8;_] that saves text, without creating an intermediate reference.

      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.get_tones_addr.html b/docs/doc/arduboy_rust/macro.get_tones_addr.html index 4454a20..130d1fb 100644 --- a/docs/doc/arduboy_rust/macro.get_tones_addr.html +++ b/docs/doc/arduboy_rust/macro.get_tones_addr.html @@ -1,4 +1,4 @@ -get_tones_addr in arduboy_rust - Rust
      macro_rules! get_tones_addr {
      +get_tones_addr in arduboy_rust - Rust
      macro_rules! get_tones_addr {
           ( $s:expr ) => { ... };
       }
      Expand description

      Create a const raw pointer to a tone sequenze as u16, without creating an intermediate reference.

      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/macro.progmem.html b/docs/doc/arduboy_rust/macro.progmem.html index 2036f34..6248b4c 100644 --- a/docs/doc/arduboy_rust/macro.progmem.html +++ b/docs/doc/arduboy_rust/macro.progmem.html @@ -1,4 +1,4 @@ -progmem in arduboy_rust - Rust

      Macro arduboy_rust::progmem

      source ·
      macro_rules! progmem {
      +progmem in arduboy_rust - Rust

      Macro arduboy_rust::progmem

      source ·
      macro_rules! progmem {
           (
               $( #[$attr:meta] )*
               $v:vis $id:ident $name:ident: [$ty:ty; _] = $value:expr;
      @@ -22,7 +22,8 @@
           () => { ... };
       }
      Expand description

      Create a space for Progmem variable

      Example

      -
      //for text
      +
      use arduboy_rust::prelude::*;
      +//for text
       progmem!(
           static text: [u8; _] = *b"I'm a PROGMEM Text\0";
       );
      diff --git a/docs/doc/arduboy_rust/prelude/macro.f.html b/docs/doc/arduboy_rust/prelude/macro.f.html
      index 2e3d931..8cd8e34 100644
      --- a/docs/doc/arduboy_rust/prelude/macro.f.html
      +++ b/docs/doc/arduboy_rust/prelude/macro.f.html
      @@ -1,8 +1,11 @@
      -f in arduboy_rust::prelude - Rust

      Macro arduboy_rust::prelude::f

      source ·
      macro_rules! f {
      +f in arduboy_rust::prelude - Rust

      Macro arduboy_rust::prelude::f

      source ·
      macro_rules! f {
           ($string_literal:literal) => { ... };
       }
      Expand description

      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"))
      +
      use arduboy_rust::prelude::*;
      +#[allow(non_upper_case_globals)]
      +const arduboy: Arduboy2 = Arduboy2::new();
      +arduboy.print(f!(b"Random text to print\0"))
      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr.html b/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr.html index 2605fa5..9764724 100644 --- a/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr.html +++ b/docs/doc/arduboy_rust/prelude/macro.get_ardvoice_tone_addr.html @@ -1,4 +1,4 @@ -get_ardvoice_tone_addr in arduboy_rust::prelude - Rust
      macro_rules! get_ardvoice_tone_addr {
      +get_ardvoice_tone_addr in arduboy_rust::prelude - Rust
      macro_rules! get_ardvoice_tone_addr {
           ( $s:expr ) => { ... };
       }
      Expand description

      Create a const raw pointer to a ardvoice tone as u8, without creating an intermediate reference.

      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr.html b/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr.html index 47c545e..173ee10 100644 --- a/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr.html +++ b/docs/doc/arduboy_rust/prelude/macro.get_sprite_addr.html @@ -1,4 +1,4 @@ -get_sprite_addr in arduboy_rust::prelude - Rust
      macro_rules! get_sprite_addr {
      +get_sprite_addr in arduboy_rust::prelude - Rust
      macro_rules! get_sprite_addr {
           ( $s:expr ) => { ... };
       }
      Expand description

      Create a const raw pointer to a sprite as u8, without creating an intermediate reference.

      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_string_addr.html b/docs/doc/arduboy_rust/prelude/macro.get_string_addr.html index c62b8c2..7e0022d 100644 --- a/docs/doc/arduboy_rust/prelude/macro.get_string_addr.html +++ b/docs/doc/arduboy_rust/prelude/macro.get_string_addr.html @@ -1,4 +1,4 @@ -get_string_addr in arduboy_rust::prelude - Rust
      macro_rules! get_string_addr {
      +get_string_addr in arduboy_rust::prelude - Rust
      macro_rules! get_string_addr {
           ( $s:expr ) => { ... };
       }
      Expand description

      Create a const raw pointer to a [u8;_] that saves text, without creating an intermediate reference.

      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.get_tones_addr.html b/docs/doc/arduboy_rust/prelude/macro.get_tones_addr.html index 37238aa..d6fadd9 100644 --- a/docs/doc/arduboy_rust/prelude/macro.get_tones_addr.html +++ b/docs/doc/arduboy_rust/prelude/macro.get_tones_addr.html @@ -1,4 +1,4 @@ -get_tones_addr in arduboy_rust::prelude - Rust
      macro_rules! get_tones_addr {
      +get_tones_addr in arduboy_rust::prelude - Rust
      macro_rules! get_tones_addr {
           ( $s:expr ) => { ... };
       }
      Expand description

      Create a const raw pointer to a tone sequenze as u16, without creating an intermediate reference.

      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/macro.progmem.html b/docs/doc/arduboy_rust/prelude/macro.progmem.html index d415ca4..684792d 100644 --- a/docs/doc/arduboy_rust/prelude/macro.progmem.html +++ b/docs/doc/arduboy_rust/prelude/macro.progmem.html @@ -1,4 +1,4 @@ -progmem in arduboy_rust::prelude - Rust
      macro_rules! progmem {
      +progmem in arduboy_rust::prelude - Rust
      macro_rules! progmem {
           (
               $( #[$attr:meta] )*
               $v:vis $id:ident $name:ident: [$ty:ty; _] = $value:expr;
      @@ -22,7 +22,8 @@
           () => { ... };
       }
      Expand description

      Create a space for Progmem variable

      Example

      -
      //for text
      +
      use arduboy_rust::prelude::*;
      +//for text
       progmem!(
           static text: [u8; _] = *b"I'm a PROGMEM Text\0";
       );
      diff --git a/docs/doc/arduboy_rust/prelude/serial/index.html b/docs/doc/arduboy_rust/prelude/serial/index.html
      index 36a3977..e891c4e 100644
      --- a/docs/doc/arduboy_rust/prelude/serial/index.html
      +++ b/docs/doc/arduboy_rust/prelude/serial/index.html
      @@ -1,4 +1,4 @@
       arduboy_rust::prelude::serial - Rust
      Expand description

      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.

      Traits

      Functions

      • 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).
      • 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.
      • Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call begin().
      • The Arduino Serial Print class is available for writing text to the screen buffer.
      • The Arduino Serial Print class is available for writing text to the screen buffer.
      • Reads incoming serial data. Use only inside of available():
      • Reads incoming serial data.
      \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html b/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html index 34de2fe..90e3396 100644 --- a/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html +++ b/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html @@ -1,10 +1,11 @@ ArduboyTones in arduboy_rust::prelude - Rust
      pub struct ArduboyTones {}
      Expand description

      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.

      -

      Implementations§

      source§

      impl ArduboyTones

      source

      pub const fn new() -> ArduboyTones

      Get a new instance of ArduboyTones

      +

      You will need to uncomment the ArduboyTones in the config.toml file.

      +

      Implementations§

      source§

      impl ArduboyTones

      source

      pub const fn new() -> ArduboyTones

      Get a new instance of ArduboyTones

      Example
      use arduboy_rust::prelude::*;
      -const sound: ArduboyTones = ArduboyTones::new();
      -
      source

      pub fn tone(&self, frequency: u16, duration: u32)

      Play a single tone.

      +#[allow(non_upper_case_globals)] +const sound: ArduboyTones = ArduboyTones::new();
      +
      source

      pub fn tone(&self, frequency: u16, duration: u32)

      Play a single tone.

      • freq The frequency of the tone, in hertz.
      • dur The duration to play the tone for, in 1024ths of a @@ -12,7 +13,7 @@ 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.
      -
      source

      pub fn tone2( +

      source

      pub fn tone2( &self, frequency1: u16, duration1: u32, @@ -24,7 +25,7 @@ sequence is started.
    • dur1,dur2 The duration to play the tone for, in 1024ths of a second (very close to milliseconds).
    -
    source

    pub fn tone3( +

    source

    pub fn tone3( &self, frequency1: u16, duration1: u32, @@ -38,7 +39,7 @@ second (very close to milliseconds).
  • dur1,dur2,dur3 The duration to play the tone for, in 1024ths of a second (very close to milliseconds).
  • -

    source

    pub fn tones(&self, tones: *const u16)

    Play a tone sequence from frequency/duration pairs in a PROGMEM array.

    +
    source

    pub fn tones(&self, tones: *const u16)

    Play a tone sequence from frequency/duration pairs in a PROGMEM array.

    • tones A pointer to an array of frequency/duration pairs.
    @@ -49,20 +50,21 @@ A frequency of 0 for any tone means silence (a musical rest).

    Example:

    use arduboy_rust::prelude::*;
    -const sound: ArduboyTones = ArduboyTones::new();
    +#[allow(non_upper_case_globals)]
    +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));
    -
    source

    pub fn no_tone(&self)

    Stop playing the tone or sequence.

    +
    source

    pub fn no_tone(&self)

    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.

    -
    source

    pub fn playing(&self) -> bool

    Check if a tone or tone sequence is playing.

    +
    source

    pub fn playing(&self) -> bool

    Check if a tone or tone sequence is playing.

    • return boolean true if playing (even if sound is muted).
    -
    source

    pub fn tones_in_ram(&self, tones: *mut u32)

    Play a tone sequence from frequency/duration pairs in an array in RAM.

    +
    source

    pub fn tones_in_ram(&self, tones: *mut u32)

    Play a tone sequence from frequency/duration pairs in an array in RAM.

    • tones A pointer to an array of frequency/duration pairs.
    @@ -73,12 +75,12 @@ A frequency of 0 for any tone means silence (a musical rest).

    Example:

    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 choice. The only reason to use tonesInRAM() would be if dynamically altering the contents of the array is required.

    -
    source

    pub fn volume_mode(&self, mode: u8)

    Set the volume to always normal, always high, or tone controlled.

    +
    source

    pub fn volume_mode(&self, mode: u8)

    Set the volume to always normal, always high, or tone controlled.

    One of the following values should be used: