更新UCD-API库及文档
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from UniTAP.libs.lib_tsi.tsi_io import PortIO
|
||||
from UniTAP.libs.lib_tsi.tsi import *
|
||||
import UniTAP.libs.lib_tsi.tsi_types as ci
|
||||
import UniTAP.libs.lib_tsi.tsi_private_types as p_ci
|
||||
from .pr_private_types import *
|
||||
from .pr_status import PanelReplayStatus
|
||||
from .pr_config import PanelReplayConfig
|
||||
@@ -68,6 +69,6 @@ class PanelReplay:
|
||||
self.__write_pr_control(PrControl.EnableSelectiveUpdate)
|
||||
|
||||
def __write_pr_control(self, command: PrControl):
|
||||
self.__io.set(TSI_PG_STREAM_SELECT, 0)
|
||||
self.__io.set(TSI_PG_PR_CTRL_W, command.value)
|
||||
self.__io.set(ci.TSI_PG_STREAM_SELECT, 0)
|
||||
self.__io.set(p_ci.TSI_PG_PR_CTRL_W, command.value)
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from UniTAP.libs.lib_tsi.tsi_io import PortIO
|
||||
from UniTAP.libs.lib_tsi.tsi import *
|
||||
import UniTAP.libs.lib_tsi.tsi as tsi
|
||||
import UniTAP.libs.lib_tsi.tsi_types as ci
|
||||
import UniTAP.libs.lib_tsi.tsi_private_types as p_ci
|
||||
from .pr_types import *
|
||||
from .pr_private_types import *
|
||||
|
||||
@@ -35,7 +37,7 @@ class PanelReplayConfig:
|
||||
"""
|
||||
caps = self.pr_caps
|
||||
|
||||
self.__io.set(TSI_PG_STREAM_SELECT, 0)
|
||||
self.__io.set(ci.TSI_PG_STREAM_SELECT, 0)
|
||||
pr_config, _ = self.__read_config()
|
||||
|
||||
pr_config.early_transport = config.flags.early_transport if caps.pr_flags().early_transport else 0
|
||||
@@ -60,7 +62,7 @@ class PanelReplayConfig:
|
||||
region = RegionConfig(0)
|
||||
region.value = item
|
||||
data.extend(region.value)
|
||||
self.__io.set(TSI_PG_PR_CFG, data, data_count=len(data))
|
||||
self.__io.set(p_ci.TSI_PG_PR_CFG, data, data_count=len(data))
|
||||
|
||||
def get(self) -> PrSettings:
|
||||
"""
|
||||
@@ -114,8 +116,8 @@ class PanelReplayConfig:
|
||||
def __read_config(self):
|
||||
caps = self.pr_caps
|
||||
|
||||
self.__io.set(TSI_PG_STREAM_SELECT, 0)
|
||||
result = self.__io.get(TSI_PG_PR_CFG, c_uint32, caps.calculate_size())[1]
|
||||
self.__io.set(ci.TSI_PG_STREAM_SELECT, 0)
|
||||
result = self.__io.get(p_ci.TSI_PG_PR_CFG, c_uint32, caps.calculate_size())[1]
|
||||
if not isinstance(result, list):
|
||||
result = [0]
|
||||
pr_config = PrConfig(result[0])
|
||||
@@ -128,5 +130,5 @@ class PanelReplayConfig:
|
||||
return pr_config, pr_regions
|
||||
|
||||
def __read_caps(self) -> PRCaps:
|
||||
self.__io.set(TSI_PG_STREAM_SELECT, 0)
|
||||
return self.__io.get(TSI_PG_PR_CAPS_R, PRCaps)[1]
|
||||
self.__io.set(ci.TSI_PG_STREAM_SELECT, 0)
|
||||
return self.__io.get(p_ci.TSI_PG_PR_CAPS_R, PRCaps)[1]
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from ctypes import c_int, c_uint32
|
||||
|
||||
from UniTAP.libs.lib_tsi.tsi_io import PortIO
|
||||
from .pr_sink_private_types import SinkPanelReplayCapsStruct, SinkPanelSelfRefreshCapsStruct
|
||||
from .pr_sink_types import PRCapsFlags, PrGranularityCaps, SuYGranularity, PSRCapsFlags, PSRCaps, PSRSetupTime
|
||||
from UniTAP.libs.lib_tsi.tsi import *
|
||||
import UniTAP.libs.lib_tsi.tsi_types as ci
|
||||
from typing import Tuple
|
||||
|
||||
|
||||
@@ -27,7 +29,7 @@ class SinkPanelReplayCaps:
|
||||
(flags.y_gran_extended_supported << 14) | (flags.link_off_supported << 15))
|
||||
|
||||
self.__write([flags_value, x_granularity.value, y_granularity.value, granularity.combined_value()])
|
||||
self.__io.set(TSI_DPRX_HPD_PULSE_W, 500000, c_int)
|
||||
self.__io.set(ci.TSI_DPRX_HPD_PULSE_W, 500000, c_int)
|
||||
|
||||
def get(self) -> Tuple[PRCapsFlags, PrGranularityCaps, PrGranularityCaps, SuYGranularity]:
|
||||
caps = self.__read()
|
||||
@@ -65,10 +67,10 @@ class SinkPanelReplayCaps:
|
||||
return flags, x_granularity, y_granularity, granularity
|
||||
|
||||
def __read(self) -> SinkPanelReplayCapsStruct:
|
||||
return self.__io.get(TSI_DPRX_PR_CAPS, SinkPanelReplayCapsStruct)[1]
|
||||
return self.__io.get(ci.TSI_DPRX_PR_CAPS, SinkPanelReplayCapsStruct)[1]
|
||||
|
||||
def __write(self, data: list):
|
||||
self.__io.set(TSI_DPRX_PR_CAPS, data, data_type=c_uint32, data_count=len(data))
|
||||
self.__io.set(ci.TSI_DPRX_PR_CAPS, data, data_type=c_uint32, data_count=len(data))
|
||||
|
||||
|
||||
class SinkPanelSelfRefreshCaps:
|
||||
@@ -105,7 +107,7 @@ class SinkPanelSelfRefreshCaps:
|
||||
return flags, x_granularity, y_granularity
|
||||
|
||||
def __read(self) -> SinkPanelSelfRefreshCapsStruct:
|
||||
return self.__io.get(TSI_DPRX_PSR_CAPS, SinkPanelSelfRefreshCapsStruct)[1]
|
||||
return self.__io.get(ci.TSI_DPRX_PSR_CAPS, SinkPanelSelfRefreshCapsStruct)[1]
|
||||
|
||||
def __write(self, data: list):
|
||||
self.__io.set(TSI_DPRX_PSR_CAPS, data, data_type=c_uint32, data_count=len(data))
|
||||
self.__io.set(ci.TSI_DPRX_PSR_CAPS, data, data_type=c_uint32, data_count=len(data))
|
||||
@@ -1,7 +1,8 @@
|
||||
from UniTAP.libs.lib_tsi.tsi_io import PortIO
|
||||
import UniTAP.libs.lib_tsi.tsi_types as ci
|
||||
from .pr_sink_private_types import SinkPanelSelfRefreshStatusStruct, SinkPanelReplayStatusStruct
|
||||
from .pr_sink_types import (SinkPRStatusFlags, SelfStatus, FrameStatus, SinkPSRStatusFlags, PRSSelfRefreshStatus)
|
||||
from UniTAP.libs.lib_tsi.tsi import *
|
||||
import UniTAP.libs.lib_tsi.tsi as tsi
|
||||
|
||||
|
||||
class SinkPanelReplayStatus:
|
||||
@@ -31,7 +32,7 @@ class SinkPanelReplayStatus:
|
||||
|
||||
def __read(self) -> SinkPanelReplayStatusStruct:
|
||||
|
||||
return self.__io.get(TSI_DPRX_PR_STATUS, SinkPanelReplayStatusStruct)[1]
|
||||
return self.__io.get(ci.TSI_DPRX_PR_STATUS, SinkPanelReplayStatusStruct)[1]
|
||||
|
||||
|
||||
class SinkPanelSelfRefreshStatus:
|
||||
@@ -59,4 +60,4 @@ class SinkPanelSelfRefreshStatus:
|
||||
self_refresh=PRSSelfRefreshStatus(pr_flags.self_refresh))
|
||||
|
||||
def __read(self) -> SinkPanelSelfRefreshStatusStruct:
|
||||
return self.__io.get(TSI_DPRX_PSR_STATUS, SinkPanelSelfRefreshStatusStruct)[1]
|
||||
return self.__io.get(ci.TSI_DPRX_PSR_STATUS, SinkPanelSelfRefreshStatusStruct)[1]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from UniTAP.libs.lib_tsi.tsi_io import PortIO
|
||||
import UniTAP.libs.lib_tsi.tsi_private_types as p_ci
|
||||
import UniTAP.libs.lib_tsi.tsi_types as ci
|
||||
from .pr_private_types import *
|
||||
from UniTAP.libs.lib_tsi.tsi import *
|
||||
from .pr_types import *
|
||||
|
||||
|
||||
@@ -43,6 +44,6 @@ class PanelReplayStatus:
|
||||
return PRError(self.__read().error)
|
||||
|
||||
def __read(self) -> PrStatus:
|
||||
self.__io.set(TSI_PG_STREAM_SELECT, 0)
|
||||
return self.__io.get(TSI_PG_PR_STATUS_R, PrStatus)[1]
|
||||
self.__io.set(ci.TSI_PG_STREAM_SELECT, 0)
|
||||
return self.__io.get(p_ci.TSI_PG_PR_STATUS_R, PrStatus)[1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user