Skip to content

Commit

Permalink
Merge pull request #8 from niclashoyer/1.0.0-alpha.9
Browse files Browse the repository at this point in the history
Update for embedded-hal@1.0.0-alpha.9
  • Loading branch information
niclashoyer authored Dec 3, 2022
2 parents 1c1aea3 + 4ee3bce commit 069751b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
15 changes: 3 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "embedded-hal-sync-pins"
version = "0.6.0"
version = "0.7.0"
authors = ["Niclas Hoyer <info@niclashoyer.de>"]
edition = "2018"
description = "embedded-hal pin implementations that can be shared between threads"
Expand All @@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0"
[dependencies]
num-derive = "0.3"
num-traits = "0.2"
embedded-hal = "1.0.0-alpha.7"
embedded-hal = "1.0.0-alpha.9"
vcd = { version = "0.6", optional = true }

[features]
Expand Down
14 changes: 7 additions & 7 deletions src/pins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
//!
//! This module provides implementations of atomic pin types that
//! can be used by any [`embedded_hal`] implementation that use
//! [`Input`-](`embedded_hal::digital::blocking::InputPin`) or
//! [`OutputPin`s](`embedded_hal::digital::blocking::OutputPin`).
//! [`Input`-](`embedded_hal::digital::InputPin`) or
//! [`OutputPin`s](`embedded_hal::digital::OutputPin`).
//!
//! As atomic types these pins use primitive [`atomic`](`std::sync::atomic`) types,
//! so that these pins can be shared safely between threads. Especially useful
//! for integration testing.
use core::convert::Infallible;
use embedded_hal::digital::blocking as hal;
use embedded_hal::digital as hal;
use embedded_hal::digital::ErrorType;
use num_derive::{FromPrimitive, ToPrimitive};
use num_traits::{FromPrimitive, ToPrimitive};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;

/// A digital pin state.
#[derive(Clone, Debug, PartialEq, FromPrimitive, ToPrimitive)]
#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive, ToPrimitive)]
pub enum PinState {
/// Logical high
High = 1,
Expand Down Expand Up @@ -105,7 +105,7 @@ impl Default for AtomicPinState {
///
/// ```
/// use embedded_hal_sync_pins::pins::{AtomicPinState, InputPin, PinState};
/// use embedded_hal::digital::blocking::InputPin as HalInputPin;
/// use embedded_hal::digital::InputPin as HalInputPin;
/// use std::sync::{Arc, atomic::Ordering};
///
/// let state = Arc::new(AtomicPinState::new_with_state(PinState::Low));
Expand Down Expand Up @@ -152,7 +152,7 @@ impl hal::InputPin for InputPin {
///
/// ```
/// use embedded_hal_sync_pins::pins::{AtomicPinState, PushPullPin, PinState};
/// use embedded_hal::digital::blocking::{InputPin as HalInputPin, OutputPin};
/// use embedded_hal::digital::{InputPin as HalInputPin, OutputPin};
/// use std::sync::Arc;
///
/// let state = Arc::new(AtomicPinState::new());
Expand Down Expand Up @@ -236,7 +236,7 @@ impl hal::InputPin for PushPullPin {
///
/// ```
/// use embedded_hal_sync_pins::pins::{AtomicPinState, OpenDrainPin, PinState};
/// use embedded_hal::digital::blocking::{InputPin as HalInputPin, OutputPin};
/// use embedded_hal::digital::{InputPin as HalInputPin, OutputPin};
/// use std::sync::{Arc, atomic::Ordering};
///
/// let state = Arc::new(AtomicPinState::new());
Expand Down
6 changes: 2 additions & 4 deletions src/wire.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use embedded_hal::digital::blocking::{
InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin,
};
use embedded_hal::digital::ErrorType;
use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin};
use std::convert::Infallible;
use std::sync::Arc;
use std::sync::Mutex;

type PinId = usize;

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum WireState {
Low,
High,
Expand Down

0 comments on commit 069751b

Please sign in to comment.