更新UCD-API库及文档

This commit is contained in:
xinzhu.yin
2026-07-02 17:16:18 +08:00
parent a500751d85
commit 9fa811a9eb
290 changed files with 9558 additions and 2306 deletions

View File

@@ -0,0 +1,40 @@
#
# 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.UCD400.DPSourceDPSink)
role = dev.select_role(UniTAP.dev.UCD500.DPSourceDPSink)
# Will be returned object of DPCDRegion
dpcd_data = role.dptx.dpcd.read(0, 1)
# Print data of DPCDRegion object
print(dpcd_data.data)
# Write DPCDRegion data to device
role.dptx.dpcd.write(0, dpcd_data.data)
#
# 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()