Skip to content

Commit c7ac0df

Browse files
bors[bot]sourcebox
andauthored
Merge #429
429: Implement From<PinState> for bool r=Dirbaio a=sourcebox Closes #427 Co-authored-by: Oliver Rockstedt <[email protected]>
2 parents 812471b + 1d79987 commit c7ac0df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

embedded-hal/src/digital.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ impl Not for PinState {
5555
}
5656
}
5757

58+
impl From<PinState> for bool {
59+
fn from(value: PinState) -> bool {
60+
match value {
61+
PinState::Low => false,
62+
PinState::High => true,
63+
}
64+
}
65+
}
66+
5867
/// Single digital push-pull output pin
5968
pub trait OutputPin: ErrorType {
6069
/// Drives the pin low

0 commit comments

Comments
 (0)