reordering the crate and addind more documentation
This commit is contained in:
parent
2111e26566
commit
6fb155dff3
14 changed files with 637 additions and 174 deletions
|
@ -43,18 +43,18 @@ pub struct ButtonSet {
|
|||
|
||||
impl ButtonSet {
|
||||
pub unsafe fn pressed(&self) -> bool {
|
||||
crate::library::arduboy::pressed(self.flag_set)
|
||||
crate::library::arduboy2::pressed(self.flag_set)
|
||||
}
|
||||
|
||||
pub unsafe fn just_pressed(&self) -> bool {
|
||||
crate::library::arduboy::just_pressed(self.flag_set)
|
||||
crate::library::arduboy2::just_pressed(self.flag_set)
|
||||
}
|
||||
|
||||
pub unsafe fn just_released(&self) -> bool {
|
||||
crate::library::arduboy::just_released(self.flag_set)
|
||||
crate::library::arduboy2::just_released(self.flag_set)
|
||||
}
|
||||
pub unsafe fn not_pressed(&self) -> bool {
|
||||
crate::library::arduboy::not_pressed(self.flag_set)
|
||||
crate::library::arduboy2::not_pressed(self.flag_set)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
11
arduboy-rust/src/hardware/led.rs
Normal file
11
arduboy-rust/src/hardware/led.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
//! A list of all LED variables available
|
||||
///Just a `const` for the red led
|
||||
pub const RED_LED: u8 = 10;
|
||||
///Just a `const` for the green led
|
||||
pub const GREEN_LED: u8 = 11;
|
||||
///Just a `const` for the blue led
|
||||
pub const BLUE_LED: u8 = 9;
|
||||
///Just a `const` for led on
|
||||
pub const RGB_ON: u8 = 1;
|
||||
///Just a `const` for led off
|
||||
pub const RGB_OFF: u8 = 0;
|
|
@ -1 +1,2 @@
|
|||
pub mod buttons;
|
||||
pub mod led;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue