Skip to content

Commit

Permalink
More tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
playfulFence committed Jan 9, 2025
1 parent 13774b6 commit f4cfbe0
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions esp-hal/src/gpio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 3 additions & 1 deletion esp-hal/src/i2c/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
pub mod master;

#[cfg(lp_i2c0)]
pub mod lp_i2c;
crate::unstable_module! {
pub mod lp_i2c;
}
4 changes: 4 additions & 0 deletions esp-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions esp-hal/src/spi/master.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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<CS: PeripheralOutput>(self, cs: impl Peripheral<P = CS> + 'd) -> Self {
crate::into_mapped_ref!(cs);
Expand Down Expand Up @@ -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<SIO2: PeripheralOutput>(self, sio2: impl Peripheral<P = SIO2> + 'd) -> Self {
// TODO: panic if not QSPI?
Expand All @@ -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<SIO3: PeripheralOutput>(self, sio3: impl Peripheral<P = SIO3> + 'd) -> Self {
// TODO: panic if not QSPI?
Expand Down
6 changes: 6 additions & 0 deletions esp-hal/src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<EnumSet<UartInterrupt>>) {
self.tx.uart.info().enable_listen(interrupts.into(), true)
}

/// Unlisten the given interrupts
#[instability::unstable]
pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<UartInterrupt>>) {
self.tx.uart.info().enable_listen(interrupts.into(), false)
}

/// Gets asserted interrupts
#[instability::unstable]
pub fn interrupts(&mut self) -> EnumSet<UartInterrupt> {
self.tx.uart.info().interrupts()
}

/// Resets asserted interrupts
#[instability::unstable]
pub fn clear_interrupts(&mut self, interrupts: EnumSet<UartInterrupt>) {
self.tx.uart.info().clear_interrupts(interrupts)
}
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit f4cfbe0

Please sign in to comment.