pub fn retrieve(&mut self) -> nb::Result<i32, !> {
        self.pd_sck.set_low();
        if self.dout.is_high() {
            // Conversion not ready yet
            return Err(nb::Error::WouldBlock);
        }

        let mut count: i32 = 0;
        for _ in 0..24 {
            // Read 24 bits
            count <<= 1;
            self.pd_sck.set_high();
            self.pd_sck.set_low();
            if self.dout.is_high() {
                count += 1;
            }
        }

        // Continue to set mode for next conversion
        let n_reads = self.mode as u16;
        for _ in 0..n_reads {
            self.pd_sck.set_high();
            self.pd_sck.set_low();
        }

        Ok(i24_to_i32(count))
    }
/// Retrieve the latest conversion value if available
Retrieve the latest conversion value if available
Retrieve the latest conversion value if available
pub fn retrieve(&mut self) -> nb::Result<i32, !> {
        self.pd_sck.set_low();
        if self.dout.is_high() {
            // Conversion not ready yet
            return Err(nb::Error::WouldBlock);
        }
        let mut count: i32 = 0;
        for _ in 0..24 {
            // Read 24 bits
            count <<= 1;
            self.pd_sck.set_high();
            self.pd_sck.set_low();
            if self.dout.is_high() {
                count += 1;
            }
        }
        // Continue to set mode for next conversion
        let n_reads = self.mode as u16;
        for _ in 0..n_reads {
            self.pd_sck.set_high();
            self.pd_sck.set_low();
        }
        Ok(i24_to_i32(count))
    }
pub fn retrieve ( & mut self ) -> nb :: Result < i32 , ! > { self . pd_sck . set_low ( ) ; if self . dout . is_high ( ) { // Conversion not ready yet return Err ( nb :: Error :: WouldBlock ) ; } let mut count : i32 = 0 ; for _ in 0 .. 24 { // Read 24 bits count <<= 1 ; self . pd_sck . set_high ( ) ; self . pd_sck . set_low ( ) ; if self . dout . is_high ( ) { count += 1 ; } } // Continue to set mode for next conversion let n_reads = self . mode as u16 ; for _ in 0 .. n_reads { self . pd_sck . set_high ( ) ; self . pd_sck . set_low ( ) ; } Ok ( i24_to_i32 ( count ) ) }
Retrieve the latest conversion value if available
Retrieve the latest conversion value if available
&mut self
&mut self