fn write_byte_and_wait_ack(&self, byte: u8) {
        let mut data = byte;

        // 8 bits
        for _ in 0..8 {
            // CLK low
            (self.pin_clock_write_fn)(GpioPinValue::LOW);
            // Set data bit (we send one bit of our byte per iteration)
            // LSF (least significant bit) first
            // => target has (probably?) shift register => this way the byte has the
            // correct order on the target
            (self.pin_dio_write_fn)(GpioPinValue::from(data & 0x01));
            self.bit_delay();

            // CLK high
            (self.pin_clock_write_fn)(GpioPinValue::HIGH);
            self.bit_delay();

            // shift to next bit
            data = data >> 1;
        }

        self.recv_ack();
    }
/// Writes a byte bit by bit and waits for the acknowledge.
Writes a byte bit by bit and waits for the acknowledge.
Writes a byte bit by bit and waits for the acknowledge .
fn write_byte_and_wait_ack(&self, byte: u8) {
        let mut data = byte;
        // 8 bits
        for _ in 0..8 {
            // CLK low
            (self.pin_clock_write_fn)(GpioPinValue::LOW);
            // Set data bit (we send one bit of our byte per iteration)
            // LSF (least significant bit) first
            // => target has (probably?) shift register => this way the byte has the
            // correct order on the target
            (self.pin_dio_write_fn)(GpioPinValue::from(data & 0x01));
            self.bit_delay();
            // CLK high
            (self.pin_clock_write_fn)(GpioPinValue::HIGH);
            self.bit_delay();
            // shift to next bit
            data = data >> 1;
        }
        self.recv_ack();
    }
fn write_byte_and_wait_ack ( & self , byte : u8 ) { let mut data = byte ; // 8 bits for _ in 0 .. 8 { // CLK low ( self . pin_clock_write_fn ) ( GpioPinValue :: LOW ) ; // Set data bit (we send one bit of our byte per iteration) // LSF (least significant bit) first // => target has (probably?) shift register => this way the byte has the // correct order on the target ( self . pin_dio_write_fn ) ( GpioPinValue :: from ( data & 0x01 ) ) ; self . bit_delay ( ) ; // CLK high ( self . pin_clock_write_fn ) ( GpioPinValue :: HIGH ) ; self . bit_delay ( ) ; // shift to next bit data = data >> 1 ; } self . recv_ack ( ) ; }
Writes a byte bit by bit and waits for the acknowledge.
Writes a byte bit by bit and waits for the acknowledge .
&self
byte
u8