Seal the PeripheralInput and PeripheralOutput traits (#2690)

* Seal the `PeripheralInput` and `PeripheralOutput` traits

* Update `CHANGELOG.md`
This commit is contained in:
Jesse Braham 2024-12-06 01:13:39 -08:00 committed by GitHub
parent 9458fd3ed4
commit d86a079ea9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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 {}