Skip to content

Commit

Permalink
Seal the PeripheralInput and PeripheralOutput traits (#2690)
Browse files Browse the repository at this point in the history
* Seal the `PeripheralInput` and `PeripheralOutput` traits

* Update `CHANGELOG.md`
  • Loading branch information
jessebraham authored Dec 6, 2024
1 parent 9458fd3 commit d86a079
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- I8080, camera, DPI: The various standalone configuration options have been merged into `Config` (#2610)
- Dropped GPIO futures stop listening for interrupts (#2625)
- UART driver's `StopBits` enum variants now correctly use UpperCamelCase (#2669)
- The `PeripheralInput` and `PeripheralOutput` traits are now sealed (#2690)

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/gpio/interconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ use crate::{
///
/// Peripheral drivers are encouraged to accept types that implement this and
/// [`PeripheralOutput`] as arguments instead of pin types.
pub trait PeripheralInput: Into<InputConnection> + 'static {}
pub trait PeripheralInput: Into<InputConnection> + 'static + crate::private::Sealed {}

/// A signal that can be connected to a peripheral input and/or output.
///
/// Peripheral drivers are encouraged to accept types that implement this and
/// [`PeripheralInput`] as arguments instead of pin types.
pub trait PeripheralOutput: Into<OutputConnection> + 'static {}
pub trait PeripheralOutput: Into<OutputConnection> + 'static + crate::private::Sealed {}

// Pins
impl<P: InputPin> PeripheralInput for P {}
Expand Down

0 comments on commit d86a079

Please sign in to comment.