diff --git a/Examples/Arduboy-Tutorials/demo3/src/lib.rs b/Examples/Arduboy-Tutorials/demo3/src/lib.rs index b467b39..0bdd332 100644 --- a/Examples/Arduboy-Tutorials/demo3/src/lib.rs +++ b/Examples/Arduboy-Tutorials/demo3/src/lib.rs @@ -1,10 +1,11 @@ #![no_std] +#![allow(non_upper_case_globals)] //Include the Arduboy Library //Initialize the arduboy object use arduboy_rust::prelude::*; const arduboy: Arduboy2 = Arduboy2::new(); //Initialize our counter variable -#[allow(non_upper_case_globals)] + static mut counter: c_int = 0; //The setup() function runs once when you turn your Arduboy on #[no_mangle] diff --git a/arduboy-rust/src/lib.rs b/arduboy-rust/src/lib.rs index b36ac0a..bb1adc2 100644 --- a/arduboy-rust/src/lib.rs +++ b/arduboy-rust/src/lib.rs @@ -1,6 +1,13 @@ #![cfg(target_arch = "avr")] #![no_std] #![feature(c_size_t)] +//! This is the arduboy_rust crate +//! To get started import the [prelude] to your project. +//! +//! Import the module: +//! ``` +//! use arduboy_rust::prelude::*; +//! ``` extern crate panic_halt; pub mod hardware; @@ -10,4 +17,4 @@ mod print; pub use crate::library::arduboy2::{self, Arduboy2, Color, FONT_SIZE, HEIGHT, WIDTH}; pub use crate::library::arduboy_tone::{self, ArduboyTones}; pub use crate::library::eeprom::{EEPROM, EEPROMBYTE}; -pub use crate::library::{c, sprites}; +pub use crate::library::{arduino, c, sprites}; diff --git a/arduboy-rust/src/library/arduboy2.rs b/arduboy-rust/src/library/arduboy2.rs index 3e83a33..496c705 100644 --- a/arduboy-rust/src/library/arduboy2.rs +++ b/arduboy-rust/src/library/arduboy2.rs @@ -1,6 +1,6 @@ //! This is the Module to interact in a save way with the Arduboy2 C++ library. //! -//! All of the functions are safe wrapped inside the struct. +//! All of the functions are safe wrapped inside the [Arduboy2] struct. #![allow(dead_code)] use crate::hardware::buttons::ButtonSet; use crate::print::Printable; @@ -93,11 +93,9 @@ impl Arduboy2 { /// ///### Parameters: /// - ///x The X coordinate of the left start point. - /// - ///y The Y coordinate of the left start point. - /// - ///w The width of the line. + ///- x The X coordinate of the left start point. + ///- y The Y coordinate of the left start point. + ///- w The width of the line. /// ///color The color of the line (optional; defaults to WHITE). pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color) { @@ -107,11 +105,9 @@ impl Arduboy2 { /// ///### Parameters: /// - ///x The X coordinate of the left start point. - /// - ///y The Y coordinate of the left start point. - /// - ///h The height of the line. + ///- x The X coordinate of the left start point. + ///- y The Y coordinate of the left start point. + ///- h The height of the line. /// ///color The color of the line (optional; defaults to WHITE). pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color) { @@ -120,12 +116,9 @@ impl Arduboy2 { ///Set a single pixel in the display buffer to the specified color. /// ///### Parameters - /// - ///x The X coordinate of the pixel. - /// - ///y The Y coordinate of the pixel. - /// - ///color The color of the pixel (optional; defaults to WHITE). + ///- x The X coordinate of the pixel. + ///- y The Y coordinate of the pixel. + ///- color The color of the pixel (optional; defaults to WHITE). /// ///The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn't included, the pixel will be set to WHITE. pub fn draw_pixel(&self, x: i16, y: i16, color: Color) { @@ -135,13 +128,10 @@ impl Arduboy2 { /// ///### Parameters /// - ///x The X coordinate of the upper left corner. - /// - ///y The Y coordinate of the upper left corner. - /// - ///w The width of the rectangle. - /// - ///h The height of the rectangle. + ///- x The X coordinate of the upper left corner. + ///- y The Y coordinate of the upper left corner. + ///- w The width of the rectangle. + ///- h The height of the rectangle. /// ///color The color of the pixel (optional; defaults to WHITE). pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color) { @@ -172,11 +162,9 @@ impl Arduboy2 { /// ///### Parameters /// - ///x0 The X coordinate of the circle's center. - /// - ///y0 The Y coordinate of the circle's center. - /// - ///r The radius of the circle in pixels. + ///- x The X coordinate of the circle's center. + ///- y The Y coordinate of the circle's center. + ///- r The radius of the circle in pixels. /// ///color The circle's color (optional; defaults to WHITE). pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color) { @@ -249,9 +237,8 @@ impl Arduboy2 { ///Returns the state of the given pixel in the screen buffer. /// ///### Parameters - ///x The X coordinate of the pixel. - /// - ///y The Y coordinate of the pixel. + ///- x The X coordinate of the pixel. + ///- y The Y coordinate of the pixel. /// ///### Returns ///WHITE if the pixel is on or BLACK if the pixel is off. @@ -267,7 +254,7 @@ impl Arduboy2 { ///Check if a button has just been pressed. /// ///### Parameters - ///button The button to test for. Only one button should be specified. + ///- button The button to test for. Only one button should be specified. /// ///### Returns ///true if the specified button has just been pressed. @@ -283,7 +270,7 @@ impl Arduboy2 { ///Check if a button has just been released. /// ///### Parameters - ///button The button to test for. Only one button should be specified. + ///- button The button to test for. Only one button should be specified. /// ///### Returns ///true if the specified button has just been released. @@ -300,7 +287,7 @@ impl Arduboy2 { /// ///### Parameters /// - ///buttons A bit mask indicating which buttons to test. (Can be a single button) + ///- buttons A bit mask indicating which buttons to test. (Can be a single button) /// ///### Returns /// @@ -334,7 +321,7 @@ impl Arduboy2 { ///Test if the all of the specified buttons are pressed. /// ///### Parameters - /// buttons A bit mask indicating which buttons to test. (Can be a single button) + ///- buttons A bit mask indicating which buttons to test. (Can be a single button) /// ///### Returns /// true if all buttons in the provided mask are currently pressed. @@ -354,15 +341,14 @@ impl Arduboy2 { /// /// ///Example - /// ```text - /// let value:i16 = 42; + /// ``` + /// let value: i16 = 42; /// - /// arduboy.println("Hello World\0"); // Prints "Hello World" and then sets the - /// // text cursor to the start of the next line - /// arduboy.print(value); // Prints "42" - /// arduboy.print('\n\0'); // Sets the text cursor to the start of the next line - /// arduboy.print(78, HEX); // Prints "4E" (78 in hexadecimal) - /// arduboy.print("\x03\xEA"); // Prints a heart symbol and a Greek uppercase omega + /// arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the + /// // text cursor to the start of the next line + /// arduboy.print(value); // Prints "42" + /// arduboy.print("\n\0"); // Sets the text cursor to the start of the next line + /// arduboy.print("hello world") // Prints normal [&str] /// ``` pub fn print(&self, x: impl Printable) { x.print() @@ -370,9 +356,9 @@ impl Arduboy2 { ///Set the location of the text cursor. /// ///### Parameters - /// x The X (horizontal) coordinate, in pixels, for the new location of the text cursor. + ///- x The X (horizontal) coordinate, in pixels, for the new location of the text cursor. /// - /// y The Y (vertical) coordinate, in pixels, for the new location of the text cursor. + /// - y The Y (vertical) coordinate, in pixels, for the new location of the text cursor. /// ///The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written. pub fn set_cursor(&self, x: i16, y: i16) { @@ -381,7 +367,7 @@ impl Arduboy2 { ///Set the frame rate used by the frame control functions. /// ///### Parameters - /// rate The desired frame rate in frames per second. + ///- rate The desired frame rate in frames per second. /// ///Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate. pub fn set_frame_rate(&self, rate: u8) { @@ -390,7 +376,7 @@ impl Arduboy2 { ///Set the text character size. /// ///### Parameters - /// s The text size multiplier. Must be 1 or higher. + ///- s The text size multiplier. Must be 1 or higher. /// ///Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc. pub fn set_text_size(&self, size: u8) { @@ -442,7 +428,7 @@ impl Arduboy2 { ///Invert the entire display or set it back to normal. /// ///### Parameters - ///inverse true will invert the display. false will set the display to no-inverted. + ///- inverse true will invert the display. false will set the display to no-inverted. /// ///Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off. /// @@ -612,19 +598,19 @@ impl Arduboy2 { } extern "C" { - #[doc(hidden)] + #[link_name = "arduboy_begin"] fn begin(); - #[doc(hidden)] + #[link_name = "arduboy_clear"] fn clear(); - #[doc(hidden)] + #[link_name = "arduboy_display"] fn display(); - #[doc(hidden)] + #[link_name = "arduboy_display_and_clear_buffer"] fn display_and_clear_buffer(); - #[doc(hidden)] + #[link_name = "arduboy_draw_fast_hline"] fn draw_fast_hline_raw(x: i16, y: i16, w: u8, color: u8); @@ -672,10 +658,10 @@ extern "C" { #[doc(hidden)] #[link_name = "arduboy_not_pressed"] pub fn not_pressed(button: u8) -> bool; - #[doc(hidden)] + #[link_name = "arduboy_next_frame"] fn next_frame() -> bool; - #[doc(hidden)] + #[link_name = "arduboy_poll_buttons"] fn poll_buttons(); #[doc(hidden)] @@ -705,16 +691,16 @@ extern "C" { #[doc(hidden)] #[link_name = "arduboy_print_unsigned_long"] pub fn print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t; - #[doc(hidden)] + #[link_name = "arduboy_set_cursor"] fn set_cursor(x: i16, y: i16); - #[doc(hidden)] + #[link_name = "arduboy_set_frame_rate"] fn set_frame_rate(rate: u8); - #[doc(hidden)] + #[link_name = "arduboy_set_text_size"] fn set_text_size(size: u8); - #[doc(hidden)] + #[link_name = "arduboy_audio_on"] fn arduboy_audio_on(); @@ -765,31 +751,3 @@ extern "C" { #[link_name = "arduboy_digital_write_rgb"] fn digital_write_rgb(red: c_uchar, green: c_uchar, blue: c_uchar); } - -// pub unsafe fn print(x: impl Printable) { -// x.print(); -// } - -// pub unsafe fn draw_fast_hline(x: i16, y: i16, w: u8, color: Color) { -// draw_fast_hline_raw(x, y, w, color as u8); -// } - -// pub unsafe fn draw_fast_vline(x: i16, y: i16, h: u8, color: Color) { -// draw_fast_vline_raw(x, y, h, color as u8); -// } - -// pub unsafe fn draw_pixel(x: i16, y: i16, color: Color) { -// draw_pixel_raw(x, y, color as u8); -// } - -// pub unsafe fn fill_rect(x: i16, y: i16, w: u8, h: u8, color: Color) { -// fill_rect_raw(x, y, w, h, color as u8); -// } - -// pub unsafe fn draw_circle(x: i16, y: i16, r: u8, color: Color) { -// draw_circle_raw(x, y, r, color as u8); -// } - -// pub unsafe fn get_pixel(x: u8, y: u8) -> Color { -// mem::transmute::(get_pixel_raw(x, y)) -// } diff --git a/arduboy-rust/src/library/arduboy_tone.rs b/arduboy-rust/src/library/arduboy_tone.rs index 1050a14..e795bad 100644 --- a/arduboy-rust/src/library/arduboy_tone.rs +++ b/arduboy-rust/src/library/arduboy_tone.rs @@ -32,7 +32,7 @@ extern "C" { fn sound_volume_mode(mode: c_uchar); } -///This is the struct to interact in a save way with the Arduboy2Audio C++ library. +///This is the struct to interact in a save way with the ArduboyTones C++ library. pub struct ArduboyTones {} impl ArduboyTones { ///Get a new instance of [ArduboyTones] diff --git a/arduboy-rust/src/library/arduino.rs b/arduboy-rust/src/library/arduino.rs index 51a2c2b..0be5d6b 100644 --- a/arduboy-rust/src/library/arduino.rs +++ b/arduboy-rust/src/library/arduino.rs @@ -1,3 +1,4 @@ +//! This is the Module to interact in a save way with the Arduino C++ library. use core::ffi::{c_long, c_ulong}; extern "C" { diff --git a/arduboy-rust/src/library/eeprom.rs b/arduboy-rust/src/library/eeprom.rs index a1cacbb..90a7d77 100644 --- a/arduboy-rust/src/library/eeprom.rs +++ b/arduboy-rust/src/library/eeprom.rs @@ -14,7 +14,7 @@ extern "C" { #[link_name = "arduboy_eeprom_put"] fn arduboy_eeprom_put_raw(idx: c_int, object: *const u8, size: usize); } -///This struct to store and read structs objects to eeprom memory. +///This struct to store and read structs objects to/from eeprom memory. /// ## Example /// ``` /// static e: EEPROM = EEPROM::new(10); diff --git a/arduboy-rust/src/library/progmem.rs b/arduboy-rust/src/library/progmem.rs index ca8e182..963cd78 100644 --- a/arduboy-rust/src/library/progmem.rs +++ b/arduboy-rust/src/library/progmem.rs @@ -1,5 +1,5 @@ #![allow(unused_imports)] -/// Create a space for Progrem variable +/// Create a space for Progmem variable /// ## Example /// ``` /// //for text diff --git a/arduboy-rust/src/prelude.rs b/arduboy-rust/src/prelude.rs index eb22955..e869644 100644 --- a/arduboy-rust/src/prelude.rs +++ b/arduboy-rust/src/prelude.rs @@ -1,4 +1,9 @@ //! This is the important one to use this library effective in your project +//! +//! Import the module: +//! ``` +//! use arduboy_rust::prelude::*; +//! ``` #[doc(inline)] pub use crate::hardware::buttons::{self, *}; #[doc(inline)] diff --git a/docs/doc/arduboy_rust/all.html b/docs/doc/arduboy_rust/all.html index eea88d9..63b0bcd 100644 --- a/docs/doc/arduboy_rust/all.html +++ b/docs/doc/arduboy_rust/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Definitions

Constants

\ No newline at end of file +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Definitions

Constants

\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/index.html b/docs/doc/arduboy_rust/arduboy2/index.html index 70075ed..7b523e3 100644 --- a/docs/doc/arduboy_rust/arduboy2/index.html +++ b/docs/doc/arduboy_rust/arduboy2/index.html @@ -1,3 +1,3 @@ -arduboy_rust::arduboy2 - Rust

Module arduboy_rust::arduboy2

source ·
Expand description

This is the Module to interact in a save way with the Arduboy2 C++ library.

-

All of the functions are safe wrapped inside the struct.

+arduboy_rust::arduboy2 - Rust

Module arduboy_rust::arduboy2

source ·
Expand description

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.

Structs

  • This is the struct to interact in a save way with the Arduboy2 C++ library.
  • This struct is used by a few Arduboy functions.
  • This struct is used by a few Arduboy functions.

Enums

  • This item is to chose between Black or White

Constants

  • The standard font size of the arduboy
  • The standard height of the arduboy
  • The standard width of the arduboy
\ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy2/struct.Arduboy2.html b/docs/doc/arduboy_rust/arduboy2/struct.Arduboy2.html index ad1361b..3b90525 100644 --- a/docs/doc/arduboy_rust/arduboy2/struct.Arduboy2.html +++ b/docs/doc/arduboy_rust/arduboy2/struct.Arduboy2.html @@ -1,5 +1,5 @@ Arduboy2 in arduboy_rust::arduboy2 - Rust
pub struct Arduboy2 {}
Expand description

This is the struct to interact in a save way with the Arduboy2 C++ library.

-

Implementations§

source§

impl Arduboy2

source

pub const fn new() -> Self

gives you a new instans of the Arduboy2

+

Implementations§

source§

impl Arduboy2

source

pub const fn new() -> Self

gives you a new instans of the Arduboy2

Example
const arduboy: Arduboy2 = Arduboy2::new();
source

pub fn begin(&self)

Initialize the hardware, display the boot logo, provide boot utilities, etc. @@ -9,32 +9,40 @@ This function should be called once near the start of the sketch, usually in set The contents of the display buffer in RAM are copied to the display and will appear on the screen.

source

pub fn display_and_clear_buffer(&self)

Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.

Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.

-
source

pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

Draw a horizontal line.

+
source

pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

Draw a horizontal line.

Parameters:
-

x The X coordinate of the left start point.

-

y The Y coordinate of the left start point.

-

w The width of the line.

+
    +
  • x The X coordinate of the left start point.
  • +
  • y The Y coordinate of the left start point.
  • +
  • w The width of the line.
  • +

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

Draw a vertical line.

+
source

pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

Draw a vertical line.

Parameters:
-

x The X coordinate of the left start point.

-

y The Y coordinate of the left start point.

-

h The height of the line.

+
    +
  • x The X coordinate of the left start point.
  • +
  • y The Y coordinate of the left start point.
  • +
  • h The height of the line.
  • +

color The color of the line (optional; defaults to WHITE).

-
source

pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

Set a single pixel in the display buffer to the specified color.

+
source

pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

Set a single pixel in the display buffer to the specified color.

Parameters
-

x The X coordinate of the pixel.

-

y The Y coordinate of the pixel.

-

color The color of the pixel (optional; defaults to WHITE).

+
    +
  • x The X coordinate of the pixel.
  • +
  • y The Y coordinate of the pixel.
  • +
  • color The color of the pixel (optional; defaults to WHITE).
  • +

The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.

-
source

pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a filled-in rectangle of a specified width and height.

+
source

pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a filled-in rectangle of a specified width and height.

Parameters
-

x The X coordinate of the upper left corner.

-

y The Y coordinate of the upper left corner.

-

w The width of the rectangle.

-

h The height of the rectangle.

+
    +
  • x The X coordinate of the upper left corner.
  • +
  • y The Y coordinate of the upper left corner.
  • +
  • w The width of the rectangle.
  • +
  • h The height of the rectangle.
  • +

color The color of the pixel (optional; defaults to WHITE).

-
source

pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a rectangle of a specified width and height.

+
source

pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

Draw a rectangle of a specified width and height.

Parameters

  • x The X coordinate of the upper left corner.
  • @@ -43,7 +51,7 @@ The contents of the display buffer in RAM are copied to the display and will app
  • h The height of the rectangle.
  • color The color of the pixel (optional; defaults to WHITE).
-
source

pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a circle of a given radius.

+
source

pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a circle of a given radius.

Parameters

  • x0 The X coordinate of the circle’s center.
  • @@ -51,13 +59,15 @@ The contents of the display buffer in RAM are copied to the display and will app
  • r The radius of the circle in pixels.
  • color The circle’s color (optional; defaults to WHITE).
-
source

pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a filled-in circle of a given radius.

+
source

pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

Draw a filled-in circle of a given radius.

Parameters
-

x0 The X coordinate of the circle’s center.

-

y0 The Y coordinate of the circle’s center.

-

r The radius of the circle in pixels.

+
    +
  • x The X coordinate of the circle’s center.
  • +
  • y The Y coordinate of the circle’s center.
  • +
  • r The radius of the circle in pixels.
  • +

color The circle’s color (optional; defaults to WHITE).

-
source

pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a filled-in rectangle with rounded corners.

+
source

pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a filled-in rectangle with rounded corners.

Parameters

  • x The X coordinate of the left edge.
  • @@ -67,7 +77,7 @@ The contents of the display buffer in RAM are copied to the display and will app
  • r The radius of the semicircles forming the corners.
  • color The color of the rectangle (optional; defaults to WHITE).
-
source

pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a rectangle with rounded corners.

+
source

pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

Draw a rectangle with rounded corners.

Parameters

  • x The X coordinate of the left edge.
  • @@ -77,7 +87,7 @@ The contents of the display buffer in RAM are copied to the display and will app
  • r The radius of the semicircles forming the corners.
  • color The color of the rectangle (optional; defaults to WHITE).
-
source

