更新UCD-API库及文档
This commit is contained in:
55
docs/UCD-API文档/examples/work_with_sink_panel_replay.py
Normal file
55
docs/UCD-API文档/examples/work_with_sink_panel_replay.py
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
# Import UniTAP module.
|
||||
#
|
||||
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)
|
||||
|
||||
# Get and print Panel Replay status (flags and debug)
|
||||
sink_pr_status = role.dprx.panel_replay.status
|
||||
print(f"Panel Replay status:\nFlags\n{sink_pr_status.flags()}")
|
||||
|
||||
# Get and print Panel Self Refresh status (flags and debug)
|
||||
sink_psr_status = role.dprx.panel_self_refresh.status
|
||||
print(f"Panel Self Refresh status:\nFlags\n{sink_psr_status.flags()}")
|
||||
|
||||
# Get, set and print Panel Replay capabilities
|
||||
flags, x_granularity, y_granularity, granularity = role.dprx.panel_replay.caps.get()
|
||||
print(f"Flags:\n{flags}\n"
|
||||
f"X Granularity - {x_granularity}\n"
|
||||
f"Y Granularity - {y_granularity}\n"
|
||||
f"SU Y granularity\n{granularity}")
|
||||
|
||||
flags.link_off_supported = True
|
||||
flags.early_transport_support = True
|
||||
flags.pr_support = True
|
||||
|
||||
x_granularity = UniTAP.PrGranularityCaps.Line_4
|
||||
y_granularity = UniTAP.PrGranularityCaps.Line_8
|
||||
|
||||
granularity.value_of_14 = True
|
||||
granularity.value_of_20 = True
|
||||
|
||||
role.dprx.panel_replay.caps.set(flags, x_granularity, y_granularity, granularity)
|
||||
|
||||
#
|
||||
# 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