From f4cfbe00f1766f577747b8afa867251375374c41 Mon Sep 17 00:00:00 2001 From: Kirill Mikhailov Date: Thu, 9 Jan 2025 14:49:15 +0100 Subject: [PATCH] More tagging --- esp-hal/src/gpio/mod.rs | 2 ++ esp-hal/src/i2c/mod.rs | 4 +++- esp-hal/src/lib.rs | 4 ++++ esp-hal/src/spi/master.rs | 14 ++++++++++++++ esp-hal/src/uart.rs | 6 ++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/esp-hal/src/gpio/mod.rs b/esp-hal/src/gpio/mod.rs index 0886c2de397..6ec6e6eb22e 100644 --- a/esp-hal/src/gpio/mod.rs +++ b/esp-hal/src/gpio/mod.rs @@ -1000,6 +1000,8 @@ macro_rules! io_type { (Analog, $gpionum:literal) => { // FIXME: the implementation shouldn't be in the GPIO module #[cfg(any(esp32c2, esp32c3, esp32c6, esp32h2))] + #[cfg(any(doc, feature = "unstable"))] + #[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] impl $crate::gpio::AnalogPin for $crate::gpio::GpioPin<$gpionum> { /// Configures the pin for analog mode. fn set_analog(&self, _: $crate::private::Internal) { diff --git a/esp-hal/src/i2c/mod.rs b/esp-hal/src/i2c/mod.rs index 69d84bc5576..ec19dba62fd 100644 --- a/esp-hal/src/i2c/mod.rs +++ b/esp-hal/src/i2c/mod.rs @@ -8,4 +8,6 @@ pub mod master; #[cfg(lp_i2c0)] -pub mod lp_i2c; +crate::unstable_module! { + pub mod lp_i2c; +} diff --git a/esp-hal/src/lib.rs b/esp-hal/src/lib.rs index caf7bc689f5..5dd29337e9f 100644 --- a/esp-hal/src/lib.rs +++ b/esp-hal/src/lib.rs @@ -144,10 +144,13 @@ mod fmt; #[cfg(riscv)] +#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] pub use esp_riscv_rt::{self, entry, riscv}; #[cfg(xtensa)] +#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] pub use xtensa_lx; #[cfg(xtensa)] +#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] pub use xtensa_lx_rt::{self, entry}; // TODO what should we reexport stably? @@ -190,6 +193,7 @@ mod macros; #[cfg(feature = "unstable")] #[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] pub use procmacros::load_lp_code; +#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] pub use procmacros::{handler, ram}; // can't use instability on inline module definitions, see https://github.com/rust-lang/rust/issues/54727 diff --git a/esp-hal/src/spi/master.rs b/esp-hal/src/spi/master.rs index 3d3fb3e75f2..59bfe369ef5 100644 --- a/esp-hal/src/spi/master.rs +++ b/esp-hal/src/spi/master.rs @@ -95,6 +95,7 @@ use crate::{ #[derive(Debug, Hash, EnumSetType)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[non_exhaustive] +#[instability::unstable] pub enum SpiInterrupt { /// Indicates that the SPI transaction has completed successfully. /// @@ -704,6 +705,11 @@ where /// /// Sets the specified pin to push-pull output and connects it to the SPI CS /// signal. + /// + /// # Current Stability Limitations + /// The hardware chip select functionality is limited; only one CS line can + /// be set, regardless of the total number available. There is no + /// mechanism to select which CS line to use. #[instability::unstable] pub fn with_cs(self, cs: impl Peripheral

+ 'd) -> Self { crate::into_mapped_ref!(cs); @@ -741,6 +747,10 @@ where /// /// Enables both input and output functionality for the pin, and connects it /// to the SIO2 output and input signals. + /// + /// # Current Stability Limitations + /// QSPI operations are unstable, associated pins configuration is + /// inefficient. #[instability::unstable] pub fn with_sio2(self, sio2: impl Peripheral

+ 'd) -> Self { // TODO: panic if not QSPI? @@ -758,6 +768,10 @@ where /// /// Enables both input and output functionality for the pin, and connects it /// to the SIO3 output and input signals. + /// + /// # Current Stability Limitations + /// QSPI operations are unstable, associated pins configuration is + /// inefficient. #[instability::unstable] pub fn with_sio3(self, sio3: impl Peripheral

+ 'd) -> Self { // TODO: panic if not QSPI? diff --git a/esp-hal/src/uart.rs b/esp-hal/src/uart.rs index a08dddafb15..f0402ecb10e 100644 --- a/esp-hal/src/uart.rs +++ b/esp-hal/src/uart.rs @@ -1040,6 +1040,7 @@ impl<'d> Uart<'d, Async> { #[derive(Debug, EnumSetType)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[non_exhaustive] +#[instability::unstable] pub enum UartInterrupt { /// Indicates that the received has detected the configured /// [`Uart::set_at_cmd`] character. @@ -1238,21 +1239,25 @@ impl InterruptConfigurable for Uart<'_, Blocking> { impl Uart<'_, Blocking> { /// Listen for the given interrupts + #[instability::unstable] pub fn listen(&mut self, interrupts: impl Into>) { self.tx.uart.info().enable_listen(interrupts.into(), true) } /// Unlisten the given interrupts + #[instability::unstable] pub fn unlisten(&mut self, interrupts: impl Into>) { self.tx.uart.info().enable_listen(interrupts.into(), false) } /// Gets asserted interrupts + #[instability::unstable] pub fn interrupts(&mut self) -> EnumSet { self.tx.uart.info().interrupts() } /// Resets asserted interrupts + #[instability::unstable] pub fn clear_interrupts(&mut self, interrupts: EnumSet) { self.tx.uart.info().clear_interrupts(interrupts) } @@ -1878,6 +1883,7 @@ pub(super) fn intr_handler(uart: &Info, state: &State) { /// Low-power UART #[cfg(lp_uart)] +#[instability::unstable] pub mod lp_uart { use crate::{ gpio::lp_io::{LowPowerInput, LowPowerOutput},