更新UCD-API库及文档
This commit is contained in:
60
docs/UCD-API文档/examples/work_with_panel_replay.py
Normal file
60
docs/UCD-API文档/examples/work_with_panel_replay.py
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Import UniTAP module.
|
||||
#
|
||||
import time
|
||||
|
||||
import UniTAP
|
||||
|
||||
#
|
||||
# To initialize UniTAP library wrapper user should create UniTAP.TsiLib() object.
|
||||
#
|
||||
lUniTAP = UniTAP.TsiLib()
|
||||
|
||||
#
|
||||
# For opening device, please, put serial number of the device as 8 symbol str or put index of device.
|
||||
#
|
||||
# dev = lUniTAP.open("NNNNNNNN")
|
||||
dev = lUniTAP.open(0)
|
||||
|
||||
# After opening device as in UCD Console device role should be selected.
|
||||
role = dev.select_role(UniTAP.dev.UCD500.DPSourceDPSink)
|
||||
|
||||
# Select PR'Active mode'
|
||||
role.dptx.pg.panel_replay.active_mode()
|
||||
time.sleep(3)
|
||||
|
||||
# Get current panel replay configuration of PR regions
|
||||
pr_conf = role.dptx.pg.panel_replay.config.get()
|
||||
|
||||
# Set new values for PR Region
|
||||
pr_conf.regions[0].x = 10
|
||||
pr_conf.regions[0].y = 20
|
||||
pr_conf.regions[0].width = 30
|
||||
pr_conf.regions[0].height = 40
|
||||
|
||||
# PanelReplay config
|
||||
pr_conf.flags.mode = UniTAP.PRMode.PR
|
||||
pr_conf.flags.y_granularity = UniTAP.YGranularity.Value_14
|
||||
pr_conf.flags.early_transport = True
|
||||
pr_conf.flags.main_link_remain_on = True
|
||||
pr_conf.flags.hpd_irq_vsc_sdp = True
|
||||
|
||||
# Apply config
|
||||
role.dptx.pg.panel_replay.config.set(pr_conf)
|
||||
|
||||
time.sleep(3)
|
||||
|
||||
# Read status, command and error
|
||||
print(role.dptx.pg.panel_replay.status.status().name)
|
||||
print(role.dptx.pg.panel_replay.status.command().name)
|
||||
print(role.dptx.pg.panel_replay.status.error().name)
|
||||
|
||||
#
|
||||
# Since the 3.5 version, TsiLib and TSIDevice objects have the option to be closed earlier.
|
||||
# TSIDevice can be closed with the TsiLib method close(). TsiLib can be closed with cleanup().
|
||||
# Clean up will close all opened devices and block ability to open any devices
|
||||
# with same TsiLib object.
|
||||
#
|
||||
lUniTAP.close(dev)
|
||||
|
||||
lUniTAP.cleanup()
|
||||
Reference in New Issue
Block a user