Skip to content

Add type-c traits for getting Discovered SVIDs, Discover Identity, executing Hard Reset#850

Open
tullom wants to merge 5 commits into
OpenDevicePartnership:v0.2.0from
tullom:type-c-discovered-svids
Open

Add type-c traits for getting Discovered SVIDs, Discover Identity, executing Hard Reset#850
tullom wants to merge 5 commits into
OpenDevicePartnership:v0.2.0from
tullom:type-c-discovered-svids

Conversation

@tullom
Copy link
Copy Markdown
Contributor

@tullom tullom commented May 18, 2026

Mirrors PR #820 for v0.2.0

Resolves #849

@tullom tullom self-assigned this May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 21:47
@tullom tullom requested review from a team as code owners May 18, 2026 21:47
@tullom tullom added the enhancement New feature or request label May 18, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Mirrors PR #820 onto the v0.2.0 branch by adding port- and controller-level traits (and tps6699x driver implementations) for getting Discovered SVIDs, getting Discover Identity SOP/SOP' responses, and executing Hard Reset. Resolves issue #849.

Changes:

  • Adds new SvidDiscovery, HardReset, and DiscoverIdentity traits at both port and controller levels in type-c-interface, plus a new DiscoveredSvids data type in control::svid.
  • Implements these traits for the tps6699x driver and for the std example mock controller.
  • Wires up heapless as a new dependency of type-c-interface (reflected in workspace Cargo.lock files).

Reviewed changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
type-c-interface/src/control/svid.rs New DiscoveredSvids value type with fixed-capacity SOP/SOP' arrays.
type-c-interface/src/control/mod.rs Registers the new svid module.
type-c-interface/src/controller/svid.rs New controller-level SvidDiscovery trait.
type-c-interface/src/controller/hard_reset.rs New controller-level HardReset trait.
type-c-interface/src/controller/discover_identity.rs New controller-level DiscoverIdentity trait (SOP and SOP').
type-c-interface/src/controller/mod.rs Registers the three new controller modules.
type-c-interface/src/port/svid.rs New port-level SvidDiscovery trait.
type-c-interface/src/port/hard_reset.rs New port-level HardReset trait.
type-c-interface/src/port/discover_identity.rs New port-level DiscoverIdentity trait.
type-c-interface/src/port/mod.rs Registers the three new port modules.
type-c-interface/Cargo.toml Adds heapless workspace dependency.
type-c-service/src/controller/svid.rs Port-trait blanket impl that delegates to the controller's SvidDiscovery.
type-c-service/src/controller/hard_reset.rs Port-trait blanket impl that delegates to the controller's HardReset.
type-c-service/src/controller/discover_identity.rs Port-trait blanket impl delegating to the controller's DiscoverIdentity.
type-c-service/src/controller/mod.rs Registers the three new service-side controller modules.
type-c-service/src/driver/tps6699x.rs Concrete impls calling tps6699x driver primitives for SVID/HRST/Discover Identity.
examples/std/src/lib/type_c/mock_controller.rs Mock implementations of the new traits for the std example.
Cargo.lock / examples/*/Cargo.lock Lockfile updates reflecting the new heapless dependency.

Comment thread type-c-service/src/controller/svid.rs Outdated
Comment thread type-c-service/src/driver/tps6699x.rs Outdated
@tullom tullom requested a review from RobertZ2011 May 18, 2026 22:00
Comment thread type-c-interface/src/controller/discover_identity.rs Outdated
Comment thread type-c-interface/src/controller/hard_reset.rs Outdated
Comment thread type-c-interface/src/controller/svid.rs Outdated
Comment thread type-c-interface/src/port/discover_identity.rs Outdated
Comment thread type-c-interface/src/port/hard_reset.rs Outdated
Comment thread type-c-interface/src/port/svid.rs Outdated
@tullom tullom requested a review from RobertZ2011 May 18, 2026 22:53
RobertZ2011
RobertZ2011 previously approved these changes May 18, 2026
jerrysxie
jerrysxie previously approved these changes May 18, 2026
Comment thread type-c-service/src/driver/tps6699x.rs Outdated
Comment thread type-c-interface/src/control/svid.rs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 11 changed files in this pull request and generated no new comments.

match data.try_into() {
Ok(vdos) => Ok(vdos),
Err(e) => {
debug!("Error deserializing Received SOP Identity Data: {:?}", e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: error!() here as well?

match data.try_into() {
Ok(vdos) => Ok(vdos),
Err(e) => {
debug!("Error deserializing Received SOP Prime Identity Data: {:?}", e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: error!() here as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants