commit
4d646828cb
2731 changed files with 11110 additions and 20016 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@ localcommands.txt
|
||||||
arduboy-rust/Wrapper-Project/.pio
|
arduboy-rust/Wrapper-Project/.pio
|
||||||
arduboy-rust/Wrapper-Project/lib/*.a
|
arduboy-rust/Wrapper-Project/lib/*.a
|
||||||
arduboy-rust/Wrapper-Project/build/*.hex
|
arduboy-rust/Wrapper-Project/build/*.hex
|
||||||
|
**/imports.h
|
||||||
|
|
8
.idea/Rust-for-Arduboy.iml
generated
8
.idea/Rust-for-Arduboy.iml
generated
|
@ -1,5 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module type="EMPTY_MODULE" version="4">
|
<module type="EMPTY_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="Python" name="Python facet">
|
||||||
|
<configuration sdkName="Python 3.12" />
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/demo2/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/demo2/src" isTestSource="false" />
|
||||||
|
@ -9,7 +14,6 @@
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/demo6/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/demo6/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/demo7/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/demo7/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/demo9/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/demo9/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/eeprom-byte/src" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/eeprom/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/eeprom/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/progmem/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/progmem/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/serial/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/serial/src" isTestSource="false" />
|
||||||
|
@ -26,9 +30,11 @@
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/ArduboyFX/fxdrawframes/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/ArduboyFX/fxdrawframes/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/ArduboyFX/fxhelloworld/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/ArduboyFX/fxhelloworld/src" isTestSource="false" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/Examples/ArduboyFX/fxloadgamestate/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/Examples/ArduboyFX/fxloadgamestate/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/Examples/Arduboy-Tutorials/eeprom_byte/src" isTestSource="false" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Python 3.12 interpreter library" level="application" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
6
.idea/misc.xml
generated
Normal file
6
.idea/misc.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="Python 3.12" />
|
||||||
|
</component>
|
||||||
|
</project>
|
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -108,7 +108,7 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "eeprom-byte"
|
name = "eeprom_byte"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arduboy-rust",
|
"arduboy-rust",
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
"arduboy-rust",
|
"arduboy-rust",
|
||||||
"Examples/Arduboy-Tutorials/eeprom",
|
"Examples/Arduboy-Tutorials/eeprom",
|
||||||
"Examples/Arduboy-Tutorials/eeprom-byte",
|
"Examples/Arduboy-Tutorials/eeprom_byte",
|
||||||
"Examples/Arduboy-Tutorials/progmem",
|
"Examples/Arduboy-Tutorials/progmem",
|
||||||
"Examples/Arduboy-Tutorials/tone",
|
"Examples/Arduboy-Tutorials/tone",
|
||||||
"Examples/Arduboy-Tutorials/serial",
|
"Examples/Arduboy-Tutorials/serial",
|
||||||
|
|
9
Examples/Arduboy-Tutorials/demo2/config.toml
Normal file
9
Examples/Arduboy-Tutorials/demo2/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/Arduboy-Tutorials/demo3/config.toml
Normal file
9
Examples/Arduboy-Tutorials/demo3/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/Arduboy-Tutorials/demo4/config.toml
Normal file
9
Examples/Arduboy-Tutorials/demo4/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/Arduboy-Tutorials/demo5/config.toml
Normal file
9
Examples/Arduboy-Tutorials/demo5/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/Arduboy-Tutorials/demo6/config.toml
Normal file
9
Examples/Arduboy-Tutorials/demo6/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -5,22 +5,19 @@
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
|
progmem!(
|
||||||
#[link_section = ".progmem.data"]
|
static background_sprite: [u8; _] = [8, 8, 0x81, 0x00, 0x12, 0x40, 0x04, 0x11, 0x00, 0x04];
|
||||||
static background_sprite: [u8; 10] = [8, 8, 0x81, 0x00, 0x12, 0x40, 0x04, 0x11, 0x00, 0x04];
|
static player_sprite1: [u8; _] = [
|
||||||
#[link_section = ".progmem.data"]
|
|
||||||
static player_sprite1: [u8; 34] = [
|
|
||||||
16, 16, 0xfe, 0x01, 0x3d, 0x25, 0x25, 0x3d, 0x01, 0x01, 0xc1, 0x01, 0x3d, 0x25, 0x25, 0x3d,
|
16, 16, 0xfe, 0x01, 0x3d, 0x25, 0x25, 0x3d, 0x01, 0x01, 0xc1, 0x01, 0x3d, 0x25, 0x25, 0x3d,
|
||||||
0x01, 0xfe, 0x7f, 0x80, 0x9c, 0xbc, 0xb0, 0xb0, 0xb2, 0xb2, 0xb3, 0xb0, 0xb0, 0xb0, 0xbc, 0x9c,
|
0x01, 0xfe, 0x7f, 0x80, 0x9c, 0xbc, 0xb0, 0xb0, 0xb2, 0xb2, 0xb3, 0xb0, 0xb0, 0xb0, 0xbc,
|
||||||
0x80, 0x7f,
|
0x9c, 0x80, 0x7f,
|
||||||
];
|
];
|
||||||
#[link_section = ".progmem.data"]
|
static player_sprite2: [u8; _] = [
|
||||||
static player_sprite2: [u8; 34] = [
|
|
||||||
16, 16, 0xfc, 0x02, 0x19, 0x25, 0x25, 0x19, 0x01, 0x01, 0x01, 0x01, 0x19, 0x25, 0x25, 0x19,
|
16, 16, 0xfc, 0x02, 0x19, 0x25, 0x25, 0x19, 0x01, 0x01, 0x01, 0x01, 0x19, 0x25, 0x25, 0x19,
|
||||||
0x02, 0xfc, 0x3f, 0x40, 0x80, 0x98, 0x8c, 0x86, 0x82, 0x82, 0x82, 0x82, 0x86, 0x8c, 0x98, 0x80,
|
0x02, 0xfc, 0x3f, 0x40, 0x80, 0x98, 0x8c, 0x86, 0x82, 0x82, 0x82, 0x82, 0x86, 0x8c, 0x98,
|
||||||
0x40, 0x3f,
|
0x80, 0x40, 0x3f,
|
||||||
];
|
];
|
||||||
|
);
|
||||||
// Put your variables here
|
// Put your variables here
|
||||||
static mut playerx: c_int = 5;
|
static mut playerx: c_int = 5;
|
||||||
static mut playery: c_int = 10;
|
static mut playery: c_int = 10;
|
||||||
|
|
9
Examples/Arduboy-Tutorials/demo7/config.toml
Normal file
9
Examples/Arduboy-Tutorials/demo7/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/Arduboy-Tutorials/demo9/config.toml
Normal file
9
Examples/Arduboy-Tutorials/demo9/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -1,56 +0,0 @@
|
||||||
#![no_std]
|
|
||||||
#![allow(non_upper_case_globals)]
|
|
||||||
//Include the Arduboy Library
|
|
||||||
//Initialize the arduboy object
|
|
||||||
#[allow(unused_imports)]
|
|
||||||
use arduboy_rust::prelude::*;
|
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
|
||||||
|
|
||||||
// #[link_section = ".progmem.data"]
|
|
||||||
|
|
||||||
// Setup eeprom memory
|
|
||||||
static mut eeprom: EEPROMBYTE = EEPROMBYTE::new(10);
|
|
||||||
|
|
||||||
static mut count: u8 = 0;
|
|
||||||
|
|
||||||
// The setup() function runs once when you turn your Arduboy on
|
|
||||||
#[no_mangle]
|
|
||||||
pub unsafe extern "C" fn setup() {
|
|
||||||
// put your setup code here, to run once:
|
|
||||||
arduboy.begin();
|
|
||||||
eeprom.init();
|
|
||||||
arduboy.clear();
|
|
||||||
arduboy.set_frame_rate(30);
|
|
||||||
}
|
|
||||||
// The loop() function repeats forever after setup() is done
|
|
||||||
#[no_mangle]
|
|
||||||
#[export_name = "loop"]
|
|
||||||
pub unsafe extern "C" fn loop_() {
|
|
||||||
// put your main code here, to run repeatedly:
|
|
||||||
if !arduboy.next_frame() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
arduboy.clear();
|
|
||||||
arduboy.poll_buttons();
|
|
||||||
if arduboy.just_pressed(UP) {
|
|
||||||
count += 1;
|
|
||||||
}
|
|
||||||
if arduboy.just_pressed(DOWN) {
|
|
||||||
count -= 1;
|
|
||||||
}
|
|
||||||
if arduboy.just_pressed(A) {
|
|
||||||
eeprom.update(count)
|
|
||||||
}
|
|
||||||
arduboy.set_cursor(0, 0);
|
|
||||||
arduboy.print(count as u16);
|
|
||||||
|
|
||||||
arduboy.set_cursor(0, 30);
|
|
||||||
arduboy.print(f!(b"Counter:\0"));
|
|
||||||
arduboy.print(count as u16);
|
|
||||||
arduboy.set_cursor(0, 40);
|
|
||||||
arduboy.print(f!(b"eeprom:\0"));
|
|
||||||
|
|
||||||
//arduboy.print(eeprom.read() as u16);
|
|
||||||
|
|
||||||
arduboy.display();
|
|
||||||
}
|
|
9
Examples/Arduboy-Tutorials/eeprom/config.toml
Normal file
9
Examples/Arduboy-Tutorials/eeprom/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -24,7 +24,7 @@ static mut s: Scorebord = Scorebord {
|
||||||
pub unsafe extern "C" fn setup() {
|
pub unsafe extern "C" fn setup() {
|
||||||
// put your setup code here, to run once:
|
// put your setup code here, to run once:
|
||||||
arduboy.begin();
|
arduboy.begin();
|
||||||
arduboy.set_frame_rate(1);
|
arduboy.set_frame_rate(30);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
e.init(&mut s);
|
e.init(&mut s);
|
||||||
}
|
}
|
||||||
|
@ -54,11 +54,9 @@ pub unsafe extern "C" fn loop_() {
|
||||||
if s.player1 == 5 {
|
if s.player1 == 5 {
|
||||||
arduboy.print(f!(b"lolxd\0"));
|
arduboy.print(f!(b"lolxd\0"));
|
||||||
s.text = "it works!!!\0";
|
s.text = "it works!!!\0";
|
||||||
e.put(&s)
|
|
||||||
} else {
|
} else {
|
||||||
arduboy.print(f!(b"nope\0"));
|
arduboy.print(f!(b"nope\0"));
|
||||||
s.text = "lol\0";
|
s.text = "lol\0";
|
||||||
e.put(&s)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//e.get(&mut s);
|
//e.get(&mut s);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "eeprom-byte"
|
name = "eeprom_byte"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["ZennDev <zenndev@protonmail.com>"]
|
authors = ["ZennDev <zenndev@protonmail.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
9
Examples/Arduboy-Tutorials/eeprom_byte/config.toml
Normal file
9
Examples/Arduboy-Tutorials/eeprom_byte/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
56
Examples/Arduboy-Tutorials/eeprom_byte/src/lib.rs
Normal file
56
Examples/Arduboy-Tutorials/eeprom_byte/src/lib.rs
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
#![no_std]
|
||||||
|
#![allow(non_upper_case_globals)]
|
||||||
|
//Include the Arduboy Library
|
||||||
|
//Initialize the arduboy object
|
||||||
|
#[allow(unused_imports)]
|
||||||
|
use arduboy_rust::prelude::*;
|
||||||
|
const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
|
|
||||||
|
// #[link_section = ".progmem.data"]
|
||||||
|
|
||||||
|
// Setup eeprom memory
|
||||||
|
static mut eeprom: EEPROMBYTE = EEPROMBYTE::new(10);
|
||||||
|
|
||||||
|
static mut count_in_ram: u8 = 0;
|
||||||
|
static mut count_in_eeprom: u8 = 0;
|
||||||
|
|
||||||
|
// The setup() function runs once when you turn your Arduboy on
|
||||||
|
#[no_mangle]
|
||||||
|
pub unsafe extern "C" fn setup() {
|
||||||
|
// put your setup code here, to run once:
|
||||||
|
arduboy.begin();
|
||||||
|
eeprom.init();
|
||||||
|
arduboy.clear();
|
||||||
|
arduboy.set_frame_rate(30);
|
||||||
|
}
|
||||||
|
// The loop() function repeats forever after setup() is done
|
||||||
|
#[no_mangle]
|
||||||
|
#[export_name = "loop"]
|
||||||
|
pub unsafe extern "C" fn loop_() {
|
||||||
|
// put your main code here, to run repeatedly:
|
||||||
|
if !arduboy.next_frame() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
arduboy.clear();
|
||||||
|
arduboy.poll_buttons();
|
||||||
|
if arduboy.just_pressed(UP) {
|
||||||
|
count_in_ram += 1;
|
||||||
|
}
|
||||||
|
if arduboy.just_pressed(DOWN) {
|
||||||
|
count_in_ram -= 1;
|
||||||
|
}
|
||||||
|
if arduboy.just_pressed(A) {
|
||||||
|
eeprom.update(count_in_ram);
|
||||||
|
count_in_eeprom = eeprom.read()
|
||||||
|
}
|
||||||
|
arduboy.set_cursor(0, 0);
|
||||||
|
arduboy.print(f!(b"Up/Down: Edit InRam\n\nA: Save to EEPROM\0"));
|
||||||
|
|
||||||
|
arduboy.set_cursor(0, HEIGHT - FONT_HEIGHT);
|
||||||
|
arduboy.print(f!(b"InRam:\0"));
|
||||||
|
arduboy.print(count_in_ram as u16);
|
||||||
|
arduboy.set_cursor(10 * FONT_WIDTH, HEIGHT - FONT_HEIGHT);
|
||||||
|
arduboy.print(f!(b"EEPROM:\0"));
|
||||||
|
arduboy.print(count_in_eeprom as u16);
|
||||||
|
arduboy.display();
|
||||||
|
}
|
9
Examples/Arduboy-Tutorials/progmem/config.toml
Normal file
9
Examples/Arduboy-Tutorials/progmem/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -5,7 +5,7 @@
|
||||||
//Include the Arduboy Library
|
//Include the Arduboy Library
|
||||||
//Initialize the arduboy object
|
//Initialize the arduboy object
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
use arduboy_tones::tones_pitch::*;
|
use tones_pitch::*;
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
const sound: ArduboyTones = ArduboyTones::new();
|
const sound: ArduboyTones = ArduboyTones::new();
|
||||||
// Progmem data
|
// Progmem data
|
||||||
|
@ -106,7 +106,10 @@ pub unsafe extern "C" fn loop_() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.set_cursor((WIDTH as i16 / 2) - (text1.len() as i16 * FONT_SIZE as i16 / 2), 10);
|
arduboy.set_cursor(
|
||||||
|
(WIDTH as i16 / 2) - (text1.len() as i16 * FONT_WIDTH / 2),
|
||||||
|
10,
|
||||||
|
);
|
||||||
arduboy.print(get_string_addr!(text1));
|
arduboy.print(get_string_addr!(text1));
|
||||||
sprites::draw_override(playerx, playery, get_sprite_addr!(player_sprite1), 0);
|
sprites::draw_override(playerx, playery, get_sprite_addr!(player_sprite1), 0);
|
||||||
arduboy.display();
|
arduboy.display();
|
||||||
|
|
9
Examples/Arduboy-Tutorials/serial/config.toml
Normal file
9
Examples/Arduboy-Tutorials/serial/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
"Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/Arduboy-Tutorials/tone/config.toml
Normal file
9
Examples/Arduboy-Tutorials/tone/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
"ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -4,7 +4,7 @@
|
||||||
//Initialize the arduboy object
|
//Initialize the arduboy object
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
use arduboy_tones::tones_pitch::*;
|
use tones_pitch::*;
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
const sound: ArduboyTones = ArduboyTones::new();
|
const sound: ArduboyTones = ArduboyTones::new();
|
||||||
const NDUR: u16 = 100;
|
const NDUR: u16 = 100;
|
||||||
|
@ -346,7 +346,9 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tone(1000, 0);
|
sound.tone(1000, 0);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print(f!(b"tone(1000)\n\nB: no_tone()\n delay(1000)\n break\0"));
|
arduboy.print(f!(
|
||||||
|
b"tone(1000)\n\nB: no_tone()\n delay(1000)\n break\0"
|
||||||
|
));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B_BUTTON) {
|
if arduboy.pressed(B_BUTTON) {
|
||||||
|
@ -381,7 +383,9 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tone3(NOTE_C7H, 500, NOTE_REST, 1000, NOTE_C6, 5000);
|
sound.tone3(NOTE_C7H, 500, NOTE_REST, 1000, NOTE_C6, 5000);
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print(f!(b"tone(C7H,500,\n REST,1000,\n C6,6000)\n\nB: no_tone(), break\0"));
|
arduboy.print(f!(
|
||||||
|
b"tone(C7H,500,\n REST,1000,\n C6,6000)\n\nB: no_tone(), break\0"
|
||||||
|
));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B_BUTTON) {
|
if arduboy.pressed(B_BUTTON) {
|
||||||
|
@ -393,7 +397,9 @@ pub unsafe extern "C" fn loop_() {
|
||||||
|
|
||||||
sound.tones(get_tones_addr!(allNotes));
|
sound.tones(get_tones_addr!(allNotes));
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print(f!(b"tones(allNotes)\n\nA: no_tone(), again\nUP: again\nB: break\0"));
|
arduboy.print(f!(
|
||||||
|
b"tones(allNotes)\n\nA: no_tone(), again\nUP: again\nB: break\0"
|
||||||
|
));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(A_BUTTON) {
|
if arduboy.pressed(A_BUTTON) {
|
||||||
|
@ -446,7 +452,9 @@ pub unsafe extern "C" fn loop_() {
|
||||||
sound.volume_mode(VOLUME_ALWAYS_NORMAL);
|
sound.volume_mode(VOLUME_ALWAYS_NORMAL);
|
||||||
sound.tones(get_tones_addr!(sound1));
|
sound.tones(get_tones_addr!(sound1));
|
||||||
arduboy.clear();
|
arduboy.clear();
|
||||||
arduboy.print(f!(b"volume_mode(NORMAL)\ntones(sound1)\n\nB: no_tone(), break\0"));
|
arduboy.print(f!(
|
||||||
|
b"volume_mode(NORMAL)\ntones(sound1)\n\nB: no_tone(), break\0"
|
||||||
|
));
|
||||||
while sound.playing() {
|
while sound.playing() {
|
||||||
move_circle();
|
move_circle();
|
||||||
if arduboy.pressed(B) {
|
if arduboy.pressed(B) {
|
||||||
|
|
9
Examples/ArduboyFX/fxbasicexample/config.toml
Normal file
9
Examples/ArduboyFX/fxbasicexample/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
"ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/ArduboyFX/fxchompies/config.toml
Normal file
9
Examples/ArduboyFX/fxchompies/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
"ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -4,7 +4,7 @@
|
||||||
//Include the Arduboy Library
|
//Include the Arduboy Library
|
||||||
//Initialize the arduboy object
|
//Initialize the arduboy object
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
use arduboyfx::fx_consts::*;
|
use fx_consts::*;
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
|
|
||||||
// FX Data
|
// FX Data
|
||||||
|
|
9
Examples/ArduboyFX/fxdrawballs/config.toml
Normal file
9
Examples/ArduboyFX/fxdrawballs/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
"ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -1,10 +1,11 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![allow(non_upper_case_globals)]
|
#![allow(non_upper_case_globals)]
|
||||||
|
|
||||||
use arduboy_rust::arduboyfx::fx_consts::{dbmMasked, dbmNormal};
|
|
||||||
//Include the Arduboy Library
|
//Include the Arduboy Library
|
||||||
//Initialize the arduboy object
|
//Initialize the arduboy object
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
|
use fx_consts::{dbmMasked, dbmNormal};
|
||||||
|
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
|
|
||||||
// FX Data
|
// FX Data
|
||||||
|
|
9
Examples/ArduboyFX/fxdrawframes/config.toml
Normal file
9
Examples/ArduboyFX/fxdrawframes/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
"ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/ArduboyFX/fxhelloworld/config.toml
Normal file
9
Examples/ArduboyFX/fxhelloworld/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
"ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -4,7 +4,7 @@
|
||||||
//Include the Arduboy Library
|
//Include the Arduboy Library
|
||||||
//Initialize the arduboy object
|
//Initialize the arduboy object
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
use arduboyfx::fx_consts::*;
|
use fx_consts::*;
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
const arduboy: Arduboy2 = Arduboy2::new();
|
||||||
|
|
||||||
//FX Data
|
//FX Data
|
||||||
|
|
9
Examples/ArduboyFX/fxloadgamestate/config.toml
Normal file
9
Examples/ArduboyFX/fxloadgamestate/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
"ArduboyFX",
|
||||||
|
# "ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/ardvoice/config.toml
Normal file
9
Examples/ardvoice/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
# "ArduboyTones",
|
||||||
|
# "ArduboyFX",
|
||||||
|
"ArdVoice",
|
||||||
|
# "Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/drboy/config.toml
Normal file
9
Examples/drboy/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
"ArduboyTones",
|
||||||
|
#"ArduboyFX",
|
||||||
|
#"ArdVoice",
|
||||||
|
#"Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -4,7 +4,7 @@
|
||||||
//Include the Arduboy Library
|
//Include the Arduboy Library
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use arduboy_rust::prelude::*;
|
use arduboy_rust::prelude::*;
|
||||||
use arduboy_tones::tones_pitch::*;
|
use tones_pitch::*;
|
||||||
mod gameloop;
|
mod gameloop;
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
|
9
Examples/rustacean/config.toml
Normal file
9
Examples/rustacean/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
"ArduboyTones",
|
||||||
|
#"ArduboyFX",
|
||||||
|
#"ArdVoice",
|
||||||
|
#"Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
9
Examples/snake/config.toml
Normal file
9
Examples/snake/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
"ArduboyTones",
|
||||||
|
#"ArduboyFX",
|
||||||
|
#"ArdVoice",
|
||||||
|
#"Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
|
@ -257,11 +257,8 @@ pub unsafe extern "C" fn loop_() {
|
||||||
State::Win => (),
|
State::Win => (),
|
||||||
State::Pause => {
|
State::Pause => {
|
||||||
let msg = "[ Break ]\0";
|
let msg = "[ Break ]\0";
|
||||||
let l = msg.len() as u8 * FONT_SIZE / 2;
|
let l = msg.len() as i16 * FONT_WIDTH / 2;
|
||||||
arduboy.set_cursor(
|
arduboy.set_cursor(WIDTH / 2 - l, HEIGHT / 2);
|
||||||
((WIDTH / 2) as u16 - l as u16).try_into().unwrap(),
|
|
||||||
((HEIGHT / 2) as u16).try_into().unwrap(),
|
|
||||||
);
|
|
||||||
snake.render();
|
snake.render();
|
||||||
snake.boarder();
|
snake.boarder();
|
||||||
arduboy.print(msg);
|
arduboy.print(msg);
|
||||||
|
|
9
Project/game/config.toml
Normal file
9
Project/game/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Libraries = [
|
||||||
|
"Arduboy2",
|
||||||
|
"ArduboyTones",
|
||||||
|
#"ArduboyFX",
|
||||||
|
#"ArdVoice",
|
||||||
|
#"Serial",
|
||||||
|
"EEPROM",
|
||||||
|
"Arduino",
|
||||||
|
]
|
99
README.md
99
README.md
|
@ -25,7 +25,7 @@ git clone https://github.com/ZennDev1337/Rust-for-Arduboy
|
||||||
|
|
||||||
Install [PlatformIO Core](https://docs.platformio.org/en/latest/core/installation/methods/pypi.html) on your system.
|
Install [PlatformIO Core](https://docs.platformio.org/en/latest/core/installation/methods/pypi.html) on your system.
|
||||||
I recommend the pip install if you don't want to configure a new path variable for pio.
|
I recommend the pip install if you don't want to configure a new path variable for pio.
|
||||||
Otherwise you will know how to do that.
|
Otherwise, you will know how to do that.
|
||||||
|
|
||||||
The rust-analyzer will complain about a missing test crate to fix this
|
The rust-analyzer will complain about a missing test crate to fix this
|
||||||
add the following rule to the lsp settings :
|
add the following rule to the lsp settings :
|
||||||
|
@ -64,10 +64,11 @@ I will from time to time also upload my projects to the Example folder so you ha
|
||||||
|
|
||||||
## Usage of the run tool
|
## Usage of the run tool
|
||||||
|
|
||||||
**Both run scripts** (only works if you use the given folder structure)
|
**The run script** only work if you use the given folder structure!
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
|
|
||||||
|
- Python3.11 or higher
|
||||||
- [PlatformIO Core](https://docs.platformio.org/en/latest/core/installation/methods/pypi.html) must be installed
|
- [PlatformIO Core](https://docs.platformio.org/en/latest/core/installation/methods/pypi.html) must be installed
|
||||||
- The Arduboy must be plugged in
|
- The Arduboy must be plugged in
|
||||||
- You are in the root directory of this project
|
- You are in the root directory of this project
|
||||||
|
@ -80,13 +81,28 @@ To upload your own game to the Arduboy use:
|
||||||
Linux:
|
Linux:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./run <Project_Name>
|
python ./run.py <Project_Name>
|
||||||
```
|
```
|
||||||
|
|
||||||
Windows:
|
Windows:
|
||||||
|
|
||||||
```ps1
|
```ps1
|
||||||
.\run.bat <Project_Name>
|
python .\run.py <Project_Name>
|
||||||
|
```
|
||||||
|
|
||||||
|
All commands:
|
||||||
|
|
||||||
|
```
|
||||||
|
Usage build and upload Project:
|
||||||
|
run.py list Get a list of all Projects
|
||||||
|
run.py new <Project-Name> Create a new game in the Project folder
|
||||||
|
run.py <Project-Name> For uploading a game
|
||||||
|
|
||||||
|
Usage FX-Data build and upload:
|
||||||
|
run.py fxbuild <Project-Name> Build your fxdata
|
||||||
|
run.py fxupload <Project-Name> Upload your fxdata
|
||||||
|
run.py fxall <Project-Name> Build and Upload your fxdata
|
||||||
|
and the game in one step
|
||||||
```
|
```
|
||||||
|
|
||||||
## List of all the Example Games:
|
## List of all the Example Games:
|
||||||
|
@ -135,6 +151,7 @@ run Commands:
|
||||||
```
|
```
|
||||||
|Project_Dir
|
|Project_Dir
|
||||||
->fxdata
|
->fxdata
|
||||||
|
->fxdata.txt
|
||||||
->src
|
->src
|
||||||
->lib.rs
|
->lib.rs
|
||||||
>cargo.toml
|
>cargo.toml
|
||||||
|
@ -157,17 +174,17 @@ run Commands:
|
||||||
Linux:
|
Linux:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./run fxbuild <Project_Name>
|
python ./run.py fxbuild <Project_Name>
|
||||||
./run fxupload <Project_Name>
|
python ./run.py fxupload <Project_Name>
|
||||||
./run fxall <Project_Name>
|
python ./run.py fxall <Project_Name>
|
||||||
```
|
```
|
||||||
|
|
||||||
Windows:
|
Windows:
|
||||||
|
|
||||||
```ps1
|
```ps1
|
||||||
.\run.bat fxbuild <Project_Name>
|
python .\run.py fxbuild <Project_Name>
|
||||||
.\run.bat fxupload <Project_Name>
|
python .\run.py fxupload <Project_Name>
|
||||||
.\run.bat fxall <Project_Name>
|
python .\run.py fxall <Project_Name>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Convert the fxdata.h file to Rust
|
### Convert the fxdata.h file to Rust
|
||||||
|
@ -178,76 +195,20 @@ Windows:
|
||||||
|
|
||||||
In the root of the repo use the command:
|
In the root of the repo use the command:
|
||||||
|
|
||||||
(Don't use "-" in the name because of a cargo feature that takes the "-" and mixes sometimes with a "\_". You will have
|
|
||||||
some weird behavior with the run tool.)
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo new --vcs=none --lib ./Project/newproject
|
python ./run.py new <Project-Name>
|
||||||
```
|
|
||||||
|
|
||||||
Then open the Cargo.toml in your new project and add the following dependencies and settings:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[lib]
|
|
||||||
crate-type = ["staticlib"]
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
|
|
||||||
arduboy-rust = { path = "../../arduboy-rust" }
|
|
||||||
```
|
|
||||||
|
|
||||||
Next jump in your lib.rs file and add the following:
|
|
||||||
|
|
||||||
```rust
|
|
||||||
#![no_std]
|
|
||||||
#![allow(non_upper_case_globals)]
|
|
||||||
|
|
||||||
//Include the Arduboy Library
|
|
||||||
#[allow(unused_imports)]
|
|
||||||
use arduboy_rust::prelude::*;
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
const arduboy: Arduboy2 = Arduboy2::new();
|
|
||||||
|
|
||||||
// Progmem data
|
|
||||||
|
|
||||||
// dynamic ram variables
|
|
||||||
|
|
||||||
// The setup() function runs once when you turn your Arduboy on
|
|
||||||
#[no_mangle]
|
|
||||||
pub unsafe extern "C" fn setup() {
|
|
||||||
// put your setup code here, to run once:
|
|
||||||
}
|
|
||||||
|
|
||||||
// The loop() function repeats forever after setup() is done
|
|
||||||
#[no_mangle]
|
|
||||||
#[export_name = "loop"]
|
|
||||||
pub unsafe extern "C" fn loop_() {
|
|
||||||
// put your main code here, to run repeatedly:
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Now the last step. Go in the Cargo.toml in the root directory and add your project:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[workspace]
|
|
||||||
members = [
|
|
||||||
#{All other Projects...}
|
|
||||||
"Project/newproject",
|
|
||||||
]
|
|
||||||
resolver = "2"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To run and upload your game use the run tool
|
To run and upload your game use the run tool
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Linux
|
# Linux
|
||||||
./run newproject
|
python ./run.py <Project-Name>
|
||||||
```
|
```
|
||||||
|
|
||||||
```ps1
|
```ps1
|
||||||
# Windows
|
# Windows
|
||||||
.\run.bat newproject
|
python .\run.py <Project-Name>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Creating and building an Arduboy crate [Outdated]
|
## Creating and building an Arduboy crate [Outdated]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../../../import_config.h"
|
#include "imports.h"
|
||||||
|
|
||||||
#if defined(Arduboy2_Library)
|
#if defined(Arduboy2_Library)
|
||||||
#include <Arduboy2.h>
|
#include <Arduboy2.h>
|
||||||
|
|
|
@ -47,18 +47,18 @@ pub struct ButtonSet {
|
||||||
|
|
||||||
impl ButtonSet {
|
impl ButtonSet {
|
||||||
pub unsafe fn pressed(&self) -> bool {
|
pub unsafe fn pressed(&self) -> bool {
|
||||||
crate::library::arduboy2::pressed(self.flag_set)
|
crate::libraries::arduboy2_library::binding::pressed(self.flag_set)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn just_pressed(&self) -> bool {
|
pub unsafe fn just_pressed(&self) -> bool {
|
||||||
crate::library::arduboy2::just_pressed(self.flag_set)
|
crate::libraries::arduboy2_library::binding::just_pressed(self.flag_set)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn just_released(&self) -> bool {
|
pub unsafe fn just_released(&self) -> bool {
|
||||||
crate::library::arduboy2::just_released(self.flag_set)
|
crate::libraries::arduboy2_library::binding::just_released(self.flag_set)
|
||||||
}
|
}
|
||||||
pub unsafe fn not_pressed(&self) -> bool {
|
pub unsafe fn not_pressed(&self) -> bool {
|
||||||
crate::library::arduboy2::not_pressed(self.flag_set)
|
crate::libraries::arduboy2_library::binding::not_pressed(self.flag_set)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,15 +27,11 @@
|
||||||
|
|
||||||
extern crate panic_halt;
|
extern crate panic_halt;
|
||||||
pub mod hardware;
|
pub mod hardware;
|
||||||
mod library;
|
mod libraries;
|
||||||
pub mod prelude;
|
pub mod prelude;
|
||||||
mod print;
|
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub extern crate heapless;
|
pub extern crate heapless;
|
||||||
pub use crate::library::arduboy2::{self, Arduboy2, Color, FONT_SIZE, HEIGHT, WIDTH};
|
pub use crate::libraries::{
|
||||||
pub use crate::library::arduboy_tones::{self, ArduboyTones};
|
arduboy2_library, arduboy_tones_library, arduboyfx_library, arduino_system, ardvoice_library,
|
||||||
pub use crate::library::ardvoice::{self, ArdVoice};
|
};
|
||||||
pub use crate::library::eeprom::{EEPROM, EEPROMBYTE};
|
|
||||||
pub use crate::library::{arduino, c, sprites};
|
|
||||||
pub use crate::library::arduboyfx::{self};
|
|
||||||
pub mod serial_print;
|
|
||||||
|
|
|
@ -3,16 +3,17 @@
|
||||||
//! All of the functions are safe wrapped inside the [Arduboy2] struct.
|
//! All of the functions are safe wrapped inside the [Arduboy2] struct.
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
|
use super::binding::*;
|
||||||
|
use super::print::Printable;
|
||||||
use crate::hardware::buttons::ButtonSet;
|
use crate::hardware::buttons::ButtonSet;
|
||||||
use crate::print::Printable;
|
|
||||||
use core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong};
|
|
||||||
use core::mem;
|
use core::mem;
|
||||||
use core::ops::Not;
|
use core::ops::Not;
|
||||||
|
|
||||||
/// The standard font size of the arduboy
|
/// The standard font size of the arduboy
|
||||||
///
|
///
|
||||||
/// this is to calculate with it.
|
/// this is to calculate with it.
|
||||||
pub const FONT_SIZE: u8 = 6;
|
pub const FONT_WIDTH: i16 = 6;
|
||||||
|
pub const FONT_HEIGHT: i16 = 8;
|
||||||
/// The standard width of the arduboy
|
/// The standard width of the arduboy
|
||||||
///
|
///
|
||||||
/// this is to calculate with it.
|
/// this is to calculate with it.
|
||||||
|
@ -664,169 +665,3 @@ impl Arduboy2 {
|
||||||
unsafe { arduboy_exit_to_bootloader() }
|
unsafe { arduboy_exit_to_bootloader() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#[link_name = "arduboy_begin"]
|
|
||||||
fn begin();
|
|
||||||
|
|
||||||
#[link_name = "arduboy_clear"]
|
|
||||||
fn clear();
|
|
||||||
|
|
||||||
#[link_name = "arduboy_display"]
|
|
||||||
fn display();
|
|
||||||
|
|
||||||
#[link_name = "arduboy_display_and_clear_buffer"]
|
|
||||||
fn display_and_clear_buffer();
|
|
||||||
|
|
||||||
#[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"]
|
|
||||||
fn draw_fast_vline_raw(x: i16, y: i16, h: u8, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_draw_pixel"]
|
|
||||||
fn draw_pixel_raw(x: i16, y: i16, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_draw_circle"]
|
|
||||||
fn draw_circle_raw(x: i16, y: i16, r: u8, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_draw_rect"]
|
|
||||||
fn draw_rect_raw(x: i16, y: i16, w: u8, h: u8, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_fill_circle"]
|
|
||||||
fn fill_circle_raw(x: i16, y: i16, r: u8, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_fill_rect"]
|
|
||||||
fn fill_rect_raw(x: i16, y: i16, w: u8, h: u8, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_fill_round_rect"]
|
|
||||||
fn fill_round_rect(x: i16, y: i16, w: u8, h: u8, r: u8, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_draw_round_rect"]
|
|
||||||
fn draw_round_rect(x: i16, y: i16, w: u8, h: u8, r: u8, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_fill_triangle"]
|
|
||||||
fn fill_triangle(x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_draw_triangle"]
|
|
||||||
fn draw_triangle(x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16, color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_get_pixel"]
|
|
||||||
fn get_pixel_raw(x: u8, y: u8) -> u8;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_init_random_seed"]
|
|
||||||
fn init_random_seed();
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_just_pressed"]
|
|
||||||
pub fn just_pressed(button: u8) -> bool;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_just_released"]
|
|
||||||
pub fn just_released(button: u8) -> bool;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_not_pressed"]
|
|
||||||
pub fn not_pressed(button: u8) -> bool;
|
|
||||||
|
|
||||||
#[link_name = "arduboy_next_frame"]
|
|
||||||
fn next_frame() -> bool;
|
|
||||||
|
|
||||||
#[link_name = "arduboy_poll_buttons"]
|
|
||||||
fn poll_buttons();
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_pressed"]
|
|
||||||
pub fn pressed(buttons: u8) -> bool;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_print_chars"]
|
|
||||||
pub fn print_chars(cstr: *const c_char);
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_print_chars_progmem"]
|
|
||||||
pub fn print_chars_progmem(pstring: *const c_char);
|
|
||||||
|
|
||||||
// #[link_name = "arduboy_print_char"]
|
|
||||||
// fn print_char(c: c_char) -> c_size_t;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_print_int"]
|
|
||||||
pub fn print_int(n: c_int, base: c_int) -> c_size_t;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_print_long"]
|
|
||||||
pub fn print_long(n: c_long, base: c_int) -> c_size_t;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_print_unsigned_char"]
|
|
||||||
pub fn print_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_print_unsigned_int"]
|
|
||||||
pub fn print_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[link_name = "arduboy_print_unsigned_long"]
|
|
||||||
pub fn print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_cursor"]
|
|
||||||
fn set_cursor(x: i16, y: i16);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_frame_rate"]
|
|
||||||
fn set_frame_rate(rate: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_text_size"]
|
|
||||||
fn set_text_size(size: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_audio_on"]
|
|
||||||
fn arduboy_audio_on();
|
|
||||||
|
|
||||||
#[link_name = "arduboy_audio_off"]
|
|
||||||
fn arduboy_audio_off();
|
|
||||||
|
|
||||||
#[link_name = "arduboy_audio_save_on_off"]
|
|
||||||
fn arduboy_audio_save_on_off();
|
|
||||||
|
|
||||||
#[link_name = "arduboy_audio_toggle"]
|
|
||||||
fn arduboy_audio_toggle();
|
|
||||||
|
|
||||||
#[link_name = "arduboy_audio_enabled"]
|
|
||||||
fn arduboy_audio_enabled() -> bool;
|
|
||||||
|
|
||||||
#[link_name = "arduboy_invert"]
|
|
||||||
fn arduboy_invert(inverse: bool);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_every_x_frames"]
|
|
||||||
fn every_x_frames(frames: u8) -> bool;
|
|
||||||
|
|
||||||
#[link_name = "arduboy_flip_horizontal"]
|
|
||||||
fn flip_horizontal(flipped: bool);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_flip_vertical"]
|
|
||||||
fn flip_vertical(flipped: bool);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_text_color"]
|
|
||||||
fn set_text_color(color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_text_background_color"]
|
|
||||||
fn set_text_background_color(color: u8);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_cursor_x"]
|
|
||||||
fn set_cursor_x(x: i16);
|
|
||||||
#[link_name = "arduboy_set_cursor_y"]
|
|
||||||
fn set_cursor_y(y: i16);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_text_wrap"]
|
|
||||||
fn set_text_wrap(w: bool);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_idle"]
|
|
||||||
fn idle();
|
|
||||||
|
|
||||||
#[link_name = "arduboy_digital_write_rgb_single"]
|
|
||||||
fn digital_write_rgb_single(color: c_uchar, val: c_uchar);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_digital_write_rgb"]
|
|
||||||
fn digital_write_rgb(red: c_uchar, green: c_uchar, blue: c_uchar);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_rgb_led_single"]
|
|
||||||
fn set_rgb_led_single(color: c_uchar, val: c_uchar);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_set_rgb_led"]
|
|
||||||
fn set_rgb_led(red: c_uchar, green: c_uchar, blue: c_uchar);
|
|
||||||
|
|
||||||
#[link_name = "arduboy_buttons_state"]
|
|
||||||
fn arduboy_buttons_state() -> u8;
|
|
||||||
|
|
||||||
#[link_name = "arduboy_exit_to_bootloader"]
|
|
||||||
fn arduboy_exit_to_bootloader();
|
|
||||||
}
|
|
168
arduboy-rust/src/libraries/arduboy2_library/binding.rs
Normal file
168
arduboy-rust/src/libraries/arduboy2_library/binding.rs
Normal file
|
@ -0,0 +1,168 @@
|
||||||
|
use core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong};
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#[link_name = "arduboy_begin"]
|
||||||
|
pub fn begin();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_clear"]
|
||||||
|
pub fn clear();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_display"]
|
||||||
|
pub fn display();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_display_and_clear_buffer"]
|
||||||
|
pub fn display_and_clear_buffer();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_draw_fast_hline"]
|
||||||
|
pub fn draw_fast_hline_raw(x: i16, y: i16, w: u8, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_draw_fast_vline"]
|
||||||
|
pub fn draw_fast_vline_raw(x: i16, y: i16, h: u8, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_draw_pixel"]
|
||||||
|
pub fn draw_pixel_raw(x: i16, y: i16, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_draw_circle"]
|
||||||
|
pub fn draw_circle_raw(x: i16, y: i16, r: u8, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_draw_rect"]
|
||||||
|
pub fn draw_rect_raw(x: i16, y: i16, w: u8, h: u8, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_fill_circle"]
|
||||||
|
pub fn fill_circle_raw(x: i16, y: i16, r: u8, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_fill_rect"]
|
||||||
|
pub fn fill_rect_raw(x: i16, y: i16, w: u8, h: u8, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_fill_round_rect"]
|
||||||
|
pub fn fill_round_rect(x: i16, y: i16, w: u8, h: u8, r: u8, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_draw_round_rect"]
|
||||||
|
pub fn draw_round_rect(x: i16, y: i16, w: u8, h: u8, r: u8, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_fill_triangle"]
|
||||||
|
pub fn fill_triangle(x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_draw_triangle"]
|
||||||
|
pub fn draw_triangle(x0: i16, y0: i16, x1: i16, y1: i16, x2: i16, y2: i16, color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_get_pixel"]
|
||||||
|
pub fn get_pixel_raw(x: u8, y: u8) -> u8;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_init_random_seed"]
|
||||||
|
pub fn init_random_seed();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_just_pressed"]
|
||||||
|
pub fn just_pressed(button: u8) -> bool;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_just_released"]
|
||||||
|
pub fn just_released(button: u8) -> bool;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_not_pressed"]
|
||||||
|
pub fn not_pressed(button: u8) -> bool;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_next_frame"]
|
||||||
|
pub fn next_frame() -> bool;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_poll_buttons"]
|
||||||
|
pub fn poll_buttons();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_pressed"]
|
||||||
|
pub fn pressed(buttons: u8) -> bool;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_print_chars"]
|
||||||
|
pub fn print_chars(cstr: *const c_char);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_print_chars_progmem"]
|
||||||
|
pub fn print_chars_progmem(pstring: *const c_char);
|
||||||
|
|
||||||
|
// #[link_name = "arduboy_print_char"]
|
||||||
|
// fn print_char(c: c_char) -> c_size_t;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_print_int"]
|
||||||
|
pub fn print_int(n: c_int, base: c_int) -> c_size_t;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_print_long"]
|
||||||
|
pub fn print_long(n: c_long, base: c_int) -> c_size_t;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_print_unsigned_char"]
|
||||||
|
pub fn print_unsigned_char(n: c_uchar, base: c_int) -> c_size_t;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_print_unsigned_int"]
|
||||||
|
pub fn print_unsigned_int(n: c_uint, base: c_int) -> c_size_t;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_print_unsigned_long"]
|
||||||
|
pub fn print_unsigned_long(n: c_ulong, base: c_int) -> c_size_t;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_cursor"]
|
||||||
|
pub fn set_cursor(x: i16, y: i16);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_frame_rate"]
|
||||||
|
pub fn set_frame_rate(rate: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_text_size"]
|
||||||
|
pub fn set_text_size(size: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_audio_on"]
|
||||||
|
pub fn arduboy_audio_on();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_audio_off"]
|
||||||
|
pub fn arduboy_audio_off();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_audio_save_on_off"]
|
||||||
|
pub fn arduboy_audio_save_on_off();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_audio_toggle"]
|
||||||
|
pub fn arduboy_audio_toggle();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_audio_enabled"]
|
||||||
|
pub fn arduboy_audio_enabled() -> bool;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_invert"]
|
||||||
|
pub fn arduboy_invert(inverse: bool);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_every_x_frames"]
|
||||||
|
pub fn every_x_frames(frames: u8) -> bool;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_flip_horizontal"]
|
||||||
|
pub fn flip_horizontal(flipped: bool);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_flip_vertical"]
|
||||||
|
pub fn flip_vertical(flipped: bool);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_text_color"]
|
||||||
|
pub fn set_text_color(color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_text_background_color"]
|
||||||
|
pub fn set_text_background_color(color: u8);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_cursor_x"]
|
||||||
|
pub fn set_cursor_x(x: i16);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_cursor_y"]
|
||||||
|
pub fn set_cursor_y(y: i16);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_text_wrap"]
|
||||||
|
pub fn set_text_wrap(w: bool);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_idle"]
|
||||||
|
pub fn idle();
|
||||||
|
|
||||||
|
#[link_name = "arduboy_digital_write_rgb_single"]
|
||||||
|
pub fn digital_write_rgb_single(color: c_uchar, val: c_uchar);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_digital_write_rgb"]
|
||||||
|
pub fn digital_write_rgb(red: c_uchar, green: c_uchar, blue: c_uchar);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_rgb_led_single"]
|
||||||
|
pub fn set_rgb_led_single(color: c_uchar, val: c_uchar);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_set_rgb_led"]
|
||||||
|
pub fn set_rgb_led(red: c_uchar, green: c_uchar, blue: c_uchar);
|
||||||
|
|
||||||
|
#[link_name = "arduboy_buttons_state"]
|
||||||
|
pub fn arduboy_buttons_state() -> u8;
|
||||||
|
|
||||||
|
#[link_name = "arduboy_exit_to_bootloader"]
|
||||||
|
pub fn arduboy_exit_to_bootloader();
|
||||||
|
}
|
12
arduboy-rust/src/libraries/arduboy2_library/mod.rs
Normal file
12
arduboy-rust/src/libraries/arduboy2_library/mod.rs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
//! 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.
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub mod arduboy2;
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub mod binding;
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub mod print;
|
||||||
|
|
||||||
|
pub mod sprites;
|
||||||
|
pub use arduboy2::{Arduboy2, Color, Point, Rect, FONT_HEIGHT, FONT_WIDTH, HEIGHT, WIDTH};
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::prelude::Pstring;
|
use crate::arduino_system::progmem::Pstring;
|
||||||
use core::ffi::c_int;
|
use core::ffi::c_int;
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
|
||||||
|
@ -28,7 +28,7 @@ impl Printable for i16 {
|
||||||
|
|
||||||
fn print_2(self, params: Self::Parameters) {
|
fn print_2(self, params: Self::Parameters) {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::library::arduboy2::print_int(self, params as c_int);
|
super::binding::print_int(self, params as c_int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ impl Printable for u16 {
|
||||||
|
|
||||||
fn print_2(self, params: Self::Parameters) {
|
fn print_2(self, params: Self::Parameters) {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::library::arduboy2::print_unsigned_int(self, params as c_int);
|
super::binding::print_unsigned_int(self, params as c_int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ impl Printable for i32 {
|
||||||
|
|
||||||
fn print_2(self, params: Self::Parameters) {
|
fn print_2(self, params: Self::Parameters) {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::library::arduboy2::print_long(self, params as c_int);
|
super::binding::print_long(self, params as c_int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ impl Printable for u32 {
|
||||||
|
|
||||||
fn print_2(self, params: Self::Parameters) {
|
fn print_2(self, params: Self::Parameters) {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::library::arduboy2::print_unsigned_long(self, params as c_int);
|
super::binding::print_unsigned_long(self, params as c_int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ impl Printable for &[u8] {
|
||||||
|
|
||||||
fn print_2(self, _params: Self::Parameters) {
|
fn print_2(self, _params: Self::Parameters) {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::library::arduboy2::print_chars(self as *const [u8] as *const i8);
|
super::binding::print_chars(self as *const [u8] as *const i8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ impl Printable for &str {
|
||||||
|
|
||||||
fn print_2(self, _params: Self::Parameters) {
|
fn print_2(self, _params: Self::Parameters) {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::library::arduboy2::print_chars(self.as_bytes() as *const [u8] as *const i8);
|
super::binding::print_chars(self.as_bytes() as *const [u8] as *const i8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ impl<const N: usize> Printable for crate::heapless::String<N> {
|
||||||
|
|
||||||
fn print_2(self, _params: Self::Parameters) {
|
fn print_2(self, _params: Self::Parameters) {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::library::arduboy2::print_chars(self.as_bytes() as *const [u8] as *const i8);
|
super::binding::print_chars(self.as_bytes() as *const [u8] as *const i8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ impl Printable for Pstring {
|
||||||
|
|
||||||
fn print_2(self, _params: Self::Parameters) {
|
fn print_2(self, _params: Self::Parameters) {
|
||||||
unsafe {
|
unsafe {
|
||||||
crate::library::arduboy2::print_chars_progmem(self.pointer);
|
super::binding::print_chars_progmem(self.pointer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
//!This is the Module to interact in a save way with the ArduboyTones C++ library.
|
|
||||||
//!
|
|
||||||
//! You will need to uncomment the ArduboyTones_Library in the import_config.h file.
|
|
||||||
pub mod tones_pitch;
|
|
||||||
|
|
||||||
use core::ffi::{c_uchar, c_uint, c_ulong};
|
use core::ffi::{c_uchar, c_uint, c_ulong};
|
||||||
|
|
||||||
///This is the struct to interact in a save way with the ArduboyTones C++ library.
|
///This is the struct to interact in a save way with the ArduboyTones C++ library.
|
||||||
///
|
///
|
||||||
/// You will need to uncomment the ArduboyTones_Library in the import_config.h file.
|
/// You will need to uncomment the ArduboyTones_Library in the import_config.h file.
|
||||||
|
|
||||||
pub struct ArduboyTones {}
|
pub struct ArduboyTones {}
|
||||||
impl ArduboyTones {
|
impl ArduboyTones {
|
||||||
///Get a new instance of [ArduboyTones]
|
///Get a new instance of [ArduboyTones]
|
||||||
|
@ -71,9 +67,9 @@ impl ArduboyTones {
|
||||||
/// Example:
|
/// Example:
|
||||||
/// ```
|
/// ```
|
||||||
/// use arduboy_rust::prelude::*;
|
/// use arduboy_rust::prelude::*;
|
||||||
/// const sound:ArduboyTones=ArduboyTones::new();
|
/// const sound: ArduboyTones = ArduboyTones::new();
|
||||||
/// progmem!(
|
/// progmem!(
|
||||||
/// static sound1:[u8;_]=[220,1000, 0,250, 440,500, 880,2000,TONES_END];
|
/// static sound1: [u8; _] = [220, 1000, 0, 250, 440, 500, 880, 2000, TONES_END];
|
||||||
/// );
|
/// );
|
||||||
///
|
///
|
||||||
/// sound.tones(get_tones_addr!(sound1));
|
/// sound.tones(get_tones_addr!(sound1));
|
8
arduboy-rust/src/libraries/arduboy_tones_library/mod.rs
Normal file
8
arduboy-rust/src/libraries/arduboy_tones_library/mod.rs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
//!This is the Module to interact in a save way with the ArduboyTones C++ library.
|
||||||
|
//!
|
||||||
|
//! You will need to uncomment the ArduboyTones_Library in the import_config.h file.
|
||||||
|
#[doc(hidden)]
|
||||||
|
mod arduboy_tones;
|
||||||
|
pub mod tones_pitch;
|
||||||
|
|
||||||
|
pub use arduboy_tones::ArduboyTones;
|
|
@ -1,5 +1,5 @@
|
||||||
|
use crate::libraries::arduino_system::progmem::Pstring;
|
||||||
use core::ffi::{c_char, c_uchar, c_ulong};
|
use core::ffi::{c_char, c_uchar, c_ulong};
|
||||||
use crate::library::progmem::Pstring;
|
|
||||||
|
|
||||||
pub trait DrawableString
|
pub trait DrawableString
|
||||||
where
|
where
|
11
arduboy-rust/src/libraries/arduboyfx_library/mod.rs
Normal file
11
arduboy-rust/src/libraries/arduboyfx_library/mod.rs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
//! This is the Module to interact in a save way with the ArduboyFX C++ library.
|
||||||
|
//!
|
||||||
|
//! You will need to uncomment the ArduboyFX_Library in the import_config.h file.
|
||||||
|
mod drawable_number;
|
||||||
|
pub mod fx_consts;
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use drawable_number::DrawableNumber;
|
||||||
|
mod drawable_string;
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub use drawable_string::DrawableString;
|
||||||
|
pub mod fx;
|
|
@ -1,3 +1,4 @@
|
||||||
|
//!This is the module to interact with the eeprom memory
|
||||||
use core::ffi::{c_int, c_uchar};
|
use core::ffi::{c_int, c_uchar};
|
||||||
|
|
||||||
pub const EEPROM_STORAGE_SPACE_START: i16 = 16;
|
pub const EEPROM_STORAGE_SPACE_START: i16 = 16;
|
7
arduboy-rust/src/libraries/arduino_system/mod.rs
Normal file
7
arduboy-rust/src/libraries/arduino_system/mod.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
//!This module contains all the Arduino system functions to interact with the hardware.
|
||||||
|
|
||||||
|
pub mod arduino;
|
||||||
|
pub mod c;
|
||||||
|
pub mod eeprom;
|
||||||
|
pub mod progmem;
|
||||||
|
pub mod serial_print;
|
|
@ -1,3 +1,4 @@
|
||||||
|
//!This is the module to interact with the progmem memory
|
||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
/// Create a space for Progmem variable
|
/// Create a space for Progmem variable
|
||||||
/// ## Example
|
/// ## Example
|
|
@ -1,10 +1,10 @@
|
||||||
//! This is the Module to interact in a save way with the Arduino Serial C++ library.
|
//! This is the Module to interact in a save way with the Arduino Serial C++ library.
|
||||||
//!
|
//!
|
||||||
//! You will need to uncomment the Arduino_Serial_Library in the import_config.h file.
|
//! You will need to uncomment the Arduino_Serial_Library in the import_config.h file.
|
||||||
use crate::prelude::Pstring;
|
use crate::arduino_system::progmem::Pstring;
|
||||||
use core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong};
|
use core::ffi::{c_char, c_int, c_long, c_size_t, c_uchar, c_uint, c_ulong};
|
||||||
|
|
||||||
use crate::print::Base;
|
use crate::libraries::arduboy2_library::print::Base;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#[link_name = "arduino_serial_begin"]
|
#[link_name = "arduino_serial_begin"]
|
||||||
fn serial_begin(serial: c_ulong);
|
fn serial_begin(serial: c_ulong);
|
5
arduboy-rust/src/libraries/ardvoice_library/mod.rs
Normal file
5
arduboy-rust/src/libraries/ardvoice_library/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
//! This is the Module to interact in a save way with the ArdVoice C++ library.
|
||||||
|
//!
|
||||||
|
//! You will need to uncomment the ArdVoice_Library in the import_config.h file.
|
||||||
|
mod ardvoice;
|
||||||
|
pub use ardvoice::ArdVoice;
|
5
arduboy-rust/src/libraries/mod.rs
Normal file
5
arduboy-rust/src/libraries/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pub mod arduboy2_library;
|
||||||
|
pub mod arduboy_tones_library;
|
||||||
|
pub mod arduino_system;
|
||||||
|
pub mod arduboyfx_library;
|
||||||
|
pub mod ardvoice_library;
|
|
@ -1,9 +0,0 @@
|
||||||
//! This is the Module to interact in a save way with the ArduboyFX C++ library.
|
|
||||||
//!
|
|
||||||
//! You will need to uncomment the ArduboyFX_Library in the import_config.h file.
|
|
||||||
pub mod fx_consts;
|
|
||||||
mod drawable_number;
|
|
||||||
pub use drawable_number::DrawableNumber;
|
|
||||||
mod drawable_string;
|
|
||||||
pub use drawable_string::DrawableString;
|
|
||||||
pub mod fx;
|
|
|
@ -1,9 +0,0 @@
|
||||||
pub mod arduboy2;
|
|
||||||
pub mod arduboy_tones;
|
|
||||||
pub mod arduino;
|
|
||||||
pub mod ardvoice;
|
|
||||||
pub mod c;
|
|
||||||
pub mod eeprom;
|
|
||||||
pub mod progmem;
|
|
||||||
pub mod sprites;
|
|
||||||
pub mod arduboyfx;
|
|
|
@ -5,23 +5,19 @@
|
||||||
//! use arduboy_rust::prelude::*;
|
//! use arduboy_rust::prelude::*;
|
||||||
//! ```
|
//! ```
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use crate::hardware::buttons::{self, *};
|
pub use crate::hardware::buttons::*;
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use crate::hardware::led::{self, *};
|
pub use crate::hardware::led::*;
|
||||||
pub use crate::heapless::{LinearMap, String, Vec};
|
pub use crate::heapless::{LinearMap, String, Vec};
|
||||||
pub use crate::library::arduboy2::{self, *};
|
pub use crate::libraries::arduboy2_library::*;
|
||||||
pub use crate::library::arduboy_tones::{self, ArduboyTones};
|
pub use crate::libraries::arduboy_tones_library::*;
|
||||||
pub use crate::library::arduboyfx::{self, fx};
|
pub use crate::libraries::arduboyfx_library::*;
|
||||||
pub use crate::library::arduino::*;
|
pub use crate::libraries::arduino_system::arduino::*;
|
||||||
pub use crate::library::ardvoice::{self, ArdVoice};
|
pub use crate::libraries::arduino_system::c::*;
|
||||||
pub use crate::library::c::*;
|
pub use crate::libraries::arduino_system::eeprom::*;
|
||||||
pub use crate::library::eeprom::{EEPROM, EEPROMBYTE, EEPROMBYTECHECKLESS};
|
pub use crate::libraries::arduino_system::progmem::*;
|
||||||
#[doc(hidden)]
|
pub use crate::libraries::arduino_system::serial_print as serial;
|
||||||
pub use crate::library::progmem::Pstring;
|
pub use crate::libraries::ardvoice_library::ArdVoice;
|
||||||
pub use crate::library::sprites;
|
|
||||||
pub use crate::print::*;
|
|
||||||
#[doc(inline)]
|
|
||||||
pub use crate::serial_print as serial;
|
|
||||||
pub use crate::{
|
pub use crate::{
|
||||||
f, get_ardvoice_tone_addr, get_sprite_addr, get_string_addr, get_tones_addr, progmem,
|
f, get_ardvoice_tone_addr, get_sprite_addr, get_string_addr, get_tones_addr, progmem,
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The standard font size of the arduboy"><title>FONT_SIZE in arduboy_rust::arduboy2 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Constant <a href="../index.html">arduboy_rust</a>::<wbr><a href="index.html">arduboy2</a>::<wbr><a class="constant" href="#">FONT_SIZE</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/library/arduboy2.rs.html#15">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub const FONT_SIZE: u8 = 6;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The standard font size of the arduboy</p>
|
|
||||||
<p>this is to calculate with it.</p>
|
|
||||||
</div></details></section></div></main></body></html>
|
|
|
@ -1,3 +0,0 @@
|
||||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The standard height of the arduboy"><title>HEIGHT in arduboy_rust::arduboy2 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Constant <a href="../index.html">arduboy_rust</a>::<wbr><a href="index.html">arduboy2</a>::<wbr><a class="constant" href="#">HEIGHT</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/library/arduboy2.rs.html#23">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub const HEIGHT: i16 = 64;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The standard height of the arduboy</p>
|
|
||||||
<p>this is to calculate with it.</p>
|
|
||||||
</div></details></section></div></main></body></html>
|
|
|
@ -1,3 +0,0 @@
|
||||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The standard width of the arduboy"><title>WIDTH in arduboy_rust::arduboy2 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Constant <a href="../index.html">arduboy_rust</a>::<wbr><a href="index.html">arduboy2</a>::<wbr><a class="constant" href="#">WIDTH</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/library/arduboy2.rs.html#19">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub const WIDTH: i16 = 128;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The standard width of the arduboy</p>
|
|
||||||
<p>this is to calculate with it.</p>
|
|
||||||
</div></details></section></div></main></body></html>
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This is the Module to interact in a save way with the Arduboy2 C++ library."><title>arduboy_rust::arduboy2 - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-cb6f1f67f1bcd037.css" id="mainThemeStyle"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.73.0-nightly (8131b9774 2023-08-02)" data-channel="nightly" data-search-js="search-6dfdfced5eff6596.js" data-settings-js="settings-de11bff964e9d4e5.js" data-settings-css="settings-8c76f75bfb6bd192.css" data-theme-light-css="light-6d2c9675f3d09c26.css" data-theme-dark-css="dark-45ceb8f2e522f4d1.css" data-theme-ayu-css="ayu-fd19013d6ce078bf.css" ><script src="../../static.files/storage-db41da1a38ea3cb8.js"></script><script defer src="../../static.files/main-0795b7d26be81095.js"></script><noscript><link rel="stylesheet" media="(prefers-color-scheme:light)" href="../../static.files/light-6d2c9675f3d09c26.css"><link rel="stylesheet" media="(prefers-color-scheme:dark)" href="../../static.files/dark-45ceb8f2e522f4d1.css"><link rel="stylesheet" href="../../static.files/noscript-cffde32267a19fd6.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2></h2></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2 class="location"><a href="#">Module arduboy2</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">arduboy_rust</a>::<wbr><a class="mod" href="#">arduboy2</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/library/arduboy2.rs.html#1-832">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This is the Module to interact in a save way with the Arduboy2 C++ library.</p>
|
|
||||||
<p>All of the functions are safe wrapped inside the <a href="../prelude/arduboy2/struct.Arduboy2.html" title="struct arduboy_rust::prelude::arduboy2::Arduboy2">Arduboy2</a> struct.</p>
|
|
||||||
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Arduboy2.html" title="struct arduboy_rust::arduboy2::Arduboy2">Arduboy2</a></div><div class="desc docblock-short">This is the struct to interact in a save way with the Arduboy2 C++ library.</div></li><li><div class="item-name"><a class="struct" href="struct.Point.html" title="struct arduboy_rust::arduboy2::Point">Point</a></div><div class="desc docblock-short">This struct is used by a few Arduboy functions.</div></li><li><div class="item-name"><a class="struct" href="struct.Rect.html" title="struct arduboy_rust::arduboy2::Rect">Rect</a></div><div class="desc docblock-short">This struct is used by a few Arduboy functions.</div></li></ul><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.Color.html" title="enum arduboy_rust::arduboy2::Color">Color</a></div><div class="desc docblock-short">This item is to chose between Black or White</div></li></ul><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2><ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.FONT_SIZE.html" title="constant arduboy_rust::arduboy2::FONT_SIZE">FONT_SIZE</a></div><div class="desc docblock-short">The standard font size of the arduboy</div></li><li><div class="item-name"><a class="constant" href="constant.HEIGHT.html" title="constant arduboy_rust::arduboy2::HEIGHT">HEIGHT</a></div><div class="desc docblock-short">The standard height of the arduboy</div></li><li><div class="item-name"><a class="constant" href="constant.WIDTH.html" title="constant arduboy_rust::arduboy2::WIDTH">WIDTH</a></div><div class="desc docblock-short">The standard width of the arduboy</div></li></ul></section></div></main></body></html>
|
|
|
@ -1 +0,0 @@
|
||||||
window.SIDEBAR_ITEMS = {"constant":["FONT_SIZE","HEIGHT","WIDTH"],"enum":["Color"],"struct":["Arduboy2","Point","Rect"]};
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0;URL=../../../arduboy_rust/prelude/constant.FONT_HEIGHT.html">
|
||||||
|
<title>Redirection</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Redirecting to <a href="../../../arduboy_rust/prelude/constant.FONT_HEIGHT.html">../../../arduboy_rust/prelude/constant.FONT_HEIGHT.html</a>...</p>
|
||||||
|
<script>location.replace("../../../arduboy_rust/prelude/constant.FONT_HEIGHT.html" + location.search + location.hash);</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0;URL=../../../arduboy_rust/prelude/constant.FONT_WIDTH.html">
|
||||||
|
<title>Redirection</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Redirecting to <a href="../../../arduboy_rust/prelude/constant.FONT_WIDTH.html">../../../arduboy_rust/prelude/constant.FONT_WIDTH.html</a>...</p>
|
||||||
|
<script>location.replace("../../../arduboy_rust/prelude/constant.FONT_WIDTH.html" + location.search + location.hash);</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0;URL=../../../arduboy_rust/prelude/constant.HEIGHT.html">
|
||||||
|
<title>Redirection</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Redirecting to <a href="../../../arduboy_rust/prelude/constant.HEIGHT.html">../../../arduboy_rust/prelude/constant.HEIGHT.html</a>...</p>
|
||||||
|
<script>location.replace("../../../arduboy_rust/prelude/constant.HEIGHT.html" + location.search + location.hash);</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0;URL=../../../arduboy_rust/prelude/constant.WIDTH.html">
|
||||||
|
<title>Redirection</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Redirecting to <a href="../../../arduboy_rust/prelude/constant.WIDTH.html">../../../arduboy_rust/prelude/constant.WIDTH.html</a>...</p>
|
||||||
|
<script>location.replace("../../../arduboy_rust/prelude/constant.WIDTH.html" + location.search + location.hash);</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0;URL=../../../arduboy_rust/prelude/enum.Color.html">
|
||||||
|
<title>Redirection</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Redirecting to <a href="../../../arduboy_rust/prelude/enum.Color.html">../../../arduboy_rust/prelude/enum.Color.html</a>...</p>
|
||||||
|
<script>location.replace("../../../arduboy_rust/prelude/enum.Color.html" + location.search + location.hash);</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0;URL=../../../arduboy_rust/prelude/struct.Arduboy2.html">
|
||||||
|
<title>Redirection</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Redirecting to <a href="../../../arduboy_rust/prelude/struct.Arduboy2.html">../../../arduboy_rust/prelude/struct.Arduboy2.html</a>...</p>
|
||||||
|
<script>location.replace("../../../arduboy_rust/prelude/struct.Arduboy2.html" + location.search + location.hash);</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0;URL=../../../arduboy_rust/prelude/struct.Point.html">
|
||||||
|
<title>Redirection</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Redirecting to <a href="../../../arduboy_rust/prelude/struct.Point.html">../../../arduboy_rust/prelude/struct.Point.html</a>...</p>
|
||||||
|
<script>location.replace("../../../arduboy_rust/prelude/struct.Point.html" + location.search + location.hash);</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="0;URL=../../../arduboy_rust/prelude/struct.Rect.html">
|
||||||
|
<title>Redirection</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Redirecting to <a href="../../../arduboy_rust/prelude/struct.Rect.html">../../../arduboy_rust/prelude/struct.Rect.html</a>...</p>
|
||||||
|
<script>location.replace("../../../arduboy_rust/prelude/struct.Rect.html" + location.search + location.hash);</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `FONT_HEIGHT` constant in crate `arduboy_rust`."><title>FONT_HEIGHT in arduboy_rust::arduboy2_library - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Constant <a href="../index.html">arduboy_rust</a>::<wbr><a href="index.html">arduboy2_library</a>::<wbr><a class="constant" href="#">FONT_HEIGHT</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/libraries\arduboy2_library/arduboy2.rs.html#16">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub const FONT_HEIGHT: i16 = 8;</code></pre></section></div></main></body></html>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The standard font size of the arduboy"><title>FONT_WIDTH in arduboy_rust::arduboy2_library - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Constant <a href="../index.html">arduboy_rust</a>::<wbr><a href="index.html">arduboy2_library</a>::<wbr><a class="constant" href="#">FONT_WIDTH</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/libraries\arduboy2_library/arduboy2.rs.html#15">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub const FONT_WIDTH: i16 = 6;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The standard font size of the arduboy</p>
|
||||||
|
<p>this is to calculate with it.</p>
|
||||||
|
</div></details></section></div></main></body></html>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The standard height of the arduboy"><title>HEIGHT in arduboy_rust::arduboy2_library - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Constant <a href="../index.html">arduboy_rust</a>::<wbr><a href="index.html">arduboy2_library</a>::<wbr><a class="constant" href="#">HEIGHT</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/libraries\arduboy2_library/arduboy2.rs.html#24">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub const HEIGHT: i16 = 64;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The standard height of the arduboy</p>
|
||||||
|
<p>this is to calculate with it.</p>
|
||||||
|
</div></details></section></div></main></body></html>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The standard width of the arduboy"><title>WIDTH in arduboy_rust::arduboy2_library - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Constant <a href="../index.html">arduboy_rust</a>::<wbr><a href="index.html">arduboy2_library</a>::<wbr><a class="constant" href="#">WIDTH</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/libraries\arduboy2_library/arduboy2.rs.html#20">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub const WIDTH: i16 = 128;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The standard width of the arduboy</p>
|
||||||
|
<p>this is to calculate with it.</p>
|
||||||
|
</div></details></section></div></main></body></html>
|
26
docs/doc/arduboy_rust/arduboy2_library/enum.Color.html
Normal file
26
docs/doc/arduboy_rust/arduboy2_library/enum.Color.html
Normal file
File diff suppressed because one or more lines are too long
3
docs/doc/arduboy_rust/arduboy2_library/index.html
Normal file
3
docs/doc/arduboy_rust/arduboy2_library/index.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This is the Module to interact in a save way with the Arduboy2 C++ library."><title>arduboy_rust::arduboy2_library - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../arduboy_rust/index.html"><img class="rust-logo" src="../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2 class="location"><a href="#">Module arduboy2_library</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../index.html">arduboy_rust</a>::<wbr><a class="mod" href="#">arduboy2_library</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/arduboy_rust/libraries\arduboy2_library/mod.rs.html#1-12">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This is the Module to interact in a save way with the Arduboy2 C++ library.</p>
|
||||||
|
<p>All of the functions are safe wrapped inside the <a href="../prelude/struct.Arduboy2.html" title="struct arduboy_rust::prelude::Arduboy2">Arduboy2</a> struct.</p>
|
||||||
|
</div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="sprites/index.html" title="mod arduboy_rust::arduboy2_library::sprites">sprites</a></div><div class="desc docblock-short">This is the module to interact in a save way with the Sprites C++ library.</div></li></ul><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Arduboy2.html" title="struct arduboy_rust::arduboy2_library::Arduboy2">Arduboy2</a></div><div class="desc docblock-short">This is the struct to interact in a save way with the Arduboy2 C++ library.</div></li><li><div class="item-name"><a class="struct" href="struct.Point.html" title="struct arduboy_rust::arduboy2_library::Point">Point</a></div><div class="desc docblock-short">This struct is used by a few Arduboy functions.</div></li><li><div class="item-name"><a class="struct" href="struct.Rect.html" title="struct arduboy_rust::arduboy2_library::Rect">Rect</a></div><div class="desc docblock-short">This struct is used by a few Arduboy functions.</div></li></ul><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.Color.html" title="enum arduboy_rust::arduboy2_library::Color">Color</a></div><div class="desc docblock-short">This item is to chose between Black or White</div></li></ul><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2><ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.FONT_HEIGHT.html" title="constant arduboy_rust::arduboy2_library::FONT_HEIGHT">FONT_HEIGHT</a></div></li><li><div class="item-name"><a class="constant" href="constant.FONT_WIDTH.html" title="constant arduboy_rust::arduboy2_library::FONT_WIDTH">FONT_WIDTH</a></div><div class="desc docblock-short">The standard font size of the arduboy</div></li><li><div class="item-name"><a class="constant" href="constant.HEIGHT.html" title="constant arduboy_rust::arduboy2_library::HEIGHT">HEIGHT</a></div><div class="desc docblock-short">The standard height of the arduboy</div></li><li><div class="item-name"><a class="constant" href="constant.WIDTH.html" title="constant arduboy_rust::arduboy2_library::WIDTH">WIDTH</a></div><div class="desc docblock-short">The standard width of the arduboy</div></li></ul></section></div></main></body></html>
|
1
docs/doc/arduboy_rust/arduboy2_library/sidebar-items.js
Normal file
1
docs/doc/arduboy_rust/arduboy2_library/sidebar-items.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
window.SIDEBAR_ITEMS = {"constant":["FONT_HEIGHT","FONT_WIDTH","HEIGHT","WIDTH"],"enum":["Color"],"mod":["sprites"],"struct":["Arduboy2","Point","Rect"]};
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="“Erase” a sprite."><title>draw_erase in arduboy_rust::arduboy2_library::sprites - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library::sprites</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../../index.html">arduboy_rust</a>::<wbr><a href="../index.html">arduboy2_library</a>::<wbr><a href="index.html">sprites</a>::<wbr><a class="fn" href="#">draw_erase</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../../src/arduboy_rust/libraries\arduboy2_library/sprites.rs.html#149-151">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub fn draw_erase(x: i16, y: i16, bitmap: *const u8, frame: u8)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>“Erase” a sprite.</p>
|
||||||
|
<p>Parameters</p>
|
||||||
|
<ul>
|
||||||
|
<li>x,y The coordinates of the top left pixel location.</li>
|
||||||
|
<li>bitmap A pointer to the array containing the image frames.</li>
|
||||||
|
<li>frame The frame number of the image to erase.</li>
|
||||||
|
</ul>
|
||||||
|
<p>The data from the specified frame in the array is used to erase a sprite. To “erase” a sprite, bits set to 1 in the frame will set the corresponding pixel in the buffer to 0. Frame bits set to 0 will remain unchanged in the buffer.</p>
|
||||||
|
<div class="example-wrap"><pre class="language-text"><code> image before after (# = 1, - = 0)
|
||||||
|
|
||||||
|
----- ----- -----
|
||||||
|
--#-- ----- -----
|
||||||
|
##-## ----- -----
|
||||||
|
--#-- ----- -----
|
||||||
|
----- ----- -----
|
||||||
|
|
||||||
|
image before after
|
||||||
|
|
||||||
|
----- ##### #####
|
||||||
|
--#-- ##### ##-##
|
||||||
|
##-## ##### --#--
|
||||||
|
--#-- ##### ##-##
|
||||||
|
----- ##### #####
|
||||||
|
</code></pre></div></div></details></section></div></main></body></html>
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Draw a sprite using a separate image and mask array."><title>draw_external_mask in arduboy_rust::arduboy2_library::sprites - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library::sprites</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../../index.html">arduboy_rust</a>::<wbr><a href="../index.html">arduboy2_library</a>::<wbr><a href="index.html">sprites</a>::<wbr><a class="fn" href="#">draw_external_mask</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../../src/arduboy_rust/libraries\arduboy2_library/sprites.rs.html#84-93">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub fn draw_external_mask(
|
||||||
|
x: i16,
|
||||||
|
y: i16,
|
||||||
|
bitmap: *const u8,
|
||||||
|
mask: *const u8,
|
||||||
|
frame: u8,
|
||||||
|
mask_frame: u8
|
||||||
|
)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Draw a sprite using a separate image and mask array.</p>
|
||||||
|
<p>Parameters</p>
|
||||||
|
<ul>
|
||||||
|
<li>x,y The coordinates of the top left pixel location.</li>
|
||||||
|
<li>bitmap A pointer to the array containing the image frames.</li>
|
||||||
|
<li>mask A pointer to the array containing the mask frames.</li>
|
||||||
|
<li>frame The frame number of the image to draw.</li>
|
||||||
|
<li>mask_frame The frame number for the mask to use (can be different from the image frame number).</li>
|
||||||
|
</ul>
|
||||||
|
<p>An array containing the image frames, and another array containing corresponding mask frames, are used to draw a sprite.</p>
|
||||||
|
<p>For the mask array, the width and height are not included but must contain data of the same dimensions as the corresponding image array.</p>
|
||||||
|
<p>Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.</p>
|
||||||
|
<div class="example-wrap"><pre class="language-text"><code> image mask before after (# = 1, - = 0)
|
||||||
|
|
||||||
|
----- -###- ----- -----
|
||||||
|
--#-- ##### ----- --#--
|
||||||
|
##-## ##-## ----- ##-##
|
||||||
|
--#-- ##### ----- --#--
|
||||||
|
----- -###- ----- -----
|
||||||
|
|
||||||
|
image mask before after
|
||||||
|
|
||||||
|
----- -###- ##### #---#
|
||||||
|
--#-- ##### ##### --#--
|
||||||
|
##-## ##### ##### ##-##
|
||||||
|
--#-- ##### ##### --#--
|
||||||
|
----- -###- ##### #---#
|
||||||
|
</code></pre></div></div></details></section></div></main></body></html>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Draw a sprite by replacing the existing content completely."><title>draw_override in arduboy_rust::arduboy2_library::sprites - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library::sprites</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../../index.html">arduboy_rust</a>::<wbr><a href="../index.html">arduboy2_library</a>::<wbr><a href="index.html">sprites</a>::<wbr><a class="fn" href="#">draw_override</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../../src/arduboy_rust/libraries\arduboy2_library/sprites.rs.html#50-52">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub fn draw_override(x: i16, y: i16, bitmap: *const u8, frame: u8)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Draw a sprite by replacing the existing content completely.</p>
|
||||||
|
<h4 id="parameters"><a href="#parameters">Parameters</a></h4>
|
||||||
|
<ul>
|
||||||
|
<li>x,y The coordinates of the top left pixel location.</li>
|
||||||
|
<li>bitmap A pointer to the array containing the image frames.</li>
|
||||||
|
<li>frame The frame number of the image to draw.</li>
|
||||||
|
</ul>
|
||||||
|
<p>A sprite is drawn by overwriting the pixels in the buffer with the data from the specified frame in the array. No masking is done. A bit set to 1 in the frame will set the pixel to 1 in the buffer, and a 0 in the array will set a 0 in the buffer.</p>
|
||||||
|
<div class="example-wrap"><pre class="language-text"><code> image before after (# = 1, - = 0)
|
||||||
|
|
||||||
|
----- ----- -----
|
||||||
|
--#-- ----- --#--
|
||||||
|
##-## ----- ##-##
|
||||||
|
--#-- ----- --#--
|
||||||
|
----- ----- -----
|
||||||
|
|
||||||
|
image before after
|
||||||
|
|
||||||
|
----- ##### -----
|
||||||
|
--#-- ##### --#--
|
||||||
|
##-## ##### ##-##
|
||||||
|
--#-- ##### --#--
|
||||||
|
----- ##### -----
|
||||||
|
</code></pre></div></div></details></section></div></main></body></html>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Draw a sprite using an array containing both image and mask values."><title>draw_plus_mask in arduboy_rust::arduboy2_library::sprites - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library::sprites</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../../index.html">arduboy_rust</a>::<wbr><a href="../index.html">arduboy2_library</a>::<wbr><a href="index.html">sprites</a>::<wbr><a class="fn" href="#">draw_plus_mask</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../../src/arduboy_rust/libraries\arduboy2_library/sprites.rs.html#121-123">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub fn draw_plus_mask(x: i16, y: i16, bitmap: *const u8, frame: u8)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Draw a sprite using an array containing both image and mask values.</p>
|
||||||
|
<p>Parameters</p>
|
||||||
|
<ul>
|
||||||
|
<li>x,y The coordinates of the top left pixel location.</li>
|
||||||
|
<li>bitmap A pointer to the array containing the image/mask frames.</li>
|
||||||
|
<li>frame The frame number of the image to draw.</li>
|
||||||
|
</ul>
|
||||||
|
<p>An array containing combined image and mask data is used to draw a sprite. Bytes are given in pairs with the first byte representing the image pixels and the second byte specifying the corresponding mask. The width given in the array still specifies the image width, so each row of image and mask bytes will be twice the width value.</p>
|
||||||
|
<p>Bits set to 1 in the mask indicate that the pixel will be set to the value of the corresponding image bit. Bits set to 0 in the mask will be left unchanged.</p>
|
||||||
|
<p>image mask before after (# = 1, - = 0)</p>
|
||||||
|
<div class="example-wrap"><pre class="language-text"><code> ----- -###- ----- -----
|
||||||
|
--#-- ##### ----- --#--
|
||||||
|
##-## ##-## ----- ##-##
|
||||||
|
--#-- ##### ----- --#--
|
||||||
|
----- -###- ----- -----
|
||||||
|
|
||||||
|
image mask before after
|
||||||
|
|
||||||
|
----- -###- ##### #---#
|
||||||
|
--#-- ##### ##### --#--
|
||||||
|
##-## ##### ##### ##-##
|
||||||
|
--#-- ##### ##### --#--
|
||||||
|
----- -###- ##### #---#
|
||||||
|
</code></pre></div></div></details></section></div></main></body></html>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Draw a sprite using only the bits set to 1."><title>draw_self_masked in arduboy_rust::arduboy2_library::sprites - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><div class="sidebar-elems"><h2><a href="index.html">In arduboy_rust::arduboy2_library::sprites</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Function <a href="../../index.html">arduboy_rust</a>::<wbr><a href="../index.html">arduboy2_library</a>::<wbr><a href="index.html">sprites</a>::<wbr><a class="fn" href="#">draw_self_masked</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../../src/arduboy_rust/libraries\arduboy2_library/sprites.rs.html#177-179">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub fn draw_self_masked(x: i16, y: i16, bitmap: *const u8, frame: u8)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Draw a sprite using only the bits set to 1.</p>
|
||||||
|
<p>Parameters</p>
|
||||||
|
<ul>
|
||||||
|
<li>x,y The coordinates of the top left pixel location.</li>
|
||||||
|
<li>bitmap A pointer to the array containing the image frames.</li>
|
||||||
|
<li>frame The frame number of the image to draw.</li>
|
||||||
|
</ul>
|
||||||
|
<p>Bits set to 1 in the frame will be used to draw the sprite by setting the corresponding pixel in the buffer to 1. Bits set to 0 in the frame will remain unchanged in the buffer.</p>
|
||||||
|
<div class="example-wrap"><pre class="language-text"><code> image before after (# = 1, - = 0)
|
||||||
|
|
||||||
|
----- ----- -----
|
||||||
|
--#-- ----- --#--
|
||||||
|
##-## ----- ##-##
|
||||||
|
--#-- ----- --#--
|
||||||
|
----- ----- -----
|
||||||
|
|
||||||
|
image before after
|
||||||
|
|
||||||
|
----- ##### ##### (no change because all pixels were
|
||||||
|
--#-- ##### ##### already white)
|
||||||
|
##-## ##### #####
|
||||||
|
--#-- ##### #####
|
||||||
|
----- ##### #####
|
||||||
|
</code></pre></div></div></details></section></div></main></body></html>
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This is the module to interact in a save way with the Sprites C++ library."><title>arduboy_rust::arduboy2_library::sprites - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="arduboy_rust" data-themes="" data-resource-suffix="" data-rustdoc-version="1.75.0-nightly (2bbb61989 2023-10-04)" data-channel="nightly" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../../arduboy_rust/index.html"><img class="rust-logo" src="../../../static.files/rust-logo-151179464ae7ed46.svg" alt="logo"></a><h2 class="location"><a href="#">Module sprites</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#functions">Functions</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../../index.html">arduboy_rust</a>::<wbr><a href="../index.html">arduboy2_library</a>::<wbr><a class="mod" href="#">sprites</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../../src/arduboy_rust/libraries\arduboy2_library/sprites.rs.html#1-179">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This is the module to interact in a save way with the Sprites C++ library.</p>
|
||||||
|
</div></details><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2><ul class="item-table"><li><div class="item-name"><a class="fn" href="fn.draw_erase.html" title="fn arduboy_rust::arduboy2_library::sprites::draw_erase">draw_erase</a></div><div class="desc docblock-short">“Erase” a sprite.</div></li><li><div class="item-name"><a class="fn" href="fn.draw_external_mask.html" title="fn arduboy_rust::arduboy2_library::sprites::draw_external_mask">draw_external_mask</a></div><div class="desc docblock-short">Draw a sprite using a separate image and mask array.</div></li><li><div class="item-name"><a class="fn" href="fn.draw_override.html" title="fn arduboy_rust::arduboy2_library::sprites::draw_override">draw_override</a></div><div class="desc docblock-short">Draw a sprite by replacing the existing content completely.</div></li><li><div class="item-name"><a class="fn" href="fn.draw_plus_mask.html" title="fn arduboy_rust::arduboy2_library::sprites::draw_plus_mask">draw_plus_mask</a></div><div class="desc docblock-short">Draw a sprite using an array containing both image and mask values.</div></li><li><div class="item-name"><a class="fn" href="fn.draw_self_masked.html" title="fn arduboy_rust::arduboy2_library::sprites::draw_self_masked">draw_self_masked</a></div><div class="desc docblock-short">Draw a sprite using only the bits set to 1.</div></li></ul></section></div></main></body></html>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue