From b8ca1323d052299587971232294936ff0d6235ff Mon Sep 17 00:00:00 2001 From: Scott Mabin Date: Thu, 4 Apr 2024 11:33:23 +0100 Subject: [PATCH] Remove remaining references to embedded-hal-02 for GPIO examples (#1392) --- esp-hal/src/gpio.rs | 4 ++++ examples/src/bin/blinky_erased_pins.rs | 2 -- examples/src/bin/embassy_multicore.rs | 3 +-- examples/src/bin/embassy_multicore_interrupt.rs | 3 +-- examples/src/bin/embassy_rmt_rx.rs | 3 +-- examples/src/bin/embassy_wait.rs | 1 - examples/src/bin/etm_gpio.rs | 2 -- examples/src/bin/serial_interrupts.rs | 3 +-- examples/src/bin/spi_slave_dma.rs | 2 -- 9 files changed, 8 insertions(+), 15 deletions(-) diff --git a/esp-hal/src/gpio.rs b/esp-hal/src/gpio.rs index 7d4a0cffc2a..f1613691289 100644 --- a/esp-hal/src/gpio.rs +++ b/esp-hal/src/gpio.rs @@ -1166,11 +1166,13 @@ where GpioPin { _mode: PhantomData } } + /// Configures the pin into alternate mode one. pub fn into_alternate_1(self) -> GpioPin, GPIONUM> { self.init_output(AlternateFunction::Function1, false); GpioPin { _mode: PhantomData } } + /// Configures the pin into alternate mode two. pub fn into_alternate_2(self) -> GpioPin, GPIONUM> { self.init_output(AlternateFunction::Function2, false); GpioPin { _mode: PhantomData } @@ -1334,6 +1336,7 @@ where Self: GpioProperties, ::PinType: IsAnalogPin, { + /// Configures the pin into a an [Analog] pin. pub fn into_analog(self) -> GpioPin { crate::soc::gpio::internal_into_analog(GPIONUM); @@ -1377,6 +1380,7 @@ impl AnyPin where TYPE: PinType, { + /// Degrade the pin to remove the pin number generics. pub fn degrade(self) -> AnyPin { AnyPin { inner: self.inner, diff --git a/examples/src/bin/blinky_erased_pins.rs b/examples/src/bin/blinky_erased_pins.rs index 810c0de6c39..d4a9560ae7f 100644 --- a/examples/src/bin/blinky_erased_pins.rs +++ b/examples/src/bin/blinky_erased_pins.rs @@ -6,12 +6,10 @@ //! Additionally demonstrates passing GPIO to a function in a generic way. //% CHIPS: esp32 esp32c2 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: embedded-hal-02 #![no_std] #![no_main] -use embedded_hal_02::digital::v2::{InputPin, ToggleableOutputPin}; use esp_backtrace as _; use esp_hal::{ clock::ClockControl, diff --git a/examples/src/bin/embassy_multicore.rs b/examples/src/bin/embassy_multicore.rs index f27070ac0ed..758e3e11436 100644 --- a/examples/src/bin/embassy_multicore.rs +++ b/examples/src/bin/embassy_multicore.rs @@ -4,7 +4,7 @@ //! signal set by the task running on the other core. //% CHIPS: esp32 esp32s3 -//% FEATURES: embassy embassy-executor-thread embassy-time-timg0 embassy-generic-timers embedded-hal-02 +//% FEATURES: embassy embassy-executor-thread embassy-time-timg0 embassy-generic-timers #![no_std] #![no_main] @@ -15,7 +15,6 @@ use core::ptr::addr_of_mut; use embassy_executor::Spawner; use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, signal::Signal}; use embassy_time::{Duration, Ticker}; -use embedded_hal_02::digital::v2::OutputPin; use esp_backtrace as _; use esp_hal::{ clock::ClockControl, diff --git a/examples/src/bin/embassy_multicore_interrupt.rs b/examples/src/bin/embassy_multicore_interrupt.rs index e474a2cb90f..e5d78205c24 100644 --- a/examples/src/bin/embassy_multicore_interrupt.rs +++ b/examples/src/bin/embassy_multicore_interrupt.rs @@ -4,7 +4,7 @@ //! signal set by the task running on the other core. //% CHIPS: esp32 esp32s3 -//% FEATURES: embassy embassy-executor-interrupt embassy-time-timg0 embassy-generic-timers embedded-hal-02 +//% FEATURES: embassy embassy-executor-interrupt embassy-time-timg0 embassy-generic-timers #![no_std] #![no_main] @@ -14,7 +14,6 @@ use core::ptr::addr_of_mut; use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, signal::Signal}; use embassy_time::{Duration, Ticker}; -use embedded_hal_02::digital::v2::OutputPin; use esp_backtrace as _; use esp_hal::{ clock::ClockControl, diff --git a/examples/src/bin/embassy_rmt_rx.rs b/examples/src/bin/embassy_rmt_rx.rs index fe567cb3a2b..d05917cdf09 100644 --- a/examples/src/bin/embassy_rmt_rx.rs +++ b/examples/src/bin/embassy_rmt_rx.rs @@ -2,7 +2,7 @@ //! Connect GPIO5 to GPIO4 //% CHIPS: esp32 esp32c3 esp32c6 esp32h2 esp32s2 esp32s3 -//% FEATURES: async embassy embassy-executor-thread embassy-time-timg0 embassy-generic-timers embedded-hal-02 +//% FEATURES: async embassy embassy-executor-thread embassy-time-timg0 embassy-generic-timers #![no_std] #![no_main] @@ -10,7 +10,6 @@ use embassy_executor::Spawner; use embassy_time::{Duration, Timer}; -use embedded_hal_02::digital::v2::ToggleableOutputPin; use esp_backtrace as _; use esp_hal::{ clock::ClockControl, diff --git a/examples/src/bin/embassy_wait.rs b/examples/src/bin/embassy_wait.rs index dae642039d3..246bb50ad9f 100644 --- a/examples/src/bin/embassy_wait.rs +++ b/examples/src/bin/embassy_wait.rs @@ -11,7 +11,6 @@ use embassy_executor::Spawner; use embassy_time::{Duration, Timer}; -use embedded_hal_async::digital::Wait; use esp_backtrace as _; use esp_hal::{ clock::ClockControl, diff --git a/examples/src/bin/etm_gpio.rs b/examples/src/bin/etm_gpio.rs index e4fa43b1abb..8cc0caa1697 100644 --- a/examples/src/bin/etm_gpio.rs +++ b/examples/src/bin/etm_gpio.rs @@ -1,12 +1,10 @@ //! Control LED on GPIO1 by the BOOT-BUTTON via ETM //% CHIPS: esp32c6 esp32h2 -//% FEATURES: embedded-hal-02 #![no_std] #![no_main] -use embedded_hal_02::digital::v2::OutputPin; use esp_backtrace as _; use esp_hal::{ etm::Etm, diff --git a/examples/src/bin/serial_interrupts.rs b/examples/src/bin/serial_interrupts.rs index 4159863b34c..cc3cdadf033 100644 --- a/examples/src/bin/serial_interrupts.rs +++ b/examples/src/bin/serial_interrupts.rs @@ -15,8 +15,7 @@ use esp_hal::{ clock::ClockControl, delay::Delay, gpio, - interrupt::{self, Priority}, - peripherals::{Interrupt, Peripherals, UART0}, + peripherals::{Peripherals, UART0}, prelude::*, uart::{ config::{AtCmdConfig, Config}, diff --git a/examples/src/bin/spi_slave_dma.rs b/examples/src/bin/spi_slave_dma.rs index 898ef5db475..2d52b88acdc 100644 --- a/examples/src/bin/spi_slave_dma.rs +++ b/examples/src/bin/spi_slave_dma.rs @@ -24,12 +24,10 @@ //! so no immediate neighbor is available. //% CHIPS: esp32c2 esp32c3 esp32c6 esp32h2 esp32s3 -//% FEATURES: embedded-hal-02 #![no_std] #![no_main] -use embedded_hal_02::digital::v2::{InputPin, OutputPin}; use esp_backtrace as _; use esp_hal::{ clock::ClockControl,