fmckeogh / usb-pd-rs

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

pdo: expand storage types to cover common units #16

Closed sjoerdsimons closed 5 months ago

sjoerdsimons commented 5 months ago

Using e.g. si::u8::ElectricPotential with a base unit of decivolts can not be converted to milivolts (which is the obvious conversion) as the u8 milivolts range is only 0 - 255mv.. Same for current. Expand the storage to 16 bits so the full range can be exposes as milivolt/miliamp