pub fn events(&mut self) -> ButtonIter {
        self.latch.set_low().ok();
        cycle_delay(7); //tsu?
        self.latch.set_high().ok();
        cycle_delay(1); //th?

        let mut current: u8 = 0;

        for _i in 0..8 {
            current <<= 1;

            self.clock.set_low().ok();
            cycle_delay(5); //tw

            if self.data_in.is_high().unwrap() {
                current |= 1;
            }
            self.clock.set_high().ok();
        }

        let iter = ButtonIter {
            pressed: (self.last ^ current) & current,
            released: (self.last ^ current) & self.last,
            bit_index: 0,
        };

        self.last = current;

        iter
    }
// 48*8.333ns total blocking read
/// Returns a ButtonIter of button changes as Keys enums
48*8.333ns total blocking read
Returns a ButtonIter of button changes as Keys enums
48 * 8 . 333ns total blocking read Returns a ButtonIter of button changes as Keys enums
pub fn events(&mut self) -> ButtonIter {
        self.latch.set_low().ok();
        cycle_delay(7); //tsu?
        self.latch.set_high().ok();
        cycle_delay(1); //th?
        let mut current: u8 = 0;
        for _i in 0..8 {
            current <<= 1;
            self.clock.set_low().ok();
            cycle_delay(5); //tw
            if self.data_in.is_high().unwrap() {
                current |= 1;
            }
            self.clock.set_high().ok();
        }
        let iter = ButtonIter {
            pressed: (self.last ^ current) & current,
            released: (self.last ^ current) & self.last,
            bit_index: 0,
        };
        self.last = current;
        iter
    }
pub fn events ( & mut self ) -> ButtonIter { self . latch . set_low ( ) . ok ( ) ; cycle_delay ( 7 ) ; //tsu? self . latch . set_high ( ) . ok ( ) ; cycle_delay ( 1 ) ; //th? let mut current : u8 = 0 ; for _i in 0 .. 8 { current <<= 1 ; self . clock . set_low ( ) . ok ( ) ; cycle_delay ( 5 ) ; //tw if self . data_in . is_high ( ) . unwrap ( ) { current |= 1 ; } self . clock . set_high ( ) . ok ( ) ; } let iter = ButtonIter { pressed : ( self . last ^ current ) & current , released : ( self . last ^ current ) & self . last , bit_index : 0 , } ; self . last = current ; iter }
48*8.333ns total blocking read
Returns a ButtonIter of button changes as Keys enums
48 * 8 . 333ns total blocking read Returns a ButtonIter of button changes as Keys enums
&mut self
&mut self