onebitsy 0.2.0

Board Support Crate for the 1Bitsy development board
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::hal::gpio::gpioc::PC1;
use crate::hal::gpio::{Floating, Input};
use crate::hal::prelude::*;

pub type BUTTON = PC1<Input<Floating>>;

pub trait Button {
    fn is_pressed(&self) -> bool;
}

impl Button for BUTTON {
    fn is_pressed(&self) -> bool {
        self.is_low().unwrap()
    }
}