Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric committed May 12, 2018
1 parent c940b77 commit f2b72ac
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [v0.2.0] - 2018-05-11
## [v0.2.0] - 2018-05-12

### Added

- A `ToggeableOutputPin` trait has been added. This trait contains a single method: `toggle` that
can be used to toggle the state of a push-pull pin.

### Changed

Expand All @@ -19,6 +24,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
[`Void`]: https://docs.rs/void/1.0.2/void/enum.Void.html
[`void`]: https://crates.io/crates/void

- [breaking-change] the `OutputPin.is_{low,high}` methods have been moved into its own trait
`StatefulOutputPin` and renamed to `is_set_{low,high}`.

- It has been clarified in the documentation that `OutputPin` must be implemented for push-pull
output pins (and e.g. not for open drain output pins).

## [v0.1.2] - 2018-02-14

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
name = "embedded-hal"
readme = "README.md"
repository = "https://github.com/japaric/embedded-hal"
version = "0.1.2"
version = "0.2.0"

[dependencies.void]
default-features = false
Expand Down
22 changes: 16 additions & 6 deletions src/digital.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
//! Digital I/O

/// Single digital output pin
/// Single digital push-pull output pin
pub trait OutputPin {
/// Sets the pin low
/// Drives the pin low
///
/// *NOTE* the actual electrical state of the pin may not actually be low, e.g. due to external
/// electrical sources
fn set_low(&mut self);

/// Sets the pin high
/// Drives the pin high
///
/// *NOTE* the actual electrical state of the pin may not actually be high, e.g. due to external
/// electrical sources
fn set_high(&mut self);
}

/// Output pin that can read its output state
/// Push-pull output pin that can read its output state
#[cfg(feature = "unproven")]
pub trait StatefulOutputPin {
/// Is the pin set to high?
/// Is the pin in drive high mode?
///
/// *NOTE* this does *not* read the electrical state of the pin
fn is_set_high(&self) -> bool;

/// Is the pin set to low?
/// Is the pin in drive low mode?
///
/// *NOTE* this does *not* read the electrical state of the pin
fn is_set_low(&self) -> bool;
}

Expand Down

0 comments on commit f2b72ac

Please sign in to comment.