Skip to content

Commit

Permalink
Add type for gpio::AnyPin
Browse files Browse the repository at this point in the history
This makes it possible to safely implement the InputPin and OutputPin
traits for AnyPin. Now you can convert any pin to AnyPin with the
appropriate type and use it in other library modules

Added:
- Peripheral implementation for AnyPin
- Implementation of Pin for AnyPin
- Implementation of OutputPin for AnyPin with type IsOutputPin
- Implementation of InputPin for AnyPin with type IsInputPin
- Upgrade types for AnyPin (for example InputOutputAnalogPinType ->
InputOutputPinType)
- Implementation of From<Gpio> for AnyPin with the appropriate type

Changed:
- The Gpio::degrage method returns AnyPin with the appropriate type

undefined
  • Loading branch information
Volkalex28 committed Jan 9, 2024
1 parent bb58446 commit 9836fd3
Show file tree
Hide file tree
Showing 10 changed files with 397 additions and 31 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A macro to make it easier to create DMA buffers and descriptors (#935)
- I2C timeout is configurable (#1011)
- ESP32-C6/ESP32-H2: `flip-link` feature gives zero-cost stack overflow protection (#1008)
- Implementation OutputPin and InputPin for AnyPin

### Changed

Expand Down
1 change: 1 addition & 0 deletions esp-hal-common/src/analog/adc/esp32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ macro_rules! impl_adc_interface {
}
}

#[allow(unused_imports)]
pub use implementation::*;

mod implementation {
Expand Down
Loading

0 comments on commit 9836fd3

Please sign in to comment.