diff --git a/Cargo.toml b/Cargo.toml index ebe2118ea..3ff629aa4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,8 @@ [package] -authors = ["Jorge Aparicio "] +authors = [ + "Jorge Aparicio ", + "Jonathan 'theJPster' Pallant " +] categories = ["asynchronous", "embedded", "hardware-support", "no-std"] description = " A Hardware Abstraction Layer (HAL) for embedded systems " documentation = "https://docs.rs/embedded-hal" @@ -7,7 +10,7 @@ keywords = ["hal", "IO"] license = "MIT OR Apache-2.0" name = "embedded-hal" repository = "https://github.com/japaric/embedded-hal" -version = "0.1.0" +version = "0.1.1" [dependencies.nb] version = "0.1.1" diff --git a/src/digital.rs b/src/digital.rs index a2f3000cd..9f54c5d1a 100644 --- a/src/digital.rs +++ b/src/digital.rs @@ -14,3 +14,12 @@ pub trait OutputPin { /// Sets the pin high fn set_high(&mut self); } + +/// Single digital input pin +pub trait InputPin { + /// Is the input pin high? + fn is_high(&self) -> bool; + + /// Is the input pin low? + fn is_low(&self) -> bool; +} diff --git a/src/prelude.rs b/src/prelude.rs index 442723d23..38a553ec3 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -14,6 +14,7 @@ pub use ::timer::CountDown as _embedded_hal_timer_CountDown; pub use ::blocking::delay::DelayMs as _embedded_hal_blocking_delay_DelayMs; pub use ::blocking::delay::DelayUs as _embedded_hal_blocking_delay_DelayUs; pub use ::digital::OutputPin as _embedded_hal_digital_OutputPin; +pub use ::digital::InputPin as _embedded_hal_digital_InputPin; pub use ::serial::Read as _embedded_hal_serial_Read; pub use ::serial::Write as _embedded_hal_serial_Write; pub use ::spi::FullDuplex as _embedded_hal_spi_FullDuplex;