We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4d039af + 61a2ef0 commit 80bc5c8Copy full SHA for 80bc5c8
Cargo.toml
@@ -9,7 +9,7 @@ repository = "https://github.com/japaric/linux-embedded-hal"
9
version = "0.2.0"
10
11
[dependencies]
12
-embedded-hal = "0.2.0"
+embedded-hal = { version = "0.2.0", features = ["unproven"] }
13
i2cdev = "0.3.1"
14
spidev = "0.3.0"
15
sysfs_gpio = "0.5.1"
src/lib.rs
@@ -119,6 +119,16 @@ impl hal::digital::OutputPin for Pin {
119
}
120
121
122
+impl hal::digital::InputPin for Pin {
123
+ fn is_high(&self) -> bool{
124
+ self.0.get_value().unwrap() != 0
125
+ }
126
+
127
+ fn is_low(&self) -> bool{
128
+ self.0.get_value().unwrap() == 0
129
130
+}
131
132
impl ops::Deref for Pin {
133
type Target = sysfs_gpio::Pin;
134
0 commit comments