Fill USB 2.0 Rev 2.0 and Type-C CabCon R2.5 numbers (2.75.0).

LS/FS rates, pull-up/down, and VBUS come from the base spec. Cable Z0 90 ohm is CABLE; PCB should 90 ohm is RECOMMENDED. L2 differential_impedance stays UNKNOWN. Rp/Rd/Ra from CabCon Tables 4-27/28/29. IEEE Section One/Three and HDMI still missing. PDFs not in git.
This commit is contained in:
2026-09-22 16:53:49 +02:00
parent f3be485b75
commit c4cd046ea9
6 changed files with 955 additions and 353 deletions
+2 -1
View File
@@ -98,7 +98,8 @@ def test_usb2_and_usb_c_unknown_with_usbif_needed_document_no_90ohm():
assert c.needed_document
assert "USB-IF" in c.needed_document or "specification" in c.needed_document.lower() or "Specification" in c.needed_document
if p.logical_protocol_id == "usb-c" and c.parameter in {"rp", "rd"}:
assert c.value_kind == "UNKNOWN"
assert c.value_kind == "NUMERIC"
assert c.source and "Type-C" in (c.source.document or "")
over = next(p for p in cat.physical_interfaces if p.id == "usb-c-usb2-receptacle")
assert over.logical_protocol_id == "usb2-hs"
assert over.connector == "Type-C"
+28 -10
View File
@@ -33,11 +33,11 @@ def test_usb_cts_hs_numeric_cited_no_zdiff_90():
hs = next(p for p in cat.physical_interfaces if p.id == "usb2-hs-dpair")
by = {c.parameter: c for c in hs.constraints}
_cite_ok(by["data_rate"])
assert by["data_rate"].value == 480.0
assert by["data_rate"].value == 480.00
assert by["data_rate"].unit == "Mb/s"
assert by["data_rate"].source.document == "USB 2.0 Electrical Compliance Test Specification"
assert "1.08" in by["data_rate"].source.revision
assert "EL_2" in (by["data_rate"].source.section or "")
assert by["data_rate"].source.document == "Universal Serial Bus Specification"
assert "2.0" in by["data_rate"].source.revision
assert by["data_rate"].source.section == "7.1.11"
assert by["rise_time"].value == 300.0
assert by["fall_time"].value == 300.0
assert by["pull_up"].value == 1500.0
@@ -47,27 +47,45 @@ def test_usb_cts_hs_numeric_cited_no_zdiff_90():
for key in (
"data_rate", "rise_time", "fall_time", "pull_up", "dc_resistance",
"dc_resistance_captive_cable_device", "dc_resistance_host_hub_downstream",
"cable_differential_impedance", "pcb_trace_nominal_zdiff",
):
_cite_ok(by[key])
assert by[key].source.organization == "USB-IF"
assert by["cable_differential_impedance"].value == 90.0
assert by["cable_differential_impedance"].source_type == "CABLE"
assert by["pcb_trace_nominal_zdiff"].value == 90.0
assert by["pcb_trace_nominal_zdiff"].mandatory == "RECOMMENDED"
assert by["pcb_trace_nominal_zdiff"].source_type == "PCB"
z = by["differential_impedance"]
assert z.value_kind == "UNKNOWN"
assert z.value is None
ls = next(p for p in cat.physical_interfaces if p.id == "usb2-ls-dpair")
ls_rate = next(c for c in ls.constraints if c.parameter == "data_rate")
assert ls_rate.value_kind == "UNKNOWN"
_cite_ok(ls_rate)
assert ls_rate.value == 1.50
fs = next(p for p in cat.physical_interfaces if p.id == "usb2-fs-dpair")
fs_rate = next(c for c in fs.constraints if c.parameter == "data_rate")
_cite_ok(fs_rate)
assert fs_rate.value == 12.000
blob = json.dumps(z.model_dump())
assert "90" not in blob
def test_type_c_rp_rd_unknown_fts_does_not_state_ohms():
def test_type_c_rp_rd_from_cabcon_r25_vbus_volts_unknown():
cat = load_catalog()
rec = next(p for p in cat.physical_interfaces if p.id == "usb-c-receptacle")
by = {c.parameter: c for c in rec.constraints}
for p in ("rp", "rd", "ra", "cc"):
assert by[p].value_kind == "UNKNOWN"
assert "Cable and Connector" in (by[p].needed_document or "")
_cite_ok(by["rp"])
assert by["rp"].value == 56000.0
assert by["rp"].source.table == "Table 4-27"
assert by["rp"].source_type == "CONNECTOR"
_cite_ok(by["rd"])
assert by["rd"].value == 5100.0
assert by["rd"].source.table == "Table 4-28"
_cite_ok(by["ra"])
assert by["ra"].value == 800.0
assert by["ra"].source_type == "CABLE"
assert by["voltage"].value_kind == "UNKNOWN"
assert "vSafe5V" in (by["voltage"].needed_document or "")
_cite_ok(by["gnd_ir_drop_cable"])
assert by["gnd_ir_drop_cable"].value == 250.0
assert by["gnd_ir_drop_cable"].source_type == "CABLE"