Skip to content

Commit 0d3a5f9

Browse files
Merge pull request #24 from zhuyi2024/personal/zhuyi/addDataRole
Add DataRole and PlugOrientation
2 parents 99232ec + b04cfa6 commit 0d3a5f9

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,26 @@ pub enum PowerRole {
9191
Source,
9292
}
9393

94+
/// Data role
95+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
96+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
97+
pub enum DataRole {
98+
/// Upward-facing port
99+
Ufp,
100+
/// Downward-facing port
101+
Dfp,
102+
}
103+
104+
/// Plug orientation
105+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
106+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
107+
pub enum PlugOrientation {
108+
/// Upside-up orientation
109+
CC1,
110+
/// Upside-down orientation
111+
CC2,
112+
}
113+
94114
impl<T, BE> From<PdError> for Result<T, Error<BE>> {
95115
fn from(err: PdError) -> Self {
96116
Err(err.into())

0 commit comments

Comments
 (0)