From cc9dc58a41c1359336ff5ec663b580f4568128eb Mon Sep 17 00:00:00 2001 From: Rene van der Meer <9930578+golemparts@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:38:00 +0100 Subject: [PATCH] Update embedded-hal documentation --- src/gpio/pin.rs | 56 ++++++++++++++----------------------------------- src/i2c.rs | 9 ++------ src/pwm.rs | 11 ++-------- src/spi.rs | 9 ++------ src/uart.rs | 9 ++------ 5 files changed, 24 insertions(+), 70 deletions(-) diff --git a/src/gpio/pin.rs b/src/gpio/pin.rs index eee5da9f..88e2a8e5 100644 --- a/src/gpio/pin.rs +++ b/src/gpio/pin.rs @@ -252,11 +252,9 @@ macro_rules! impl_eq { /// various `into_` methods available on `Pin` configures the appropriate mode, and /// provides access to additional methods relevant to the selected pin mode. /// -/// The `unproven` `embedded-hal` [`digital::InputPin`] trait implementation for `Pin` can be enabled -/// by specifying the optional `hal-unproven` feature in the dependency declaration for -/// the `rppal` crate. +/// The `embedded-hal` trait implementations for `Pin` can be enabled by specifying +/// the optional `hal` feature in the dependency declaration for the `rppal` crate. /// -/// [`digital::InputPin`]: ../../embedded_hal/digital/trait.InputPin.html /// [`Gpio::get`]: struct.Gpio.html#method.get /// [`InputPin`]: struct.InputPin.html /// [`OutputPin`]: struct.OutputPin.html @@ -407,18 +405,16 @@ impl_eq!(Pin); /// /// `InputPin`s are constructed by converting a [`Pin`] using [`Pin::into_input`], /// [`Pin::into_input_pullup`] or [`Pin::into_input_pulldown`]. The pin's mode is -/// automatically set to [`Input`]. +/// automatically set to [`Mode::Input`]. /// /// An `InputPin` can be used to read a pin's logic level, or (a)synchronously poll for /// interrupt trigger events. /// -/// The `unproven` `embedded-hal` [`digital::InputPin`] trait implementation for `InputPin` can be enabled -/// by specifying the optional `hal-unproven` feature in the dependency declaration for -/// the `rppal` crate. +/// The `embedded-hal` trait implementations for `InputPin` can be enabled by specifying +/// the optional `hal` feature in the dependency declaration for the `rppal` crate. /// -/// [`digital::InputPin`]: ../../embedded_hal/digital/trait.InputPin.html /// [`Pin`]: struct.Pin.html -/// [`Input`]: enum.Mode.html#variant.Input +/// [`Mode::Input`]: enum.Mode.html#variant.Input /// [`Pin::into_input`]: struct.Pin.html#method.into_input /// [`Pin::into_input_pullup`]: struct.Pin.html#method.into_input_pullup /// [`Pin::into_input_pulldown`]: struct.Pin.html#method.into_input_pulldown @@ -562,21 +558,13 @@ impl_eq!(InputPin); /// /// An `OutputPin` can be used to change a pin's output state. /// -/// The `embedded-hal` [`digital::OutputPin`] and [`PwmPin`] trait implementations for `OutputPin` -/// can be enabled by specifying the optional `hal` feature in the dependency -/// declaration for the `rppal` crate. +/// The `embedded-hal` trait implementations for `OutputPin` can be enabled by specifying +/// the optional `hal` feature in the dependency declaration for the `rppal` crate. /// -/// The `unproven` `embedded-hal` [`digital::InputPin`], [`digital::StatefulOutputPin`], -/// [`digital::ToggleableOutputPin`] and [`Pwm`] trait implementations for `OutputPin` can be enabled -/// by specifying the optional `hal-unproven` feature in the dependency declaration for -/// the `rppal` crate. -/// -/// [`digital::InputPin`]: ../../embedded_hal/digital/trait.InputPin.html -/// [`digital::StatefulOutputPin`]: ../../embedded_hal/digital/trait.StatefulOutputPin.html -/// [`digital::ToggleableOutputPin`]: ../../embedded_hal/digital/trait.ToggleableOutputPin.html -/// [`Pwm`]: ../../embedded_hal/trait.Pwm.html -/// [`digital::OutputPin`]: ../../embedded_hal/digital/trait.OutputPin.html -/// [`PwmPin`]: ../../embedded_hal/trait.PwmPin.html +/// [`Pin`]: struct.Pin.html +/// [`Mode::Output`]: enum.Mode.html#variant.Output +/// [`Pin::into_output_low`]: struct.Pin.html#method.into_output_low +/// [`Pin::into_output_high`]: struct.Pin.html#method.into_output_high #[derive(Debug)] pub struct OutputPin { pin: Pin, @@ -665,26 +653,14 @@ impl_eq!(OutputPin); /// An `IoPin` can be reconfigured for any available mode. Depending on the /// mode, some methods may not have any effect. For instance, calling a method that /// alters the pin's output state won't cause any changes when the pin's mode is set -/// to [`Input`]. -/// -/// The `embedded-hal` [`digital::OutputPin`] and [`PwmPin`] trait implementations for `IoPin` -/// can be enabled by specifying the optional `hal` feature in the dependency -/// declaration for the `rppal` crate. +/// to [`Mode::Input`]. /// -/// The `unproven` `embedded-hal` [`digital::InputPin`], [`digital::StatefulOutputPin`], -/// [`digital::ToggleableOutputPin`] and [`Pwm`] trait implementations for `IoPin` can be enabled -/// by specifying the optional `hal-unproven` feature in the dependency declaration for -/// the `rppal` crate. +/// The `embedded-hal` trait implementations for `IoPin` can be enabled by specifying +/// the optional `hal` feature in the dependency declaration for the `rppal` crate. /// -/// [`digital::InputPin`]: ../../embedded_hal/digital/trait.InputPin.html -/// [`digital::StatefulOutputPin`]: ../../embedded_hal/digital/trait.StatefulOutputPin.html -/// [`digital::ToggleableOutputPin`]: ../../embedded_hal/digital/trait.ToggleableOutputPin.html -/// [`Pwm`]: ../../embedded_hal/trait.Pwm.html /// [`Pin`]: struct.Pin.html -/// [`Input`]: enum.Mode.html#variant.Input +/// [`Mode::Input`]: enum.Mode.html#variant.Input /// [`Pin::into_io`]: struct.Pin.html#method.into_io -/// [`digital::OutputPin`]: ../../embedded_hal/digital/trait.OutputPin.html -/// [`PwmPin`]: ../../embedded_hal/trait.PwmPin.html #[derive(Debug)] pub struct IoPin { pin: Pin, diff --git a/src/i2c.rs b/src/i2c.rs index c17f66c7..36acc93f 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -202,16 +202,11 @@ pub type Result = result::Result; /// through its various protocols. More details can be found in the latest SMBus /// [specification]. /// -/// The `embedded-hal` [`blocking::i2c::Read`], [`blocking::i2c::Write`] and -/// [`blocking::i2c::WriteRead`] trait implementations for `I2c` can be enabled -/// by specifying the optional `hal` -/// feature in the dependency declaration for the `rppal` crate. +/// The `embedded-hal` trait implementations for `I2c` can be enabled by specifying +/// the optional `hal` feature in the dependency declaration for the `rppal` crate. /// /// [here]: index.html#i2c-buses /// [specification]: http://smbus.org/specs/SMBus_3_1_20180319.pdf -/// [`blocking::i2c::Read`]: ../../embedded_hal/blocking/i2c/trait.Read.html -/// [`blocking::i2c::Write`]: ../../embedded_hal/blocking/i2c/trait.Write.html -/// [`blocking::i2c::WriteRead`]: ../../embedded_hal/blocking/i2c/trait.WriteRead.html #[derive(Debug)] pub struct I2c { bus: u8, diff --git a/src/pwm.rs b/src/pwm.rs index 04e5d1c0..ea96d5e0 100644 --- a/src/pwm.rs +++ b/src/pwm.rs @@ -146,17 +146,10 @@ impl fmt::Display for Polarity { /// Before using `Pwm`, make sure the selected PWM channel has been configured /// and activated. More information can be found [here]. /// -/// The `embedded-hal` [`PwmPin`] trait implementation for `Pwm` can be enabled -/// by specifying the optional `hal` feature in the dependency declaration for -/// the `rppal` crate. -/// -/// The `unproven` `embedded-hal` [`Pwm`] trait implementation for `Pwm` can be enabled -/// by specifying the optional `hal-unproven` feature in the dependency declaration for -/// the `rppal` crate. +/// The `embedded-hal` trait implementations for `Pwm` can be enabled by specifying +/// the optional `hal` feature in the dependency declaration for the `rppal` crate. /// /// [here]: index.html -/// [`PwmPin`]: ../../embedded_hal/trait.PwmPin.html -/// [`Pwm`]: ../../embedded_hal/trait.Pwm.html #[derive(Debug)] pub struct Pwm { channel: Channel, diff --git a/src/spi.rs b/src/spi.rs index 2f7bdbd1..776286ef 100644 --- a/src/spi.rs +++ b/src/spi.rs @@ -410,15 +410,10 @@ impl fmt::Display for BitOrder { /// Before using `Spi`, make sure your Raspberry Pi has the necessary SPI buses /// and Slave Select pins enabled. More information can be found [here]. /// -/// The `embedded-hal` [`blocking::spi::Transfer`], [`blocking::spi::Write`] -/// and [`spi::FullDuplex`] trait -/// implementations for `Spi` can be enabled by specifying the optional `hal` -/// feature in the dependency declaration for the `rppal` crate. +/// The `embedded-hal` trait implementations for `Spi` can be enabled by specifying +/// the optional `hal` feature in the dependency declaration for the `rppal` crate. /// /// [here]: index.html -/// [`blocking::spi::Transfer`]: ../../embedded_hal/blocking/spi/trait.Transfer.html -/// [`blocking::spi::Write`]: ../../embedded_hal/blocking/spi/trait.Write.html -/// [`spi::FullDuplex`]: ../../embedded_hal/spi/trait.FullDuplex.html pub struct Spi { spidev: File, // Stores the last read value. Used for embedded_hal::spi::FullDuplex. diff --git a/src/uart.rs b/src/uart.rs index d5a9d14c..78cfad0f 100644 --- a/src/uart.rs +++ b/src/uart.rs @@ -404,13 +404,8 @@ struct UartInner { /// Provides access to the Raspberry Pi's UART peripherals and any USB to /// serial adapters. /// -/// The `embedded-hal` [`serial::Read`], [`serial::Write`] and [`blocking::serial::Write`] trait -/// implementations for `Uart` can be enabled by specifying the optional `hal` feature in the -/// dependency declaration for the `rppal` crate. -/// -/// [`serial::Read`]: ../../embedded_hal/serial/trait.Read.html -/// [`serial::Write`]: ../../embedded_hal/serial/trait.Write.html -/// [`blocking::serial::Write`]: ../../embedded_hal/blocking/serial/trait.Write.html +/// The `embedded-hal` trait implementations for `Uart` can be enabled by specifying +/// the optional `hal` feature in the dependency declaration for the `rppal` crate. #[derive(Debug)] pub struct Uart { inner: UartInner,