Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[package]
authors = ["Jorge Aparicio <jorge@japaric.io>"]
authors = [
"Jorge Aparicio <jorge@japaric.io>",
"Jonathan 'theJPster' Pallant <github@thejpster.org.uk>"
]
categories = ["asynchronous", "embedded", "hardware-support", "no-std"]
description = " A Hardware Abstraction Layer (HAL) for embedded systems "
documentation = "https://docs.rs/embedded-hal"
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"
Expand Down
9 changes: 9 additions & 0 deletions src/digital.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;