diff --git a/rp2040-hal/src/gpio/pin.rs b/rp2040-hal/src/gpio/pin.rs index 90d9317..15a8508 100644 --- a/rp2040-hal/src/gpio/pin.rs +++ b/rp2040-hal/src/gpio/pin.rs @@ -1102,9 +1102,15 @@ macro_rules! bsp_pins { /// /// like this: ///```no_run - /// let _spi_sclk = pins.gpio2.into_mode::(); - /// let _spi_mosi = pins.gpio3.into_mode::(); - /// let _spi_miso = pins.gpio4.into_mode::(); + /// use rp2040_hal::{pac, gpio::{bank0::Gpio12, Pin, Pins, PushPullOutput}, sio::Sio}; + /// + /// let mut peripherals = pac::Peripherals::take().unwrap(); + /// let sio = Sio::new(peripherals.SIO); + /// let pins = Pins::new(peripherals.IO_BANK0,peripherals.PADS_BANK0,sio.gpio_bank0, &mut peripherals.RESETS); + /// + /// let _spi_sclk = pins.gpio2.into_mode::(); + /// let _spi_mosi = pins.gpio3.into_mode::(); + /// let _spi_miso = pins.gpio4.into_mode::(); ///``` /// /// **See also [rp2040_hal::gpio::pin] for more in depth information