fmckeogh / usb-pd-rs

USB-PD and associated hardware driver libraries in Rust
MIT License
19 stars 4 forks source link

Thoughts on implementing the USB PD Policy Engine as layed out in the standard docs. #11

Open bentwire opened 6 months ago

bentwire commented 6 months ago

Been thinking about starting work on a policy engine based on the state machine in the docs.

Its got 195 states... We don't have to do them all, just the sink ones first should be fine...

fmckeogh commented 6 months ago

Sounds good to me, my main focus will be on PD source support but this would be awesome

bentwire commented 6 months ago

Awesome!

The section I am going over in the spec is 8.3. It looks like they split things in to a few different state groups. Not sure the best way to handle that. I was thinking one state machine per group where appropriate, and then some over all state machine that switches between them. Not 100% sure I like the idea though.