Skip to content

Commit

Permalink
asynchronous: Create initial PD controller trait
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertZ2011 committed Feb 6, 2025
1 parent 747eff2 commit 8ed15ae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ edition = "2021"

[dependencies]
defmt = { version = "0.3", optional = true }
embedded-hal-async = "1.0.0"

[features]
default = ["defmt"]
defmt = [
"dep:defmt"
]
default = []
defmt = ["dep:defmt"]
11 changes: 11 additions & 0 deletions src/asynchronous/controller.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use core::future::Future;

use embedded_hal_async::delay::DelayNs;

use crate::Error;

pub trait PdController {
type BusError;

fn reset(&mut self, delay: &mut impl DelayNs) -> impl Future<Output = Result<(), Error<Self::BusError>>>;
}
1 change: 1 addition & 0 deletions src/asynchronous/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod controller;
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![no_std]

pub mod asynchronous;

/// Port ID new type
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
Expand Down

0 comments on commit 8ed15ae

Please sign in to comment.