pub fn new(spi: impl Instance + 'd, config: Config) -> Result<Self, ConfigError> {
        let guard = PeripheralGuard::new(spi.info().peripheral);

        let mosi_pin = PinGuard::new_unconnected(spi.info().mosi);
        let sclk_pin = PinGuard::new_unconnected(spi.info().sclk);
        let cs_pin = PinGuard::new_unconnected(spi.info().cs[0]);
        let sio1_pin = PinGuard::new_unconnected(spi.info().sio1_output);
        let sio2_pin = spi.info().sio2_output.map(PinGuard::new_unconnected);
        let sio3_pin = spi.info().sio3_output.map(PinGuard::new_unconnected);

        let mut this = Spi {
            spi: spi.degrade(),
            _mode: PhantomData,
            guard,
            pins: SpiPinGuard {
                mosi_pin,
                sclk_pin,
                cs_pin,
                sio1_pin,
                sio2_pin,
                sio3_pin,
            },
        };

        this.driver().init();
        this.apply_config(&config)?;

        let this = this
            .with_sio0(NoPin)
            .with_sio1(NoPin)
            .with_sck(NoPin)
            .with_cs(NoPin);

        let is_qspi = this.driver().info.sio2_input.is_some();
        if is_qspi {
            unwrap!(this.driver().info.sio2_input).connect_to(&NoPin);
            unwrap!(this.driver().info.sio2_output).connect_to(&NoPin);
            unwrap!(this.driver().info.sio3_input).connect_to(&NoPin);
            unwrap!(this.driver().info.sio3_output).connect_to(&NoPin);
        }

        Ok(this)
    }
Constructs an SPI instance in 8bit dataframe mode.

# Errors

See [`Spi::apply_config`].
esp-hal/src/spi/master.rs