pub fn draw_triangle( +

source

pub fn draw_triangle( &self, x0: i16, y0: i16, @@ -94,7 +104,7 @@ The contents of the display buffer in RAM are copied to the display and will app
  • color The triangle’s color (optional; defaults to WHITE).
  • A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

    -

    source

    pub fn fill_triangle( +

    source

    pub fn fill_triangle( &self, x0: i16, y0: i16, @@ -111,52 +121,62 @@ The contents of the display buffer in RAM are copied to the display and will app
  • color The triangle’s color (optional; defaults to WHITE).
  • A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

    -

    source

    pub fn get_pixel(&self, x: u8, y: u8) -> Color

    Returns the state of the given pixel in the screen buffer.

    +
    source

    pub fn get_pixel(&self, x: u8, y: u8) -> Color

    Returns the state of the given pixel in the screen buffer.

    Parameters
    -

    x The X coordinate of the pixel.

    -

    y The Y coordinate of the pixel.

    +
      +
    • x The X coordinate of the pixel.
    • +
    • y The Y coordinate of the pixel.
    • +
    Returns

    WHITE if the pixel is on or BLACK if the pixel is off.

    -
    source

    pub fn init_random_seed(&self)

    Seed the random number generator with a random value.

    +
    source

    pub fn init_random_seed(&self)

    Seed the random number generator with a random value.

    The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().

    -
    source

    pub fn just_pressed(&self, button: ButtonSet) -> bool

    Check if a button has just been pressed.

    +
    source

    pub fn just_pressed(&self, button: ButtonSet) -> bool

    Check if a button has just been pressed.

    Parameters
    -

    button The button to test for. Only one button should be specified.

    +
      +
    • button The button to test for. Only one button should be specified.
    • +
    Returns

    true if the specified button has just been pressed.

    Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

    There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.

    This function should only be used to test a single button.

    -
    source

    pub fn just_released(&self, button: ButtonSet) -> bool

    Check if a button has just been released.

    +
    source

    pub fn just_released(&self, button: ButtonSet) -> bool

    Check if a button has just been released.

    Parameters
    -

    button The button to test for. Only one button should be specified.

    +
      +
    • button The button to test for. Only one button should be specified.
    • +
    Returns

    true if the specified button has just been released.

    Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

    There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.

    This function should only be used to test a single button.

    -
    source

    pub fn not_pressed(&self, button: ButtonSet) -> bool

    Test if the specified buttons are not pressed.

    +
    source

    pub fn not_pressed(&self, button: ButtonSet) -> bool

    Test if the specified buttons are not pressed.

    Parameters
    -

    buttons A bit mask indicating which buttons to test. (Can be a single button)

    +
      +
    • buttons A bit mask indicating which buttons to test. (Can be a single button)
    • +
    Returns

    True if all buttons in the provided mask are currently released.

    Read the state of the buttons and return true if all the buttons in the specified mask are currently released.

    -
    source

    pub fn next_frame(&self) -> bool

    Indicate that it’s time to render the next frame.

    +
    source

    pub fn next_frame(&self) -> bool

    Indicate that it’s time to render the next frame.

    Returns

    true if it’s time for the next frame.

    When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().

    This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.

    -
    source

    pub fn poll_buttons(&self)

    Poll the buttons and track their state over time.

    +
    source

    pub fn poll_buttons(&self)

    Poll the buttons and track their state over time.

    Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().

    This function should be called once at the start of each new frame.

    The justPressed() and justReleased() functions rely on this function.

    -
    source

    pub fn pressed(&self, button: ButtonSet) -> bool

    Test if the all of the specified buttons are pressed.

    +
    source

    pub fn pressed(&self, button: ButtonSet) -> bool

    Test if the all of the specified buttons are pressed.

    Parameters
    -

    buttons A bit mask indicating which buttons to test. (Can be a single button)

    +
      +
    • buttons A bit mask indicating which buttons to test. (Can be a single button)
    • +
    Returns

    true if all buttons in the provided mask are currently pressed.

    Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.

    -
    source

    pub fn print(&self, x: impl Printable)

    The Arduino Print class is available for writing text to the screen buffer.

    +
    source

    pub fn print(&self, x: impl Printable)

    The Arduino Print class is available for writing text to the screen buffer.

    For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

    Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:

      @@ -164,48 +184,60 @@ The contents of the display buffer in RAM are copied to the display and will app
    • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.

    Example

    -
    let value:i16 = 42;
     
    -arduboy.println("Hello World\0"); // Prints "Hello World" and then sets the
    -                                  // text cursor to the start of the next line
    -arduboy.print(value);             // Prints "42"
    -arduboy.print('\n\0');            // Sets the text cursor to the start of the next line
    -arduboy.print(78, HEX);           // Prints "4E" (78 in hexadecimal)
    -arduboy.print("\x03\xEA");        // Prints a heart symbol and a Greek uppercase omega
    -
    source

    pub fn set_cursor(&self, x: i16, y: i16)

    Set the location of the text cursor.

    +
    let value: i16 = 42;
    +
    +arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
    +                                       // text cursor to the start of the next line
    +arduboy.print(value); // Prints "42"
    +arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
    +arduboy.print("hello world") // Prints normal [&str]
    +
    source

    pub fn set_cursor(&self, x: i16, y: i16)

    Set the location of the text cursor.

    Parameters
    +
      +
    • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

      +
    • +
    • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

      +
    • +

    The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.

    -
    source

    pub fn set_frame_rate(&self, rate: u8)

    Set the frame rate used by the frame control functions.

    +
    source

    pub fn set_frame_rate(&self, rate: u8)

    Set the frame rate used by the frame control functions.

    Parameters
    -

    rate The desired frame rate in frames per second.

    +
      +
    • rate The desired frame rate in frames per second.
    • +

    Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.

    -
    source

    pub fn set_text_size(&self, size: u8)

    Set the text character size.

    +
    source

    pub fn set_text_size(&self, size: u8)

    Set the text character size.

    Parameters
    -

    s The text size multiplier. Must be 1 or higher.

    +
      +
    • s The text size multiplier. Must be 1 or higher.
    • +

    Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.

    -
    source

    pub fn audio_on(&self)

    Turn sound on.

    +
    source

    pub fn audio_on(&self)

    Turn sound on.

    The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.

    -
    source

    pub fn audio_off(&self)

    Turn sound off (mute).

    +
    source

    pub fn audio_off(&self)

    Turn sound off (mute).

    The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.

    -
    source

    pub fn audio_save_on_off(&self)

    Save the current sound state in EEPROM.

    +
    source

    pub fn audio_save_on_off(&self)

    Save the current sound state in EEPROM.

    The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.

    Note EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.

    -
    source

    pub fn audio_toggle(&self)

    Toggle the sound on/off state.

    +
    source

    pub fn audio_toggle(&self)

    Toggle the sound on/off state.

    If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().

    -
    source

    pub fn audio_on_and_save(&self)

    Combines the use function of audio_on() and audio_save_on_off()

    -
    source

    pub fn audio_enabled(&self) -> bool

    Get the current sound state.

    +
    source

    pub fn audio_on_and_save(&self)

    Combines the use function of audio_on() and audio_save_on_off()

    +
    source

    pub fn audio_enabled(&self) -> bool

    Get the current sound state.

    Returns

    true if sound is currently enabled (not muted).

    This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.

    -
    source

    pub fn invert(&self, inverse: bool)

    Invert the entire display or set it back to normal.

    +
    source

    pub fn invert(&self, inverse: bool)

    Invert the entire display or set it back to normal.

    Parameters
    -

    inverse true will invert the display. false will set the display to no-inverted.

    +
      +
    • inverse true will invert the display. false will set the display to no-inverted.
    • +

    Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.

    Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.

    -
    source

    pub fn collide_point(&self, point: Point, rect: Rect) -> bool

    Test if a point falls within a rectangle.

    +
    source

    pub fn collide_point(&self, point: Point, rect: Rect) -> bool

    Test if a point falls within a rectangle.

    Parameters

    • point A structure describing the location of the point.
    • @@ -214,7 +246,7 @@ EEPROM is limited in the number of times it can be written to. Sketches should n

      Returns true if the specified point is within the specified rectangle.

      This function is intended to detemine if an object, whose boundaries are are defined by the given rectangle, is in contact with the given point.

      -
    source

    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

    Test if a rectangle is intersecting with another rectangle.

    +
    source

    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

    Test if a rectangle is intersecting with another rectangle.

    Parameters

    • rect1,rect2 Structures describing the size and locations of the rectangles.
    • @@ -222,14 +254,14 @@ true if the specified point is within the specified rectangle.

      Returns true if the first rectangle is intersecting the second.

      This function is intended to detemine if an object, whose boundaries are are defined by the given rectangle, is in contact with another rectangular object.

      -
    source

    pub fn digital_write_rgb_single(&self, color: u8, val: u8)

    Set one of the RGB LEDs digitally, to either fully on or fully off.

    +
    source

    pub fn digital_write_rgb_single(&self, color: u8, val: u8)

    Set one of the RGB LEDs digitally, to either fully on or fully off.

    Parameters

    • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
    • val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.

    This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.

    -
    source

    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

    Set the RGB LEDs digitally, to either fully on or fully off.

    +
    source

    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

    Set the RGB LEDs digitally, to either fully on or fully off.

    Parameters

    • red,green,blue Use value RGB_ON or RGB_OFF to set each LED.
    • @@ -245,7 +277,7 @@ true if the first rectangle is intersecting the second.

      RGB_ON RGB_OFF RGB_ON Magenta RGB_ON RGB_ON RGB_OFF Yellow RGB_ON RGB_ON RGB_ON White -
    source

    pub fn every_x_frames(&self, frames: u8) -> bool

    Indicate if the specified number of frames has elapsed.

    +
    source

    pub fn every_x_frames(&self, frames: u8) -> bool

    Indicate if the specified number of frames has elapsed.

    Parameters frames The desired number of elapsed frames.

    Returns @@ -259,52 +291,52 @@ true if the specified number of frames has elapsed.

    fireShot(); } }
    -
    source

    pub fn flip_vertical(&self, flipped: bool)

    Flip the display vertically or set it back to normal.

    +
    source

    pub fn flip_vertical(&self, flipped: bool)

    Flip the display vertically or set it back to normal.

    Parameters

    • flipped true will set vertical flip mode. false will set normal vertical orientation.

    Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.

    Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.

    -
    source

    pub fn flip_horizontal(&self, flipped: bool)

    Flip the display horizontally or set it back to normal.

    +
    source

    pub fn flip_horizontal(&self, flipped: bool)

    Flip the display horizontally or set it back to normal.

    Parameters

    • flipped true will set horizontal flip mode. false will set normal horizontal orientation.

    Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.

    Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.

    -
    source

    pub fn set_text_color(&self, color: Color)

    Set the text foreground color.

    +
    source

    pub fn set_text_color(&self, color: Color)

    Set the text foreground color.

    Parameters

    • color The color to be used for following text. The values WHITE or BLACK should be used.
    -
    source

    pub fn set_text_background_color(&self, color: Color)

    Set the text background color.

    +
    source

    pub fn set_text_background_color(&self, color: Color)

    Set the text background color.

    Parameters

    • color The background color to be used for following text. The values WHITE or BLACK should be used.

    The background pixels of following characters will be set to the specified color.

    However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.

    -
    source

    pub fn set_cursor_x(&self, x: i16)

    Set the X coordinate of the text cursor location.

    +
    source

    pub fn set_cursor_x(&self, x: i16)

    Set the X coordinate of the text cursor location.

    Parameters

    • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

    The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.

    -
    source

    pub fn set_cursor_y(&self, y: i16)

    Set the Y coordinate of the text cursor location.

    +
    source

    pub fn set_cursor_y(&self, y: i16)

    Set the Y coordinate of the text cursor location.

    Parameters

    • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

    The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.

    -
    source

    pub fn set_text_wrap(&self, w: bool)

    Set or disable text wrap mode.

    +
    source

    pub fn set_text_wrap(&self, w: bool)

    Set or disable text wrap mode.

    Parameters

    • w true enables text wrap mode. false disables it.

    Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.

    If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.

    -
    source

    pub fn idle(&self)

    Idle the CPU to save power.

    +
    source

    pub fn idle(&self)

    Idle the CPU to save power.

    This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Arduboy2

    §

    impl Send for Arduboy2

    §

    impl Sync for Arduboy2

    §

    impl Unpin for Arduboy2

    §

    impl UnwindSafe for Arduboy2

    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 diff --git a/docs/doc/arduboy_rust/arduboy_tone/index.html b/docs/doc/arduboy_rust/arduboy_tone/index.html index b67c882..df72a59 100644 --- a/docs/doc/arduboy_rust/arduboy_tone/index.html +++ b/docs/doc/arduboy_rust/arduboy_tone/index.html @@ -1,2 +1,2 @@ arduboy_rust::arduboy_tone - Rust
    Expand description

    This is the Module to interact in a save way with the ArduboyTones C++ library.

    -

    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 Arduboy2Audio C++ library.
    \ No newline at end of file +

    Modules

    Structs

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduboy_tone/struct.ArduboyTones.html b/docs/doc/arduboy_rust/arduboy_tone/struct.ArduboyTones.html index b42c616..136595a 100644 --- a/docs/doc/arduboy_rust/arduboy_tone/struct.ArduboyTones.html +++ b/docs/doc/arduboy_rust/arduboy_tone/struct.ArduboyTones.html @@ -1,4 +1,4 @@ -ArduboyTones in arduboy_rust::arduboy_tone - Rust
    pub struct ArduboyTones {}
    Expand description

    This is the struct to interact in a save way with the Arduboy2Audio C++ library.

    +ArduboyTones in arduboy_rust::arduboy_tone - Rust
    pub struct ArduboyTones {}
    Expand description

    This is the struct to interact in a save way with the ArduboyTones C++ library.

    Implementations§

    source§

    impl ArduboyTones

    source

    pub const fn new() -> ArduboyTones

    Get a new instance of ArduboyTones

    Example
    const sound: ArduboyTones = ArduboyTones::new();
    diff --git a/docs/doc/arduboy_rust/arduino/fn.delay.html b/docs/doc/arduboy_rust/arduino/fn.delay.html new file mode 100644 index 0000000..04df5a3 --- /dev/null +++ b/docs/doc/arduboy_rust/arduino/fn.delay.html @@ -0,0 +1,2 @@ +delay in arduboy_rust::arduino - Rust

    Function arduboy_rust::arduino::delay

    source ·
    pub fn delay(ms: u32)
    Expand description

    A Arduino function to pause the cpu circles for a given amount of ms

    +
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/fn.random_between.html b/docs/doc/arduboy_rust/arduino/fn.random_between.html new file mode 100644 index 0000000..56ff91a --- /dev/null +++ b/docs/doc/arduboy_rust/arduino/fn.random_between.html @@ -0,0 +1,3 @@ +random_between in arduboy_rust::arduino - Rust
    pub fn random_between(min: i32, max: i32) -> i32
    Expand description

    A Arduino function to get a random number between 2 numbers +seed based

    +
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/fn.random_less_than.html b/docs/doc/arduboy_rust/arduino/fn.random_less_than.html new file mode 100644 index 0000000..358e700 --- /dev/null +++ b/docs/doc/arduboy_rust/arduino/fn.random_less_than.html @@ -0,0 +1,3 @@ +random_less_than in arduboy_rust::arduino - Rust
    pub fn random_less_than(max: i32) -> i32
    Expand description

    A Arduino function to get a random number smaller than the number given +seed based

    +
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/index.html b/docs/doc/arduboy_rust/arduino/index.html new file mode 100644 index 0000000..1839fb4 --- /dev/null +++ b/docs/doc/arduboy_rust/arduino/index.html @@ -0,0 +1,4 @@ +arduboy_rust::arduino - Rust

    Module arduboy_rust::arduino

    source ·
    Expand description

    This is the Module to interact in a save way with the Arduino C++ library.

    +

    Functions

    • A Arduino function to pause the cpu circles for a given amount of ms
    • A Arduino function to get a random number between 2 numbers +seed based
    • A Arduino function to get a random number smaller than the number given +seed based
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/arduino/sidebar-items.js b/docs/doc/arduboy_rust/arduino/sidebar-items.js new file mode 100644 index 0000000..689e506 --- /dev/null +++ b/docs/doc/arduboy_rust/arduino/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["delay","random_between","random_less_than"]}; \ No newline at end of file diff --git a/docs/doc/arduboy_rust/index.html b/docs/doc/arduboy_rust/index.html index b24c7de..2fdae51 100644 --- a/docs/doc/arduboy_rust/index.html +++ b/docs/doc/arduboy_rust/index.html @@ -1 +1,6 @@ -arduboy_rust - Rust

    Crate arduboy_rust

    source ·

    Modules

    • This is the Module to interact in a save way with the Arduboy2 C++ library.
    • This is the Module to interact in a save way with the ArduboyTones C++ library.
    • Clib functions you can use on the Arduboy
    • This is the Module to interact in a save way with the Arduboy hardware.
    • This is the important one to use this library effective in your project
    • This is the module to interact in a save way with the Sprites C++ library.

    Macros

    • This is the way to go if you want print some random text
    • 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 sprite as u16, without creating an intermediate reference.
    • Create a space for Progrem variable

    Structs

    • This is the struct to interact in a save way with the Arduboy2 C++ library.
    • This is the struct to interact in a save way with the Arduboy2Audio C++ library.
    • This struct to store and read structs objects to eeprom memory.
    • Use this struct to store and read single bytes to/from eeprom memory.

    Enums

    • This item is to chose between Black or White

    Constants

    • The standard font size of the arduboy
    • The standard height of the arduboy
    • The standard width of the arduboy
    \ No newline at end of file +arduboy_rust - Rust

    Crate arduboy_rust

    source ·
    Expand description

    This is the arduboy_rust crate +To get started import the prelude to your project.

    +

    Import the module:

    + +
    use arduboy_rust::prelude::*;
    +

    Modules

    • This is the Module to interact in a save way with the Arduboy2 C++ library.
    • This is the Module to interact in a save way with the ArduboyTones C++ library.
    • This is the Module to interact in a save way with the Arduino C++ library.
    • Clib functions you can use on the Arduboy
    • This is the Module to interact in a save way with the Arduboy hardware.
    • This is the important one to use this library effective in your project
    • This is the module to interact in a save way with the Sprites C++ library.

    Macros

    • This is the way to go if you want print some random text
    • 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 sprite as u16, without creating an intermediate reference.
    • Create a space for Progmem variable

    Structs

    • This is the struct to interact in a save way with the Arduboy2 C++ library.
    • This is the struct to interact in a save way with the ArduboyTones C++ library.
    • This struct to store and read structs objects to/from eeprom memory.
    • Use this struct to store and read single bytes to/from eeprom memory.

    Enums

    • This item is to chose between Black or White

    Constants

    • The standard font size of the arduboy
    • The standard height of the arduboy
    • The standard width of the arduboy
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/library/arduino/index.html b/docs/doc/arduboy_rust/library/arduino/index.html new file mode 100644 index 0000000..072e293 --- /dev/null +++ b/docs/doc/arduboy_rust/library/arduino/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

    Redirecting to ../../../arduboy_rust/arduino/index.html...

    + + + \ 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 432cb0d..19e2c6f 100644 --- a/docs/doc/arduboy_rust/macro.progmem.html +++ b/docs/doc/arduboy_rust/macro.progmem.html @@ -1,11 +1,11 @@ -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;
             $($rest:tt)*
         ) => { ... };
         () => { ... };
    -}
    Expand description

    Create a space for Progrem variable

    +}
    Expand description

    Create a space for Progmem variable

    Example

    //for text
     progmem!(
    diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/index.html b/docs/doc/arduboy_rust/prelude/arduboy2/index.html
    index 9b3511c..c2ec4c4 100644
    --- a/docs/doc/arduboy_rust/prelude/arduboy2/index.html
    +++ b/docs/doc/arduboy_rust/prelude/arduboy2/index.html
    @@ -1,3 +1,3 @@
    -arduboy_rust::prelude::arduboy2 - Rust
    Expand description

    This is the Module to interact in a save way with the Arduboy2 C++ library.

    -

    All of the functions are safe wrapped inside the struct.

    +arduboy_rust::prelude::arduboy2 - Rust
    Expand description

    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.

    Structs

    • This is the struct to interact in a save way with the Arduboy2 C++ library.
    • This struct is used by a few Arduboy functions.
    • This struct is used by a few Arduboy functions.

    Enums

    • This item is to chose between Black or White

    Constants

    • The standard font size of the arduboy
    • The standard height of the arduboy
    • The standard width of the arduboy
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy2/struct.Arduboy2.html b/docs/doc/arduboy_rust/prelude/arduboy2/struct.Arduboy2.html index ac9aed1..90d78d7 100644 --- a/docs/doc/arduboy_rust/prelude/arduboy2/struct.Arduboy2.html +++ b/docs/doc/arduboy_rust/prelude/arduboy2/struct.Arduboy2.html @@ -1,5 +1,5 @@ Arduboy2 in arduboy_rust::prelude::arduboy2 - Rust
    pub struct Arduboy2 {}
    Expand description

    This is the struct to interact in a save way with the Arduboy2 C++ library.

    -

    Implementations§

    source§

    impl Arduboy2

    source

    pub const fn new() -> Self

    gives you a new instans of the Arduboy2

    +

    Implementations§

    source§

    impl Arduboy2

    source

    pub const fn new() -> Self

    gives you a new instans of the Arduboy2

    Example
    const arduboy: Arduboy2 = Arduboy2::new();
    source

    pub fn begin(&self)

    Initialize the hardware, display the boot logo, provide boot utilities, etc. @@ -9,32 +9,40 @@ This function should be called once near the start of the sketch, usually in set The contents of the display buffer in RAM are copied to the display and will appear on the screen.

    source

    pub fn display_and_clear_buffer(&self)

    Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.

    Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.

    -
    source

    pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

    Draw a horizontal line.

    +
    source

    pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

    Draw a horizontal line.

    Parameters:
    -

    x The X coordinate of the left start point.

    -

    y The Y coordinate of the left start point.

    -

    w The width of the line.

    +
      +
    • x The X coordinate of the left start point.
    • +
    • y The Y coordinate of the left start point.
    • +
    • w The width of the line.
    • +

    color The color of the line (optional; defaults to WHITE).

    -
    source

    pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

    Draw a vertical line.

    +
    source

    pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

    Draw a vertical line.

    Parameters:
    -

    x The X coordinate of the left start point.

    -

    y The Y coordinate of the left start point.

    -

    h The height of the line.

    +
      +
    • x The X coordinate of the left start point.
    • +
    • y The Y coordinate of the left start point.
    • +
    • h The height of the line.
    • +

    color The color of the line (optional; defaults to WHITE).

    -
    source

    pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

    Set a single pixel in the display buffer to the specified color.

    +
    source

    pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

    Set a single pixel in the display buffer to the specified color.

    Parameters
    -

    x The X coordinate of the pixel.

    -

    y The Y coordinate of the pixel.

    -

    color The color of the pixel (optional; defaults to WHITE).

    +
      +
    • x The X coordinate of the pixel.
    • +
    • y The Y coordinate of the pixel.
    • +
    • color The color of the pixel (optional; defaults to WHITE).
    • +

    The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.

    -
    source

    pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

    Draw a filled-in rectangle of a specified width and height.

    +
    source

    pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

    Draw a filled-in rectangle of a specified width and height.

    Parameters
    -

    x The X coordinate of the upper left corner.

    -

    y The Y coordinate of the upper left corner.

    -

    w The width of the rectangle.

    -

    h The height of the rectangle.

    +
      +
    • x The X coordinate of the upper left corner.
    • +
    • y The Y coordinate of the upper left corner.
    • +
    • w The width of the rectangle.
    • +
    • h The height of the rectangle.
    • +

    color The color of the pixel (optional; defaults to WHITE).

    -
    source

    pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

    Draw a rectangle of a specified width and height.

    +
    source

    pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

    Draw a rectangle of a specified width and height.

    Parameters

    • x The X coordinate of the upper left corner.
    • @@ -43,7 +51,7 @@ The contents of the display buffer in RAM are copied to the display and will app
    • h The height of the rectangle.
    • color The color of the pixel (optional; defaults to WHITE).
    -
    source

    pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

    Draw a circle of a given radius.

    +
    source

    pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

    Draw a circle of a given radius.

    Parameters

    • x0 The X coordinate of the circle’s center.
    • @@ -51,13 +59,15 @@ The contents of the display buffer in RAM are copied to the display and will app
    • r The radius of the circle in pixels.
    • color The circle’s color (optional; defaults to WHITE).
    -
    source

    pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

    Draw a filled-in circle of a given radius.

    +
    source

    pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

    Draw a filled-in circle of a given radius.

    Parameters
    -

    x0 The X coordinate of the circle’s center.

    -

    y0 The Y coordinate of the circle’s center.

    -

    r The radius of the circle in pixels.

    +
      +
    • x The X coordinate of the circle’s center.
    • +
    • y The Y coordinate of the circle’s center.
    • +
    • r The radius of the circle in pixels.
    • +

    color The circle’s color (optional; defaults to WHITE).

    -
    source

    pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

    Draw a filled-in rectangle with rounded corners.

    +
    source

    pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

    Draw a filled-in rectangle with rounded corners.

    Parameters

    • x The X coordinate of the left edge.
    • @@ -67,7 +77,7 @@ The contents of the display buffer in RAM are copied to the display and will app
    • r The radius of the semicircles forming the corners.
    • color The color of the rectangle (optional; defaults to WHITE).
    -
    source

    pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

    Draw a rectangle with rounded corners.

    +
    source

    pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

    Draw a rectangle with rounded corners.

    Parameters

    • x The X coordinate of the left edge.
    • @@ -77,7 +87,7 @@ The contents of the display buffer in RAM are copied to the display and will app
    • r The radius of the semicircles forming the corners.
    • color The color of the rectangle (optional; defaults to WHITE).
    -
    source

    pub fn draw_triangle( +

    source

    pub fn draw_triangle( &self, x0: i16, y0: i16, @@ -94,7 +104,7 @@ The contents of the display buffer in RAM are copied to the display and will app
  • color The triangle’s color (optional; defaults to WHITE).
  • A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

    -

    source

    pub fn fill_triangle( +

    source

    pub fn fill_triangle( &self, x0: i16, y0: i16, @@ -111,52 +121,62 @@ The contents of the display buffer in RAM are copied to the display and will app
  • color The triangle’s color (optional; defaults to WHITE).
  • A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

    -

    source

    pub fn get_pixel(&self, x: u8, y: u8) -> Color

    Returns the state of the given pixel in the screen buffer.

    +
    source

    pub fn get_pixel(&self, x: u8, y: u8) -> Color

    Returns the state of the given pixel in the screen buffer.

    Parameters
    -

    x The X coordinate of the pixel.

    -

    y The Y coordinate of the pixel.

    +
      +
    • x The X coordinate of the pixel.
    • +
    • y The Y coordinate of the pixel.
    • +
    Returns

    WHITE if the pixel is on or BLACK if the pixel is off.

    -
    source

    pub fn init_random_seed(&self)

    Seed the random number generator with a random value.

    +
    source

    pub fn init_random_seed(&self)

    Seed the random number generator with a random value.

    The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().

    -
    source

    pub fn just_pressed(&self, button: ButtonSet) -> bool

    Check if a button has just been pressed.

    +
    source

    pub fn just_pressed(&self, button: ButtonSet) -> bool

    Check if a button has just been pressed.

    Parameters
    -

    button The button to test for. Only one button should be specified.

    +
      +
    • button The button to test for. Only one button should be specified.
    • +
    Returns

    true if the specified button has just been pressed.

    Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

    There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.

    This function should only be used to test a single button.

    -
    source

    pub fn just_released(&self, button: ButtonSet) -> bool

    Check if a button has just been released.

    +
    source

    pub fn just_released(&self, button: ButtonSet) -> bool

    Check if a button has just been released.

    Parameters
    -

    button The button to test for. Only one button should be specified.

    +
      +
    • button The button to test for. Only one button should be specified.
    • +
    Returns

    true if the specified button has just been released.

    Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

    There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.

    This function should only be used to test a single button.

    -
    source

    pub fn not_pressed(&self, button: ButtonSet) -> bool

    Test if the specified buttons are not pressed.

    +
    source

    pub fn not_pressed(&self, button: ButtonSet) -> bool

    Test if the specified buttons are not pressed.

    Parameters
    -

    buttons A bit mask indicating which buttons to test. (Can be a single button)

    +
      +
    • buttons A bit mask indicating which buttons to test. (Can be a single button)
    • +
    Returns

    True if all buttons in the provided mask are currently released.

    Read the state of the buttons and return true if all the buttons in the specified mask are currently released.

    -
    source

    pub fn next_frame(&self) -> bool

    Indicate that it’s time to render the next frame.

    +
    source

    pub fn next_frame(&self) -> bool

    Indicate that it’s time to render the next frame.

    Returns

    true if it’s time for the next frame.

    When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().

    This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.

    -
    source

    pub fn poll_buttons(&self)

    Poll the buttons and track their state over time.

    +
    source

    pub fn poll_buttons(&self)

    Poll the buttons and track their state over time.

    Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().

    This function should be called once at the start of each new frame.

    The justPressed() and justReleased() functions rely on this function.

    -
    source

    pub fn pressed(&self, button: ButtonSet) -> bool

    Test if the all of the specified buttons are pressed.

    +
    source

    pub fn pressed(&self, button: ButtonSet) -> bool

    Test if the all of the specified buttons are pressed.

    Parameters
    -

    buttons A bit mask indicating which buttons to test. (Can be a single button)

    +
      +
    • buttons A bit mask indicating which buttons to test. (Can be a single button)
    • +
    Returns

    true if all buttons in the provided mask are currently pressed.

    Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.

    -
    source

    pub fn print(&self, x: impl Printable)

    The Arduino Print class is available for writing text to the screen buffer.

    +
    source

    pub fn print(&self, x: impl Printable)

    The Arduino Print class is available for writing text to the screen buffer.

    For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

    Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:

      @@ -164,48 +184,60 @@ The contents of the display buffer in RAM are copied to the display and will app
    • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.

    Example

    -
    let value:i16 = 42;
     
    -arduboy.println("Hello World\0"); // Prints "Hello World" and then sets the
    -                                  // text cursor to the start of the next line
    -arduboy.print(value);             // Prints "42"
    -arduboy.print('\n\0');            // Sets the text cursor to the start of the next line
    -arduboy.print(78, HEX);           // Prints "4E" (78 in hexadecimal)
    -arduboy.print("\x03\xEA");        // Prints a heart symbol and a Greek uppercase omega
    -
    source

    pub fn set_cursor(&self, x: i16, y: i16)

    Set the location of the text cursor.

    +
    let value: i16 = 42;
    +
    +arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
    +                                       // text cursor to the start of the next line
    +arduboy.print(value); // Prints "42"
    +arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
    +arduboy.print("hello world") // Prints normal [&str]
    +
    source

    pub fn set_cursor(&self, x: i16, y: i16)

    Set the location of the text cursor.

    Parameters
    +
      +
    • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

      +
    • +
    • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

      +
    • +

    The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.

    -
    source

    pub fn set_frame_rate(&self, rate: u8)

    Set the frame rate used by the frame control functions.

    +
    source

    pub fn set_frame_rate(&self, rate: u8)

    Set the frame rate used by the frame control functions.

    Parameters
    -

    rate The desired frame rate in frames per second.

    +
      +
    • rate The desired frame rate in frames per second.
    • +

    Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.

    -
    source

    pub fn set_text_size(&self, size: u8)

    Set the text character size.

    +
    source

    pub fn set_text_size(&self, size: u8)

    Set the text character size.

    Parameters
    -

    s The text size multiplier. Must be 1 or higher.

    +
      +
    • s The text size multiplier. Must be 1 or higher.
    • +

    Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.

    -
    source

    pub fn audio_on(&self)

    Turn sound on.

    +
    source

    pub fn audio_on(&self)

    Turn sound on.

    The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.

    -
    source

    pub fn audio_off(&self)

    Turn sound off (mute).

    +
    source

    pub fn audio_off(&self)

    Turn sound off (mute).

    The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.

    -
    source

    pub fn audio_save_on_off(&self)

    Save the current sound state in EEPROM.

    +
    source

    pub fn audio_save_on_off(&self)

    Save the current sound state in EEPROM.

    The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.

    Note EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.

    -
    source

    pub fn audio_toggle(&self)

    Toggle the sound on/off state.

    +
    source

    pub fn audio_toggle(&self)

    Toggle the sound on/off state.

    If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().

    -
    source

    pub fn audio_on_and_save(&self)

    Combines the use function of audio_on() and audio_save_on_off()

    -
    source

    pub fn audio_enabled(&self) -> bool

    Get the current sound state.

    +
    source

    pub fn audio_on_and_save(&self)

    Combines the use function of audio_on() and audio_save_on_off()

    +
    source

    pub fn audio_enabled(&self) -> bool

    Get the current sound state.

    Returns

    true if sound is currently enabled (not muted).

    This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.

    -
    source

    pub fn invert(&self, inverse: bool)

    Invert the entire display or set it back to normal.

    +
    source

    pub fn invert(&self, inverse: bool)

    Invert the entire display or set it back to normal.

    Parameters
    -

    inverse true will invert the display. false will set the display to no-inverted.

    +
      +
    • inverse true will invert the display. false will set the display to no-inverted.
    • +

    Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.

    Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.

    -
    source

    pub fn collide_point(&self, point: Point, rect: Rect) -> bool

    Test if a point falls within a rectangle.

    +
    source

    pub fn collide_point(&self, point: Point, rect: Rect) -> bool

    Test if a point falls within a rectangle.

    Parameters

    • point A structure describing the location of the point.
    • @@ -214,7 +246,7 @@ EEPROM is limited in the number of times it can be written to. Sketches should n

      Returns true if the specified point is within the specified rectangle.

      This function is intended to detemine if an object, whose boundaries are are defined by the given rectangle, is in contact with the given point.

      -
    source

    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

    Test if a rectangle is intersecting with another rectangle.

    +
    source

    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

    Test if a rectangle is intersecting with another rectangle.

    Parameters

    • rect1,rect2 Structures describing the size and locations of the rectangles.
    • @@ -222,14 +254,14 @@ true if the specified point is within the specified rectangle.

      Returns true if the first rectangle is intersecting the second.

      This function is intended to detemine if an object, whose boundaries are are defined by the given rectangle, is in contact with another rectangular object.

      -
    source

    pub fn digital_write_rgb_single(&self, color: u8, val: u8)

    Set one of the RGB LEDs digitally, to either fully on or fully off.

    +
    source

    pub fn digital_write_rgb_single(&self, color: u8, val: u8)

    Set one of the RGB LEDs digitally, to either fully on or fully off.

    Parameters

    • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
    • val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.

    This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.

    -
    source

    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

    Set the RGB LEDs digitally, to either fully on or fully off.

    +
    source

    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

    Set the RGB LEDs digitally, to either fully on or fully off.

    Parameters

    • red,green,blue Use value RGB_ON or RGB_OFF to set each LED.
    • @@ -245,7 +277,7 @@ true if the first rectangle is intersecting the second.

      RGB_ON RGB_OFF RGB_ON Magenta RGB_ON RGB_ON RGB_OFF Yellow RGB_ON RGB_ON RGB_ON White -
    source

    pub fn every_x_frames(&self, frames: u8) -> bool

    Indicate if the specified number of frames has elapsed.

    +
    source

    pub fn every_x_frames(&self, frames: u8) -> bool

    Indicate if the specified number of frames has elapsed.

    Parameters frames The desired number of elapsed frames.

    Returns @@ -259,52 +291,52 @@ true if the specified number of frames has elapsed.

    fireShot(); } }
    -
    source

    pub fn flip_vertical(&self, flipped: bool)

    Flip the display vertically or set it back to normal.

    +
    source

    pub fn flip_vertical(&self, flipped: bool)

    Flip the display vertically or set it back to normal.

    Parameters

    • flipped true will set vertical flip mode. false will set normal vertical orientation.

    Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.

    Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.

    -
    source

    pub fn flip_horizontal(&self, flipped: bool)

    Flip the display horizontally or set it back to normal.

    +
    source

    pub fn flip_horizontal(&self, flipped: bool)

    Flip the display horizontally or set it back to normal.

    Parameters

    • flipped true will set horizontal flip mode. false will set normal horizontal orientation.

    Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.

    Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.

    -
    source

    pub fn set_text_color(&self, color: Color)

    Set the text foreground color.

    +
    source

    pub fn set_text_color(&self, color: Color)

    Set the text foreground color.

    Parameters

    • color The color to be used for following text. The values WHITE or BLACK should be used.
    -
    source

    pub fn set_text_background_color(&self, color: Color)

    Set the text background color.

    +
    source

    pub fn set_text_background_color(&self, color: Color)

    Set the text background color.

    Parameters

    • color The background color to be used for following text. The values WHITE or BLACK should be used.

    The background pixels of following characters will be set to the specified color.

    However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.

    -
    source

    pub fn set_cursor_x(&self, x: i16)

    Set the X coordinate of the text cursor location.

    +
    source

    pub fn set_cursor_x(&self, x: i16)

    Set the X coordinate of the text cursor location.

    Parameters

    • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

    The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.

    -
    source

    pub fn set_cursor_y(&self, y: i16)

    Set the Y coordinate of the text cursor location.

    +
    source

    pub fn set_cursor_y(&self, y: i16)

    Set the Y coordinate of the text cursor location.

    Parameters

    • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

    The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.

    -
    source

    pub fn set_text_wrap(&self, w: bool)

    Set or disable text wrap mode.

    +
    source

    pub fn set_text_wrap(&self, w: bool)

    Set or disable text wrap mode.

    Parameters

    • w true enables text wrap mode. false disables it.

    Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.

    If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.

    -
    source

    pub fn idle(&self)

    Idle the CPU to save power.

    +
    source

    pub fn idle(&self)

    Idle the CPU to save power.

    This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Arduboy2

    §

    impl Send for Arduboy2

    §

    impl Sync for Arduboy2

    §

    impl Unpin for Arduboy2

    §

    impl UnwindSafe for Arduboy2

    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 diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/index.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/index.html index 861c062..5c03a35 100644 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/index.html +++ b/docs/doc/arduboy_rust/prelude/arduboy_tone/index.html @@ -1,2 +1,2 @@ arduboy_rust::prelude::arduboy_tone - Rust
    Expand description

    This is the Module to interact in a save way with the ArduboyTones C++ library.

    -

    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 Arduboy2Audio C++ library.
    \ No newline at end of file +

    Modules

    Structs

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/arduboy_tone/struct.ArduboyTones.html b/docs/doc/arduboy_rust/prelude/arduboy_tone/struct.ArduboyTones.html index 64271f0..9081498 100644 --- a/docs/doc/arduboy_rust/prelude/arduboy_tone/struct.ArduboyTones.html +++ b/docs/doc/arduboy_rust/prelude/arduboy_tone/struct.ArduboyTones.html @@ -1,4 +1,4 @@ -ArduboyTones in arduboy_rust::prelude::arduboy_tone - Rust
    pub struct ArduboyTones {}
    Expand description

    This is the struct to interact in a save way with the Arduboy2Audio C++ library.

    +ArduboyTones in arduboy_rust::prelude::arduboy_tone - Rust
    pub struct ArduboyTones {}
    Expand description

    This is the struct to interact in a save way with the ArduboyTones C++ library.

    Implementations§

    source§

    impl ArduboyTones

    source

    pub const fn new() -> ArduboyTones

    Get a new instance of ArduboyTones

    Example
    const sound: ArduboyTones = ArduboyTones::new();
    diff --git a/docs/doc/arduboy_rust/prelude/fn.constrain.html b/docs/doc/arduboy_rust/prelude/fn.constrain.html index 5470dbc..ddd1b11 100644 --- a/docs/doc/arduboy_rust/prelude/fn.constrain.html +++ b/docs/doc/arduboy_rust/prelude/fn.constrain.html @@ -1 +1 @@ -constrain in arduboy_rust::prelude - Rust
    pub fn constrain<T: Ord>(x: T, a: T, b: T) -> T
    \ No newline at end of file +constrain in arduboy_rust::prelude - Rust
    pub fn constrain<T: Ord>(x: T, a: T, b: T) -> T
    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/fn.delay.html b/docs/doc/arduboy_rust/prelude/fn.delay.html index 68a4de6..aa30fd7 100644 --- a/docs/doc/arduboy_rust/prelude/fn.delay.html +++ b/docs/doc/arduboy_rust/prelude/fn.delay.html @@ -1,2 +1,2 @@ -delay in arduboy_rust::prelude - Rust

    Function arduboy_rust::prelude::delay

    source ·
    pub fn delay(ms: u32)
    Expand description

    A Arduino function to pause the cpu circles for a given amount of ms

    +delay in arduboy_rust::prelude - Rust

    Function arduboy_rust::prelude::delay

    source ·
    pub fn delay(ms: u32)
    Expand description

    A Arduino function to pause the cpu circles for a given amount of ms

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/fn.random_between.html b/docs/doc/arduboy_rust/prelude/fn.random_between.html index faa688b..d45643a 100644 --- a/docs/doc/arduboy_rust/prelude/fn.random_between.html +++ b/docs/doc/arduboy_rust/prelude/fn.random_between.html @@ -1,3 +1,3 @@ -random_between in arduboy_rust::prelude - Rust
    pub fn random_between(min: i32, max: i32) -> i32
    Expand description

    A Arduino function to get a random number between 2 numbers +random_between in arduboy_rust::prelude - Rust

    pub fn random_between(min: i32, max: i32) -> i32
    Expand description

    A Arduino function to get a random number between 2 numbers seed based

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/fn.random_less_than.html b/docs/doc/arduboy_rust/prelude/fn.random_less_than.html index e30ed3a..f5ac00c 100644 --- a/docs/doc/arduboy_rust/prelude/fn.random_less_than.html +++ b/docs/doc/arduboy_rust/prelude/fn.random_less_than.html @@ -1,3 +1,3 @@ -random_less_than in arduboy_rust::prelude - Rust
    pub fn random_less_than(max: i32) -> i32
    Expand description

    A Arduino function to get a random number smaller than the number given +random_less_than in arduboy_rust::prelude - Rust

    pub fn random_less_than(max: i32) -> i32
    Expand description

    A Arduino function to get a random number smaller than the number given seed based

    \ No newline at end of file diff --git a/docs/doc/arduboy_rust/prelude/index.html b/docs/doc/arduboy_rust/prelude/index.html index 638b762..bfc7b0d 100644 --- a/docs/doc/arduboy_rust/prelude/index.html +++ b/docs/doc/arduboy_rust/prelude/index.html @@ -1,4 +1,7 @@ -arduboy_rust::prelude - Rust

    Module arduboy_rust::prelude

    source ·
    Expand description

    This is the important one to use this library effective in your project

    -

    Modules

    • This is the Module to interact in a save way with the Arduboy2 C++ library.
    • This is the Module to interact in a save way with the ArduboyTones C++ library.
    • A list of all six buttons available on the Arduboy
    • A list of all LED variables available
    • This is the module to interact in a save way with the Sprites C++ library.

    Macros

    • This is the way to go if you want print some random text
    • 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 sprite as u16, without creating an intermediate reference.
    • Create a space for Progrem variable

    Structs

    • This is the struct to interact in a save way with the Arduboy2 C++ library.
    • This is the struct to interact in a save way with the Arduboy2Audio C++ library.
    • This struct gives the library a understanding what Buttons on the Arduboy are.
    • This struct to store and read structs objects to eeprom memory.
    • Use this struct to store and read single bytes to/from eeprom memory.
    • This struct is used by a few Arduboy functions.
    • This struct is used by a few Arduboy functions.

    Enums

    • This item is to chose between Black or White

    Constants

    • Just a const for the A button
    • Just a const for the A button
    • Just a const for the B button
    • Just a const for the blue led
    • Just a const for the B button
    • Just a const for the DOWN button
    • Just a const for the DOWN button
    • The standard font size of the arduboy
    • Just a const for the green led
    • The standard height of the arduboy
    • Just a const for the LEFT button
    • Just a const for the LEFT button
    • Just a const for the red led
    • Just a const for led off
    • Just a const for led on
    • Just a const for the RIGHT button
    • Just a const for the RIGHT button
    • Just a const for the UP button
    • Just a const for the UP button
    • The standard width of the arduboy

    Traits

    Functions

    • A Arduino function to pause the cpu circles for a given amount of ms
    • A Arduino function to get a random number between 2 numbers +arduboy_rust::prelude - Rust

      Module arduboy_rust::prelude

      source ·
      Expand description

      This is the important one to use this library effective in your project

      +

      Import the module:

      + +
      use arduboy_rust::prelude::*;
      +

      Modules

      • This is the Module to interact in a save way with the Arduboy2 C++ library.
      • This is the Module to interact in a save way with the ArduboyTones C++ library.
      • A list of all six buttons available on the Arduboy
      • A list of all LED variables available
      • This is the module to interact in a save way with the Sprites C++ library.

      Macros

      • This is the way to go if you want print some random text
      • 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 sprite as u16, without creating an intermediate reference.
      • Create a space for Progmem variable

      Structs

      • This is the struct to interact in a save way with the Arduboy2 C++ library.
      • This is the struct to interact in a save way with the ArduboyTones C++ library.
      • This struct gives the library a understanding what Buttons on the Arduboy are.
      • This struct to store and read structs objects to/from eeprom memory.
      • Use this struct to store and read single bytes to/from eeprom memory.
      • This struct is used by a few Arduboy functions.
      • This struct is used by a few Arduboy functions.

      Enums

      • This item is to chose between Black or White

      Constants

      • Just a const for the A button
      • Just a const for the A button
      • Just a const for the B button
      • Just a const for the blue led
      • Just a const for the B button
      • Just a const for the DOWN button
      • Just a const for the DOWN button
      • The standard font size of the arduboy
      • Just a const for the green led
      • The standard height of the arduboy
      • Just a const for the LEFT button
      • Just a const for the LEFT button
      • Just a const for the red led
      • Just a const for led off
      • Just a const for led on
      • Just a const for the RIGHT button
      • Just a const for the RIGHT button
      • Just a const for the UP button
      • Just a const for the UP button
      • The standard width of the arduboy

      Traits

      Functions

      • A Arduino function to pause the cpu circles for a given amount of ms
      • A Arduino function to get a random number between 2 numbers seed based
      • A Arduino function to get a random number smaller than the number given seed based
      • A C function to get the length of a string

      Type Definitions

      • c_size_tExperimental
        Equivalent to C’s size_t type, from stddef.h (or cstddef for C++).
      • Equivalent to C’s char type.
      • Equivalent to C’s double type.
      • Equivalent to C’s float type.
      • Equivalent to C’s signed int (int) type.
      • Equivalent to C’s signed long (long) type.
      • Equivalent to C’s signed long long (long long) type.
      • Equivalent to C’s unsigned char type.
      • Equivalent to C’s unsigned int type.
      • Equivalent to C’s unsigned long type.
      • Equivalent to C’s unsigned long long type.
      \ 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 5d39ae4..4ef69fa 100644 --- a/docs/doc/arduboy_rust/prelude/macro.progmem.html +++ b/docs/doc/arduboy_rust/prelude/macro.progmem.html @@ -1,11 +1,11 @@ -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;
               $($rest:tt)*
           ) => { ... };
           () => { ... };
      -}
      Expand description

      Create a space for Progrem variable

      +}
      Expand description

      Create a space for Progmem variable

      Example

      //for text
       progmem!(
      diff --git a/docs/doc/arduboy_rust/prelude/struct.Arduboy2.html b/docs/doc/arduboy_rust/prelude/struct.Arduboy2.html
      index 2fe9e27..5a99aad 100644
      --- a/docs/doc/arduboy_rust/prelude/struct.Arduboy2.html
      +++ b/docs/doc/arduboy_rust/prelude/struct.Arduboy2.html
      @@ -1,5 +1,5 @@
       Arduboy2 in arduboy_rust::prelude - Rust
      pub struct Arduboy2 {}
      Expand description

      This is the struct to interact in a save way with the Arduboy2 C++ library.

      -

      Implementations§

      source§

      impl Arduboy2

      source

      pub const fn new() -> Self

      gives you a new instans of the Arduboy2

      +

      Implementations§

      source§

      impl Arduboy2

      source

      pub const fn new() -> Self

      gives you a new instans of the Arduboy2

      Example
      const arduboy: Arduboy2 = Arduboy2::new();
      source

      pub fn begin(&self)

      Initialize the hardware, display the boot logo, provide boot utilities, etc. @@ -9,32 +9,40 @@ This function should be called once near the start of the sketch, usually in set The contents of the display buffer in RAM are copied to the display and will appear on the screen.

      source

      pub fn display_and_clear_buffer(&self)

      Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.

      Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.

      -
      source

      pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

      Draw a horizontal line.

      +
      source

      pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

      Draw a horizontal line.

      Parameters:
      -

      x The X coordinate of the left start point.

      -

      y The Y coordinate of the left start point.

      -

      w The width of the line.

      +
        +
      • x The X coordinate of the left start point.
      • +
      • y The Y coordinate of the left start point.
      • +
      • w The width of the line.
      • +

      color The color of the line (optional; defaults to WHITE).

      -
      source

      pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

      Draw a vertical line.

      +
      source

      pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

      Draw a vertical line.

      Parameters:
      -

      x The X coordinate of the left start point.

      -

      y The Y coordinate of the left start point.

      -

      h The height of the line.

      +
        +
      • x The X coordinate of the left start point.
      • +
      • y The Y coordinate of the left start point.
      • +
      • h The height of the line.
      • +

      color The color of the line (optional; defaults to WHITE).

      -
      source

      pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

      Set a single pixel in the display buffer to the specified color.

      +
      source

      pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

      Set a single pixel in the display buffer to the specified color.

      Parameters
      -

      x The X coordinate of the pixel.

      -

      y The Y coordinate of the pixel.

      -

      color The color of the pixel (optional; defaults to WHITE).

      +
        +
      • x The X coordinate of the pixel.
      • +
      • y The Y coordinate of the pixel.
      • +
      • color The color of the pixel (optional; defaults to WHITE).
      • +

      The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.

      -
      source

      pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

      Draw a filled-in rectangle of a specified width and height.

      +
      source

      pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

      Draw a filled-in rectangle of a specified width and height.

      Parameters
      -

      x The X coordinate of the upper left corner.

      -

      y The Y coordinate of the upper left corner.

      -

      w The width of the rectangle.

      -

      h The height of the rectangle.

      +
        +
      • x The X coordinate of the upper left corner.
      • +
      • y The Y coordinate of the upper left corner.
      • +
      • w The width of the rectangle.
      • +
      • h The height of the rectangle.
      • +

      color The color of the pixel (optional; defaults to WHITE).

      -
      source

      pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

      Draw a rectangle of a specified width and height.

      +
      source

      pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

      Draw a rectangle of a specified width and height.

      Parameters

      • x The X coordinate of the upper left corner.
      • @@ -43,7 +51,7 @@ The contents of the display buffer in RAM are copied to the display and will app
      • h The height of the rectangle.
      • color The color of the pixel (optional; defaults to WHITE).
      -
      source

      pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

      Draw a circle of a given radius.

      +
      source

      pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

      Draw a circle of a given radius.

      Parameters

      • x0 The X coordinate of the circle’s center.
      • @@ -51,13 +59,15 @@ The contents of the display buffer in RAM are copied to the display and will app
      • r The radius of the circle in pixels.
      • color The circle’s color (optional; defaults to WHITE).
      -
      source

      pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

      Draw a filled-in circle of a given radius.

      +
      source

      pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

      Draw a filled-in circle of a given radius.

      Parameters
      -

      x0 The X coordinate of the circle’s center.

      -

      y0 The Y coordinate of the circle’s center.

      -

      r The radius of the circle in pixels.

      +
        +
      • x The X coordinate of the circle’s center.
      • +
      • y The Y coordinate of the circle’s center.
      • +
      • r The radius of the circle in pixels.
      • +

      color The circle’s color (optional; defaults to WHITE).

      -
      source

      pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

      Draw a filled-in rectangle with rounded corners.

      +
      source

      pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

      Draw a filled-in rectangle with rounded corners.

      Parameters

      • x The X coordinate of the left edge.
      • @@ -67,7 +77,7 @@ The contents of the display buffer in RAM are copied to the display and will app
      • r The radius of the semicircles forming the corners.
      • color The color of the rectangle (optional; defaults to WHITE).
      -
      source

      pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

      Draw a rectangle with rounded corners.

      +
      source

      pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

      Draw a rectangle with rounded corners.

      Parameters

      • x The X coordinate of the left edge.
      • @@ -77,7 +87,7 @@ The contents of the display buffer in RAM are copied to the display and will app
      • r The radius of the semicircles forming the corners.
      • color The color of the rectangle (optional; defaults to WHITE).
      -
      source

      pub fn draw_triangle( +

      source

      pub fn draw_triangle( &self, x0: i16, y0: i16, @@ -94,7 +104,7 @@ The contents of the display buffer in RAM are copied to the display and will app
    • color The triangle’s color (optional; defaults to WHITE).

    A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

    -
    source

    pub fn fill_triangle( +

    source

    pub fn fill_triangle( &self, x0: i16, y0: i16, @@ -111,52 +121,62 @@ The contents of the display buffer in RAM are copied to the display and will app
  • color The triangle’s color (optional; defaults to WHITE).
  • A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

    -

    source

    pub fn get_pixel(&self, x: u8, y: u8) -> Color

    Returns the state of the given pixel in the screen buffer.

    +
    source

    pub fn get_pixel(&self, x: u8, y: u8) -> Color

    Returns the state of the given pixel in the screen buffer.

    Parameters
    -

    x The X coordinate of the pixel.

    -

    y The Y coordinate of the pixel.

    +
      +
    • x The X coordinate of the pixel.
    • +
    • y The Y coordinate of the pixel.
    • +
    Returns

    WHITE if the pixel is on or BLACK if the pixel is off.

    -
    source

    pub fn init_random_seed(&self)

    Seed the random number generator with a random value.

    +
    source

    pub fn init_random_seed(&self)

    Seed the random number generator with a random value.

    The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().

    -
    source

    pub fn just_pressed(&self, button: ButtonSet) -> bool

    Check if a button has just been pressed.

    +
    source

    pub fn just_pressed(&self, button: ButtonSet) -> bool

    Check if a button has just been pressed.

    Parameters
    -

    button The button to test for. Only one button should be specified.

    +
      +
    • button The button to test for. Only one button should be specified.
    • +
    Returns

    true if the specified button has just been pressed.

    Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

    There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.

    This function should only be used to test a single button.

    -
    source

    pub fn just_released(&self, button: ButtonSet) -> bool

    Check if a button has just been released.

    +
    source

    pub fn just_released(&self, button: ButtonSet) -> bool

    Check if a button has just been released.

    Parameters
    -

    button The button to test for. Only one button should be specified.

    +
      +
    • button The button to test for. Only one button should be specified.
    • +
    Returns

    true if the specified button has just been released.

    Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

    There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.

    This function should only be used to test a single button.

    -
    source

    pub fn not_pressed(&self, button: ButtonSet) -> bool

    Test if the specified buttons are not pressed.

    +
    source

    pub fn not_pressed(&self, button: ButtonSet) -> bool

    Test if the specified buttons are not pressed.

    Parameters
    -

    buttons A bit mask indicating which buttons to test. (Can be a single button)

    +
      +
    • buttons A bit mask indicating which buttons to test. (Can be a single button)
    • +
    Returns

    True if all buttons in the provided mask are currently released.

    Read the state of the buttons and return true if all the buttons in the specified mask are currently released.

    -
    source

    pub fn next_frame(&self) -> bool

    Indicate that it’s time to render the next frame.

    +
    source

    pub fn next_frame(&self) -> bool

    Indicate that it’s time to render the next frame.

    Returns

    true if it’s time for the next frame.

    When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().

    This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.

    -
    source

    pub fn poll_buttons(&self)

    Poll the buttons and track their state over time.

    +
    source

    pub fn poll_buttons(&self)

    Poll the buttons and track their state over time.

    Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().

    This function should be called once at the start of each new frame.

    The justPressed() and justReleased() functions rely on this function.

    -
    source

    pub fn pressed(&self, button: ButtonSet) -> bool

    Test if the all of the specified buttons are pressed.

    +
    source

    pub fn pressed(&self, button: ButtonSet) -> bool

    Test if the all of the specified buttons are pressed.

    Parameters
    -

    buttons A bit mask indicating which buttons to test. (Can be a single button)

    +
      +
    • buttons A bit mask indicating which buttons to test. (Can be a single button)
    • +
    Returns

    true if all buttons in the provided mask are currently pressed.

    Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.

    -
    source

    pub fn print(&self, x: impl Printable)

    The Arduino Print class is available for writing text to the screen buffer.

    +
    source

    pub fn print(&self, x: impl Printable)

    The Arduino Print class is available for writing text to the screen buffer.

    For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

    Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:

      @@ -164,48 +184,60 @@ The contents of the display buffer in RAM are copied to the display and will app
    • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.

    Example

    -
    let value:i16 = 42;
     
    -arduboy.println("Hello World\0"); // Prints "Hello World" and then sets the
    -                                  // text cursor to the start of the next line
    -arduboy.print(value);             // Prints "42"
    -arduboy.print('\n\0');            // Sets the text cursor to the start of the next line
    -arduboy.print(78, HEX);           // Prints "4E" (78 in hexadecimal)
    -arduboy.print("\x03\xEA");        // Prints a heart symbol and a Greek uppercase omega
    -
    source

    pub fn set_cursor(&self, x: i16, y: i16)

    Set the location of the text cursor.

    +
    let value: i16 = 42;
    +
    +arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
    +                                       // text cursor to the start of the next line
    +arduboy.print(value); // Prints "42"
    +arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
    +arduboy.print("hello world") // Prints normal [&str]
    +
    source

    pub fn set_cursor(&self, x: i16, y: i16)

    Set the location of the text cursor.

    Parameters
    +
      +
    • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

      +
    • +
    • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

      +
    • +

    The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.

    -
    source

    pub fn set_frame_rate(&self, rate: u8)

    Set the frame rate used by the frame control functions.

    +
    source

    pub fn set_frame_rate(&self, rate: u8)

    Set the frame rate used by the frame control functions.

    Parameters
    -

    rate The desired frame rate in frames per second.

    +
      +
    • rate The desired frame rate in frames per second.
    • +

    Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.

    -
    source

    pub fn set_text_size(&self, size: u8)

    Set the text character size.

    +
    source

    pub fn set_text_size(&self, size: u8)

    Set the text character size.

    Parameters
    -

    s The text size multiplier. Must be 1 or higher.

    +
      +
    • s The text size multiplier. Must be 1 or higher.
    • +

    Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.

    -
    source

    pub fn audio_on(&self)

    Turn sound on.

    +
    source

    pub fn audio_on(&self)

    Turn sound on.

    The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.

    -
    source

    pub fn audio_off(&self)

    Turn sound off (mute).

    +
    source

    pub fn audio_off(&self)

    Turn sound off (mute).

    The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.

    -
    source

    pub fn audio_save_on_off(&self)

    Save the current sound state in EEPROM.

    +
    source

    pub fn audio_save_on_off(&self)

    Save the current sound state in EEPROM.

    The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.

    Note EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.

    -
    source

    pub fn audio_toggle(&self)

    Toggle the sound on/off state.

    +
    source

    pub fn audio_toggle(&self)

    Toggle the sound on/off state.

    If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().

    -
    source

    pub fn audio_on_and_save(&self)

    Combines the use function of audio_on() and audio_save_on_off()

    -
    source

    pub fn audio_enabled(&self) -> bool

    Get the current sound state.

    +
    source

    pub fn audio_on_and_save(&self)

    Combines the use function of audio_on() and audio_save_on_off()

    +
    source

    pub fn audio_enabled(&self) -> bool

    Get the current sound state.

    Returns

    true if sound is currently enabled (not muted).

    This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.

    -
    source

    pub fn invert(&self, inverse: bool)

    Invert the entire display or set it back to normal.

    +
    source

    pub fn invert(&self, inverse: bool)

    Invert the entire display or set it back to normal.

    Parameters
    -

    inverse true will invert the display. false will set the display to no-inverted.

    +
      +
    • inverse true will invert the display. false will set the display to no-inverted.
    • +

    Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.

    Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.

    -
    source

    pub fn collide_point(&self, point: Point, rect: Rect) -> bool

    Test if a point falls within a rectangle.

    +
    source

    pub fn collide_point(&self, point: Point, rect: Rect) -> bool

    Test if a point falls within a rectangle.

    Parameters

    • point A structure describing the location of the point.
    • @@ -214,7 +246,7 @@ EEPROM is limited in the number of times it can be written to. Sketches should n

      Returns true if the specified point is within the specified rectangle.

      This function is intended to detemine if an object, whose boundaries are are defined by the given rectangle, is in contact with the given point.

      -
    source

    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

    Test if a rectangle is intersecting with another rectangle.

    +
    source

    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

    Test if a rectangle is intersecting with another rectangle.

    Parameters

    • rect1,rect2 Structures describing the size and locations of the rectangles.
    • @@ -222,14 +254,14 @@ true if the specified point is within the specified rectangle.

      Returns true if the first rectangle is intersecting the second.

      This function is intended to detemine if an object, whose boundaries are are defined by the given rectangle, is in contact with another rectangular object.

      -
    source

    pub fn digital_write_rgb_single(&self, color: u8, val: u8)

    Set one of the RGB LEDs digitally, to either fully on or fully off.

    +
    source

    pub fn digital_write_rgb_single(&self, color: u8, val: u8)

    Set one of the RGB LEDs digitally, to either fully on or fully off.

    Parameters

    • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
    • val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.

    This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.

    -
    source

    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

    Set the RGB LEDs digitally, to either fully on or fully off.

    +
    source

    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

    Set the RGB LEDs digitally, to either fully on or fully off.

    Parameters

    • red,green,blue Use value RGB_ON or RGB_OFF to set each LED.
    • @@ -245,7 +277,7 @@ true if the first rectangle is intersecting the second.

      RGB_ON RGB_OFF RGB_ON Magenta RGB_ON RGB_ON RGB_OFF Yellow RGB_ON RGB_ON RGB_ON White -
    source

    pub fn every_x_frames(&self, frames: u8) -> bool

    Indicate if the specified number of frames has elapsed.

    +
    source

    pub fn every_x_frames(&self, frames: u8) -> bool

    Indicate if the specified number of frames has elapsed.

    Parameters frames The desired number of elapsed frames.

    Returns @@ -259,52 +291,52 @@ true if the specified number of frames has elapsed.

    fireShot(); } }
    -
    source

    pub fn flip_vertical(&self, flipped: bool)

    Flip the display vertically or set it back to normal.

    +
    source

    pub fn flip_vertical(&self, flipped: bool)

    Flip the display vertically or set it back to normal.

    Parameters

    • flipped true will set vertical flip mode. false will set normal vertical orientation.

    Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.

    Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.

    -
    source

    pub fn flip_horizontal(&self, flipped: bool)

    Flip the display horizontally or set it back to normal.

    +
    source

    pub fn flip_horizontal(&self, flipped: bool)

    Flip the display horizontally or set it back to normal.

    Parameters

    • flipped true will set horizontal flip mode. false will set normal horizontal orientation.

    Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.

    Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.

    -
    source

    pub fn set_text_color(&self, color: Color)

    Set the text foreground color.

    +
    source

    pub fn set_text_color(&self, color: Color)

    Set the text foreground color.

    Parameters

    • color The color to be used for following text. The values WHITE or BLACK should be used.
    -
    source

    pub fn set_text_background_color(&self, color: Color)

    Set the text background color.

    +
    source

    pub fn set_text_background_color(&self, color: Color)

    Set the text background color.

    Parameters

    • color The background color to be used for following text. The values WHITE or BLACK should be used.

    The background pixels of following characters will be set to the specified color.

    However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.

    -
    source

    pub fn set_cursor_x(&self, x: i16)

    Set the X coordinate of the text cursor location.

    +
    source

    pub fn set_cursor_x(&self, x: i16)

    Set the X coordinate of the text cursor location.

    Parameters

    • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

    The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.

    -
    source

    pub fn set_cursor_y(&self, y: i16)

    Set the Y coordinate of the text cursor location.

    +
    source

    pub fn set_cursor_y(&self, y: i16)

    Set the Y coordinate of the text cursor location.

    Parameters

    • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

    The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.

    -
    source

    pub fn set_text_wrap(&self, w: bool)

    Set or disable text wrap mode.

    +
    source

    pub fn set_text_wrap(&self, w: bool)

    Set or disable text wrap mode.

    Parameters

    • w true enables text wrap mode. false disables it.

    Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.

    If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.

    -
    source

    pub fn idle(&self)

    Idle the CPU to save power.

    +
    source

    pub fn idle(&self)

    Idle the CPU to save power.

    This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Arduboy2

    §

    impl Send for Arduboy2

    §

    impl Sync for Arduboy2

    §

    impl Unpin for Arduboy2

    §

    impl UnwindSafe for Arduboy2

    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 diff --git a/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html b/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html index 3f72c86..7dd4ec2 100644 --- a/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html +++ b/docs/doc/arduboy_rust/prelude/struct.ArduboyTones.html @@ -1,4 +1,4 @@ -ArduboyTones in arduboy_rust::prelude - Rust
    pub struct ArduboyTones {}
    Expand description

    This is the struct to interact in a save way with the Arduboy2Audio C++ library.

    +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.

    Implementations§

    source§

    impl ArduboyTones

    source

    pub const fn new() -> ArduboyTones

    Get a new instance of ArduboyTones

    Example
    const sound: ArduboyTones = ArduboyTones::new();
    diff --git a/docs/doc/arduboy_rust/prelude/struct.EEPROM.html b/docs/doc/arduboy_rust/prelude/struct.EEPROM.html index 9a72bfa..1e45456 100644 --- a/docs/doc/arduboy_rust/prelude/struct.EEPROM.html +++ b/docs/doc/arduboy_rust/prelude/struct.EEPROM.html @@ -1,4 +1,4 @@ -EEPROM in arduboy_rust::prelude - Rust
    pub struct EEPROM { /* private fields */ }
    Expand description

    This struct to store and read structs objects to eeprom memory.

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

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

    Example

    static e: EEPROM = EEPROM::new(10);
     struct Scorebord {
    diff --git a/docs/doc/arduboy_rust/sidebar-items.js b/docs/doc/arduboy_rust/sidebar-items.js
    index 24825d1..c48906e 100644
    --- a/docs/doc/arduboy_rust/sidebar-items.js
    +++ b/docs/doc/arduboy_rust/sidebar-items.js
    @@ -1 +1 @@
    -window.SIDEBAR_ITEMS = {"constant":["FONT_SIZE","HEIGHT","WIDTH"],"enum":["Color"],"macro":["f","get_sprite_addr","get_string_addr","get_tones_addr","progmem"],"mod":["arduboy2","arduboy_tone","c","hardware","prelude","sprites"],"struct":["Arduboy2","ArduboyTones","EEPROM","EEPROMBYTE"]};
    \ No newline at end of file
    +window.SIDEBAR_ITEMS = {"constant":["FONT_SIZE","HEIGHT","WIDTH"],"enum":["Color"],"macro":["f","get_sprite_addr","get_string_addr","get_tones_addr","progmem"],"mod":["arduboy2","arduboy_tone","arduino","c","hardware","prelude","sprites"],"struct":["Arduboy2","ArduboyTones","EEPROM","EEPROMBYTE"]};
    \ No newline at end of file
    diff --git a/docs/doc/arduboy_rust/struct.Arduboy2.html b/docs/doc/arduboy_rust/struct.Arduboy2.html
    index a3b8f85..e947ea2 100644
    --- a/docs/doc/arduboy_rust/struct.Arduboy2.html
    +++ b/docs/doc/arduboy_rust/struct.Arduboy2.html
    @@ -1,5 +1,5 @@
     Arduboy2 in arduboy_rust - Rust

    Struct arduboy_rust::Arduboy2

    source ·
    pub struct Arduboy2 {}
    Expand description

    This is the struct to interact in a save way with the Arduboy2 C++ library.

    -

    Implementations§

    source§

    impl Arduboy2

    source

    pub const fn new() -> Self

    gives you a new instans of the Arduboy2

    +

    Implementations§

    source§

    impl Arduboy2

    source

    pub const fn new() -> Self

    gives you a new instans of the Arduboy2

    Example
    const arduboy: Arduboy2 = Arduboy2::new();
    source

    pub fn begin(&self)

    Initialize the hardware, display the boot logo, provide boot utilities, etc. @@ -9,32 +9,40 @@ This function should be called once near the start of the sketch, usually in set The contents of the display buffer in RAM are copied to the display and will appear on the screen.

    source

    pub fn display_and_clear_buffer(&self)

    Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.

    Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.

    -
    source

    pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

    Draw a horizontal line.

    +
    source

    pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color)

    Draw a horizontal line.

    Parameters:
    -

    x The X coordinate of the left start point.

    -

    y The Y coordinate of the left start point.

    -

    w The width of the line.

    +
      +
    • x The X coordinate of the left start point.
    • +
    • y The Y coordinate of the left start point.
    • +
    • w The width of the line.
    • +

    color The color of the line (optional; defaults to WHITE).

    -
    source

    pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

    Draw a vertical line.

    +
    source

    pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color)

    Draw a vertical line.

    Parameters:
    -

    x The X coordinate of the left start point.

    -

    y The Y coordinate of the left start point.

    -

    h The height of the line.

    +
      +
    • x The X coordinate of the left start point.
    • +
    • y The Y coordinate of the left start point.
    • +
    • h The height of the line.
    • +

    color The color of the line (optional; defaults to WHITE).

    -
    source

    pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

    Set a single pixel in the display buffer to the specified color.

    +
    source

    pub fn draw_pixel(&self, x: i16, y: i16, color: Color)

    Set a single pixel in the display buffer to the specified color.

    Parameters
    -

    x The X coordinate of the pixel.

    -

    y The Y coordinate of the pixel.

    -

    color The color of the pixel (optional; defaults to WHITE).

    +
      +
    • x The X coordinate of the pixel.
    • +
    • y The Y coordinate of the pixel.
    • +
    • color The color of the pixel (optional; defaults to WHITE).
    • +

    The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.

    -
    source

    pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

    Draw a filled-in rectangle of a specified width and height.

    +
    source

    pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

    Draw a filled-in rectangle of a specified width and height.

    Parameters
    -

    x The X coordinate of the upper left corner.

    -

    y The Y coordinate of the upper left corner.

    -

    w The width of the rectangle.

    -

    h The height of the rectangle.

    +
      +
    • x The X coordinate of the upper left corner.
    • +
    • y The Y coordinate of the upper left corner.
    • +
    • w The width of the rectangle.
    • +
    • h The height of the rectangle.
    • +

    color The color of the pixel (optional; defaults to WHITE).

    -
    source

    pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

    Draw a rectangle of a specified width and height.

    +
    source

    pub fn draw_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color)

    Draw a rectangle of a specified width and height.

    Parameters

    • x The X coordinate of the upper left corner.
    • @@ -43,7 +51,7 @@ The contents of the display buffer in RAM are copied to the display and will app
    • h The height of the rectangle.
    • color The color of the pixel (optional; defaults to WHITE).
    -
    source

    pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

    Draw a circle of a given radius.

    +
    source

    pub fn draw_circle(&self, x: i16, y: i16, r: u8, color: Color)

    Draw a circle of a given radius.

    Parameters

    • x0 The X coordinate of the circle’s center.
    • @@ -51,13 +59,15 @@ The contents of the display buffer in RAM are copied to the display and will app
    • r The radius of the circle in pixels.
    • color The circle’s color (optional; defaults to WHITE).
    -
    source

    pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

    Draw a filled-in circle of a given radius.

    +
    source

    pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color)

    Draw a filled-in circle of a given radius.

    Parameters
    -

    x0 The X coordinate of the circle’s center.

    -

    y0 The Y coordinate of the circle’s center.

    -

    r The radius of the circle in pixels.

    +
      +
    • x The X coordinate of the circle’s center.
    • +
    • y The Y coordinate of the circle’s center.
    • +
    • r The radius of the circle in pixels.
    • +

    color The circle’s color (optional; defaults to WHITE).

    -
    source

    pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

    Draw a filled-in rectangle with rounded corners.

    +
    source

    pub fn fill_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

    Draw a filled-in rectangle with rounded corners.

    Parameters

    • x The X coordinate of the left edge.
    • @@ -67,7 +77,7 @@ The contents of the display buffer in RAM are copied to the display and will app
    • r The radius of the semicircles forming the corners.
    • color The color of the rectangle (optional; defaults to WHITE).
    -
    source

    pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

    Draw a rectangle with rounded corners.

    +
    source

    pub fn draw_round_rect(&self, x: i16, y: i16, w: u8, h: u8, r: u8, color: Color)

    Draw a rectangle with rounded corners.

    Parameters

    • x The X coordinate of the left edge.
    • @@ -77,7 +87,7 @@ The contents of the display buffer in RAM are copied to the display and will app
    • r The radius of the semicircles forming the corners.
    • color The color of the rectangle (optional; defaults to WHITE).
    -
    source

    pub fn draw_triangle( +

    source

    pub fn draw_triangle( &self, x0: i16, y0: i16, @@ -94,7 +104,7 @@ The contents of the display buffer in RAM are copied to the display and will app
  • color The triangle’s color (optional; defaults to WHITE).
  • A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

    -

    source

    pub fn fill_triangle( +

    source

    pub fn fill_triangle( &self, x0: i16, y0: i16, @@ -111,52 +121,62 @@ The contents of the display buffer in RAM are copied to the display and will app
  • color The triangle’s color (optional; defaults to WHITE).
  • A triangle is drawn by specifying each of the three corner locations. The corners can be at any position with respect to the others.

    -

    source

    pub fn get_pixel(&self, x: u8, y: u8) -> Color

    Returns the state of the given pixel in the screen buffer.

    +
    source

    pub fn get_pixel(&self, x: u8, y: u8) -> Color

    Returns the state of the given pixel in the screen buffer.

    Parameters
    -

    x The X coordinate of the pixel.

    -

    y The Y coordinate of the pixel.

    +
      +
    • x The X coordinate of the pixel.
    • +
    • y The Y coordinate of the pixel.
    • +
    Returns

    WHITE if the pixel is on or BLACK if the pixel is off.

    -
    source

    pub fn init_random_seed(&self)

    Seed the random number generator with a random value.

    +
    source

    pub fn init_random_seed(&self)

    Seed the random number generator with a random value.

    The Arduino pseudorandom number generator is seeded with the random value returned from a call to generateRandomSeed().

    -
    source

    pub fn just_pressed(&self, button: ButtonSet) -> bool

    Check if a button has just been pressed.

    +
    source

    pub fn just_pressed(&self, button: ButtonSet) -> bool

    Check if a button has just been pressed.

    Parameters
    -

    button The button to test for. Only one button should be specified.

    +
      +
    • button The button to test for. Only one button should be specified.
    • +
    Returns

    true if the specified button has just been pressed.

    Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

    There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.

    This function should only be used to test a single button.

    -
    source

    pub fn just_released(&self, button: ButtonSet) -> bool

    Check if a button has just been released.

    +
    source

    pub fn just_released(&self, button: ButtonSet) -> bool

    Check if a button has just been released.

    Parameters
    -

    button The button to test for. Only one button should be specified.

    +
      +
    • button The button to test for. Only one button should be specified.
    • +
    Returns

    true if the specified button has just been released.

    Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.

    There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.

    This function should only be used to test a single button.

    -
    source

    pub fn not_pressed(&self, button: ButtonSet) -> bool

    Test if the specified buttons are not pressed.

    +
    source

    pub fn not_pressed(&self, button: ButtonSet) -> bool

    Test if the specified buttons are not pressed.

    Parameters
    -

    buttons A bit mask indicating which buttons to test. (Can be a single button)

    +
      +
    • buttons A bit mask indicating which buttons to test. (Can be a single button)
    • +
    Returns

    True if all buttons in the provided mask are currently released.

    Read the state of the buttons and return true if all the buttons in the specified mask are currently released.

    -
    source

    pub fn next_frame(&self) -> bool

    Indicate that it’s time to render the next frame.

    +
    source

    pub fn next_frame(&self) -> bool

    Indicate that it’s time to render the next frame.

    Returns

    true if it’s time for the next frame.

    When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().

    This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.

    -
    source

    pub fn poll_buttons(&self)

    Poll the buttons and track their state over time.

    +
    source

    pub fn poll_buttons(&self)

    Poll the buttons and track their state over time.

    Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().

    This function should be called once at the start of each new frame.

    The justPressed() and justReleased() functions rely on this function.

    -
    source

    pub fn pressed(&self, button: ButtonSet) -> bool

    Test if the all of the specified buttons are pressed.

    +
    source

    pub fn pressed(&self, button: ButtonSet) -> bool

    Test if the all of the specified buttons are pressed.

    Parameters
    -

    buttons A bit mask indicating which buttons to test. (Can be a single button)

    +
      +
    • buttons A bit mask indicating which buttons to test. (Can be a single button)
    • +
    Returns

    true if all buttons in the provided mask are currently pressed.

    Read the state of the buttons and return true if all of the buttons in the specified mask are being pressed.

    -
    source

    pub fn print(&self, x: impl Printable)

    The Arduino Print class is available for writing text to the screen buffer.

    +
    source

    pub fn print(&self, x: impl Printable)

    The Arduino Print class is available for writing text to the screen buffer.

    For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

    Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:

      @@ -164,48 +184,60 @@ The contents of the display buffer in RAM are copied to the display and will app
    • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.

    Example

    -
    let value:i16 = 42;
     
    -arduboy.println("Hello World\0"); // Prints "Hello World" and then sets the
    -                                  // text cursor to the start of the next line
    -arduboy.print(value);             // Prints "42"
    -arduboy.print('\n\0');            // Sets the text cursor to the start of the next line
    -arduboy.print(78, HEX);           // Prints "4E" (78 in hexadecimal)
    -arduboy.print("\x03\xEA");        // Prints a heart symbol and a Greek uppercase omega
    -
    source

    pub fn set_cursor(&self, x: i16, y: i16)

    Set the location of the text cursor.

    +
    let value: i16 = 42;
    +
    +arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
    +                                       // text cursor to the start of the next line
    +arduboy.print(value); // Prints "42"
    +arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
    +arduboy.print("hello world") // Prints normal [&str]
    +
    source

    pub fn set_cursor(&self, x: i16, y: i16)

    Set the location of the text cursor.

    Parameters
    +
      +
    • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

      +
    • +
    • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

      +
    • +

    The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.

    -
    source

    pub fn set_frame_rate(&self, rate: u8)

    Set the frame rate used by the frame control functions.

    +
    source

    pub fn set_frame_rate(&self, rate: u8)

    Set the frame rate used by the frame control functions.

    Parameters
    -

    rate The desired frame rate in frames per second.

    +
      +
    • rate The desired frame rate in frames per second.
    • +

    Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.

    -
    source

    pub fn set_text_size(&self, size: u8)

    Set the text character size.

    +
    source

    pub fn set_text_size(&self, size: u8)

    Set the text character size.

    Parameters
    -

    s The text size multiplier. Must be 1 or higher.

    +
      +
    • s The text size multiplier. Must be 1 or higher.
    • +

    Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.

    -
    source

    pub fn audio_on(&self)

    Turn sound on.

    +
    source

    pub fn audio_on(&self)

    Turn sound on.

    The system is configured to generate sound. This function sets the sound mode only until the unit is powered off.

    -
    source

    pub fn audio_off(&self)

    Turn sound off (mute).

    +
    source

    pub fn audio_off(&self)

    Turn sound off (mute).

    The system is configured to not produce sound (mute). This function sets the sound mode only until the unit is powered off.

    -
    source

    pub fn audio_save_on_off(&self)

    Save the current sound state in EEPROM.

    +
    source

    pub fn audio_save_on_off(&self)

    Save the current sound state in EEPROM.

    The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.

    Note EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.

    -
    source

    pub fn audio_toggle(&self)

    Toggle the sound on/off state.

    +
    source

    pub fn audio_toggle(&self)

    Toggle the sound on/off state.

    If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().

    -
    source

    pub fn audio_on_and_save(&self)

    Combines the use function of audio_on() and audio_save_on_off()

    -
    source

    pub fn audio_enabled(&self) -> bool

    Get the current sound state.

    +
    source

    pub fn audio_on_and_save(&self)

    Combines the use function of audio_on() and audio_save_on_off()

    +
    source

    pub fn audio_enabled(&self) -> bool

    Get the current sound state.

    Returns

    true if sound is currently enabled (not muted).

    This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.

    -
    source

    pub fn invert(&self, inverse: bool)

    Invert the entire display or set it back to normal.

    +
    source

    pub fn invert(&self, inverse: bool)

    Invert the entire display or set it back to normal.

    Parameters
    -

    inverse true will invert the display. false will set the display to no-inverted.

    +
      +
    • inverse true will invert the display. false will set the display to no-inverted.
    • +

    Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.

    Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.

    -
    source

    pub fn collide_point(&self, point: Point, rect: Rect) -> bool

    Test if a point falls within a rectangle.

    +
    source

    pub fn collide_point(&self, point: Point, rect: Rect) -> bool

    Test if a point falls within a rectangle.

    Parameters

    • point A structure describing the location of the point.
    • @@ -214,7 +246,7 @@ EEPROM is limited in the number of times it can be written to. Sketches should n

      Returns true if the specified point is within the specified rectangle.

      This function is intended to detemine if an object, whose boundaries are are defined by the given rectangle, is in contact with the given point.

      -
    source

    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

    Test if a rectangle is intersecting with another rectangle.

    +
    source

    pub fn collide_rect(&self, rect1: Rect, rect2: Rect) -> bool

    Test if a rectangle is intersecting with another rectangle.

    Parameters

    • rect1,rect2 Structures describing the size and locations of the rectangles.
    • @@ -222,14 +254,14 @@ true if the specified point is within the specified rectangle.

      Returns true if the first rectangle is intersecting the second.

      This function is intended to detemine if an object, whose boundaries are are defined by the given rectangle, is in contact with another rectangular object.

      -
    source

    pub fn digital_write_rgb_single(&self, color: u8, val: u8)

    Set one of the RGB LEDs digitally, to either fully on or fully off.

    +
    source

    pub fn digital_write_rgb_single(&self, color: u8, val: u8)

    Set one of the RGB LEDs digitally, to either fully on or fully off.

    Parameters

    • color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.
    • val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.

    This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.

    -
    source

    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

    Set the RGB LEDs digitally, to either fully on or fully off.

    +
    source

    pub fn digital_write_rgb(&self, red: u8, green: u8, blue: u8)

    Set the RGB LEDs digitally, to either fully on or fully off.

    Parameters

    • red,green,blue Use value RGB_ON or RGB_OFF to set each LED.
    • @@ -245,7 +277,7 @@ true if the first rectangle is intersecting the second.

      RGB_ON RGB_OFF RGB_ON Magenta RGB_ON RGB_ON RGB_OFF Yellow RGB_ON RGB_ON RGB_ON White -
    source

    pub fn every_x_frames(&self, frames: u8) -> bool

    Indicate if the specified number of frames has elapsed.

    +
    source

    pub fn every_x_frames(&self, frames: u8) -> bool

    Indicate if the specified number of frames has elapsed.

    Parameters frames The desired number of elapsed frames.

    Returns @@ -259,52 +291,52 @@ true if the specified number of frames has elapsed.

    fireShot(); } }
    -
    source

    pub fn flip_vertical(&self, flipped: bool)

    Flip the display vertically or set it back to normal.

    +
    source

    pub fn flip_vertical(&self, flipped: bool)

    Flip the display vertically or set it back to normal.

    Parameters

    • flipped true will set vertical flip mode. false will set normal vertical orientation.

    Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.

    Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.

    -
    source

    pub fn flip_horizontal(&self, flipped: bool)

    Flip the display horizontally or set it back to normal.

    +
    source

    pub fn flip_horizontal(&self, flipped: bool)

    Flip the display horizontally or set it back to normal.

    Parameters

    • flipped true will set horizontal flip mode. false will set normal horizontal orientation.

    Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.

    Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.

    -
    source

    pub fn set_text_color(&self, color: Color)

    Set the text foreground color.

    +
    source

    pub fn set_text_color(&self, color: Color)

    Set the text foreground color.

    Parameters

    • color The color to be used for following text. The values WHITE or BLACK should be used.
    -
    source

    pub fn set_text_background_color(&self, color: Color)

    Set the text background color.

    +
    source

    pub fn set_text_background_color(&self, color: Color)

    Set the text background color.

    Parameters

    • color The background color to be used for following text. The values WHITE or BLACK should be used.

    The background pixels of following characters will be set to the specified color.

    However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.

    -
    source

    pub fn set_cursor_x(&self, x: i16)

    Set the X coordinate of the text cursor location.

    +
    source

    pub fn set_cursor_x(&self, x: i16)

    Set the X coordinate of the text cursor location.

    Parameters

    • x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.

    The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.

    -
    source

    pub fn set_cursor_y(&self, y: i16)

    Set the Y coordinate of the text cursor location.

    +
    source

    pub fn set_cursor_y(&self, y: i16)

    Set the Y coordinate of the text cursor location.

    Parameters

    • y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.

    The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.

    -
    source

    pub fn set_text_wrap(&self, w: bool)

    Set or disable text wrap mode.

    +
    source

    pub fn set_text_wrap(&self, w: bool)

    Set or disable text wrap mode.

    Parameters

    • w true enables text wrap mode. false disables it.

    Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.

    If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.

    -
    source

    pub fn idle(&self)

    Idle the CPU to save power.

    +
    source

    pub fn idle(&self)

    Idle the CPU to save power.

    This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Arduboy2

    §

    impl Send for Arduboy2

    §

    impl Sync for Arduboy2

    §

    impl Unpin for Arduboy2

    §

    impl UnwindSafe for Arduboy2

    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 diff --git a/docs/doc/arduboy_rust/struct.ArduboyTones.html b/docs/doc/arduboy_rust/struct.ArduboyTones.html index 2f4f57e..a0b8b9b 100644 --- a/docs/doc/arduboy_rust/struct.ArduboyTones.html +++ b/docs/doc/arduboy_rust/struct.ArduboyTones.html @@ -1,4 +1,4 @@ -ArduboyTones in arduboy_rust - Rust
    pub struct ArduboyTones {}
    Expand description

    This is the struct to interact in a save way with the Arduboy2Audio C++ library.

    +ArduboyTones in arduboy_rust - Rust
    pub struct ArduboyTones {}
    Expand description

    This is the struct to interact in a save way with the ArduboyTones C++ library.

    Implementations§

    source§

    impl ArduboyTones

    source

    pub const fn new() -> ArduboyTones

    Get a new instance of ArduboyTones

    Example
    const sound: ArduboyTones = ArduboyTones::new();
    diff --git a/docs/doc/arduboy_rust/struct.EEPROM.html b/docs/doc/arduboy_rust/struct.EEPROM.html index 3b0321a..fcc4e52 100644 --- a/docs/doc/arduboy_rust/struct.EEPROM.html +++ b/docs/doc/arduboy_rust/struct.EEPROM.html @@ -1,4 +1,4 @@ -EEPROM in arduboy_rust - Rust

    Struct arduboy_rust::EEPROM

    source ·
    pub struct EEPROM { /* private fields */ }
    Expand description

    This struct to store and read structs objects to eeprom memory.

    +EEPROM in arduboy_rust - Rust

    Struct arduboy_rust::EEPROM

    source ·
    pub struct EEPROM { /* private fields */ }
    Expand description

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

    Example

    static e: EEPROM = EEPROM::new(10);
     struct Scorebord {
    diff --git a/docs/doc/search-index.js b/docs/doc/search-index.js
    index 37fa3ad..91be94b 100644
    --- a/docs/doc/search-index.js
    +++ b/docs/doc/search-index.js
    @@ -1,5 +1,5 @@
     var searchIndex = JSON.parse('{\
    -"arduboy_rust":{"doc":"","t":"DDNEDDRRRNAAAOOOOAAOADNERRDDRNMMMMMMDARRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRFAARRRRDRRRRRRRRMLLLLRRRRRRRDDRRRENNDERRNDDRRRNRRNQDIRRRRRDRRRNAALLLLLLLLLAGGGGGGGGGGGLLLLFKFLLOMLLLLLLLLOOOLLMLLLLLLALLLLLLKOLFFLAFLLLLLLLLLLLLLMLMMMMDNERRDDRNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMDALLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDRRRRRRRRMRRRRRFFFFFFFFFF","n":["Arduboy2","ArduboyTones","Black","Color","EEPROM","EEPROMBYTE","FONT_SIZE","HEIGHT","WIDTH","White","arduboy2","arduboy_tone","c","f","get_sprite_addr","get_string_addr","get_tones_addr","hardware","prelude","progmem","sprites","Arduboy2","Black","Color","FONT_SIZE","HEIGHT","Point","Rect","WIDTH","White","height","width","x","x","y","y","ArduboyTones","arduboy_tone_pitch","NOTE_A0","NOTE_A0H","NOTE_A1","NOTE_A1H","NOTE_A2","NOTE_A2H","NOTE_A3","NOTE_A3H","NOTE_A4","NOTE_A4H","NOTE_A5","NOTE_A5H","NOTE_A6","NOTE_A6H","NOTE_A7","NOTE_A7H","NOTE_A8","NOTE_A8H","NOTE_A9","NOTE_A9H","NOTE_AS0","NOTE_AS0H","NOTE_AS1","NOTE_AS1H","NOTE_AS2","NOTE_AS2H","NOTE_AS3","NOTE_AS3H","NOTE_AS4","NOTE_AS4H","NOTE_AS5","NOTE_AS5H","NOTE_AS6","NOTE_AS6H","NOTE_AS7","NOTE_AS7H","NOTE_AS8","NOTE_AS8H","NOTE_AS9","NOTE_AS9H","NOTE_B0","NOTE_B0H","NOTE_B1","NOTE_B1H","NOTE_B2","NOTE_B2H","NOTE_B3","NOTE_B3H","NOTE_B4","NOTE_B4H","NOTE_B5","NOTE_B5H","NOTE_B6","NOTE_B6H","NOTE_B7","NOTE_B7H","NOTE_B8","NOTE_B8H","NOTE_B9","NOTE_B9H","NOTE_C0","NOTE_C0H","NOTE_C1","NOTE_C1H","NOTE_C2","NOTE_C2H","NOTE_C3","NOTE_C3H","NOTE_C4","NOTE_C4H","NOTE_C5","NOTE_C5H","NOTE_C6","NOTE_C6H","NOTE_C7","NOTE_C7H","NOTE_C8","NOTE_C8H","NOTE_C9","NOTE_C9H","NOTE_CS0","NOTE_CS0H","NOTE_CS1","NOTE_CS1H","NOTE_CS2","NOTE_CS2H","NOTE_CS3","NOTE_CS3H","NOTE_CS4","NOTE_CS4H","NOTE_CS5","NOTE_CS5H","NOTE_CS6","NOTE_CS6H","NOTE_CS7","NOTE_CS7H","NOTE_CS8","NOTE_CS8H","NOTE_CS9","NOTE_CS9H","NOTE_D0","NOTE_D0H","NOTE_D1","NOTE_D1H","NOTE_D2","NOTE_D2H","NOTE_D3","NOTE_D3H","NOTE_D4","NOTE_D4H","NOTE_D5","NOTE_D5H","NOTE_D6","NOTE_D6H","NOTE_D7","NOTE_D7H","NOTE_D8","NOTE_D8H","NOTE_D9","NOTE_D9H","NOTE_DS0","NOTE_DS0H","NOTE_DS1","NOTE_DS1H","NOTE_DS2","NOTE_DS2H","NOTE_DS3","NOTE_DS3H","NOTE_DS4","NOTE_DS4H","NOTE_DS5","NOTE_DS5H","NOTE_DS6","NOTE_DS6H","NOTE_DS7","NOTE_DS7H","NOTE_DS8","NOTE_DS8H","NOTE_DS9","NOTE_DS9H","NOTE_E0","NOTE_E0H","NOTE_E1","NOTE_E1H","NOTE_E2","NOTE_E2H","NOTE_E3","NOTE_E3H","NOTE_E4","NOTE_E4H","NOTE_E5","NOTE_E5H","NOTE_E6","NOTE_E6H","NOTE_E7","NOTE_E7H","NOTE_E8","NOTE_E8H","NOTE_E9","NOTE_E9H","NOTE_F0","NOTE_F0H","NOTE_F1","NOTE_F1H","NOTE_F2","NOTE_F2H","NOTE_F3","NOTE_F3H","NOTE_F4","NOTE_F4H","NOTE_F5","NOTE_F5H","NOTE_F6","NOTE_F6H","NOTE_F7","NOTE_F7H","NOTE_F8","NOTE_F8H","NOTE_F9","NOTE_F9H","NOTE_FS0","NOTE_FS0H","NOTE_FS1","NOTE_FS1H","NOTE_FS2","NOTE_FS2H","NOTE_FS3","NOTE_FS3H","NOTE_FS4","NOTE_FS4H","NOTE_FS5","NOTE_FS5H","NOTE_FS6","NOTE_FS6H","NOTE_FS7","NOTE_FS7H","NOTE_FS8","NOTE_FS8H","NOTE_FS9","NOTE_FS9H","NOTE_G0","NOTE_G0H","NOTE_G1","NOTE_G1H","NOTE_G2","NOTE_G2H","NOTE_G3","NOTE_G3H","NOTE_G4","NOTE_G4H","NOTE_G5","NOTE_G5H","NOTE_G6","NOTE_G6H","NOTE_G7","NOTE_G7H","NOTE_G8","NOTE_G8H","NOTE_G9","NOTE_G9H","NOTE_GS0","NOTE_GS0H","NOTE_GS1","NOTE_GS1H","NOTE_GS2","NOTE_GS2H","NOTE_GS3","NOTE_GS3H","NOTE_GS4","NOTE_GS4H","NOTE_GS5","NOTE_GS5H","NOTE_GS6","NOTE_GS6H","NOTE_GS7","NOTE_GS7H","NOTE_GS8","NOTE_GS8H","NOTE_GS9","NOTE_GS9H","NOTE_REST","TONES_END","TONES_REPEAT","TONE_HIGH_VOLUME","VOLUME_ALWAYS_HIGH","VOLUME_ALWAYS_NORMAL","VOLUME_IN_TONE","strlen","buttons","led","A","A_BUTTON","B","B_BUTTON","ButtonSet","DOWN","DOWN_BUTTON","LEFT","LEFT_BUTTON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON","flag_set","just_pressed","just_released","not_pressed","pressed","BLUE_LED","GREEN_LED","RED_LED","RGB_OFF","RGB_ON","A","A_BUTTON","Arduboy2","ArduboyTones","B","BLUE_LED","B_BUTTON","Base","Bin","Black","ButtonSet","Color","DOWN","DOWN_BUTTON","Dec","EEPROM","EEPROMBYTE","FONT_SIZE","GREEN_LED","HEIGHT","Hex","LEFT","LEFT_BUTTON","Oct","Parameters","Point","Printable","RED_LED","RGB_OFF","RGB_ON","RIGHT","RIGHT_BUTTON","Rect","UP","UP_BUTTON","WIDTH","White","arduboy2","arduboy_tone","bitor","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","buttons","c_char","c_double","c_float","c_int","c_long","c_longlong","c_size_t","c_uchar","c_uint","c_ulong","c_ulonglong","clone","clone","cmp","cmp","constrain","default_parameters","delay","eq","eq","f","flag_set","fmt","fmt","from","from","from","from","get","get_direct","get_sprite_addr","get_string_addr","get_tones_addr","hash","hash","height","init","init","into","into","into","into","led","new","new","partial_cmp","partial_cmp","print","print","print_2","progmem","put","random_between","random_less_than","read","sprites","strlen","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","update","width","write","x","x","y","y","Arduboy2","Black","Color","FONT_SIZE","HEIGHT","Point","Rect","WIDTH","White","audio_enabled","audio_off","audio_on","audio_on_and_save","audio_save_on_off","audio_toggle","begin","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clear","clone","cmp","collide_point","collide_rect","digital_write_rgb","digital_write_rgb_single","display","display_and_clear_buffer","draw_circle","draw_fast_hline","draw_fast_vline","draw_pixel","draw_rect","draw_round_rect","draw_triangle","eq","every_x_frames","fill_circle","fill_rect","fill_round_rect","fill_triangle","flip_horizontal","flip_vertical","fmt","from","from","from","from","get_pixel","hash","height","idle","init_random_seed","into","into","into","into","invert","just_pressed","just_released","new","next_frame","not","not_pressed","partial_cmp","poll_buttons","pressed","print","set_cursor","set_cursor_x","set_cursor_y","set_frame_rate","set_text_background_color","set_text_color","set_text_size","set_text_wrap","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","width","x","x","y","y","ArduboyTones","arduboy_tone_pitch","borrow","borrow_mut","from","into","new","no_tone","playing","tone","tone2","tone3","tones","tones_in_ram","try_from","try_into","type_id","volume_mode","NOTE_A0","NOTE_A0H","NOTE_A1","NOTE_A1H","NOTE_A2","NOTE_A2H","NOTE_A3","NOTE_A3H","NOTE_A4","NOTE_A4H","NOTE_A5","NOTE_A5H","NOTE_A6","NOTE_A6H","NOTE_A7","NOTE_A7H","NOTE_A8","NOTE_A8H","NOTE_A9","NOTE_A9H","NOTE_AS0","NOTE_AS0H","NOTE_AS1","NOTE_AS1H","NOTE_AS2","NOTE_AS2H","NOTE_AS3","NOTE_AS3H","NOTE_AS4","NOTE_AS4H","NOTE_AS5","NOTE_AS5H","NOTE_AS6","NOTE_AS6H","NOTE_AS7","NOTE_AS7H","NOTE_AS8","NOTE_AS8H","NOTE_AS9","NOTE_AS9H","NOTE_B0","NOTE_B0H","NOTE_B1","NOTE_B1H","NOTE_B2","NOTE_B2H","NOTE_B3","NOTE_B3H","NOTE_B4","NOTE_B4H","NOTE_B5","NOTE_B5H","NOTE_B6","NOTE_B6H","NOTE_B7","NOTE_B7H","NOTE_B8","NOTE_B8H","NOTE_B9","NOTE_B9H","NOTE_C0","NOTE_C0H","NOTE_C1","NOTE_C1H","NOTE_C2","NOTE_C2H","NOTE_C3","NOTE_C3H","NOTE_C4","NOTE_C4H","NOTE_C5","NOTE_C5H","NOTE_C6","NOTE_C6H","NOTE_C7","NOTE_C7H","NOTE_C8","NOTE_C8H","NOTE_C9","NOTE_C9H","NOTE_CS0","NOTE_CS0H","NOTE_CS1","NOTE_CS1H","NOTE_CS2","NOTE_CS2H","NOTE_CS3","NOTE_CS3H","NOTE_CS4","NOTE_CS4H","NOTE_CS5","NOTE_CS5H","NOTE_CS6","NOTE_CS6H","NOTE_CS7","NOTE_CS7H","NOTE_CS8","NOTE_CS8H","NOTE_CS9","NOTE_CS9H","NOTE_D0","NOTE_D0H","NOTE_D1","NOTE_D1H","NOTE_D2","NOTE_D2H","NOTE_D3","NOTE_D3H","NOTE_D4","NOTE_D4H","NOTE_D5","NOTE_D5H","NOTE_D6","NOTE_D6H","NOTE_D7","NOTE_D7H","NOTE_D8","NOTE_D8H","NOTE_D9","NOTE_D9H","NOTE_DS0","NOTE_DS0H","NOTE_DS1","NOTE_DS1H","NOTE_DS2","NOTE_DS2H","NOTE_DS3","NOTE_DS3H","NOTE_DS4","NOTE_DS4H","NOTE_DS5","NOTE_DS5H","NOTE_DS6","NOTE_DS6H","NOTE_DS7","NOTE_DS7H","NOTE_DS8","NOTE_DS8H","NOTE_DS9","NOTE_DS9H","NOTE_E0","NOTE_E0H","NOTE_E1","NOTE_E1H","NOTE_E2","NOTE_E2H","NOTE_E3","NOTE_E3H","NOTE_E4","NOTE_E4H","NOTE_E5","NOTE_E5H","NOTE_E6","NOTE_E6H","NOTE_E7","NOTE_E7H","NOTE_E8","NOTE_E8H","NOTE_E9","NOTE_E9H","NOTE_F0","NOTE_F0H","NOTE_F1","NOTE_F1H","NOTE_F2","NOTE_F2H","NOTE_F3","NOTE_F3H","NOTE_F4","NOTE_F4H","NOTE_F5","NOTE_F5H","NOTE_F6","NOTE_F6H","NOTE_F7","NOTE_F7H","NOTE_F8","NOTE_F8H","NOTE_F9","NOTE_F9H","NOTE_FS0","NOTE_FS0H","NOTE_FS1","NOTE_FS1H","NOTE_FS2","NOTE_FS2H","NOTE_FS3","NOTE_FS3H","NOTE_FS4","NOTE_FS4H","NOTE_FS5","NOTE_FS5H","NOTE_FS6","NOTE_FS6H","NOTE_FS7","NOTE_FS7H","NOTE_FS8","NOTE_FS8H","NOTE_FS9","NOTE_FS9H","NOTE_G0","NOTE_G0H","NOTE_G1","NOTE_G1H","NOTE_G2","NOTE_G2H","NOTE_G3","NOTE_G3H","NOTE_G4","NOTE_G4H","NOTE_G5","NOTE_G5H","NOTE_G6","NOTE_G6H","NOTE_G7","NOTE_G7H","NOTE_G8","NOTE_G8H","NOTE_G9","NOTE_G9H","NOTE_GS0","NOTE_GS0H","NOTE_GS1","NOTE_GS1H","NOTE_GS2","NOTE_GS2H","NOTE_GS3","NOTE_GS3H","NOTE_GS4","NOTE_GS4H","NOTE_GS5","NOTE_GS5H","NOTE_GS6","NOTE_GS6H","NOTE_GS7","NOTE_GS7H","NOTE_GS8","NOTE_GS8H","NOTE_GS9","NOTE_GS9H","NOTE_REST","TONES_END","TONES_REPEAT","TONE_HIGH_VOLUME","VOLUME_ALWAYS_HIGH","VOLUME_ALWAYS_NORMAL","VOLUME_IN_TONE","A","A_BUTTON","B","B_BUTTON","ButtonSet","DOWN","DOWN_BUTTON","LEFT","LEFT_BUTTON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON","flag_set","BLUE_LED","GREEN_LED","RED_LED","RGB_OFF","RGB_ON","draw_erase","draw_external_mask","draw_override","draw_plus_mask","draw_self_masked","draw_erase","draw_external_mask","draw_override","draw_plus_mask","draw_self_masked"],"q":[[0,"arduboy_rust"],[21,"arduboy_rust::arduboy2"],[36,"arduboy_rust::arduboy_tone"],[38,"arduboy_rust::arduboy_tone::arduboy_tone_pitch"],[285,"arduboy_rust::c"],[286,"arduboy_rust::hardware"],[288,"arduboy_rust::hardware::buttons"],[306,"arduboy_rust::hardware::led"],[311,"arduboy_rust::prelude"],[436,"arduboy_rust::prelude::arduboy2"],[534,"arduboy_rust::prelude::arduboy_tone"],[552,"arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch"],[799,"arduboy_rust::prelude::buttons"],[813,"arduboy_rust::prelude::led"],[818,"arduboy_rust::prelude::sprites"],[823,"arduboy_rust::sprites"]],"d":["This is the struct to interact in a save way with the …","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","This struct to store and read structs objects to eeprom …","Use this struct to store and read single bytes to/from …","The standard font size of the arduboy","The standard height of the arduboy","The standard width of the arduboy","Led is on","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","Clib functions you can use on the Arduboy","This is the way to go if you want print some random text","Create a const raw pointer to a sprite as u8, without …","Create a const raw pointer to a [u8;_] that saves text, …","Create a const raw pointer to a sprite as u16, without …","This is the Module to interact in a save way with the …","This is the important one to use this library effective in …","Create a space for Progrem variable","This is the module to interact in a save way with the …","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","The standard font size of the arduboy","The standard height of the arduboy","This struct is used by a few Arduboy functions.","This struct is used by a few Arduboy functions.","The standard width of the arduboy","Led is on","Rect height","Rect width","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","A list of all tones available and used by the Sounds …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A C function to get the length of a string","A list of all six buttons available on the Arduboy","A list of all LED variables available","Just a const for the A button","Just a const for the A button","Just a const for the B button","Just a const for the B button","This struct gives the library a understanding what Buttons …","Just a const for the DOWN button","Just a const for the DOWN button","Just a const for the LEFT button","Just a const for the LEFT button","Just a const for the RIGHT button","Just a const for the RIGHT button","Just a const for the UP button","Just a const for the UP button","","","","","","Just a const for the blue led","Just a const for the green led","Just a const for the red led","Just a const for led off","Just a const for led on","Just a const for the A button","Just a const for the A button","This is the struct to interact in a save way with the …","This is the struct to interact in a save way with the …","Just a const for the B button","Just a const for the blue led","Just a const for the B button","","","Led is off","This struct gives the library a understanding what Buttons …","This item is to chose between Black or White","Just a const for the DOWN button","Just a const for the DOWN button","","This struct to store and read structs objects to eeprom …","Use this struct to store and read single bytes to/from …","The standard font size of the arduboy","Just a const for the green led","The standard height of the arduboy","","Just a const for the LEFT button","Just a const for the LEFT button","","","This struct is used by a few Arduboy functions.","","Just a const for the red led","Just a const for led off","Just a const for led on","Just a const for the RIGHT button","Just a const for the RIGHT button","This struct is used by a few Arduboy functions.","Just a const for the UP button","Just a const for the UP button","The standard width of the arduboy","Led is on","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","","","","","","","","","","A list of all six buttons available on the Arduboy","Equivalent to C’s char type.","Equivalent to C’s double type.","Equivalent to C’s float type.","Equivalent to C’s signed int (int) type.","Equivalent to C’s signed long (long) type.","Equivalent to C’s signed long long (long long) type.","Equivalent to C’s size_t type, from stddef.h (or cstddef …","Equivalent to C’s unsigned char type.","Equivalent to C’s unsigned int type.","Equivalent to C’s unsigned long type.","Equivalent to C’s unsigned long long type.","","","","","","","A Arduino function to pause the cpu circles for a given …","","","This is the way to go if you want print some random text","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Create a const raw pointer to a sprite as u8, without …","Create a const raw pointer to a [u8;_] that saves text, …","Create a const raw pointer to a sprite as u16, without …","","","Rect height","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","A list of all LED variables available","","","","","","","","Create a space for Progrem variable","","A Arduino function to get a random number between 2 numbers","A Arduino function to get a random number smaller than the …","","This is the module to interact in a save way with the …","A C function to get the length of a string","","","","","","","","","","","","","","Rect width","","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","The standard font size of the arduboy","The standard height of the arduboy","This struct is used by a few Arduboy functions.","This struct is used by a few Arduboy functions.","The standard width of the arduboy","Led is on","Get the current sound state.","Turn sound off (mute).","Turn sound on.","Combines the use function of audio_on() and …","Save the current sound state in EEPROM.","Toggle the sound on/off state.","Initialize the hardware, display the boot logo, provide …","","","","","","","","","Clear the display buffer and set the text cursor to …","","","Test if a point falls within a rectangle.","Test if a rectangle is intersecting with another rectangle.","Set the RGB LEDs digitally, to either fully on or fully …","Set one of the RGB LEDs digitally, to either fully on or …","Copy the contents of the display buffer to the display. …","Copy the contents of the display buffer to the display. …","Draw a circle of a given radius.","Draw a horizontal line.","Draw a vertical line.","Set a single pixel in the display buffer to the specified …","Draw a rectangle of a specified width and height.","Draw a rectangle with rounded corners.","Draw a triangle given the coordinates of each corner.","","Indicate if the specified number of frames has elapsed.","Draw a filled-in circle of a given radius.","Draw a filled-in rectangle of a specified width and height.","Draw a filled-in rectangle with rounded corners.","Draw a filled-in triangle given the coordinates of each …","Flip the display horizontally or set it back to normal.","Flip the display vertically or set it back to normal.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the state of the given pixel in the screen buffer.","","Rect height","Idle the CPU to save power.","Seed the random number generator with a random value.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Invert the entire display or set it back to normal.","Check if a button has just been pressed.","Check if a button has just been released.","gives you a new instans of the Arduboy2","Indicate that it’s time to render the next frame.","","Test if the specified buttons are not pressed.","","Poll the buttons and track their state over time.","Test if the all of the specified buttons are pressed.","The Arduino Print class is available for writing text to …","Set the location of the text cursor.","Set the X coordinate of the text cursor location.","Set the Y coordinate of the text cursor location.","Set the frame rate used by the frame control functions.","Set the text background color.","Set the text foreground color.","Set the text character size.","Set or disable text wrap mode.","","","","","","","","","","","","","Rect width","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","A list of all tones available and used by the Sounds …","","","Returns the argument unchanged.","Calls U::from(self).","Get a new instance of ArduboyTones","Stop playing the tone or sequence.","Check if a tone or tone sequence is playing.","Play a single tone.","Play two tones in sequence.","Play three tones in sequence.","Play a tone sequence from frequency/duration pairs in a …","Play a tone sequence from frequency/duration pairs in an …","","","","Set the volume to always normal, always high, or tone …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Just a const for the A button","Just a const for the A button","Just a const for the B button","Just a const for the B button","This struct gives the library a understanding what Buttons …","Just a const for the DOWN button","Just a const for the DOWN button","Just a const for the LEFT button","Just a const for the LEFT button","Just a const for the RIGHT button","Just a const for the RIGHT button","Just a const for the UP button","Just a const for the UP button","","Just a const for the blue led","Just a const for the green led","Just a const for the red led","Just a const for led off","Just a const for led on","“Erase” a sprite.","Draw a sprite using a separate image and mask array.","Draw a sprite by replacing the existing content completely.","Draw a sprite using an array containing both image and …","Draw a sprite using only the bits set to 1.","“Erase” a sprite.","Draw a sprite using a separate image and mask array.","Draw a sprite by replacing the existing content completely.","Draw a sprite using an array containing both image and …","Draw a sprite using only the bits set to 1."],"i":[0,0,21,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,21,23,23,23,22,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,5,21,0,0,0,0,5,0,0,0,0,0,5,0,0,5,24,0,0,0,0,0,0,0,0,0,0,0,21,0,0,3,11,13,3,5,11,13,3,5,0,0,0,0,0,0,0,0,0,0,0,0,3,5,3,5,0,24,0,3,5,0,3,3,5,11,13,3,5,11,11,0,0,0,3,5,23,11,13,11,13,3,5,0,11,13,3,5,24,24,24,0,11,0,0,13,0,0,11,13,3,5,11,13,3,5,11,13,3,5,13,23,13,23,22,23,22,0,21,0,0,0,0,0,0,21,20,20,20,20,20,20,20,23,22,20,21,23,22,20,21,20,21,21,20,20,20,20,20,20,20,20,20,20,20,20,20,21,20,20,20,20,20,20,20,21,23,22,20,21,20,21,23,20,20,23,22,20,21,20,20,20,20,20,21,20,21,20,20,20,20,20,20,20,20,20,20,20,23,22,20,21,23,22,20,21,23,22,20,21,23,23,22,23,22,0,0,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1,2],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[3,4],[3,4],[3,4],[3,4],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[3,3],3],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,[3,3],[5,5],[[3,3],6],[[5,5],6],[[7,7,7],7],[[]],[8],[[3,3],4],[[5,5],4],0,0,[[3,9],10],[[5,9],10],[[]],[[]],[[]],[[]],[11],[11],0,0,0,[[3,12]],[[5,12]],0,[11],[13],[[]],[[]],[[]],[[]],0,[14,11],[14,13],[[3,3],[[15,[6]]]],[[5,5],[[15,[6]]]],[[]],[[]],[[]],0,[11],[[16,16],16],[16,16],[13,17],0,[1,2],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],19],[[],19],[[],19],[[],19],[[13,17]],0,[[13,17]],0,0,0,0,0,0,0,0,0,0,0,0,0,[20,4],[20],[20],[20],[20],[20],[20],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[20],[21,21],[[21,21],6],[[20,22,23],4],[[20,23,23],4],[[20,17,17,17]],[[20,17,17]],[20],[20],[[20,14,14,17,21]],[[20,14,14,17,21]],[[20,14,14,17,21]],[[20,14,14,21]],[[20,14,14,17,17,21]],[[20,14,14,17,17,17,21]],[[20,14,14,14,14,14,14,21]],[[21,21],4],[[20,17],4],[[20,14,14,17,21]],[[20,14,14,17,17,21]],[[20,14,14,17,17,17,21]],[[20,14,14,14,14,14,14,21]],[[20,4]],[[20,4]],[[21,9],10],[[]],[[]],[[]],[[]],[[20,17,17],21],[[21,12]],0,[20],[20],[[]],[[]],[[]],[[]],[[20,4]],[[20,3],4],[[20,3],4],[[],20],[20,4],[21],[[20,3],4],[[21,21],[[15,[6]]]],[20],[[20,3],4],[[20,24]],[[20,14,14]],[[20,14]],[[20,14]],[[20,17]],[[20,21]],[[20,21]],[[20,17]],[[20,4]],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],19],[[],19],[[],19],[[],19],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[],25],[25],[25,4],[[25,26,8]],[[25,26,8,26,8]],[[25,26,8,26,8,26,8]],[[25,26]],[[25,8]],[[],18],[[],18],[[],19],[[25,17]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[14,14,17,17]],[[14,14,17,17,17,17]],[[14,14,17,17]],[[14,14,17,17]],[[14,14,17,17]],[[14,14,17,17]],[[14,14,17,17,17,17]],[[14,14,17,17]],[[14,14,17,17]],[[14,14,17,17]]],"c":[],"p":[[15,"i8"],[15,"usize"],[3,"ButtonSet"],[15,"bool"],[4,"Base"],[4,"Ordering"],[8,"Ord"],[15,"u32"],[3,"Formatter"],[6,"Result"],[3,"EEPROM"],[8,"Hasher"],[3,"EEPROMBYTE"],[15,"i16"],[4,"Option"],[15,"i32"],[15,"u8"],[4,"Result"],[3,"TypeId"],[3,"Arduboy2"],[4,"Color"],[3,"Point"],[3,"Rect"],[8,"Printable"],[3,"ArduboyTones"],[15,"u16"]]},\
    +"arduboy_rust":{"doc":"This is the arduboy_rust crate To get started import the …","t":"DDNEDDRRRNAAAAOOOOAAOADNERRDDRNMMMMMMDARRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRFFFFAARRRRDRRRRRRRRMLLLLRRRRRRRDDRRRENNDERRNDDRRRNRRNQDIRRRRRDRRRNAALLLLLLLLLAGGGGGGGGGGGLLLLFKFLLOMLLLLLLLLOOOLLMLLLLLLALLLLLLKOLFFLAFLLLLLLLLLLLLLMLMMMMDNERRDDRNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMDALLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDRRRRRRRRMRRRRRFFFFFFFFFF","n":["Arduboy2","ArduboyTones","Black","Color","EEPROM","EEPROMBYTE","FONT_SIZE","HEIGHT","WIDTH","White","arduboy2","arduboy_tone","arduino","c","f","get_sprite_addr","get_string_addr","get_tones_addr","hardware","prelude","progmem","sprites","Arduboy2","Black","Color","FONT_SIZE","HEIGHT","Point","Rect","WIDTH","White","height","width","x","x","y","y","ArduboyTones","arduboy_tone_pitch","NOTE_A0","NOTE_A0H","NOTE_A1","NOTE_A1H","NOTE_A2","NOTE_A2H","NOTE_A3","NOTE_A3H","NOTE_A4","NOTE_A4H","NOTE_A5","NOTE_A5H","NOTE_A6","NOTE_A6H","NOTE_A7","NOTE_A7H","NOTE_A8","NOTE_A8H","NOTE_A9","NOTE_A9H","NOTE_AS0","NOTE_AS0H","NOTE_AS1","NOTE_AS1H","NOTE_AS2","NOTE_AS2H","NOTE_AS3","NOTE_AS3H","NOTE_AS4","NOTE_AS4H","NOTE_AS5","NOTE_AS5H","NOTE_AS6","NOTE_AS6H","NOTE_AS7","NOTE_AS7H","NOTE_AS8","NOTE_AS8H","NOTE_AS9","NOTE_AS9H","NOTE_B0","NOTE_B0H","NOTE_B1","NOTE_B1H","NOTE_B2","NOTE_B2H","NOTE_B3","NOTE_B3H","NOTE_B4","NOTE_B4H","NOTE_B5","NOTE_B5H","NOTE_B6","NOTE_B6H","NOTE_B7","NOTE_B7H","NOTE_B8","NOTE_B8H","NOTE_B9","NOTE_B9H","NOTE_C0","NOTE_C0H","NOTE_C1","NOTE_C1H","NOTE_C2","NOTE_C2H","NOTE_C3","NOTE_C3H","NOTE_C4","NOTE_C4H","NOTE_C5","NOTE_C5H","NOTE_C6","NOTE_C6H","NOTE_C7","NOTE_C7H","NOTE_C8","NOTE_C8H","NOTE_C9","NOTE_C9H","NOTE_CS0","NOTE_CS0H","NOTE_CS1","NOTE_CS1H","NOTE_CS2","NOTE_CS2H","NOTE_CS3","NOTE_CS3H","NOTE_CS4","NOTE_CS4H","NOTE_CS5","NOTE_CS5H","NOTE_CS6","NOTE_CS6H","NOTE_CS7","NOTE_CS7H","NOTE_CS8","NOTE_CS8H","NOTE_CS9","NOTE_CS9H","NOTE_D0","NOTE_D0H","NOTE_D1","NOTE_D1H","NOTE_D2","NOTE_D2H","NOTE_D3","NOTE_D3H","NOTE_D4","NOTE_D4H","NOTE_D5","NOTE_D5H","NOTE_D6","NOTE_D6H","NOTE_D7","NOTE_D7H","NOTE_D8","NOTE_D8H","NOTE_D9","NOTE_D9H","NOTE_DS0","NOTE_DS0H","NOTE_DS1","NOTE_DS1H","NOTE_DS2","NOTE_DS2H","NOTE_DS3","NOTE_DS3H","NOTE_DS4","NOTE_DS4H","NOTE_DS5","NOTE_DS5H","NOTE_DS6","NOTE_DS6H","NOTE_DS7","NOTE_DS7H","NOTE_DS8","NOTE_DS8H","NOTE_DS9","NOTE_DS9H","NOTE_E0","NOTE_E0H","NOTE_E1","NOTE_E1H","NOTE_E2","NOTE_E2H","NOTE_E3","NOTE_E3H","NOTE_E4","NOTE_E4H","NOTE_E5","NOTE_E5H","NOTE_E6","NOTE_E6H","NOTE_E7","NOTE_E7H","NOTE_E8","NOTE_E8H","NOTE_E9","NOTE_E9H","NOTE_F0","NOTE_F0H","NOTE_F1","NOTE_F1H","NOTE_F2","NOTE_F2H","NOTE_F3","NOTE_F3H","NOTE_F4","NOTE_F4H","NOTE_F5","NOTE_F5H","NOTE_F6","NOTE_F6H","NOTE_F7","NOTE_F7H","NOTE_F8","NOTE_F8H","NOTE_F9","NOTE_F9H","NOTE_FS0","NOTE_FS0H","NOTE_FS1","NOTE_FS1H","NOTE_FS2","NOTE_FS2H","NOTE_FS3","NOTE_FS3H","NOTE_FS4","NOTE_FS4H","NOTE_FS5","NOTE_FS5H","NOTE_FS6","NOTE_FS6H","NOTE_FS7","NOTE_FS7H","NOTE_FS8","NOTE_FS8H","NOTE_FS9","NOTE_FS9H","NOTE_G0","NOTE_G0H","NOTE_G1","NOTE_G1H","NOTE_G2","NOTE_G2H","NOTE_G3","NOTE_G3H","NOTE_G4","NOTE_G4H","NOTE_G5","NOTE_G5H","NOTE_G6","NOTE_G6H","NOTE_G7","NOTE_G7H","NOTE_G8","NOTE_G8H","NOTE_G9","NOTE_G9H","NOTE_GS0","NOTE_GS0H","NOTE_GS1","NOTE_GS1H","NOTE_GS2","NOTE_GS2H","NOTE_GS3","NOTE_GS3H","NOTE_GS4","NOTE_GS4H","NOTE_GS5","NOTE_GS5H","NOTE_GS6","NOTE_GS6H","NOTE_GS7","NOTE_GS7H","NOTE_GS8","NOTE_GS8H","NOTE_GS9","NOTE_GS9H","NOTE_REST","TONES_END","TONES_REPEAT","TONE_HIGH_VOLUME","VOLUME_ALWAYS_HIGH","VOLUME_ALWAYS_NORMAL","VOLUME_IN_TONE","delay","random_between","random_less_than","strlen","buttons","led","A","A_BUTTON","B","B_BUTTON","ButtonSet","DOWN","DOWN_BUTTON","LEFT","LEFT_BUTTON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON","flag_set","just_pressed","just_released","not_pressed","pressed","BLUE_LED","GREEN_LED","RED_LED","RGB_OFF","RGB_ON","A","A_BUTTON","Arduboy2","ArduboyTones","B","BLUE_LED","B_BUTTON","Base","Bin","Black","ButtonSet","Color","DOWN","DOWN_BUTTON","Dec","EEPROM","EEPROMBYTE","FONT_SIZE","GREEN_LED","HEIGHT","Hex","LEFT","LEFT_BUTTON","Oct","Parameters","Point","Printable","RED_LED","RGB_OFF","RGB_ON","RIGHT","RIGHT_BUTTON","Rect","UP","UP_BUTTON","WIDTH","White","arduboy2","arduboy_tone","bitor","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","buttons","c_char","c_double","c_float","c_int","c_long","c_longlong","c_size_t","c_uchar","c_uint","c_ulong","c_ulonglong","clone","clone","cmp","cmp","constrain","default_parameters","delay","eq","eq","f","flag_set","fmt","fmt","from","from","from","from","get","get_direct","get_sprite_addr","get_string_addr","get_tones_addr","hash","hash","height","init","init","into","into","into","into","led","new","new","partial_cmp","partial_cmp","print","print","print_2","progmem","put","random_between","random_less_than","read","sprites","strlen","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","update","width","write","x","x","y","y","Arduboy2","Black","Color","FONT_SIZE","HEIGHT","Point","Rect","WIDTH","White","audio_enabled","audio_off","audio_on","audio_on_and_save","audio_save_on_off","audio_toggle","begin","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clear","clone","cmp","collide_point","collide_rect","digital_write_rgb","digital_write_rgb_single","display","display_and_clear_buffer","draw_circle","draw_fast_hline","draw_fast_vline","draw_pixel","draw_rect","draw_round_rect","draw_triangle","eq","every_x_frames","fill_circle","fill_rect","fill_round_rect","fill_triangle","flip_horizontal","flip_vertical","fmt","from","from","from","from","get_pixel","hash","height","idle","init_random_seed","into","into","into","into","invert","just_pressed","just_released","new","next_frame","not","not_pressed","partial_cmp","poll_buttons","pressed","print","set_cursor","set_cursor_x","set_cursor_y","set_frame_rate","set_text_background_color","set_text_color","set_text_size","set_text_wrap","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","width","x","x","y","y","ArduboyTones","arduboy_tone_pitch","borrow","borrow_mut","from","into","new","no_tone","playing","tone","tone2","tone3","tones","tones_in_ram","try_from","try_into","type_id","volume_mode","NOTE_A0","NOTE_A0H","NOTE_A1","NOTE_A1H","NOTE_A2","NOTE_A2H","NOTE_A3","NOTE_A3H","NOTE_A4","NOTE_A4H","NOTE_A5","NOTE_A5H","NOTE_A6","NOTE_A6H","NOTE_A7","NOTE_A7H","NOTE_A8","NOTE_A8H","NOTE_A9","NOTE_A9H","NOTE_AS0","NOTE_AS0H","NOTE_AS1","NOTE_AS1H","NOTE_AS2","NOTE_AS2H","NOTE_AS3","NOTE_AS3H","NOTE_AS4","NOTE_AS4H","NOTE_AS5","NOTE_AS5H","NOTE_AS6","NOTE_AS6H","NOTE_AS7","NOTE_AS7H","NOTE_AS8","NOTE_AS8H","NOTE_AS9","NOTE_AS9H","NOTE_B0","NOTE_B0H","NOTE_B1","NOTE_B1H","NOTE_B2","NOTE_B2H","NOTE_B3","NOTE_B3H","NOTE_B4","NOTE_B4H","NOTE_B5","NOTE_B5H","NOTE_B6","NOTE_B6H","NOTE_B7","NOTE_B7H","NOTE_B8","NOTE_B8H","NOTE_B9","NOTE_B9H","NOTE_C0","NOTE_C0H","NOTE_C1","NOTE_C1H","NOTE_C2","NOTE_C2H","NOTE_C3","NOTE_C3H","NOTE_C4","NOTE_C4H","NOTE_C5","NOTE_C5H","NOTE_C6","NOTE_C6H","NOTE_C7","NOTE_C7H","NOTE_C8","NOTE_C8H","NOTE_C9","NOTE_C9H","NOTE_CS0","NOTE_CS0H","NOTE_CS1","NOTE_CS1H","NOTE_CS2","NOTE_CS2H","NOTE_CS3","NOTE_CS3H","NOTE_CS4","NOTE_CS4H","NOTE_CS5","NOTE_CS5H","NOTE_CS6","NOTE_CS6H","NOTE_CS7","NOTE_CS7H","NOTE_CS8","NOTE_CS8H","NOTE_CS9","NOTE_CS9H","NOTE_D0","NOTE_D0H","NOTE_D1","NOTE_D1H","NOTE_D2","NOTE_D2H","NOTE_D3","NOTE_D3H","NOTE_D4","NOTE_D4H","NOTE_D5","NOTE_D5H","NOTE_D6","NOTE_D6H","NOTE_D7","NOTE_D7H","NOTE_D8","NOTE_D8H","NOTE_D9","NOTE_D9H","NOTE_DS0","NOTE_DS0H","NOTE_DS1","NOTE_DS1H","NOTE_DS2","NOTE_DS2H","NOTE_DS3","NOTE_DS3H","NOTE_DS4","NOTE_DS4H","NOTE_DS5","NOTE_DS5H","NOTE_DS6","NOTE_DS6H","NOTE_DS7","NOTE_DS7H","NOTE_DS8","NOTE_DS8H","NOTE_DS9","NOTE_DS9H","NOTE_E0","NOTE_E0H","NOTE_E1","NOTE_E1H","NOTE_E2","NOTE_E2H","NOTE_E3","NOTE_E3H","NOTE_E4","NOTE_E4H","NOTE_E5","NOTE_E5H","NOTE_E6","NOTE_E6H","NOTE_E7","NOTE_E7H","NOTE_E8","NOTE_E8H","NOTE_E9","NOTE_E9H","NOTE_F0","NOTE_F0H","NOTE_F1","NOTE_F1H","NOTE_F2","NOTE_F2H","NOTE_F3","NOTE_F3H","NOTE_F4","NOTE_F4H","NOTE_F5","NOTE_F5H","NOTE_F6","NOTE_F6H","NOTE_F7","NOTE_F7H","NOTE_F8","NOTE_F8H","NOTE_F9","NOTE_F9H","NOTE_FS0","NOTE_FS0H","NOTE_FS1","NOTE_FS1H","NOTE_FS2","NOTE_FS2H","NOTE_FS3","NOTE_FS3H","NOTE_FS4","NOTE_FS4H","NOTE_FS5","NOTE_FS5H","NOTE_FS6","NOTE_FS6H","NOTE_FS7","NOTE_FS7H","NOTE_FS8","NOTE_FS8H","NOTE_FS9","NOTE_FS9H","NOTE_G0","NOTE_G0H","NOTE_G1","NOTE_G1H","NOTE_G2","NOTE_G2H","NOTE_G3","NOTE_G3H","NOTE_G4","NOTE_G4H","NOTE_G5","NOTE_G5H","NOTE_G6","NOTE_G6H","NOTE_G7","NOTE_G7H","NOTE_G8","NOTE_G8H","NOTE_G9","NOTE_G9H","NOTE_GS0","NOTE_GS0H","NOTE_GS1","NOTE_GS1H","NOTE_GS2","NOTE_GS2H","NOTE_GS3","NOTE_GS3H","NOTE_GS4","NOTE_GS4H","NOTE_GS5","NOTE_GS5H","NOTE_GS6","NOTE_GS6H","NOTE_GS7","NOTE_GS7H","NOTE_GS8","NOTE_GS8H","NOTE_GS9","NOTE_GS9H","NOTE_REST","TONES_END","TONES_REPEAT","TONE_HIGH_VOLUME","VOLUME_ALWAYS_HIGH","VOLUME_ALWAYS_NORMAL","VOLUME_IN_TONE","A","A_BUTTON","B","B_BUTTON","ButtonSet","DOWN","DOWN_BUTTON","LEFT","LEFT_BUTTON","RIGHT","RIGHT_BUTTON","UP","UP_BUTTON","flag_set","BLUE_LED","GREEN_LED","RED_LED","RGB_OFF","RGB_ON","draw_erase","draw_external_mask","draw_override","draw_plus_mask","draw_self_masked","draw_erase","draw_external_mask","draw_override","draw_plus_mask","draw_self_masked"],"q":[[0,"arduboy_rust"],[22,"arduboy_rust::arduboy2"],[37,"arduboy_rust::arduboy_tone"],[39,"arduboy_rust::arduboy_tone::arduboy_tone_pitch"],[286,"arduboy_rust::arduino"],[289,"arduboy_rust::c"],[290,"arduboy_rust::hardware"],[292,"arduboy_rust::hardware::buttons"],[310,"arduboy_rust::hardware::led"],[315,"arduboy_rust::prelude"],[440,"arduboy_rust::prelude::arduboy2"],[538,"arduboy_rust::prelude::arduboy_tone"],[556,"arduboy_rust::prelude::arduboy_tone::arduboy_tone_pitch"],[803,"arduboy_rust::prelude::buttons"],[817,"arduboy_rust::prelude::led"],[822,"arduboy_rust::prelude::sprites"],[827,"arduboy_rust::sprites"]],"d":["This is the struct to interact in a save way with the …","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","This struct to store and read structs objects to/from …","Use this struct to store and read single bytes to/from …","The standard font size of the arduboy","The standard height of the arduboy","The standard width of the arduboy","Led is on","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","Clib functions you can use on the Arduboy","This is the way to go if you want print some random text","Create a const raw pointer to a sprite as u8, without …","Create a const raw pointer to a [u8;_] that saves text, …","Create a const raw pointer to a sprite as u16, without …","This is the Module to interact in a save way with the …","This is the important one to use this library effective in …","Create a space for Progmem variable","This is the module to interact in a save way with the …","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","The standard font size of the arduboy","The standard height of the arduboy","This struct is used by a few Arduboy functions.","This struct is used by a few Arduboy functions.","The standard width of the arduboy","Led is on","Rect height","Rect width","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","A list of all tones available and used by the Sounds …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A Arduino function to pause the cpu circles for a given …","A Arduino function to get a random number between 2 numbers","A Arduino function to get a random number smaller than the …","A C function to get the length of a string","A list of all six buttons available on the Arduboy","A list of all LED variables available","Just a const for the A button","Just a const for the A button","Just a const for the B button","Just a const for the B button","This struct gives the library a understanding what Buttons …","Just a const for the DOWN button","Just a const for the DOWN button","Just a const for the LEFT button","Just a const for the LEFT button","Just a const for the RIGHT button","Just a const for the RIGHT button","Just a const for the UP button","Just a const for the UP button","","","","","","Just a const for the blue led","Just a const for the green led","Just a const for the red led","Just a const for led off","Just a const for led on","Just a const for the A button","Just a const for the A button","This is the struct to interact in a save way with the …","This is the struct to interact in a save way with the …","Just a const for the B button","Just a const for the blue led","Just a const for the B button","","","Led is off","This struct gives the library a understanding what Buttons …","This item is to chose between Black or White","Just a const for the DOWN button","Just a const for the DOWN button","","This struct to store and read structs objects to/from …","Use this struct to store and read single bytes to/from …","The standard font size of the arduboy","Just a const for the green led","The standard height of the arduboy","","Just a const for the LEFT button","Just a const for the LEFT button","","","This struct is used by a few Arduboy functions.","","Just a const for the red led","Just a const for led off","Just a const for led on","Just a const for the RIGHT button","Just a const for the RIGHT button","This struct is used by a few Arduboy functions.","Just a const for the UP button","Just a const for the UP button","The standard width of the arduboy","Led is on","This is the Module to interact in a save way with the …","This is the Module to interact in a save way with the …","","","","","","","","","","A list of all six buttons available on the Arduboy","Equivalent to C’s char type.","Equivalent to C’s double type.","Equivalent to C’s float type.","Equivalent to C’s signed int (int) type.","Equivalent to C’s signed long (long) type.","Equivalent to C’s signed long long (long long) type.","Equivalent to C’s size_t type, from stddef.h (or cstddef …","Equivalent to C’s unsigned char type.","Equivalent to C’s unsigned int type.","Equivalent to C’s unsigned long type.","Equivalent to C’s unsigned long long type.","","","","","","","A Arduino function to pause the cpu circles for a given …","","","This is the way to go if you want print some random text","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Create a const raw pointer to a sprite as u8, without …","Create a const raw pointer to a [u8;_] that saves text, …","Create a const raw pointer to a sprite as u16, without …","","","Rect height","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","A list of all LED variables available","","","","","","","","Create a space for Progmem variable","","A Arduino function to get a random number between 2 numbers","A Arduino function to get a random number smaller than the …","","This is the module to interact in a save way with the …","A C function to get the length of a string","","","","","","","","","","","","","","Rect width","","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","Led is off","This item is to chose between Black or White","The standard font size of the arduboy","The standard height of the arduboy","This struct is used by a few Arduboy functions.","This struct is used by a few Arduboy functions.","The standard width of the arduboy","Led is on","Get the current sound state.","Turn sound off (mute).","Turn sound on.","Combines the use function of audio_on() and …","Save the current sound state in EEPROM.","Toggle the sound on/off state.","Initialize the hardware, display the boot logo, provide …","","","","","","","","","Clear the display buffer and set the text cursor to …","","","Test if a point falls within a rectangle.","Test if a rectangle is intersecting with another rectangle.","Set the RGB LEDs digitally, to either fully on or fully …","Set one of the RGB LEDs digitally, to either fully on or …","Copy the contents of the display buffer to the display. …","Copy the contents of the display buffer to the display. …","Draw a circle of a given radius.","Draw a horizontal line.","Draw a vertical line.","Set a single pixel in the display buffer to the specified …","Draw a rectangle of a specified width and height.","Draw a rectangle with rounded corners.","Draw a triangle given the coordinates of each corner.","","Indicate if the specified number of frames has elapsed.","Draw a filled-in circle of a given radius.","Draw a filled-in rectangle of a specified width and height.","Draw a filled-in rectangle with rounded corners.","Draw a filled-in triangle given the coordinates of each …","Flip the display horizontally or set it back to normal.","Flip the display vertically or set it back to normal.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the state of the given pixel in the screen buffer.","","Rect height","Idle the CPU to save power.","Seed the random number generator with a random value.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Invert the entire display or set it back to normal.","Check if a button has just been pressed.","Check if a button has just been released.","gives you a new instans of the Arduboy2","Indicate that it’s time to render the next frame.","","Test if the specified buttons are not pressed.","","Poll the buttons and track their state over time.","Test if the all of the specified buttons are pressed.","The Arduino Print class is available for writing text to …","Set the location of the text cursor.","Set the X coordinate of the text cursor location.","Set the Y coordinate of the text cursor location.","Set the frame rate used by the frame control functions.","Set the text background color.","Set the text foreground color.","Set the text character size.","Set or disable text wrap mode.","","","","","","","","","","","","","Rect width","Position X","Position X","Position Y","Position Y","This is the struct to interact in a save way with the …","A list of all tones available and used by the Sounds …","","","Returns the argument unchanged.","Calls U::from(self).","Get a new instance of ArduboyTones","Stop playing the tone or sequence.","Check if a tone or tone sequence is playing.","Play a single tone.","Play two tones in sequence.","Play three tones in sequence.","Play a tone sequence from frequency/duration pairs in a …","Play a tone sequence from frequency/duration pairs in an …","","","","Set the volume to always normal, always high, or tone …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Just a const for the A button","Just a const for the A button","Just a const for the B button","Just a const for the B button","This struct gives the library a understanding what Buttons …","Just a const for the DOWN button","Just a const for the DOWN button","Just a const for the LEFT button","Just a const for the LEFT button","Just a const for the RIGHT button","Just a const for the RIGHT button","Just a const for the UP button","Just a const for the UP button","","Just a const for the blue led","Just a const for the green led","Just a const for the red led","Just a const for led off","Just a const for led on","“Erase” a sprite.","Draw a sprite using a separate image and mask array.","Draw a sprite by replacing the existing content completely.","Draw a sprite using an array containing both image and …","Draw a sprite using only the bits set to 1.","“Erase” a sprite.","Draw a sprite using a separate image and mask array.","Draw a sprite by replacing the existing content completely.","Draw a sprite using an array containing both image and …","Draw a sprite using only the bits set to 1."],"i":[0,0,21,0,0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0,0,0,0,21,23,23,23,22,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,7,21,0,0,0,0,7,0,0,0,0,0,7,0,0,7,24,0,0,0,0,0,0,0,0,0,0,0,21,0,0,5,12,14,5,7,12,14,5,7,0,0,0,0,0,0,0,0,0,0,0,0,5,7,5,7,0,24,0,5,7,0,5,5,7,12,14,5,7,12,12,0,0,0,5,7,23,12,14,12,14,5,7,0,12,14,5,7,24,24,24,0,12,0,0,14,0,0,12,14,5,7,12,14,5,7,12,14,5,7,14,23,14,23,22,23,22,0,21,0,0,0,0,0,0,21,20,20,20,20,20,20,20,23,22,20,21,23,22,20,21,20,21,21,20,20,20,20,20,20,20,20,20,20,20,20,20,21,20,20,20,20,20,20,20,21,23,22,20,21,20,21,23,20,20,23,22,20,21,20,20,20,20,20,21,20,21,20,20,20,20,20,20,20,20,20,20,20,23,22,20,21,23,22,20,21,23,22,20,21,23,23,22,23,22,0,0,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[1],[[2,2],2],[2,2],[3,4],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[5,6],[5,6],[5,6],[5,6],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[5,5],5],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,0,0,0,0,0,0,[5,5],[7,7],[[5,5],8],[[7,7],8],[[9,9,9],9],[[]],[1],[[5,5],6],[[7,7],6],0,0,[[5,10],11],[[7,10],11],[[]],[[]],[[]],[[]],[12],[12],0,0,0,[[5,13]],[[7,13]],0,[12],[14],[[]],[[]],[[]],[[]],0,[15,12],[15,14],[[5,5],[[16,[8]]]],[[7,7],[[16,[8]]]],[[]],[[]],[[]],0,[12],[[2,2],2],[2,2],[14,17],0,[3,4],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],19],[[],19],[[],19],[[],19],[[14,17]],0,[[14,17]],0,0,0,0,0,0,0,0,0,0,0,0,0,[20,6],[20],[20],[20],[20],[20],[20],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[20],[21,21],[[21,21],8],[[20,22,23],6],[[20,23,23],6],[[20,17,17,17]],[[20,17,17]],[20],[20],[[20,15,15,17,21]],[[20,15,15,17,21]],[[20,15,15,17,21]],[[20,15,15,21]],[[20,15,15,17,17,21]],[[20,15,15,17,17,17,21]],[[20,15,15,15,15,15,15,21]],[[21,21],6],[[20,17],6],[[20,15,15,17,21]],[[20,15,15,17,17,21]],[[20,15,15,17,17,17,21]],[[20,15,15,15,15,15,15,21]],[[20,6]],[[20,6]],[[21,10],11],[[]],[[]],[[]],[[]],[[20,17,17],21],[[21,13]],0,[20],[20],[[]],[[]],[[]],[[]],[[20,6]],[[20,5],6],[[20,5],6],[[],20],[20,6],[21],[[20,5],6],[[21,21],[[16,[8]]]],[20],[[20,5],6],[[20,24]],[[20,15,15]],[[20,15]],[[20,15]],[[20,17]],[[20,21]],[[20,21]],[[20,17]],[[20,6]],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],18],[[],19],[[],19],[[],19],[[],19],0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[],25],[25],[25,6],[[25,26,1]],[[25,26,1,26,1]],[[25,26,1,26,1,26,1]],[[25,26]],[[25,1]],[[],18],[[],18],[[],19],[[25,17]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[15,15,17,17]],[[15,15,17,17,17,17]],[[15,15,17,17]],[[15,15,17,17]],[[15,15,17,17]],[[15,15,17,17]],[[15,15,17,17,17,17]],[[15,15,17,17]],[[15,15,17,17]],[[15,15,17,17]]],"c":[],"p":[[15,"u32"],[15,"i32"],[15,"i8"],[15,"usize"],[3,"ButtonSet"],[15,"bool"],[4,"Base"],[4,"Ordering"],[8,"Ord"],[3,"Formatter"],[6,"Result"],[3,"EEPROM"],[8,"Hasher"],[3,"EEPROMBYTE"],[15,"i16"],[4,"Option"],[15,"u8"],[4,"Result"],[3,"TypeId"],[3,"Arduboy2"],[4,"Color"],[3,"Point"],[3,"Rect"],[8,"Printable"],[3,"ArduboyTones"],[15,"u16"]]},\
     "panic_halt":{"doc":"Set the panicking behavior to halt","t":"","n":[],"q":[],"d":[],"i":[],"f":[],"c":[],"p":[]}\
     }');
     if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)};
    diff --git a/docs/doc/src/arduboy_rust/lib.rs.html b/docs/doc/src/arduboy_rust/lib.rs.html
    index 320c503..3298088 100644
    --- a/docs/doc/src/arduboy_rust/lib.rs.html
    +++ b/docs/doc/src/arduboy_rust/lib.rs.html
    @@ -11,9 +11,23 @@
     11
     12
     13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
     
    #![cfg(target_arch = "avr")]
     #![no_std]
     #![feature(c_size_t)]
    +//! This is the arduboy_rust crate
    +//! To get started import the [prelude] to your project.
    +//!
    +//! Import the module:
    +//! ```
    +//! use arduboy_rust::prelude::*;
    +//! ```
     
     extern crate panic_halt;
     pub mod hardware;
    @@ -23,5 +37,5 @@
     pub use crate::library::arduboy2::{self, Arduboy2, Color, FONT_SIZE, HEIGHT, WIDTH};
     pub use crate::library::arduboy_tone::{self, ArduboyTones};
     pub use crate::library::eeprom::{EEPROM, EEPROMBYTE};
    -pub use crate::library::{c, sprites};
    +pub use crate::library::{arduino, c, sprites};
     
    \ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/arduboy2.rs.html b/docs/doc/src/arduboy_rust/library/arduboy2.rs.html index aa52513..1b3eb62 100644 --- a/docs/doc/src/arduboy_rust/library/arduboy2.rs.html +++ b/docs/doc/src/arduboy_rust/library/arduboy2.rs.html @@ -751,51 +751,9 @@ 751 752 753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795
    //! This is the Module to interact in a save way with the Arduboy2 C++ library.
     //!
    -//! All of the functions are safe wrapped inside the struct.
    +//! All of the functions are safe wrapped inside the [Arduboy2] struct.
     #![allow(dead_code)]
     use crate::hardware::buttons::ButtonSet;
     use crate::print::Printable;
    @@ -888,11 +846,9 @@
         ///
         ///### Parameters:
         ///
    -    ///x	The X coordinate of the left start point.
    -    ///
    -    ///y	The Y coordinate of the left start point.
    -    ///
    -    ///w	The width of the line.
    +    ///- x	The X coordinate of the left start point.
    +    ///- y	The Y coordinate of the left start point.
    +    ///- w	The width of the line.
         ///
         ///color	The color of the line (optional; defaults to WHITE).
         pub fn draw_fast_hline(&self, x: i16, y: i16, w: u8, color: Color) {
    @@ -902,11 +858,9 @@
         ///
         ///### Parameters:
         ///
    -    ///x	The X coordinate of the left start point.
    -    ///
    -    ///y	The Y coordinate of the left start point.
    -    ///
    -    ///h	The height of the line.
    +    ///- x	The X coordinate of the left start point.
    +    ///- y	The Y coordinate of the left start point.
    +    ///- h	The height of the line.
         ///
         ///color	The color of the line (optional; defaults to WHITE).
         pub fn draw_fast_vline(&self, x: i16, y: i16, h: u8, color: Color) {
    @@ -915,12 +869,9 @@
         ///Set a single pixel in the display buffer to the specified color.
         ///
         ///### Parameters
    -    ///
    -    ///x	The X coordinate of the pixel.
    -    ///
    -    ///y	The Y coordinate of the pixel.
    -    ///
    -    ///color	The color of the pixel (optional; defaults to WHITE).
    +    ///- x	The X coordinate of the pixel.
    +    ///- y	The Y coordinate of the pixel.
    +    ///- color	The color of the pixel (optional; defaults to WHITE).
         ///
         ///The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn't included, the pixel will be set to WHITE.
         pub fn draw_pixel(&self, x: i16, y: i16, color: Color) {
    @@ -930,13 +881,10 @@
         ///
         ///### Parameters
         ///
    -    ///x	The X coordinate of the upper left corner.
    -    ///
    -    ///y	The Y coordinate of the upper left corner.
    -    ///
    -    ///w	The width of the rectangle.
    -    ///
    -    ///h	The height of the rectangle.
    +    ///- x	The X coordinate of the upper left corner.
    +    ///- y	The Y coordinate of the upper left corner.
    +    ///- w	The width of the rectangle.
    +    ///- h	The height of the rectangle.
         ///
         ///color	The color of the pixel (optional; defaults to WHITE).
         pub fn fill_rect(&self, x: i16, y: i16, w: u8, h: u8, color: Color) {
    @@ -967,11 +915,9 @@
         ///
         ///### Parameters
         ///
    -    ///x0	The X coordinate of the circle's center.
    -    ///
    -    ///y0	The Y coordinate of the circle's center.
    -    ///
    -    ///r	The radius of the circle in pixels.
    +    ///- x	The X coordinate of the circle's center.
    +    ///- y	The Y coordinate of the circle's center.
    +    ///- r	The radius of the circle in pixels.
         ///
         ///color	The circle's color (optional; defaults to WHITE).
         pub fn fill_circle(&self, x: i16, y: i16, r: u8, color: Color) {
    @@ -1044,9 +990,8 @@
         ///Returns the state of the given pixel in the screen buffer.
         ///
         ///### Parameters
    -    ///x	The X coordinate of the pixel.
    -    ///
    -    ///y	The Y coordinate of the pixel.
    +    ///- x	The X coordinate of the pixel.
    +    ///- y	The Y coordinate of the pixel.
         ///
         ///### Returns
         ///WHITE if the pixel is on or BLACK if the pixel is off.
    @@ -1062,7 +1007,7 @@
         ///Check if a button has just been pressed.
         ///
         ///### Parameters
    -    ///button	The button to test for. Only one button should be specified.
    +    ///- button	The button to test for. Only one button should be specified.
         ///
         ///### Returns
         ///true if the specified button has just been pressed.
    @@ -1078,7 +1023,7 @@
         ///Check if a button has just been released.
         ///
         ///### Parameters
    -    ///button	The button to test for. Only one button should be specified.
    +    ///- button	The button to test for. Only one button should be specified.
         ///
         ///### Returns
         ///true if the specified button has just been released.
    @@ -1095,7 +1040,7 @@
         ///
         ///### Parameters
         ///
    -    ///buttons	A bit mask indicating which buttons to test. (Can be a single button)
    +    ///- buttons	A bit mask indicating which buttons to test. (Can be a single button)
         ///
         ///### Returns
         ///
    @@ -1129,7 +1074,7 @@
         ///Test if the all of the specified buttons are pressed.
         ///
         ///### Parameters
    -    ///   buttons	A bit mask indicating which buttons to test. (Can be a single button)
    +    ///-   buttons	A bit mask indicating which buttons to test. (Can be a single button)
         ///
         ///### Returns
         ///   true if all buttons in the provided mask are currently pressed.
    @@ -1149,15 +1094,14 @@
         ///
         ///
         ///Example
    -    /// ```text
    -    /// let value:i16 = 42;
    +    /// ```
    +    /// let value: i16 = 42;
         ///
    -    /// arduboy.println("Hello World\0"); // Prints "Hello World" and then sets the
    -    ///                                   // text cursor to the start of the next line
    -    /// arduboy.print(value);             // Prints "42"
    -    /// arduboy.print('\n\0');            // Sets the text cursor to the start of the next line
    -    /// arduboy.print(78, HEX);           // Prints "4E" (78 in hexadecimal)
    -    /// arduboy.print("\x03\xEA");        // Prints a heart symbol and a Greek uppercase omega
    +    /// arduboy.print(b"Hello World\n\0"[..]); // Prints "Hello World" and then sets the
    +    ///                                        // text cursor to the start of the next line
    +    /// arduboy.print(value); // Prints "42"
    +    /// arduboy.print("\n\0"); // Sets the text cursor to the start of the next line
    +    /// arduboy.print("hello world") // Prints normal [&str]
         /// ```
         pub fn print(&self, x: impl Printable) {
             x.print()
    @@ -1165,9 +1109,9 @@
         ///Set the location of the text cursor.
         ///
         ///### Parameters
    -    ///   x	The X (horizontal) coordinate, in pixels, for the new location of the text cursor.
    +    ///-   x	The X (horizontal) coordinate, in pixels, for the new location of the text cursor.
         ///
    -    ///   y	The Y (vertical) coordinate, in pixels, for the new location of the text cursor.
    +    /// -  y	The Y (vertical) coordinate, in pixels, for the new location of the text cursor.
         ///
         ///The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.
         pub fn set_cursor(&self, x: i16, y: i16) {
    @@ -1176,7 +1120,7 @@
         ///Set the frame rate used by the frame control functions.
         ///
         ///### Parameters
    -    ///   rate	The desired frame rate in frames per second.
    +    ///-   rate	The desired frame rate in frames per second.
         ///
         ///Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.
         pub fn set_frame_rate(&self, rate: u8) {
    @@ -1185,7 +1129,7 @@
         ///Set the text character size.
         ///
         ///### Parameters
    -    ///   s	The text size multiplier. Must be 1 or higher.
    +    ///-   s	The text size multiplier. Must be 1 or higher.
         ///
         ///Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.
         pub fn set_text_size(&self, size: u8) {
    @@ -1237,7 +1181,7 @@
         ///Invert the entire display or set it back to normal.
         ///
         ///### Parameters
    -    ///inverse	true will invert the display. false will set the display to no-inverted.
    +    ///- inverse	true will invert the display. false will set the display to no-inverted.
         ///
         ///Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.
         ///
    @@ -1407,20 +1351,20 @@
     }
     
     extern "C" {
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_begin"]
    +
    +    #[link_name = "arduboy_begin"]
         fn begin();
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_clear"]
    +
    +    #[link_name = "arduboy_clear"]
         fn clear();
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_display"]
    +
    +    #[link_name = "arduboy_display"]
         fn display();
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_display_and_clear_buffer"]
    +
    +    #[link_name = "arduboy_display_and_clear_buffer"]
         fn display_and_clear_buffer();
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_draw_fast_hline"]
    +
    +    #[link_name = "arduboy_draw_fast_hline"]
         fn draw_fast_hline_raw(x: i16, y: i16, w: u8, color: u8);
     
         #[link_name = "arduboy_draw_fast_vline"]
    @@ -1467,11 +1411,11 @@
         #[doc(hidden)]
         #[link_name = "arduboy_not_pressed"]
         pub fn not_pressed(button: u8) -> bool;
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_next_frame"]
    +
    +    #[link_name = "arduboy_next_frame"]
         fn next_frame() -> bool;
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_poll_buttons"]
    +
    +    #[link_name = "arduboy_poll_buttons"]
         fn poll_buttons();
         #[doc(hidden)]
         #[link_name = "arduboy_pressed"]
    @@ -1500,17 +1444,17 @@
         #[doc(hidden)]
         #[link_name = "arduboy_print_unsigned_long"]
         pub fn print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_set_cursor"]
    +
    +    #[link_name = "arduboy_set_cursor"]
         fn set_cursor(x: i16, y: i16);
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_set_frame_rate"]
    +
    +    #[link_name = "arduboy_set_frame_rate"]
         fn set_frame_rate(rate: u8);
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_set_text_size"]
    +
    +    #[link_name = "arduboy_set_text_size"]
         fn set_text_size(size: u8);
    -    #[doc(hidden)]
    -    #[link_name = "arduboy_audio_on"]
    +
    +    #[link_name = "arduboy_audio_on"]
         fn arduboy_audio_on();
     
         #[link_name = "arduboy_audio_off"]
    @@ -1560,32 +1504,4 @@
         #[link_name = "arduboy_digital_write_rgb"]
         fn digital_write_rgb(red: c_uchar, green: c_uchar, blue: c_uchar);
     }
    -
    -// pub unsafe fn print(x: impl Printable) {
    -//     x.print();
    -// }
    -
    -// pub unsafe fn draw_fast_hline(x: i16, y: i16, w: u8, color: Color) {
    -//     draw_fast_hline_raw(x, y, w, color as u8);
    -// }
    -
    -// pub unsafe fn draw_fast_vline(x: i16, y: i16, h: u8, color: Color) {
    -//     draw_fast_vline_raw(x, y, h, color as u8);
    -// }
    -
    -// pub unsafe fn draw_pixel(x: i16, y: i16, color: Color) {
    -//     draw_pixel_raw(x, y, color as u8);
    -// }
    -
    -// pub unsafe fn fill_rect(x: i16, y: i16, w: u8, h: u8, color: Color) {
    -//     fill_rect_raw(x, y, w, h, color as u8);
    -// }
    -
    -// pub unsafe fn draw_circle(x: i16, y: i16, r: u8, color: Color) {
    -//     draw_circle_raw(x, y, r, color as u8);
    -// }
    -
    -// pub unsafe fn get_pixel(x: u8, y: u8) -> Color {
    -//     mem::transmute::<u8, Color>(get_pixel_raw(x, y))
    -// }
    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html b/docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html index 3951e72..0d4fd37 100644 --- a/docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html +++ b/docs/doc/src/arduboy_rust/library/arduboy_tone.rs.html @@ -180,7 +180,7 @@
    fn sound_volume_mode(mode: c_uchar); } -///This is the struct to interact in a save way with the Arduboy2Audio C++ library. +///This is the struct to interact in a save way with the ArduboyTones C++ library. pub struct ArduboyTones {} impl ArduboyTones { ///Get a new instance of [ArduboyTones] diff --git a/docs/doc/src/arduboy_rust/library/arduino.rs.html b/docs/doc/src/arduboy_rust/library/arduino.rs.html index 2bf9a72..19eb181 100644 --- a/docs/doc/src/arduboy_rust/library/arduino.rs.html +++ b/docs/doc/src/arduboy_rust/library/arduino.rs.html @@ -24,7 +24,9 @@ 24 25 26 -

    use core::ffi::{c_long, c_ulong};
    +27
    +
    //! This is the Module to interact in a save way with the Arduino C++ library.
    +use core::ffi::{c_long, c_ulong};
     
     extern "C" {
         #[link_name = "arduino_random_between"]
    diff --git a/docs/doc/src/arduboy_rust/library/eeprom.rs.html b/docs/doc/src/arduboy_rust/library/eeprom.rs.html
    index ab1ed17..d465aec 100644
    --- a/docs/doc/src/arduboy_rust/library/eeprom.rs.html
    +++ b/docs/doc/src/arduboy_rust/library/eeprom.rs.html
    @@ -154,7 +154,7 @@
         #[link_name = "arduboy_eeprom_put"]
         fn arduboy_eeprom_put_raw(idx: c_int, object: *const u8, size: usize);
     }
    -///This struct to store and read structs objects to eeprom memory.
    +///This struct to store and read structs objects to/from eeprom memory.
     /// ## Example
     /// ```
     /// static e: EEPROM = EEPROM::new(10);
    diff --git a/docs/doc/src/arduboy_rust/library/progmem.rs.html b/docs/doc/src/arduboy_rust/library/progmem.rs.html
    index 53ce09a..b3368c1 100644
    --- a/docs/doc/src/arduboy_rust/library/progmem.rs.html
    +++ b/docs/doc/src/arduboy_rust/library/progmem.rs.html
    @@ -92,7 +92,7 @@
     92
     93
     
    #![allow(unused_imports)]
    -/// Create a space for Progrem variable
    +/// Create a space for Progmem variable
     /// ## Example
     /// ```
     /// //for text
    diff --git a/docs/doc/src/arduboy_rust/prelude.rs.html b/docs/doc/src/arduboy_rust/prelude.rs.html
    index 2fe03f0..37a08fa 100644
    --- a/docs/doc/src/arduboy_rust/prelude.rs.html
    +++ b/docs/doc/src/arduboy_rust/prelude.rs.html
    @@ -24,7 +24,17 @@
     24
     25
     26
    +27
    +28
    +29
    +30
    +31
     
    //! This is the important one to use this library effective in your project
    +//!
    +//! Import the module:
    +//! ```
    +//! use arduboy_rust::prelude::*;
    +//! ```
     #[doc(inline)]
     pub use crate::hardware::buttons::{self, *};
     #[doc(inline)]