更新UCD-API库及文档
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from .ports import DPRX, DPTX, HDRX, HDTX, PDC340
|
||||
from .ports import DPRX, DPTX, HDRX, HDRX_eARC, HDTX, PDC340
|
||||
from .modules import MemoryManager, Capturer, DUTTests
|
||||
from UniTAP.libs.lib_tsi.tsi_io import DeviceIO, PortProtocol
|
||||
from UniTAP.libs.lib_tsi.tsi_io import PortProtocol
|
||||
from .dev_base_roles import DevBase, DeviceIO
|
||||
|
||||
|
||||
class UCD340:
|
||||
@@ -9,7 +10,8 @@ class UCD340:
|
||||
- 'USB-C, DP Alt Mode Reference Sink' `USBCSink`
|
||||
- 'USB-C, DP Alt Mode Reference Source' `USBCSource`.
|
||||
"""
|
||||
class USBCSink:
|
||||
|
||||
class USBCSink(DevBase):
|
||||
"""
|
||||
Class `USBCSink` contains information of available functionality modules for role USB-C Sink (RX - receiver)
|
||||
role:
|
||||
@@ -17,7 +19,9 @@ class UCD340:
|
||||
- `DUTTests`.
|
||||
- `PDC`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__port_io = dev_io.create_port_io(0, PortProtocol.DisplayPortThrowUSBC)
|
||||
self.__dprx = DPRX(self.__port_io, memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
@@ -63,7 +67,7 @@ class UCD340:
|
||||
"""
|
||||
return list(UCD340.ROLE_DICT.keys())[list(UCD340.ROLE_DICT.values()).index(type(self))]
|
||||
|
||||
class USBCSource:
|
||||
class USBCSource(DevBase):
|
||||
"""
|
||||
Class `USBCSource` contains information of available functionality modules for role USB-C Source
|
||||
(TX - transmitter) role:
|
||||
@@ -71,7 +75,9 @@ class UCD340:
|
||||
- `DUTTests`.
|
||||
- `PDC`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__port_io = dev_io.create_port_io(0, PortProtocol.DisplayPortThrowUSBC)
|
||||
self.__dptx = DPTX(self.__port_io, memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
@@ -140,13 +146,16 @@ class UCD323:
|
||||
- 'HDMI Reference Sink (HDCP 2.3)' `HDMISink`
|
||||
- 'HDMI Reference Source (HDCP 2.3)' `HDMISource`
|
||||
"""
|
||||
class DPSink:
|
||||
|
||||
class DPSink(DevBase):
|
||||
"""
|
||||
Class `DPSink` contains information of available functionality modules for role DP Sink (RX - receiver) role:
|
||||
- `DPRX`.
|
||||
- `DUTTests`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__dprx = DPRX(dev_io.create_port_io(0, PortProtocol.DisplayPort), memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
|
||||
@@ -180,14 +189,16 @@ class UCD323:
|
||||
"""
|
||||
return list(UCD323.ROLE_DICT.keys())[list(UCD323.ROLE_DICT.values()).index(type(self))]
|
||||
|
||||
class DPSource:
|
||||
class DPSource(DevBase):
|
||||
"""
|
||||
Class `DPSink` contains information of available functionality modules for role DP Source (TX - transmitter)
|
||||
role:
|
||||
- `DPTX`.
|
||||
- `DUTTests`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__dptx = DPTX(dev_io.create_port_io(0, PortProtocol.DisplayPort), memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
|
||||
@@ -221,19 +232,21 @@ class UCD323:
|
||||
"""
|
||||
return list(UCD323.ROLE_DICT.keys())[list(UCD323.ROLE_DICT.values()).index(type(self))]
|
||||
|
||||
class HDMISink:
|
||||
class HDMISink(DevBase):
|
||||
"""
|
||||
Class `HDMISink` contains information of available functionality modules for role HDMI Sink (RX - receiver)
|
||||
role:
|
||||
- `HDRX`.
|
||||
- `DUTTests`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
self.__hdrx = HDRX(dev_io.create_port_io(0, PortProtocol.HDMI), memory_manager, capturer)
|
||||
super().__init__(dev_io)
|
||||
self.__hdrx = HDRX_eARC(dev_io.create_port_io(0, PortProtocol.HDMI), memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
|
||||
@property
|
||||
def hdrx(self) -> HDRX:
|
||||
def hdrx(self) -> HDRX_eARC:
|
||||
"""
|
||||
Returns HDMI Sink (RX - receiver) role.
|
||||
|
||||
@@ -262,14 +275,16 @@ class UCD323:
|
||||
"""
|
||||
return list(UCD323.ROLE_DICT.keys())[list(UCD323.ROLE_DICT.values()).index(type(self))]
|
||||
|
||||
class HDMISource:
|
||||
class HDMISource(DevBase):
|
||||
"""
|
||||
Class `HDMISource` contains information of available functionality modules for role HDMI Source
|
||||
(TX - transmitter) role:
|
||||
- `HDTX`.
|
||||
- `DUTTests`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__hdtx = HDTX(dev_io.create_port_io(0, PortProtocol.HDMI), memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
|
||||
@@ -302,12 +317,56 @@ class UCD323:
|
||||
object of str type.
|
||||
"""
|
||||
return list(UCD323.ROLE_DICT.keys())[list(UCD323.ROLE_DICT.values()).index(type(self))]
|
||||
|
||||
class HDMISinkEARC(DevBase):
|
||||
"""
|
||||
Class `HDMISink` contains information of available functionality modules for role HDMI Sink (RX - receiver)
|
||||
role:
|
||||
- `HDRX`.
|
||||
- `DUTTests`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__hdrx = HDRX_eARC(dev_io.create_port_io(0, PortProtocol.HDMI), memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
|
||||
@property
|
||||
def hdrx(self) -> HDRX_eARC:
|
||||
"""
|
||||
Returns HDMI Sink (RX - receiver) role.
|
||||
|
||||
Returns:
|
||||
object of HDRX type.
|
||||
"""
|
||||
return self.__hdrx
|
||||
|
||||
@property
|
||||
def dut_tests(self) -> DUTTests:
|
||||
"""
|
||||
Returns DUT Test module.
|
||||
|
||||
Returns:
|
||||
object of DUTTests type.
|
||||
"""
|
||||
return self.__dut_tests
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""
|
||||
Returns name of role.
|
||||
|
||||
Returns:
|
||||
object of str type.
|
||||
"""
|
||||
return list(UCD323.ROLE_DICT.keys())[list(UCD323.ROLE_DICT.values()).index(type(self))]
|
||||
|
||||
ROLE_DICT = {
|
||||
"DisplayPort Reference Sink (SST, HDCP 2.3)": DPSink,
|
||||
"DisplayPort Reference Source (SST, HDCP 2.3)": DPSource,
|
||||
"HDMI Reference Sink (HDCP 2.3)": HDMISink,
|
||||
"HDMI Reference Source (HDCP 2.3)": HDMISource,
|
||||
"HDMI Reference Sink (eARC)": HDMISinkEARC,
|
||||
}
|
||||
|
||||
|
||||
@@ -317,13 +376,16 @@ class UCD301:
|
||||
- 'DisplayPort Reference Sink (SST, HDCP 2.3)' `DPSink`
|
||||
- 'HDMI Reference Sink (HDCP 2.3)' `HDMISink`
|
||||
"""
|
||||
class DPSink:
|
||||
|
||||
class DPSink(DevBase):
|
||||
"""
|
||||
Class `DPSink` contains information of available functionality modules for role DP Sink (RX - receiver) role:
|
||||
- `DPRX`.
|
||||
- `DUTTests`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__dprx = DPRX(dev_io.create_port_io(0, PortProtocol.DisplayPort), memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
|
||||
@@ -357,14 +419,16 @@ class UCD301:
|
||||
"""
|
||||
return list(UCD301.ROLE_DICT.keys())[list(UCD301.ROLE_DICT.values()).index(type(self))]
|
||||
|
||||
class HDMISink:
|
||||
class HDMISink(DevBase):
|
||||
"""
|
||||
Class `HDMISink` contains information of available functionality modules for role HDMI Sink (RX - receiver)
|
||||
role:
|
||||
- `HDRX`.
|
||||
- `DUTTests`.
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__hdrx = HDRX(dev_io.create_port_io(0, PortProtocol.HDMI), memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
|
||||
@@ -398,7 +462,7 @@ class UCD301:
|
||||
"""
|
||||
return list(UCD301.ROLE_DICT.keys())[list(UCD301.ROLE_DICT.values()).index(type(self))]
|
||||
|
||||
class DPSinkHDMISink:
|
||||
class DPSinkHDMISink(DevBase):
|
||||
"""
|
||||
Class `DPSinkHDMISink` contains information of available functionality modules for role DP and HDMI Sink
|
||||
(RX - receiver) role:
|
||||
@@ -408,6 +472,7 @@ class UCD301:
|
||||
"""
|
||||
|
||||
def __init__(self, dev_io: DeviceIO, memory_manager: MemoryManager, capturer: Capturer):
|
||||
super().__init__(dev_io)
|
||||
self.__dprx = DPRX(dev_io.create_port_io(0, PortProtocol.DisplayPort), memory_manager, capturer)
|
||||
self.__hdrx = HDRX(dev_io.create_port_io(0, PortProtocol.HDMI), memory_manager, capturer)
|
||||
self.__dut_tests = DUTTests(dev_io)
|
||||
|
||||
Reference in New Issue
Block a user