(Hopefully) Improved documentation of bsp_pins!()

This commit is contained in:
Weird Constructor 2022-01-09 13:50:57 +01:00
parent f4a4b80459
commit 9e84c961a8

View file

@ -1088,6 +1088,27 @@ macro_rules! bsp_pins {
///
/// This type is intended to provide more meaningful names for the
/// given pins.
///
/// To enable specific functions of the pins you can use the
/// [rp2040_hal::gpio::pin::Pin::into_mode] function with
/// one of:
/// - [rp2040_hal::gpio::pin::FunctionI2C]
/// - [rp2040_hal::gpio::pin::FunctionPwm]
/// - [rp2040_hal::gpio::pin::FunctionSpi]
/// - [rp2040_hal::gpio::pin::FunctionXip]
/// - [rp2040_hal::gpio::pin::FunctionPio0]
/// - [rp2040_hal::gpio::pin::FunctionPio1]
/// - [rp2040_hal::gpio::pin::FunctionUart]
///
/// like this:
///```no_run
/// let _spi_sclk = pins.gpio2.into_mode::<gpio::FunctionSpi>();
/// let _spi_mosi = pins.gpio3.into_mode::<gpio::FunctionSpi>();
/// let _spi_miso = pins.gpio4.into_mode::<gpio::FunctionSpi>();
///```
///
/// **See also [rp2040_hal::gpio::pin] for more in depth information
/// about this**!
pub struct Pins {
$(
$( #[$id_cfg] )*