import platform
from typing import List

from ctypes import c_void_p, c_int, c_uint, Structure, c_char_p, POINTER, c_bool, c_uint32, \
    c_uint64, c_int8, c_uint8, c_char, c_int16, c_int32, c_int64
from enum import IntEnum
from ctypes import wintypes

if platform.system() == 'Windows':
    from ctypes import WINFUNCTYPE
    TSI_USER_LOG_FUNCTION = WINFUNCTYPE(None, c_int32, c_char_p)
else:
    from ctypes import CFUNCTYPE
    TSI_USER_LOG_FUNCTION = CFUNCTYPE(None, c_int32, c_char_p)


class CtypeEnum(IntEnum):
    @classmethod
    def from_param(cls, obj):
        return int(obj)


OS_WINDOW_ID = wintypes.HWND
OS_SEMAPHORE = c_void_p

# !CI_PARSE_DISABLE
TSI_BASE_LEGACY_REFFRAME = lambda offset: (0x10 + offset)  # Reserved range from 0x10 to 0x1ff.
TSI_BASE_LEGACY_INPUT = lambda offset: (0x200 + offset)  # Reserved range from 0x200 to 0x20f.
TSI_BASE_LEGACY_GENERIC = lambda offset: (0x210 + offset)  # Reserved range from 0x210 to 0x21f.
TSI_BASE_LEGACY_AUDIO = lambda offset: (0x220 + offset)  # Reserved range from 0x220 to 0x22f.
TSI_BASE_LEGACY_VX1 = lambda offset: (0x240 + offset)  # Reserved range from 0x240 to 0x24f.
TSI_BASE_LEGACY_DPRX_MSA = lambda offset: (0x260 + offset)  # Reserved range from 0x260 to 0x27f.
TSI_BASE_LEGACY_HDCP1 = lambda offset: (0x280 + offset)  # Reserved range from 0x280 to 0x28f.
TSI_BASE_LEGACY_HDCP2 = lambda offset: (0x290 + offset)  # Reserved range from 0x290 to 0x29f.
TSI_BASE_LEGACY_LVDS = lambda offset: (0x2a0 + offset)  # Reserved range from 0x2a0 to 0x2af.
TSI_BASE_LEGACY_DPRX = lambda offset: (0x2b0 + offset)  # Reserved range from 0x2b0 to 0x2ef.
TSI_BASE_LEGACY_AUDGEN = lambda offset: (0x2f0 + offset)  # Reserved range from 0x2f0 to 0x2ff.
TSI_BASE_LEGACY_CAP = lambda offset: (0x300 + offset)  # Reserved range from 0x300 to 0x31f.
TSI_BASE_LEGACY_VIDCAP = lambda offset: (0x320 + offset)  # Reserved range from 0x320 to 0x33f.
TSI_BASE_LEGACY_AUDCAP = lambda offset: (0x340 + offset)  # Reserved range from 0x340 to 0x35f.
TSI_BASE_LEGACY_EVCAP = lambda offset: (0x360 + offset)  # Reserved range from 0x360 to 0x37f.
TSI_BASE_LEGACY_USBC = lambda offset: (0x600 + offset)  # Reserved range from 0x600 to 0x6ff.
TSI_BASE_LEGACY_PATGEN = lambda offset: (0x700 + offset)  # Reserved range from 0x700 to 0x77f.
TSI_BASE_LEGACY_DPTX = lambda offset: (0x780 + offset)  # Reserved range from 0x780 to 0x7ff.
TSI_BASE_LEGACY_HDTX = lambda offset: (0x800 + offset)  # Reserved range from 0x800 to 0x80f.
TSI_BASE_LEGACY_HDRX = lambda offset: (0x810 + offset)  # Reserved range from 0x810 to 0x81f.
TSI_BASE_LEGACY_HDRX_TIM = lambda offset: (0x820 + offset)  # Reserved range from 0x820 to 0x82f.
TSI_BASE_LEGACY_MEMORY = lambda offset: (0x880 + offset)  # Reserved range from 0x880 to 0x89f.
TSI_BASE_LEGACY_PDO = lambda offset: (0xfe0 + offset)  # Reserved range from 0xfe0 to 0xfff.
TSI_BASE_LEGACY_VIDTEST = lambda offset: (0x1000 + offset)  # Reserved range from 0x1000 to 0x109f.
TSI_BASE_LEGACY_EDID = lambda offset: (0x1100 + offset)  # Reserved range from 0x1100 to 0x110f.
TSI_BASE_LEGACY_HPDARC = lambda offset: (0x1200 + offset)  # Reserved range from 0x1200 to 0x121f.
TSI_BASE_LEGACY_AUDTEST = lambda offset: (0x2020 + offset)  # Reserved range from 0x2020 to 0x202f.
TSI_BASE_LEGACY_SCRIPT = lambda offset: (0x2030 + offset)  # Reserved range from 0x2030 to 0x203f.
TSI_BASE_LEGACY_ADC = lambda offset: (0x12000 + offset)  # Reserved range from 0x12000 to 0x120ff.

TSI_BASE_DVI_RX = lambda offset: (0x00010000 + offset)
TSI_BASE_DP_RX = lambda offset: (0x00010100 + offset)
TSI_BASE_HDMI_RX = lambda offset: (0x00010200 + offset)
TSI_BASE_CRC_VIDEO = lambda offset: (0x00010300 + offset)
TSI_BASE_R_CRC_VIDEO = lambda offset: (0x00010380 + offset)
TSI_BASE_HDMI_RX_CEC = lambda offset: (0x00010400 + offset)
TSI_BASE_USBC_EL = lambda offset: (0x00010500 + offset)
TSI_BASE_DP_LTT = lambda offset: (0x00010700 + offset)
TSI_BASE_R_HDMI_INFOFRAME = lambda offset: (0x00011000 + offset)  # Reserved range from 0x11000 to 0x11200.
TSI_BASE_USBC_DP_SRC_DUT = lambda offset: (0x00011300 + offset)
TSI_BASE_USBC_DP_SINK_DUT = lambda offset: (0x00011400 + offset)
TSI_BASE_R_DP_SDP = lambda offset: (0x00011500 + offset)  # Reserved range from 0x11500 to 0x116FF (0x115ff?).
TSI_BASE_VD = lambda offset: (0x00100000 + offset)
TSI_BASE_DP14_SRCCTS = lambda offset: (0x010e0000 + offset)
TSI_BASE_TEST_HDCP2_1A = lambda offset: (0x010F0000 + offset)
TSI_BASE_TEST_HDCP2_1B = lambda offset: (0x01110000 + offset)
TSI_BASE_TEST_HDCP2_2C = lambda offset: (0x01120000 + offset)
TSI_BASE_TEST_HDCP2_3A = lambda offset: (0x01130000 + offset)
TSI_BASE_TEST_HDCP2_3B = lambda offset: (0x01140000 + offset)
TSI_BASE_TEST_HDCP2_3C = lambda offset: (0x01150000 + offset)
TSI_BASE_DP14_SINKCTS = lambda offset: (0x01160000 + offset)
TSI_BASE_VRR_SINK_DUT = lambda offset: (0x01170000 + offset)
TSI_BASE_VRR_SRC_DUT = lambda offset: (0x01180000 + offset)
TSI_BASE_DP20_SRCCTS = lambda offset: (0x01190000 + offset)
TSI_BASE_DP20_SINKCTS = lambda offset: (0x011A0000 + offset)
TSI_BASE_DP20_LTTPRCTS = lambda offset: (0x011B0000 + offset)
TSI_BASE_HDMI_SRCCTS = lambda offset: (0x011C0000 + offset)
TSI_BASE_HDMI_SINKCTS = lambda offset: (0x011D0000 + offset)
TSI_BASE_HDMI_CALBE_CHECK_SINK = lambda offset: (0x011F0000 + offset)

TSI_BASE_TPG = lambda offset: (0x50000000 + 0x5000 + offset)
TSI_BASE_TEST = lambda offset: (0x50000000 + 0xC000 + offset)
TSI_BASE_DPRX = lambda offset: (0x50000000 + 0x21000 + offset)
TSI_BASE_DPTX = lambda offset: (0x50000000 + 0x22000 + offset)
TSI_BASE_HDRX = lambda offset: (0x50000000 + 0x23000 + offset)
TSI_BASE_HDTX = lambda offset: (0x50000000 + 0x24000 + offset)
TSI_BASE_SPDIF = lambda offset: (0x50000000 + 0x25000 + offset)
TSI_BASE_PDC = lambda offset: (0x50000000 + 0x26000 + offset)
TSI_BASE_PLAYBACK = lambda offset: (0x50000000 + 0x2B000 + offset)
TSI_BASE_BULK_CAPTURE = lambda offset: (0x50000000 + 0x2C000 + offset)
TSI_BASE_MLEG = lambda offset: (0x50000000 + 0x2D000 + offset)
TSI_BASE_DSC = lambda offset: (0x50000000 + 0x32000 + offset)
TSI_BASE_INPUT = lambda offset: (0x50000000 + 0x99000 + offset)
TSI_BASE_DID = lambda offset: (0x50000000 + 0xF0000 + offset)
# !CI_PARSE_ENABLE


# !CI_PARSE_DISABLE
TSI_SUCCESS = 0  # No error -- Generic indication of success.
TSI_ERROR_NOT_INITIALIZED = -1  # TSI_Init() has not been called, and/or TSI_Clean() has already been called.
TSI_ERROR_COMPATIBILITY_MISMATCH = -2  # Compatibility mode given to TSI_Init() does not match a previously given one.
TSI_ERROR_NOT_COMPATIBLE = -3  # The requested compatibility mode is not available in this TSI version.
TSI_ERROR_DLL_NOT_FOUND = -4  # A dynamic link library file was not found.
TSI_ERROR_DLL_VERSION_READ = -5  # Failed to determine dynamic link library file's version.
TSI_ERROR_OUT_OF_MEMORY = -6  # Failed to allocate system resources (Memory and/or other resources)
TSI_ERROR_FUNCTION_NOT_FOUND = -7  # A dynamic link library is missing a required function.
TSI_ERROR_ACCESS_DENIED = -8  # The feature requires a license key and the required license key is not installed.
TSI_ERROR_NO_REFERENCES = -9  # A reference counted item is already at zero references, or the item is already destroyed.
TSI_ERROR_DEVICE_INDEX_OUT_OF_RANGE = -10  # A device index is out of range.
TSI_ERROR_INVALID_PARAMETER = -11  # One or more of the parameters passed to a function are invalid.
TSI_ERROR_INPUT_ENABLED = -12  # The requested operation is not available while input is enabled.
TSI_ERROR_INPUT_DISABLED = -13  # The requested operation is not available while input is disabled.
TSI_ERROR_INPUT_ENABLE_FAILED = -14  # Failed to enable input due to resources allocation problems.
TSI_ERROR_OPEN_DEVICE = -15  # Failed to open requested device. (Device in use? Device removed?)
TSI_ERROR_INPUT_SELECT = -16  # Failed to select input.
TSI_ERROR_NOT_IMPLEMENTED = -17  # The requested function is not implemented.
TSI_ERROR_UNEXPECTED_ITEM_SIZE = -18  # Set/Get config item: Size of the item being set or get was unexpected.
TSI_ERROR_UNSUPPORTED_CONFIG_ID = -19  # The used configuration item ID is unknown and/or not supported on the device.
TSI_ERROR_CONFIGURATION_ITEM_NOT_SET = -20  # Get config item: The configuration item has no value/data stored.
TSI_ERROR_FILE_CREATE = -21  # Failed to create save file.
TSI_ERROR_FILE_WRITE = -22  # Failed to write into file.
TSI_ERROR_FILE_OPEN = -23  # Failed to open existing file.
TSI_ERROR_FILE_READ = -24  # Failed to read file.
TSI_ERROR_INVALID_FILE = -25  # Unsupported file format.
TSI_ERROR_DATA_CORRUPTED = -26  # The load file's format is incorrect, partial or corrupted.
TSI_ERROR_FORMAT_MISMATCH = -27  # The (reference) frame does not match input format.
TSI_ERROR_UNSUPPORTED_TEST = -28  # Given test ID is not available.
TSI_ERROR_COMPARE_FAILED = -29  # Compare function failed.
TSI_ERROR_NO_REFERENCE_FRAME = -30  # Reference frame not set up..
TSI_ERROR_TIMEOUT = -31  # Requested operation did not complete within allowed time.
TSI_ERROR_NO_DATA_AVAILABLE = -32  # Requested/needed data is not available. (No signal Feature disabled etc...)
TSI_ERROR_CONFIG_ITEM_ACCESS = -33  # Configuration item read or write failed.
TSI_ERROR_PRESENT_GRAPHICS = -34  # Failed to show graphics preview frame/modify preview area properties.
TSI_ERROR_UNSUPPORTED_FORMAT = -35  # The capture format or file format is not supported.
TSI_ERROR_DEVICE_SPECIFIC = -36  # A problem occurred on the device.
TSI_ERROR_DISK_FILE_IO = -37  # A problem occurred while reading or writing to a file.
TSI_ERROR_INTERNAL = -38  # Internal state is invalid.
TSI_ERROR_CONFIGURATION_ITEM_VALUE = -39  # Attempted to set a configuration item to a value that is not allowed.
TSI_ERROR_CAPTURE_BROKEN = -40  # Capture (video/audio/other) was re-started while testing.
TSI_ERROR_OS_ERROR = -41  # An Operating system call has failed.
TSI_ERROR_DATA_PROTECTION_ENABLED = -42  # Video/Audio data is HDCP protected and can't be used for testing or saving.
TSI_ERROR_TEST_REQUIREMENTS_NOT_MET = -43  # Test requirements were not met by capture device.
TSI_ERROR_UNSUPPORTED_COLORSPACE = -44  # The frame color space is not supported by the function
TSI_ERROR_NO_DEVICE_SELECTED = -45  # No device is selected
TSI_ERROR_INVALID_ACCESS_MODE = -46  # Attempt to read a write-only CI, or write a read-only CI.
TSI_ERROR_OUTPUT_ENABLED = -47  # The attempted operation is not available if source function is enabled
TSI_ERROR_OPERATION_DATA_LOSS = -48  # The attempted operation would have caused unwanted loss of information.
TSI_ERROR_BAD_FW_VERSION = -49  # Firmware of the selected device needs to be updated
TSI_ERROR_INVALID_HANDLE = -50  # TSI X only: Invalid handle used.
TSI_ERROR_NOT_SUPPORTED = -51  # The function is not supported by the device.
TSI_ERROR_ALREADY_STARTED = -52  # The requested functionality is already started.
TSI_ERROR_ALREADY_STOPPED = -53  # The requested functionality is already stopped.
TSI_ERROR_IN_SCRIPT = -54  # Error in provided script.
TSI_ERROR_NOTHING_TO_UPDATE = -55  # Nothing to update: when try to apply something but no changes pending
TSI_ERROR_NOT_COMPLETED = -56  # The attempted operation and/or function is not completed.
TSI_ERROR_DEVICE_RESET = -57  # The attempted device reset operation failed.
TSI_ERROR_TEST_START = -58  # Test failed during startup phase.
TSI_ERROR_OUT_OF_RANGE = -59  # Provided value is out of existing range.
TSI_ERROR_DEVICE_CONNECTION = -60  # Device connection error.
# !CI_PARSE_ENABLE


# !CI_PARSE_DISABLE
TSI_IMF_PK444_RGB_W8_C8	= 0x000
TSI_IMF_PK444_RGB_W16_C12 =	0x004
TSI_IMF_PK444_RGB_W16_C16 = 0x001
TSI_IMF_PK444_RGB0_W8_C8 = 0x002
TSI_IMF_PK444_RGB0_W16_C16 = 0x003
TSI_IMF_PK444_BGR0_W8_C6 = 0x010
TSI_IMF_PK444_BGR0_W8_C8 = 0x011
TSI_IMF_PK444_BGR0_W8_C10 = 0x012
TSI_IMF_PK444_BGR_W16_C12 = 0x013
TSI_IMF_PK444_BGR_W16_C16 = 0x014
TSI_IMF_PK444_RGB_ALIGN_LSB_W8_C6 = 0x00A
TSI_IMF_PK444_RGB_ALIGN_LSB_W8_C8 = TSI_IMF_PK444_RGB_W8_C8
TSI_IMF_PK444_RGB_ALIGN_LSB_W16_C10 = 0x00B
TSI_IMF_PK444_RGB_ALIGN_LSB_W16_C12 = 0x00C
TSI_IMF_PK444_RGB_ALIGN_LSB_W16_C16 = TSI_IMF_PK444_RGB_W16_C16

TSI_IMF_PK444_YCbCr_W8_C8 = 0x100
TSI_IMF_PK444_YCbCr_W16_C16 = 0x101
TSI_IMF_PK444_YCbCr_ALIGN_LSB_W8_C8 = TSI_IMF_PK444_YCbCr_W8_C8
TSI_IMF_PK444_YCbCr_ALIGN_LSB_W16_C10 = 0x10B
TSI_IMF_PK444_YCbCr_ALIGN_LSB_W16_C12 = 0x10C
TSI_IMF_PK444_YCbCr_ALIGN_LSB_W16_C16 = TSI_IMF_PK444_YCbCr_W16_C16
TSI_IMF_PK444_CbYCr0_W8_C8 = 0x110
TSI_IMF_PK444_CbYCr0_W8_C10 = 0x111
TSI_IMF_PK444_CbYCr_W16_C12 = 0x112
TSI_IMF_PK444_CbYCr_W16_C16 = 0x113

TSI_IMF_PK422_CbYCrY_W16_C8 = 0x200
TSI_IMF_PK422_CbYCrY_W16_C10 = 0x210
TSI_IMF_PK422_CbYCrY_W16_C12 = 0x211
TSI_IMF_PK422_CbYCrY_W16_C16 = 0x201
TSI_IMF_PK422_CbYCrY_ALIGN_LSB_W8_C8 = 0x20A
TSI_IMF_PK422_CbYCrY_ALIGN_LSB_W16_C10 = 0x21B
TSI_IMF_PK422_CbYCrY_ALIGN_LSB_W16_C12 = 0x21C
TSI_IMF_PK422_CbYCrY_ALIGN_LSB_W16_C16 = TSI_IMF_PK422_CbYCrY_W16_C16

TSI_IMF_PL420_YCbCr_W8_C8 = 0x310
TSI_IMF_PL420_YCbCr_W16_C10 = 0x311
TSI_IMF_PL420_YCbCr_W16_C12 = 0x312
TSI_IMF_PL420_YCbCr_W16_C16 = 0x313
TSI_IMF_PL420_ALIGN_LSB_W8_C8 = TSI_IMF_PL420_YCbCr_W8_C8
TSI_IMF_PL420_ALIGN_LSB_W16_C10 = 0x31B
TSI_IMF_PL420_ALIGN_LSB_W16_C12 = 0x31C
TSI_IMF_PL420_ALIGN_LSB_W16_C16 = TSI_IMF_PL420_YCbCr_W16_C16

TSI_IMF_PK420_CxYY0_W8_C8 = 0x320
TSI_IMF_PK420_CxYY0_W8_C10 = 0x321
TSI_IMF_PK420_CxYY_W16_C12 = 0x322
TSI_IMF_PK420_CxYY_W16_C16 = 0x323

TSI_IMF_PK444_YYY0_W8_C6 = 0x400
TSI_IMF_PK444_YYY0_W8_C8 = 0x401
TSI_IMF_PK444_YYY0_W8_C10 = 0x402
TSI_IMF_PK444_YYY_W16_C12 = 0x403
TSI_IMF_PK444_YYY_W16_C16 = 0x404

TSI_IMF_PKN_DSC_W8_CN = 0x600

TSI_IMF_PK444_RAW0_W8_C6 = 0x500
TSI_IMF_PK444_RAW0_W8_C8 = 0x501
TSI_IMF_PK444_RAW0_W8_C10 = 0x502
TSI_IMF_PK444_RAW_W16_C12 = 0x503
TSI_IMF_PK444_RAW_W16_C16 = 0x504

# Frame format ID definitions
TSI_FRAME_FORMAT_BMP = 0x00000001  # 24 bits per pixel (true-color) BMP file, LOSSY CONVERSION ALLOWED!
TSI_FRAME_FORMAT_PPM = 0x00000002  # 24 or 48 bits per pixel PPM file. Always lossless!
TSI_FRAME_FORMAT_BMP_LOSSLESS = 0x00000003  # 24 bits per pixel (true-color) BMP file, NO LOSSY CONVERSION ALLOWED!
# !CI_PARSE_ENABLE


# !CI_PARSE_DISABLE
TSI_ELF_RGB_080808 = TSI_IMF_PK444_RGB_W8_C8
TSI_ELF_RGB_161616 = TSI_IMF_PK444_RGB_W16_C16
TSI_IMF_PK444_RGBA_W8_C8 = TSI_IMF_PK444_RGB0_W8_C8
TSI_ELF_RGBA_080808A = TSI_IMF_PK444_RGBA_W8_C8
TSI_IMF_PK444_RGBA_W16_C16 = TSI_IMF_PK444_RGB0_W16_C16
TSI_ELF_RGBA_161616A = TSI_IMF_PK444_RGBA_W16_C16
TSI_ELF_RGB_121212 = TSI_IMF_PK444_RGB_W16_C12
TSI_ELF_YCbCr_080808 = TSI_IMF_PK444_YCbCr_W8_C8
TSI_ELF_YCbCr_161616 = TSI_IMF_PK444_YCbCr_W16_C16
TSI_ELF_YCbYCr_08 = TSI_IMF_PK422_CbYCrY_W16_C8
TSI_ELF_YCbYCr_16 = TSI_IMF_PK422_CbYCrY_W16_C16
TSI_ELF_I420_08 = TSI_IMF_PL420_YCbCr_W8_C8
TSI_ELF_I420_10 = TSI_IMF_PL420_YCbCr_W16_C10
TSI_ELF_I420_12 = TSI_IMF_PL420_YCbCr_W16_C12
TSI_ELF_I420_16 = TSI_IMF_PL420_YCbCr_W16_C16
TSI_IMF_PK444_RGBA_W8_C8 = TSI_IMF_PK444_RGB0_W8_C8
# !CI_PARSE_ENABLE


# !CI_PARSE_DISABLE
TSI_CI_RO = 0x01
TSI_CI_WO = 0x02
TSI_CI_RW = (TSI_CI_RO | TSI_CI_WO)
TSI_CI_CRO = 0x04  # A CRO (Clear On Read) should also have CI_RO set.
TSI_CI_STROBE = 0x08  # A strobe should also have CI_WO set.
TSI_CI_NOLOAD = 0x10
TSI_CI_NOSAVE = 0x20

TSI_DEVCAP_VIDEO_CAPTURE = 0x00000001  # Can capture and preview video
TSI_DEVCAP_AUDIO_CAPTURE = 0x00000002  # Can capture and preview audio
TSI_DEVCAP_CEC_IO = 0x00000004  # Can capture and send CEC messages
TSI_DEVCAP_CTS = 0x00000008  # Supports interface specific CTS
TSI_DEVCAP_SOURCE = 0x00000010  # Can generate output signal.
TSI_DEVCAP_SINK = 0x00000020  # General for all sinks.
TSI_DEVCAP_ALL_CAPS = 0x0000003f  # Sum of all caps above.

TSI_SEARCHOPTIONS_SHOW_DEVICES_IN_USE = 0x00000001

TSI_NAME_SIZE = 128
TSI_SN_SIZE = 16

TSI_HANDLE = c_void_p
TSI_PARSER = c_void_p

TSI_VERSION_ID = c_uint
TSI_RESULT = c_int
TSI_DEVICE_ID = c_uint
TSI_INPUT_ID = c_uint
TSI_OUTPUT_ID = c_uint
TSI_CONFIG_ID = c_uint
TSI_TEST_ID = c_uint
TSI_DEVICE_CAPS = c_uint
TSI_SEARCH_OPTIONS = c_uint
TSI_FRAME_FORMAT_ID = c_uint


class TSI_TEST_LOG_CONFIGURATION_STRUCT(Structure):
    _fields_ = [
        ('datePrint ', c_uint),
    ]


# !CI_PARSE_ENABLE

TSI_VERSION_TEXT = 0x80000001  # Return version string identifying TSI version, used API versions and device info. !CI_PARSE_SIZE 16384
TSI_LOG_FILE = 0x80000002  # TSI status log file path and name. Default = EMPTY, log file not used.
TSI_GLOBAL_LEGACY_DEVICE_HANDLE = 0x80000004  # "Classic TSI" device handle. CAUTION: Use with care!
TSI_DEVICE_FIRMWARE_INFO = 0x80000005  # Return FW version data for the give device, if available.. !CI_PARSE_SIZE 1024
TSI_DEVICE_RELOAD_FW = 0x80000006  # STROBE, WRITE-ONLY. Re-loads FW. Supported on UCD-300 devices. Data written is ignored.
TSI_DEVICE_HW_RESET = 0x80000007  # STORBE, WRITE-ONLY. Soft-reset. Write device specific bit-mask. -1 to reset everything. Supported on UCD-300 devices.
TSI_DEVICE_MINIMUM_TEST_TIMEOUT = 0x80000008  # No test timeout will be shorter than this timeout. In milliseconds.
TSI_BUNDLE_VERSION_TEXT = 0x80000009  # Return version string identifying bundle version. !CI_PARSE_SIZE 32
TSI_TEST_LOG_CONFIGURATION = 0x80000018  # Used for configuring test logging. Please refer to TSI_TEST_LOG_CONFIGURATION_STRUCT for details.
TSI_INVALID_CONFIG_ITEM = 0xffffffff

# !CI_PARSE_DISABLE
TSI_FLAGS = c_int
TSI_FLAG_AUTOMATIC = 0x00000000  # Input: Capture formats are auto-detected.
TSI_FLAG_VIDEO = 0x00000001  # Status Video data from device.
TSI_FLAG_AUDIO = 0x00000002  # Status Audio data from device.
TSI_FLAG_CEC = 0x00000004  # Status CEC data from device.
TSI_FLAG_ERROR = 0x80000000  # Signal Error has occurred.
TSI_FLAG_QUEUED = 0x00000010  # Signal There are queued frames present on device. (NOTE: This information may not be available for all devices).
TSI_FLAG_CAPTURE_STOP = 0x00000020  # Signal Capture was stopped during last GetFrame call.
TSI_FLAG_CAPTURE_START = 0x00000040  # Signal Capture was (re)started during last CaptureState call.
TSI_FLAG_HDCP_PROTECTED = 0x00000080  # Signal HDCP protected content.
TSI_FW_VERSION_TEXT = TSI_DEVICE_FIRMWARE_INFO
TSI_PARAGRP_REFERENCE_1 = 0x7f000001  # Refers to ID's 0x10 - 0x17
# !CI_PARSE_ENABLE


TSI_FRAME_BLANK_TOP = TSI_BASE_LEGACY_SCRIPT(0x0)
TSI_FRAME_BLANK_BOT = TSI_BASE_LEGACY_SCRIPT(0xF)
TSI_SCRI_DELAY_W = 0x70000001

TSI_W_SCRI_DELAY = TSI_SCRI_DELAY_W

TSI_REF1_WIDTH = TSI_BASE_LEGACY_REFFRAME(0x0)
TSI_REF1_HEIGHT = TSI_BASE_LEGACY_REFFRAME(0x1)
TSI_REF1_ELEMENT_SIZE = TSI_BASE_LEGACY_REFFRAME(0x2)
TSI_REF1_ELEMENT_WIDTH = TSI_BASE_LEGACY_REFFRAME(0x3)
TSI_REF1_ELEMENT_HEIGHT = TSI_BASE_LEGACY_REFFRAME(0x4)
TSI_REF1_COLOR_DEPTH = TSI_BASE_LEGACY_REFFRAME(0x5)
TSI_REF1_ELEMENT_FORMAT = TSI_BASE_LEGACY_REFFRAME(0x6)
TSI_REF1_FRAME_DATA = TSI_BASE_LEGACY_REFFRAME(0x7)
TSI_REF1_LSB_MSB = TSI_BASE_LEGACY_REFFRAME(0x8)

TSI_REF1_PIXELS_PER_ELEMENT = TSI_REF1_ELEMENT_WIDTH
TSI_REF1_LINES_PER_ELEMENT = TSI_REF1_ELEMENT_HEIGHT
TSI_REF1_PIXEL_FORMAT = TSI_REF1_ELEMENT_FORMAT

TSI_UNITS_PRESENT_R = TSI_BASE_LEGACY_GENERIC(0x1)  # Number of units present on current device chain.
TSI_CABLE_STATUS = TSI_BASE_LEGACY_GENERIC(0x3)
TSI_SRC_TYPE = TSI_BASE_LEGACY_GENERIC(0x4)
TSI_TS_OF_MODE = TSI_BASE_LEGACY_GENERIC(0x5)  # Operator feedback system mode reservation (Currently not implemented)
TSI_TS_OF_REQ_ID = TSI_BASE_LEGACY_GENERIC(
    0x6)  # Operator feedback index for get/set app. setting (signed integer index)
TSI_TS_OF_EXT_APP = TSI_BASE_LEGACY_GENERIC(0x7)  # Operator feedback app setting.
TSI_TS_OF_CALLBACK = TSI_BASE_LEGACY_GENERIC(
    0x8)  # Operator feedback function pointer setting: int(__stdcall *pCB)(int ArgCount, char *Args[])
TSI_TS_OF_CALLBACK_PARAM = TSI_BASE_LEGACY_GENERIC(0xa)
TSI_TS_EXTENDED_RESULT_CODE_R = TSI_BASE_LEGACY_GENERIC(0xe)  # Extended test result (Device specific error code)
TSI_TS_EXTENDED_RESULTS_R = TSI_BASE_LEGACY_GENERIC(0xf)  # Extended test result (Text string)

TSI_R_GENERIC_STATUS = TSI_BASE_LEGACY_GENERIC(0x0)
TSI_R_UNITS_PRESENT = TSI_UNITS_PRESENT_R
TSI_R_TS_EXTENDED_RESULT_CODE = TSI_TS_EXTENDED_RESULT_CODE_R
TSI_R_TS_EXTENDED_RESULTS = TSI_TS_EXTENDED_RESULTS_R

TSI_DID_TE_INPUT = TSI_BASE_DID(0x0) # DID from currently Selected TE Input. !CI_PARSE_SIZE 512
TSI_DID_TE_OUTPUT = TSI_BASE_DID(0x1) # DID from DUT connected to currently selected TE Output. !CI_PARSE_SIZE 512
TSI_DID_SELECT_STREAM = TSI_BASE_DID(0x2) # DID select stream for writting/reading TE Input/Output.S
TSI_DID_TE_OUTPUT_REMOTE_R = TSI_BASE_DID(0x3) # Read remote DID's

TSI_EDID_TE_INPUT = TSI_BASE_LEGACY_EDID(0x0)  # EDID from currently Selected TE Input. !CI_PARSE_SIZE 512
TSI_EDID_TE_OUTPUT = TSI_BASE_LEGACY_EDID(
    0x1)  # EDID from DUT connected to currently selected TE Output. !CI_PARSE_SIZE 512
TSI_EDID_SELECT_STREAM = TSI_BASE_LEGACY_EDID(0x2)  # EDID select stream for writting/reading TE Input/Output.S
TSI_EDID_TE_OUTPUT_REMOTE_R = TSI_BASE_LEGACY_EDID(0x3)  # Read remote EDID's

TSI_EDID_CACHE_UPDATE = TSI_BASE_LEGACY_EDID(0x4)
TSI_EDID_DUT_TIMINGS_STREAM = TSI_BASE_LEGACY_EDID(0x5)
TSI_EDID_DUT_TIMINGS_COUNT = TSI_BASE_LEGACY_EDID(0x6)  # Read EDID's cached on TX
TSI_EDID_DUT_TIMINGS_DATA = TSI_BASE_LEGACY_EDID(0x7)

TSI_CURRENT_SINK_EDID = TSI_EDID_TE_INPUT

TSI_FORCE_HOT_PLUG_STATE_W = TSI_BASE_LEGACY_GENERIC(
    0x2)  # HPD state setting: 0 = Set low, 1 = Set high, Other values = INVALID.
TSI_HDCP_CAPABILITY = TSI_BASE_LEGACY_HPDARC(
    0x0)  # Input HDCP capability state. -1 = Require NO HDCP, 0 = Don't care (Default), 1 = Require HDCP 1.x
TSI_HPD_LENGTH = TSI_BASE_LEGACY_HPDARC(
    0x1)  # HPD pulse length, in milliseconds. Default is 1000. Use 0 to disable HPD pulses.
TSI_ARC_CONTROL_W = TSI_BASE_LEGACY_HPDARC(
    0x10)  # Write only, ARC control. 0 = Disable (default), 1 = Generate audio, 2 = Loopback

TSI_W_FORCE_HOT_PLUG_STATE = TSI_FORCE_HOT_PLUG_STATE_W
TSI_W_ARC_CONTROL = TSI_ARC_CONTROL_W

# !CI_PARSE_DISABLE
H1_SINK_LOAD_TEST_KEYS = 0x001
H1_SINK_LOAD_PROD_KEYS = 0x002
H1_SINK_UNLOAD_KEYS = 0x003
H1_SINK_SET_CAPABLE = 0x004
H1_SINK_CLEAR_CAPABLE = 0x005

H1_SOURCE_LOAD_TEST_KEYS = 0x101
H1_SOURCE_LOAD_PROD_KEYS = 0x102
H1_SOURCE_UNLOAD_KEYS = 0x103
H1_SOURCE_AUTHENTICATE = 0x104
H1_SOURCE_DE_AUTHENTICATE = 0x105
H1_SOURCE_ENABLE_ENCRYPT = 0x106
H1_SOURCE_DISABLE_ENCRYPT = 0x107
# !CI_PARSE_ENABLE

TSI_HDCP_1X_STATUS_R = TSI_BASE_LEGACY_HDCP1(0x0)
TSI_HDCP_1X_COMMAND_W = TSI_BASE_LEGACY_HDCP1(0x1)

# !CI_PARSE_DISABLE
H1_LOAD_TEST_KEYS = H1_SINK_LOAD_TEST_KEYS
H1_LOAD_PROD_KEYS = H1_SINK_LOAD_PROD_KEYS
H1_UNLOAD_KEYS = H1_SINK_UNLOAD_KEYS
H1_SET_CAPABLE = H1_SINK_SET_CAPABLE
H1_CLEAR_CAPABLE = H1_SINK_CLEAR_CAPABLE
# !CI_PARSE_ENABLE
TSI_R_HDCP_1X_STATUS = TSI_HDCP_1X_STATUS_R
TSI_W_HDCP_1X_COMMAND = TSI_HDCP_1X_COMMAND_W

# !CI_PARSE_DISABLE
H2_SINK_LOAD_TEST_KEYS_R1 = 0x000
H2_SINK_LOAD_TEST_KEYS_R2 = 0x001
H2_SINK_LOAD_PROD_KEYS = 0x002
H2_SINK_UNLOAD_KEYS = 0x003
H2_SINK_SET_CAPABLE = 0x004
H2_SINK_CLEAR_CAPABLE = 0x005

H2_SOURCE_LOAD_TEST_KEYS_R1 = 0x100
H2_SOURCE_LOAD_TEST_KEYS_R2 = 0x101
H2_SOURCE_LOAD_PROD_KEYS = 0x102
H2_SOURCE_UNLOAD_KEYS = 0x103
H2_SOURCE_AUTHENTICATE = 0x104
H2_SOURCE_DE_AUTHENTICATE = 0x105
H2_SOURCE_ENABLE_ENCRYPT = 0x106
H2_SOURCE_DISABLE_ENCRYPT = 0x107
H2_SOURCE_AUTHENTICATE_STORE_KM = 0x108
H2_SOURCE_CLEAR_STORE_KM = 0x109

# !CI_PARSE_ENABLE

TSI_HDCP_2X_STATUS_R = TSI_BASE_LEGACY_HDCP2(0x0)
TSI_HDCP_2X_COMMAND_W = TSI_BASE_LEGACY_HDCP2(0x1)

# !CI_PARSE_DISABLE
H2_LOAD_PROD_KEYS = H2_SINK_LOAD_PROD_KEYS
H2_UNLOAD_KEYS = H2_SINK_UNLOAD_KEYS
H2_SET_CAPABLE = H2_SINK_SET_CAPABLE
H2_CLEAR_CAPABLE = H2_SINK_CLEAR_CAPABLE
# !CI_PARSE_ENABLE
TSI_R_HDCP_2X_STATUS = TSI_HDCP_2X_STATUS_R
TSI_W_HDCP_2X_COMMAND = TSI_HDCP_2X_COMMAND_W

TSI_MEMORY_SIZE_R = TSI_BASE_LEGACY_MEMORY(0x0)
TSI_MEMORY_MAX_BLOCK_AMOUNT_R = TSI_BASE_LEGACY_MEMORY(0x1)
TSI_MEMORY_RESET_W = TSI_BASE_LEGACY_MEMORY(0x2)
TSI_MEMORY_LAYOUT = TSI_BASE_LEGACY_MEMORY(0x3)
TSI_MEMORY_BLOCK_INDEX = TSI_BASE_LEGACY_MEMORY(0x4)
TSI_MEMORY_WRITE_W = TSI_BASE_LEGACY_MEMORY(0x5)

TSI_R_MEMORY_SIZE = TSI_MEMORY_SIZE_R
TSI_R_MEMORY_MAX_BLOCK_AMOUNT = TSI_MEMORY_MAX_BLOCK_AMOUNT_R
TSI_W_MEMORY_RESET = TSI_MEMORY_RESET_W
TSI_W_MEMORY_WRITE = TSI_MEMORY_WRITE_W

TSI_PG_ENABLED_STREAM_COUNT = TSI_BASE_LEGACY_PATGEN(0x0)
TSI_PG_MAX_STREAM_COUNT_R = TSI_BASE_LEGACY_PATGEN(0x1)
TSI_PG_STREAM_SELECT = TSI_BASE_LEGACY_PATGEN(0x2)
TSI_PG_COMMAND_W = TSI_BASE_LEGACY_PATGEN(0x3)
TSI_PG_CUSTOM_TIMING_HTOTAL = TSI_BASE_LEGACY_PATGEN(0x4)
TSI_PG_CUSTOM_TIMING_HSTART = TSI_BASE_LEGACY_PATGEN(0x5)
TSI_PG_CUSTOM_TIMING_HACTIVE = TSI_BASE_LEGACY_PATGEN(0x6)
TSI_PG_CUSTOM_TIMING_HSYNCW = TSI_BASE_LEGACY_PATGEN(0x7)
TSI_PG_CUSTOM_TIMING_VTOTAL = TSI_BASE_LEGACY_PATGEN(0x8)
TSI_PG_CUSTOM_TIMING_VSTART = TSI_BASE_LEGACY_PATGEN(0x9)
TSI_PG_CUSTOM_TIMING_VACTIVE = TSI_BASE_LEGACY_PATGEN(0xa)
TSI_PG_CUSTOM_TIMING_VSYNCW = TSI_BASE_LEGACY_PATGEN(0xb)
TSI_PG_CUSTOM_TIMING_FLAGS = TSI_BASE_LEGACY_PATGEN(0xc)
TSI_PG_CUSTOM_TIMING_FIELD_RATE = TSI_BASE_LEGACY_PATGEN(0xd)
TSI_PG_PREDEF_TIMING_COUNT_R = TSI_BASE_LEGACY_PATGEN(0xe)
TSI_PG_PREDEF_TIMING_SELECT_W = TSI_BASE_LEGACY_PATGEN(0xf)

TSI_PG_PREDEF_PATTERN_COUNT_R = TSI_BASE_LEGACY_PATGEN(0x10)
TSI_PG_PREDEF_PATTERN_SELECT = TSI_BASE_LEGACY_PATGEN(0x11)
TSI_PG_PREDEF_PATTERN_NAME_R = TSI_BASE_LEGACY_PATGEN(0x12)
TSI_PG_PREDEF_PATTERN_PARAMS = TSI_BASE_LEGACY_PATGEN(0x14)
TSI_PG_CUSTOM_PATTERN_WIDTH = TSI_BASE_LEGACY_PATGEN(0x15)
TSI_PG_CUSTOM_PATTERN_HEIGHT = TSI_BASE_LEGACY_PATGEN(0x16)
TSI_PG_CUSTOM_PATTERN_PIXEL_FORMAT = TSI_BASE_LEGACY_PATGEN(0x17)
TSI_PG_CUSTOM_PATTERN_DATA_W = TSI_BASE_LEGACY_PATGEN(0x18)
TSI_PG_CUSTOM_PATTERN_MEMORY_BLOCK_INDEX = TSI_BASE_LEGACY_PATGEN(0x19)

TSI_PG_CUSTOM_PATTERN_CHAINED_DATA_W = TSI_BASE_LEGACY_PATGEN(0x20)
TSI_PG_CUSTOM_PATTERN_FRAME_TYPE = TSI_BASE_LEGACY_PATGEN(0x21)
TSI_PG_CUSTOM_TIMING_STANDARD = TSI_BASE_LEGACY_PATGEN(0x22)
TSI_PG_CUSTOM_TIMING_ID = TSI_BASE_LEGACY_PATGEN(0x23)
TSI_PG_STATUS_R = TSI_BASE_LEGACY_PATGEN(0x24)
TSI_PG_CUSTOM_TIMING_DSC_HCACTIVE = TSI_BASE_LEGACY_PATGEN(0x25)
TSI_PG_CUSTOM_TIMING_DSC_HCBLANK = TSI_BASE_LEGACY_PATGEN(0x26)
TSI_PG_CUSTOM_TIMING_DSC_FRAME_RATE = TSI_BASE_LEGACY_PATGEN(0x27)
TSI_PG_CUSTOM_TIMING_DSC_VTOTAL = TSI_BASE_LEGACY_PATGEN(0x28)
TSI_PG_CUSTOM_TIMING_DSC_VSTART = TSI_BASE_LEGACY_PATGEN(0x29)

TSI_PG_CUSTOM_TIMING_DSC_VACTIVE = TSI_BASE_LEGACY_PATGEN(0x30)
TSI_PG_CUSTOM_TIMING_DSC_VSYNC = TSI_BASE_LEGACY_PATGEN(0x31)
TSI_PG_CUSTOM_TIMING_ASPECT_RATIO = TSI_BASE_LEGACY_PATGEN(0x32)
TSI_PG_CUSTOM_PATTERN_SCROLLING_CONTROL = TSI_BASE_TPG(0x0)
TSI_PG_CUSTOM_PATTERN_SCROLLING_CONFIG = TSI_BASE_TPG(0x1)

TSI_PG_PREDEF_PATTERN_ID_R = TSI_BASE_LEGACY_PATGEN(0x13)
TSI_W_PG_PREDEF_PATTERN_SELECT = TSI_PG_PREDEF_PATTERN_SELECT
TSI_R_PG_MAX_STREAM_COUNT = TSI_PG_MAX_STREAM_COUNT_R
TSI_W_PG_COMMAND = TSI_PG_COMMAND_W
TSI_R_PG_PREDEF_TIMING_COUNT = TSI_PG_PREDEF_TIMING_COUNT_R
TSI_W_PG_PREDEF_TIMING_SELECT = TSI_PG_PREDEF_TIMING_SELECT_W
TSI_R_PG_PREDEF_PATTERN_COUNT = TSI_PG_PREDEF_PATTERN_COUNT_R
TSI_R_PG_PREDEF_PATTERN_NAME = TSI_PG_PREDEF_PATTERN_NAME_R
TSI_R_PG_PREDEF_PATTERN_ID = TSI_PG_PREDEF_PATTERN_ID_R
TSI_R_PG_STS_EX = TSI_PG_STATUS_R
TSI_PG_CUSTOM_PATTERN_INDEX = TSI_PG_CUSTOM_PATTERN_MEMORY_BLOCK_INDEX
TSI_PG_CUSTOM_PATTERN_DATA = TSI_PG_CUSTOM_PATTERN_DATA_W
TSI_PG_CUSTOM_PATTERN_CHAINED_DATA = TSI_PG_CUSTOM_PATTERN_CHAINED_DATA_W

TSI_AUDGEN_CONTROL_W = TSI_BASE_LEGACY_AUDGEN(0x0)
TSI_AUDGEN_STATUS_R = TSI_BASE_LEGACY_AUDGEN(0x1)
TSI_AUDGEN_SIGNAL_TYPE = TSI_BASE_LEGACY_AUDGEN(0x2)
TSI_AUDGEN_SIGNAL_FREQ = TSI_BASE_LEGACY_AUDGEN(0x3)
TSI_AUDGEN_SIGNAL_BLOCK = TSI_BASE_LEGACY_AUDGEN(0x4)
TSI_AUDGEN_SIGNAL_VOLUME = TSI_BASE_LEGACY_AUDGEN(0x5)
TSI_AUDGEN_CHANNEL_COUNT = TSI_BASE_LEGACY_AUDGEN(0x6)
TSI_AUDGEN_SAMPLE_RATE = TSI_BASE_LEGACY_AUDGEN(0x7)
TSI_AUDGEN_SAMPLE_SIZE = TSI_BASE_LEGACY_AUDGEN(0x8)
TSI_AUDGEN_AUDIO_SIZE = TSI_BASE_LEGACY_AUDGEN(0x9)
TSI_AUDGEN_CONFIG = TSI_BASE_LEGACY_AUDGEN(0xA)
TSI_AUDGEN_PACKET_TYPE = TSI_BASE_LEGACY_AUDGEN(0xB)
TSI_AUDGEN_CHANNELS_STS = TSI_BASE_LEGACY_AUDGEN(0xC)

TSI_W_AUDGEN_CONTROL = TSI_AUDGEN_CONTROL_W
TSI_R_AUDGEN_STATUS = TSI_AUDGEN_STATUS_R

TSI_INPUT_WIDTH_R = TSI_BASE_LEGACY_INPUT(0x0)
TSI_INPUT_HEIGHT_R = TSI_BASE_LEGACY_INPUT(0x1)
TSI_INPUT_FREQ_R = TSI_BASE_LEGACY_INPUT(0x2)
TSI_INPUT_ELEMENT_SIZE_R = TSI_BASE_LEGACY_INPUT(0x3)
TSI_INPUT_ELEMENT_WIDTH_R = TSI_BASE_LEGACY_INPUT(0x4)
TSI_INPUT_ELEMENT_HEIGHT_R = TSI_BASE_LEGACY_INPUT(0x5)
TSI_INPUT_COLOR_DEPTH_R = TSI_BASE_LEGACY_INPUT(0x6)
TSI_INPUT_ELEMENT_FORMAT_R = TSI_BASE_LEGACY_INPUT(0x7)
TSI_INPUT_INTERLACE_R = TSI_BASE_LEGACY_INPUT(0x8)
TSI_INPUT_HDCP_PROTECTION_R = TSI_BASE_LEGACY_INPUT(0xa)
TSI_INPUT_COLOR_DEPTH_BPP_R = TSI_BASE_LEGACY_INPUT(0xb)
TSI_INPUT_COLORIMETRY_R = TSI_BASE_INPUT(0x0)
TSI_INPUT_COLOR_MODE_R = TSI_BASE_INPUT(0x1)

TSI_R_INPUT_PIXELS_PER_ELEMENT = TSI_INPUT_ELEMENT_WIDTH_R
TSI_R_INPUT_LINES_PER_ELEMENT = TSI_INPUT_ELEMENT_HEIGHT_R
TSI_R_INPUT_PIXEL_FORMAT = TSI_INPUT_ELEMENT_FORMAT_R
TSI_R_INPUT_WIDTH = TSI_INPUT_WIDTH_R
TSI_R_INPUT_HEIGHT = TSI_INPUT_HEIGHT_R
TSI_R_INPUT_FREQ = TSI_INPUT_FREQ_R
TSI_R_INPUT_ELEMENT_SIZE = TSI_INPUT_ELEMENT_SIZE_R
TSI_R_INPUT_ELEMENT_WIDTH = TSI_INPUT_ELEMENT_WIDTH_R
TSI_R_INPUT_ELEMENT_HEIGHT = TSI_INPUT_ELEMENT_HEIGHT_R
TSI_R_INPUT_COLOR_DEPTH = TSI_INPUT_COLOR_DEPTH_R
TSI_R_INPUT_ELEMENT_FORMAT = TSI_INPUT_ELEMENT_FORMAT_R
TSI_R_INPUT_INTERLACE = TSI_INPUT_INTERLACE_R
TSI_R_INPUT_HDCP_PROTECTION = TSI_INPUT_HDCP_PROTECTION_R
TSI_R_INPUT_COLORIMETRY = TSI_INPUT_COLORIMETRY_R
TSI_R_INPUT_COLOR_MODE = TSI_INPUT_COLOR_MODE_R

TSI_AUDIO_CHANNELS_R = TSI_BASE_LEGACY_AUDIO(0x0)
TSI_AUDIO_SAMPLE_RATE_R = TSI_BASE_LEGACY_AUDIO(0x1)
TSI_AUDIO_SAMPLE_SIZE_R = TSI_BASE_LEGACY_AUDIO(0x2)
TSI_CAPTURE_AUDIO_MASK = 0x238

TSI_R_AUDIO_CHANNELS = TSI_AUDIO_CHANNELS_R
TSI_R_AUDIO_SAMPLE_RATE = TSI_AUDIO_SAMPLE_RATE_R
TSI_R_AUDIO_SAMPLE_SIZE = TSI_AUDIO_SAMPLE_SIZE_R

TSI_CAP_STATUS_R = TSI_BASE_LEGACY_CAP(0x0)
TSI_CAP_COMMAND_W = TSI_BASE_LEGACY_CAP(0x1)
TSI_CAP_CONFIG = TSI_BASE_LEGACY_CAP(0x2)

TSI_R_CAP_STATUS = TSI_CAP_STATUS_R
TSI_W_CAP_COMMAND = TSI_CAP_COMMAND_W

TSI_VIDCAP_WIDTH_R = TSI_BASE_LEGACY_VIDCAP(0x0)
TSI_VIDCAP_HEIGHT_R = TSI_BASE_LEGACY_VIDCAP(0x1)
TSI_VIDCAP_DATA_FORMAT_R = TSI_BASE_LEGACY_VIDCAP(0x3)
TSI_VIDCAP_FRAME_DATA_R = TSI_BASE_LEGACY_VIDCAP(0x4)
TSI_VIDCAP_MIN_BUFFER_SIZE_R = TSI_BASE_LEGACY_VIDCAP(0x5)
TSI_VIDCAP_TIMESTAMP_R = TSI_BASE_LEGACY_VIDCAP(0x6)
TSI_VIDCAP_COLOR_MODE_R = TSI_BASE_LEGACY_VIDCAP(0x7)
TSI_VIDCAP_COLORIMETRY_R = TSI_BASE_LEGACY_VIDCAP(0x8)
TSI_VIDCAP_FRAME_COUNTER_R = TSI_BASE_LEGACY_VIDCAP(0x9)
TSI_VIDCAP_FRAME_HEADER_R = TSI_BASE_LEGACY_VIDCAP(0xa)
TSI_VIDCAP_PROCESSED_FRAME_DATA_R = TSI_BASE_LEGACY_VIDCAP(0xb)
TSI_VIDCAP_PROCESSED_FRAME_SIZE_R = TSI_BASE_LEGACY_VIDCAP(0xc)
TSI_VIDCAP_FRAME_PROCESSING_METHOD = TSI_BASE_LEGACY_VIDCAP(0xd)
TSI_VIDCAP_CUSTOM_CONVERSION = TSI_BASE_LEGACY_VIDCAP(0xe)
TSI_VIDCAP_CUSTOM_CLAMPS = TSI_BASE_LEGACY_VIDCAP(0xf)
TSI_VIDCAP_CAPTURE_NEXT_W = TSI_BASE_LEGACY_VIDCAP(0x19)
TSI_VIDCAP_COLOR_DEPTH_BPC_R = TSI_BASE_LEGACY_VIDCAP(0x1a)
TSI_VIDCAP_IMF_FORMAT_R = TSI_BASE_LEGACY_VIDCAP(0x1b)
TSI_VIDCAP_COMPONENT_SIZE_R = TSI_BASE_LEGACY_VIDCAP(0x1c)
TSI_VIDCAP_SIGNAL_CRC_R = TSI_BASE_R_CRC_VIDEO(0x0)

TSI_VIDCAP_SUBFRAME_COUNT_R = TSI_BASE_LEGACY_VIDCAP(0x10)
TSI_VIDCAP_SUBFRAME_INDEX = TSI_BASE_LEGACY_VIDCAP(0x11)
TSI_VIDCAP_SUBFRAME_OFFSET_R = TSI_BASE_LEGACY_VIDCAP(0x12)
TSI_VIDCAP_SUBFRAME_WIDTH_R = TSI_BASE_LEGACY_VIDCAP(0x13)
TSI_VIDCAP_SUBFRAME_HEIGHT_R = TSI_BASE_LEGACY_VIDCAP(0x14)
TSI_VIDCAP_SUBFRAME_SIZE_R = TSI_BASE_LEGACY_VIDCAP(0x15)
TSI_VIDCAP_SUBFRAME_DATA_R = TSI_BASE_LEGACY_VIDCAP(0x16)
TSI_VIDCAP_SUBFRAME_PROCESSED_SIZE_R = TSI_BASE_LEGACY_VIDCAP(0x17)
TSI_VIDCAP_SUBFRAME_PROCESSED_DATA_R = TSI_BASE_LEGACY_VIDCAP(0x18)

TSI_R_VIDCAP_WIDTH = TSI_VIDCAP_WIDTH_R
TSI_R_VIDCAP_HEIGHT = TSI_VIDCAP_HEIGHT_R
TSI_R_VIDCAP_DATA_FORMAT = TSI_VIDCAP_DATA_FORMAT_R
TSI_R_VIDCAP_FRAME_DATA = TSI_VIDCAP_FRAME_DATA_R
TSI_R_VIDCAP_MIN_BUFFER_SIZE = TSI_VIDCAP_MIN_BUFFER_SIZE_R
TSI_R_VIDCAP_TIMESTAMP = TSI_VIDCAP_TIMESTAMP_R
TSI_R_VIDCAP_COLOR_MODE = TSI_VIDCAP_COLOR_MODE_R
TSI_R_VIDCAP_COLORIMETRY = TSI_VIDCAP_COLORIMETRY_R
TSI_R_VIDCAP_FRAME_COUNTER = TSI_VIDCAP_FRAME_COUNTER_R
TSI_R_VIDCAP_HEADER = TSI_VIDCAP_FRAME_HEADER_R
TSI_R_VIDCAP_PROCESSED_FRAME_DATA = TSI_VIDCAP_PROCESSED_FRAME_DATA_R
TSI_R_VIDCAP_PROCESSED_FRAME_SIZE = TSI_VIDCAP_PROCESSED_FRAME_SIZE_R
TSI_R_VIDCAP_CAPTURE_NEXT = TSI_VIDCAP_CAPTURE_NEXT_W
TSI_R_VIDCAP_BPC = TSI_VIDCAP_COLOR_DEPTH_BPC_R
TSI_R_CRC_CAPTURE = TSI_VIDCAP_SIGNAL_CRC_R

TSI_AUDCAP_CHANNEL_COUNT_R = TSI_BASE_LEGACY_AUDCAP(0x0)
TSI_AUDCAP_SAMPLE_COUNT_R = TSI_BASE_LEGACY_AUDCAP(0x1)
TSI_AUDCAP_SAMPLE_SIZE_R = TSI_BASE_LEGACY_AUDCAP(0x3)
TSI_AUDCAP_SAMPLE_FORMAT_R = TSI_BASE_LEGACY_AUDCAP(0x4)
TSI_AUDCAP_SAMPLE_RATE_R = TSI_BASE_LEGACY_AUDCAP(0x6)
TSI_AUDCAP_SAMPLE_DATA_R = TSI_BASE_LEGACY_AUDCAP(0x7)
TSI_AUDCAP_TIMESTAMP_R = TSI_BASE_LEGACY_AUDCAP(0x8)
TSI_AUDCAP_FRAME_COUNTER_R = TSI_BASE_LEGACY_AUDCAP(0x9)
TSI_AUDCAP_CHANNEL_STATUS_R = TSI_BASE_LEGACY_AUDCAP(0xa)
TSI_AUDCAP_MIN_BUFFER_SIZE_R = TSI_BASE_LEGACY_AUDCAP(0xb)
TSI_AUDCAP_SAMPLE_SERVICE_INFO_R = TSI_BASE_LEGACY_AUDCAP(0xc)
TSI_AUDCAP_STATUS_R = TSI_BASE_LEGACY_AUDCAP(0xd)

TSI_R_AUDCAP_CHANNEL_COUNT = TSI_AUDCAP_CHANNEL_COUNT_R
TSI_R_AUDCAP_SAMPLE_COUNT = TSI_AUDCAP_SAMPLE_COUNT_R
TSI_R_AUDCAP_SAMPLE_SIZE = TSI_AUDCAP_SAMPLE_SIZE_R
TSI_R_AUDCAP_SAMPLE_FORMAT = TSI_AUDCAP_SAMPLE_FORMAT_R
TSI_R_AUDCAP_SAMPLE_RATE = TSI_AUDCAP_SAMPLE_RATE_R
TSI_R_AUDCAP_SAMPLE_DATA = TSI_AUDCAP_SAMPLE_DATA_R
TSI_R_AUDCAP_TIMESTAMP = TSI_AUDCAP_TIMESTAMP_R
TSI_R_AUDCAP_FRAME_COUNTER = TSI_AUDCAP_FRAME_COUNTER_R
TSI_R_AUDCAP_CHANNEL_STS = TSI_AUDCAP_CHANNEL_STATUS_R
TSI_R_AUDCAP_MIN_BUFFER_SIZE = TSI_AUDCAP_MIN_BUFFER_SIZE_R
TSI_R_AUDCAP_SAMPLE_SERVICE_INFO = TSI_AUDCAP_SAMPLE_SERVICE_INFO_R
TSI_R_AUDCAP_STATUS = TSI_AUDCAP_STATUS_R

# !CI_PARSE_DISABLE
# The following bits are used to set wanted event sources into TSI_EVCAP_EVENT_SRC_EN
UCD_ALL_EVENTS = 0x7f1371f3
UCD_FW_EVENTS = 0x7f000000
UCD_NO_EVENTS = 0x00000000
UCD_DPOUT_HPD = 0x00000001
UCD_DPOUT_AUX = 0x00000002
UCD_DPIN_EV_HPD = 0x00000010
UCD_DPIN_EV_AUX = 0x00000020
UCD_DPIN_EV_SDP = 0x00000040
UCD_DPIN_EV_MSA_CHANGE = 0x00000080
UCD_DPIN_EV_VBID_CHANGE = 0x00000100
UCD_HDIN_EV_HPD = 0x00001000
UCD_HDIN_EV_HDMI = 0x00002000
UCD_HDIN_EV_I2C = 0x00004000
UCD_HDOUT_EV_HPD = 0x00010000
UCD_HDOUT_EV_I2C = 0x00020000
UCD_USBCOUT_EV_PD = 0x00100000
UCD_FWLOG_CRIT = 0x01000000
UCD_FWLOG_ERROR = 0x02000000
UCD_FWLOG_WARNING = 0x04000000
UCD_FWLOG_NOMINAL = 0x08000000
UCD_FWLOG_INFO = 0x10000000
UCD_FWLOG_DEBUG = 0x20000000
UCD_FWLOG_VERBOSE = 0x40000000
# !CI_PARSE_ENABLE

TSI_EVENT_SIZE_R = TSI_BASE_LEGACY_EVCAP(0x0)
TSI_EVENT_DATA_R = TSI_BASE_LEGACY_EVCAP(0x1)
TSI_EVCAP_HDMI_PACKETS_EN = TSI_BASE_LEGACY_EVCAP(0x2)  # !CI_PARSE_SIZE 32
TSI_EVCAP_SDP_PACKETS_EN = TSI_BASE_LEGACY_EVCAP(0x3)  # !CI_PARSE_SIZE 32
TSI_EVCAP_EVENT_SRC_EN = TSI_BASE_LEGACY_EVCAP(0x4)
TSI_EVCAP_DATA_R = TSI_BASE_LEGACY_EVCAP(0x5)
TSI_EVCAP_COUNT_R = TSI_BASE_LEGACY_EVCAP(0x6)
TSI_EVCAP_CTRL = TSI_BASE_LEGACY_EVCAP(0x7)

TSI_R_EVENT_SIZE = TSI_EVENT_SIZE_R
TSI_R_EVENT_DATA = TSI_EVENT_DATA_R
TSI_R_EVCAP_DATA = TSI_EVCAP_DATA_R
TSI_R_EVCAP_COUNT = TSI_EVCAP_COUNT_R

TSI_HDMI_INFOFRAME_RANGE_START_R = TSI_BASE_R_HDMI_INFOFRAME(0x00)
TSI_HDMI_INFOFRAME_RANGE_END_R = TSI_BASE_R_HDMI_INFOFRAME(0xff)
TSI_HDMI_INFOFRAME_NULL_R = TSI_BASE_R_HDMI_INFOFRAME(0x00)
TSI_HDMI_INFOFRAME_ACR_R = TSI_BASE_R_HDMI_INFOFRAME(0x01)
TSI_HDMI_INFOFRAME_ASP_R = TSI_BASE_R_HDMI_INFOFRAME(0x02)
TSI_HDMI_INFOFRAME_GCP_R = TSI_BASE_R_HDMI_INFOFRAME(0x03)
TSI_HDMI_INFOFRAME_ACP_R = TSI_BASE_R_HDMI_INFOFRAME(0x04)
TSI_HDMI_INFOFRAME_ISRC1_R = TSI_BASE_R_HDMI_INFOFRAME(0x05)
TSI_HDMI_INFOFRAME_ISRC2_R = TSI_BASE_R_HDMI_INFOFRAME(0x06)
TSI_HDMI_INFOFRAME_OBA_R = TSI_BASE_R_HDMI_INFOFRAME(0x07)
TSI_HDMI_INFOFRAME_DTS_R = TSI_BASE_R_HDMI_INFOFRAME(0x08)
TSI_HDMI_INFOFRAME_HBR_R = TSI_BASE_R_HDMI_INFOFRAME(0x09)
TSI_HDMI_INFOFRAME_GMP_R = TSI_BASE_R_HDMI_INFOFRAME(0x0a)
TSI_HDMI_INFOFRAME_3D_ASP_R = TSI_BASE_R_HDMI_INFOFRAME(0x0b)
TSI_HDMI_INFOFRAME_3D_OBA_R = TSI_BASE_R_HDMI_INFOFRAME(0x0c)
TSI_HDMI_INFOFRAME_AMP_R = TSI_BASE_R_HDMI_INFOFRAME(0x0d)
TSI_HDMI_INFOFRAME_MST_ASP_R = TSI_BASE_R_HDMI_INFOFRAME(0x0e)
TSI_HDMI_INFOFRAME_MST_OBA_R = TSI_BASE_R_HDMI_INFOFRAME(0x0f)
TSI_HDMI_INFOFRAME_VSI_R = TSI_BASE_R_HDMI_INFOFRAME(0x81)
TSI_HDMI_INFOFRAME_AVI_R = TSI_BASE_R_HDMI_INFOFRAME(0x82)
TSI_HDMI_INFOFRAME_SPD_R = TSI_BASE_R_HDMI_INFOFRAME(0x83)
TSI_HDMI_INFOFRAME_AIF_R = TSI_BASE_R_HDMI_INFOFRAME(0x84)
TSI_HDMI_INFOFRAME_MPEG_R = TSI_BASE_R_HDMI_INFOFRAME(0x85)
TSI_HDMI_INFOFRAME_DRM_R = TSI_BASE_R_HDMI_INFOFRAME(0x87)
TSI_HDMI_INFOFRAME_UPDATE_FLAGS_R = TSI_BASE_R_HDMI_INFOFRAME(0x100)

TSI_R_HDMI_INFOFRAME_RANGE_START = TSI_HDMI_INFOFRAME_RANGE_START_R
TSI_R_HDMI_INFOFRAME_RANGE_END = TSI_HDMI_INFOFRAME_RANGE_END_R
TSI_R_HDMI_INFOFRAME_NULL = TSI_HDMI_INFOFRAME_NULL_R
TSI_R_HDMI_INFOFRAME_ACR = TSI_HDMI_INFOFRAME_ACR_R
TSI_R_HDMI_INFOFRAME_ASP = TSI_HDMI_INFOFRAME_ASP_R
TSI_R_HDMI_INFOFRAME_GCP = TSI_HDMI_INFOFRAME_GCP_R
TSI_R_HDMI_INFOFRAME_ACP = TSI_HDMI_INFOFRAME_ACP_R
TSI_R_HDMI_INFOFRAME_ISRC1 = TSI_HDMI_INFOFRAME_ISRC1_R
TSI_R_HDMI_INFOFRAME_ISRC2 = TSI_HDMI_INFOFRAME_ISRC2_R
TSI_R_HDMI_INFOFRAME_OBA = TSI_HDMI_INFOFRAME_OBA_R
TSI_R_HDMI_INFOFRAME_DTS = TSI_HDMI_INFOFRAME_DTS_R
TSI_R_HDMI_INFOFRAME_HBR = TSI_HDMI_INFOFRAME_HBR_R
TSI_R_HDMI_INFOFRAME_GMP = TSI_HDMI_INFOFRAME_GMP_R
TSI_R_HDMI_INFOFRAME_3D_ASP = TSI_HDMI_INFOFRAME_3D_ASP_R
TSI_R_HDMI_INFOFRAME_3D_OBA = TSI_HDMI_INFOFRAME_3D_OBA_R
TSI_R_HDMI_INFOFRAME_AMP = TSI_HDMI_INFOFRAME_AMP_R
TSI_R_HDMI_INFOFRAME_MST_ASP = TSI_HDMI_INFOFRAME_MST_ASP_R
TSI_R_HDMI_INFOFRAME_MST_OBA = TSI_HDMI_INFOFRAME_MST_OBA_R
TSI_R_HDMI_INFOFRAME_VSI = TSI_HDMI_INFOFRAME_VSI_R
TSI_R_HDMI_INFOFRAME_AVI = TSI_HDMI_INFOFRAME_AVI_R
TSI_R_HDMI_INFOFRAME_SPD = TSI_HDMI_INFOFRAME_SPD_R
TSI_R_HDMI_INFOFRAME_AIF = TSI_HDMI_INFOFRAME_AIF_R
TSI_R_HDMI_INFOFRAME_MPEG = TSI_HDMI_INFOFRAME_MPEG_R
TSI_R_HDMI_INFOFRAME_DRM = TSI_HDMI_INFOFRAME_DRM_R
TSI_R_HDMI_INFOFRAME_UPDATE_FLAGS = TSI_HDMI_INFOFRAME_UPDATE_FLAGS_R

TSI_R_DP_SDP_RANGE_START = TSI_BASE_R_DP_SDP(0x00)
TSI_R_DP_SDP_RANGE_END = TSI_BASE_R_DP_SDP(0xff)
TSI_R_DP_SDP_UPDATE_FLAGS = TSI_BASE_R_DP_SDP(0x100)
TSI_BASE_R_DP_SDP_SELECT_EX = TSI_BASE_R_DP_SDP(0x00)
TSI_BASE_R_DP_SDP_DATA_EX = TSI_BASE_R_DP_SDP(0x01)

# !CI_PARSE_DISABLE
TSI_BULK_STATUS_IDLE = 0
TSI_BULK_STATUS_WAITING = 1
TSI_BULK_STATUS_CAPTURING = 2
TSI_BULK_STATUS_TRANSFERRING = 3

TSI_BULK_CAPTURE_STOP = 0
TSI_BULK_CAPTURE_START = 1

TSI_BULK_CAPTURE_TYPE_8BIT = 0
TSI_BULK_CAPTURE_TYPE_10BIT = 1

TSI_BULK_CAPTURE_TRG_POS_BEGIN = 0
TSI_BULK_CAPTURE_TRG_POS_25 = 1
TSI_BULK_CAPTURE_TRG_POS_50 = 2
TSI_BULK_CAPTURE_TRG_POS_75 = 3
TSI_BULK_CAPTURE_TRG_POS_END = 4

TSI_BULK_CAPTURE_GPIO_OFF = 0
TSI_BULK_CAPTURE_GPIO_5BIT = 1
# !CI_PARSE_ENABLE

TSI_BULK_CAPTURE_CONTROL_W = TSI_BASE_BULK_CAPTURE(0x0)
TSI_BULK_CAPTURE_STATUS_R = TSI_BASE_BULK_CAPTURE(0x1)
TSI_BULK_CAPTURE_MEMORY_BLOCK_INDEX = TSI_BASE_BULK_CAPTURE(0x2)
TSI_BULK_CAPTURE_DATA_R = TSI_BASE_BULK_CAPTURE(0x3)
TSI_BULK_CAPTURE_CLEAR_W = TSI_BASE_BULK_CAPTURE(0x4)
TSI_BULK_CAPTURE_TYPE = TSI_BASE_BULK_CAPTURE(0x5)
TSI_BULK_TRIGGER_CONFIGURATION_W = TSI_BASE_BULK_CAPTURE(0x6)
TSI_BULK_TRIGGER_MASK_W = TSI_BASE_BULK_CAPTURE(0x7)
TSI_BULK_CAPTURE_CAPS_R = TSI_BASE_BULK_CAPTURE(0x8)
TSI_BULK_TRIGGER_CAPS_R = TSI_BASE_BULK_CAPTURE(0x9)
TSI_BULK_TRIGGER_CONFIGURATION_EXT_W = TSI_BASE_BULK_CAPTURE(0xA)

TSI_BULK_TRIGGER_POS = TSI_BASE_BULK_CAPTURE(0xB)
TSI_BULK_CAPTURE_GPIO_W = TSI_BASE_BULK_CAPTURE(0xC)
TSI_BULK_CAPTURE_LANE_COUNT = TSI_BASE_BULK_CAPTURE(0xD)

TSI_BULK_CAPTURE_BLOCK = TSI_BULK_CAPTURE_MEMORY_BLOCK_INDEX
TSI_BULK_CAPTURE_TYPE_W = TSI_BULK_CAPTURE_TYPE

# !CI_PARSE_DISABLE
TSI_DPRX_LOG_CTRL_VALUE_HPD = (1 << 0)
TSI_DPRX_LOG_CTRL_VALUE_SDP = (1 << 1)
TSI_DPRX_LOG_CTRL_VALUE_AUX = (1 << 2)
TSI_DPRX_LOG_CTRL_VALUE_MSA_CHANGE = (1 << 3)
TSI_DPRX_LOG_CTRL_VALUE_VBID_CHANGE = (1 << 4)
TSI_DPRX_LOG_CTRL_VALUE_LINK_PAT = (1 << 5)
TSI_DPRX_LOG_CTRL_VALUE_VBID_HW = (1 << 6)
TSI_DPRX_LOG_CTRL_VALUE_MSA_HW = (1 << 7)
TSI_DPRX_LOG_CTRL_VALUE_AUX_BW = (1 << 8)
TSI_DPRX_LOG_CTRL_VALUE_VFRAME_INFO = (1 << 9)
# !CI_PARSE_ENABLE

TSI_DPRX_LINK_STATUS_FLAGS_R = TSI_BASE_LEGACY_DPRX(0x0)
TSI_DPRX_LT_STATUS_FLAGS_R = TSI_BASE_LEGACY_DPRX(0x1)
TSI_DPRX_LINK_VOLTAGE_SWING_R = TSI_BASE_LEGACY_DPRX(0x2)
TSI_DPRX_LINK_PRE_EMPHASIS_R = TSI_BASE_LEGACY_DPRX(0x3)
TSI_DPRX_LINK_LANE_COUNT_R = TSI_BASE_LEGACY_DPRX(0x4)
TSI_DPRX_LINK_RATE_R = TSI_BASE_LEGACY_DPRX(0x5)
TSI_DPRX_ERROR_COUNTS_R = TSI_BASE_LEGACY_DPRX(0x8)  # !CI_PARSE_SIZE 16
TSI_DPRX_DPCD_BASE_W = TSI_BASE_LEGACY_DPRX(0x9)
TSI_DPRX_DPCD_DATA = TSI_BASE_LEGACY_DPRX(0xA)
TSI_DPRX_DSC_CONTROL = TSI_BASE_LEGACY_DPRX(0xD)
TSI_DPRX_MSA_SIZE_R = TSI_BASE_LEGACY_DPRX(0xE)
TSI_DPRX_MSA_LOG_R = TSI_BASE_LEGACY_DPRX(0xF)
TSI_DPRX_MAX_LANES = TSI_BASE_LEGACY_DPRX(0x10)
TSI_DPRX_MAX_LINK_RATE = TSI_BASE_LEGACY_DPRX(0x11)
TSI_DPRX_LINK_FLAGS = TSI_BASE_LEGACY_DPRX(0x12)
TSI_DPRX_STREAM_SELECT = TSI_BASE_LEGACY_DPRX(0x13)
TSI_DPRX_CRC_R_R = TSI_BASE_LEGACY_DPRX(0x14)
TSI_DPRX_CRC_G_R = TSI_BASE_LEGACY_DPRX(0x15)
TSI_DPRX_CRC_B_R = TSI_BASE_LEGACY_DPRX(0x16)
TSI_DPRX_LT_ROUTE_CONTROL_W = TSI_BASE_LEGACY_DPRX(0x18)
TSI_DPRX_LT_ROUTE_STATUS_R = TSI_BASE_LEGACY_DPRX(0x19)
TSI_DPRX_LT_ROUTE_DATA_W = TSI_BASE_LEGACY_DPRX(0x1A)
TSI_DPRX_HPD_PULSE_W = TSI_BASE_LEGACY_DPRX(0x1B)
TSI_DPRX_EDP_LINK_RATES = TSI_BASE_LEGACY_DPRX(0x1C)
TSI_DPRX_DSC_STATUS_R = TSI_BASE_LEGACY_DPRX(0x1D)
TSI_DPRX_GET_ERROR_COUNTS_R = TSI_BASE_LEGACY_DPRX(0x1E)  # !CI_PARSE_SIZE 16
TSI_DPRX_CLEAR_ERROR_COUNTS_W = TSI_BASE_LEGACY_DPRX(0x1F)
TSI_DPRX_AUX_SWING_CAPS_R = TSI_BASE_LEGACY_DPRX(0x20)
TSI_DPRX_AUX_SWING_CONTROL = TSI_BASE_LEGACY_DPRX(0x21)
TSI_DP2RX_CUSTOM_RATE_CAPS_R = TSI_BASE_LEGACY_DPRX(0x22)
TSI_DP2RX_CUSTOM_RATE_MAP = TSI_BASE_LEGACY_DPRX(0x23)

TSI_DPRX_LINK_CONTROL = TSI_BASE_DPRX(0x3)
TSI_DPRX_HW_CAPS_R = TSI_BASE_DPRX(0x4)
TSI_DPRX_LT_VOLTAGE_SWING_R = TSI_BASE_DPRX(0x9)
TSI_DPRX_LT_PRE_EMPHASIS_R = TSI_BASE_DPRX(0xA)
TSI_DPRX_LT_LANE_COUNT_R = TSI_BASE_DPRX(0xB)
TSI_DPRX_LT_RATE_R = TSI_BASE_DPRX(0xC)
TSI_DPRX_HPD_STATUS_R = TSI_BASE_DPRX(0x10)
TSI_DPRX_CRC_SIZE_R = TSI_BASE_DPRX(0x1C)
TSI_DPRX_CRC_LOG_R = TSI_BASE_DPRX(0x1D)
TSI_DPRX_HPD_FORCE = TSI_BASE_DPRX(0x12)
TSI_DPRX_HDCP_CAPS_R = TSI_BASE_DPRX(0x20)
TSI_DPRX_HDCP_STATUS_R = TSI_BASE_DPRX(0x21)
TSI_DPRX_LOG_CONTROL = TSI_BASE_DPRX(0x22)
TSI_DPRX_FEC_CONTROL = TSI_BASE_DPRX(0x23)
TSI_DPRX_FEC_STATUS_R = TSI_BASE_DPRX(0x24)
TSI_DPRX_LOG_IF_SEL = TSI_BASE_DPRX(0x27)
TSI_DPRX_LT_INFO_R = TSI_BASE_DPRX(0x30)
TSI_DPRX_LINK_LOG_SEL = TSI_BASE_DPRX(0x34)
TSI_DPRX_VBID_LOG_SEL = TSI_BASE_DPRX(0x35)
TSI_DPRX_MSA_LOG_SEL = TSI_BASE_DPRX(0x36)
TSI_DPRX_PHY_CONTROL = TSI_BASE_DPRX(0x3A)
TSI_DPRX_FEC_ERROR_COUNTERS_R = TSI_BASE_DPRX(0x44)
TSI_DPRX_DSC_CRC_R = TSI_BASE_DPRX(0x45)
TSI_DPRX_HDCP_STREAM_STS_R = TSI_BASE_DPRX(0x47)
TSI_DPRX_PSR_CAPS = TSI_BASE_DPRX(0x4A)
TSI_DPRX_PR_CAPS = TSI_BASE_DPRX(0x4B)
TSI_DPRX_PSR_STATUS = TSI_BASE_DPRX(0x4C)
TSI_DPRX_PR_STATUS = TSI_BASE_DPRX(0x4D)
TSI_DPRX_DSC_DPCD_CONTROL = TSI_BASE_DPRX(0x50)
TSI_DPRX_DSC_DPCD_PROPERTIES = TSI_BASE_DPRX(0x51)
TSI_DPRX_EDP_LT_RATE_R = TSI_BASE_DPRX(0x52)
TSI_DPRX_SSC_STATUS_R = TSI_BASE_DPRX(0x53)
TSI_DPRX_EDP_CAPS_RATES_R = TSI_BASE_DPRX(0x54)
TSI_DPRX_EDP_SEL_RATES = TSI_BASE_DPRX(0x55)
TSI_DPRX_FORCE_LINK_CONF_W = TSI_BASE_DPRX(0x5C)
TSI_DPRX_EDP_LINK_RATE_R = TSI_BASE_DPRX(0x5D)
TSI_DPRX_VC_TABLE_R = TSI_BASE_DPRX(0x64)
TSI_DPRX_CUSTOM_PATTERN = TSI_BASE_DPRX(0x65)
TSI_DPRX_IOP_ERROR_COUNTERS = TSI_BASE_DPRX(0x66)
TSI_DP2RX_LINK_RATE_CAPS = TSI_BASE_DPRX(0x88)
TSI_DP2RX_LT_FFE_PRESET_R = TSI_BASE_DPRX(0x89)
TSI_DP2RX_LINK_FFE_PRESET_R = TSI_BASE_DPRX(0x8A)
TSI_DPRX_SCR_SEED = TSI_BASE_DPRX(0x8f)
TSI_DPRX_DISPLAYID_CTRL = TSI_BASE_DPRX(0x9A)
TSI_DPRX_MST_SINK_COUNT = TSI_BASE_DPRX(0x9D)

TSI_DPRX_MSA_COMMAND_W = TSI_BASE_LEGACY_DPRX_MSA(0x0)
TSI_DPRX_MSA_STREAM_COUNT_R = TSI_BASE_LEGACY_DPRX_MSA(0x1)
TSI_DPRX_MSA_DATA_R = TSI_BASE_LEGACY_DPRX_MSA(0x2)
TSI_DPRX_MSA_STREAM_SELECT = TSI_BASE_LEGACY_DPRX_MSA(0x3)
TSI_DPRX_MSA_N_VIDEO_R = TSI_BASE_LEGACY_DPRX_MSA(0x4)
TSI_DPRX_MSA_M_VIDEO_R = TSI_BASE_LEGACY_DPRX_MSA(0x5)
TSI_DPRX_MSA_HTOTAL_R = TSI_BASE_LEGACY_DPRX_MSA(0x6)
TSI_DPRX_MSA_VTOTAL_R = TSI_BASE_LEGACY_DPRX_MSA(0x7)
TSI_DPRX_MSA_HACTIVE_R = TSI_BASE_LEGACY_DPRX_MSA(0x8)
TSI_DPRX_MSA_VACTIVE_R = TSI_BASE_LEGACY_DPRX_MSA(0x9)
TSI_DPRX_MSA_HSYNC_WIDTH_R = TSI_BASE_LEGACY_DPRX_MSA(0xa)
TSI_DPRX_MSA_VSYNC_WIDTH_R = TSI_BASE_LEGACY_DPRX_MSA(0xb)
TSI_DPRX_MSA_HSTART_R = TSI_BASE_LEGACY_DPRX_MSA(0xc)
TSI_DPRX_MSA_VSTART_R = TSI_BASE_LEGACY_DPRX_MSA(0xd)
TSI_DPRX_MSA_MISC_R = TSI_BASE_LEGACY_DPRX_MSA(0xe)
TSI_DPRX_MSA_VBID_R = TSI_BASE_LEGACY_DPRX_MSA(0xf)
TSI_DPRX_MSA_PORT_NUMBER_R = TSI_BASE_LEGACY_DPRX_MSA(0x10)
TSI_DPRX_MSA_FRAME_RATE_R = TSI_BASE_LEGACY_DPRX_MSA(0x200 + 31)
TSI_DPRX_MSA_COLOR_DEPTH_BPC_R = TSI_BASE_LEGACY_DPRX_MSA(0x200 + 32)
TSI_DPRX_MSA_COLOR_MODE_R = TSI_BASE_LEGACY_DPRX_MSA(0x200 + 33)
TSI_DPRX_MSA_COLORIMETRY_R = TSI_BASE_LEGACY_DPRX_MSA(0x200 + 34)
TSI_DPRX_MSA_COLOR_DEPTH_BPP_R = TSI_BASE_LEGACY_DPRX_MSA(0x200 + 35)

TSI_DP2RX_LT_FFE_PRESET = TSI_DP2RX_LT_FFE_PRESET_R
TSI_DPRX_LINK_VS_R = TSI_DPRX_LINK_VOLTAGE_SWING_R
TSI_DPRX_LINK_PE_R = TSI_DPRX_LINK_PRE_EMPHASIS_R
TSI_DPRX_LINK_LC_R = TSI_DPRX_LINK_LANE_COUNT_R
TSI_DPRX_LINK_BR_R = TSI_DPRX_LINK_RATE_R
TSI_DPRX_EDP_LINK_BR_R = TSI_DPRX_EDP_LINK_RATE_R
TSI_DPRX_EDP_LT_BR_R = TSI_DPRX_EDP_LT_RATE_R
TSI_DPRX_LT_VS_R = TSI_DPRX_LT_VOLTAGE_SWING_R
TSI_DPRX_LT_PE_R = TSI_DPRX_LT_PRE_EMPHASIS_R
TSI_DPRX_LT_LC_R = TSI_DPRX_LT_LANE_COUNT_R
TSI_DPRX_LT_BR_R = TSI_DPRX_LT_RATE_R
TSI_DPRX_LINK_CONTROL_R = TSI_DPRX_LINK_CONTROL
TSI_DPRX_MSA_SIZE = TSI_DPRX_MSA_SIZE_R
TSI_DPRX_MSA_LOG = TSI_DPRX_MSA_LOG_R
TSI_DPRX_LT_ROUTE_CTRL_W = TSI_DPRX_LT_ROUTE_CONTROL_W
TSI_DPRX_FEC_CTRL = TSI_DPRX_FEC_CONTROL
TSI_DPRX_DSC_CTRL = TSI_DPRX_DSC_CONTROL
TSI_DPRX_LINK_CTRL_R = TSI_DPRX_LINK_CONTROL_R
TSI_R_DPRX_HW_CAPS = TSI_DPRX_HW_CAPS_R
TSI_DPRX_HW_CAPS = TSI_DPRX_HW_CAPS_R
TSI_R_DPRX_LINK_STATUS_FLAGS = TSI_DPRX_LINK_STATUS_FLAGS_R
TSI_R_DPRX_LT_STATUS_FLAGS = TSI_DPRX_LT_STATUS_FLAGS_R
TSI_R_DPRX_LINK_VOLTAGE_SWING = TSI_DPRX_LINK_VOLTAGE_SWING_R
TSI_R_DPRX_LINK_PRE_EMPHASIS = TSI_DPRX_LINK_PRE_EMPHASIS_R
TSI_R_DPRX_LINK_LANE_COUNT = TSI_DPRX_LINK_LANE_COUNT_R
TSI_R_DPRX_LINK_RATE = TSI_DPRX_LINK_RATE_R
TSI_R_DPRX_ERROR_COUNTS = TSI_DPRX_ERROR_COUNTS_R
TSI_W_DPRX_DPCD_BASE = TSI_DPRX_DPCD_BASE_W
TSI_R_DPRX_CRC_R = TSI_DPRX_CRC_R_R
TSI_R_DPRX_CRC_G = TSI_DPRX_CRC_G_R
TSI_R_DPRX_CRC_B = TSI_DPRX_CRC_B_R
TSI_DPRX_AUX_SWING_CTRL_RW = TSI_DPRX_AUX_SWING_CONTROL
TSI_DPRX_LOG_CTRL_RW = TSI_DPRX_LOG_CONTROL
TSI_DPRX_LOG_IF_SEL_RW = TSI_DPRX_LOG_IF_SEL
TSI_DPRX_LINK_LOG_SEL_RW = TSI_DPRX_LINK_LOG_SEL
TSI_DPRX_VBID_LOG_SEL_RW = TSI_DPRX_VBID_LOG_SEL
TSI_DPRX_MSA_LOG_SEL_RW = TSI_DPRX_MSA_LOG_SEL
TSI_DPRX_PHY_CONTROL_RW = TSI_DPRX_PHY_CONTROL
TSI_DPRX_CUSTOM_PATTERN_RW = TSI_DPRX_CUSTOM_PATTERN
TSI_DPRX_IOP_ERROR_COUNTERS_RW = TSI_DPRX_IOP_ERROR_COUNTERS
TSI_DP2RX_CUSTOM_RATE_MAP_RW = TSI_DP2RX_CUSTOM_RATE_MAP
TSI_DPRX_HPD_STATUS = TSI_DPRX_HPD_STATUS_R
TSI_W_DPRX_MSA_COMMAND = TSI_DPRX_MSA_COMMAND_W
TSI_R_DPRX_MSA_STREAM_COUNT = TSI_DPRX_MSA_STREAM_COUNT_R
TSI_R_DPRX_MSA_DATA = TSI_DPRX_MSA_DATA_R
TSI_R_DPRX_MSA_N_VIDEO = TSI_DPRX_MSA_N_VIDEO_R
TSI_R_DPRX_MSA_M_VIDEO = TSI_DPRX_MSA_M_VIDEO_R
TSI_R_DPRX_MSA_HTOTAL = TSI_DPRX_MSA_HTOTAL_R
TSI_R_DPRX_MSA_VTOTAL = TSI_DPRX_MSA_VTOTAL_R
TSI_R_DPRX_MSA_HACTIVE = TSI_DPRX_MSA_HACTIVE_R
TSI_R_DPRX_MSA_VACTIVE = TSI_DPRX_MSA_VACTIVE_R
TSI_R_DPRX_MSA_HSYNC_WIDTH = TSI_DPRX_MSA_HSYNC_WIDTH_R
TSI_R_DPRX_MSA_VSYNC_WIDTH = TSI_DPRX_MSA_VSYNC_WIDTH_R
TSI_R_DPRX_MSA_HSTART = TSI_DPRX_MSA_HSTART_R
TSI_R_DPRX_MSA_VSTART = TSI_DPRX_MSA_VSTART_R
TSI_R_DPRX_MSA_MISC = TSI_DPRX_MSA_MISC_R
TSI_R_DPRX_MSA_VBID = TSI_DPRX_MSA_VBID_R
TSI_R_DPRX_MSA_PORT_NUMBER = TSI_DPRX_MSA_PORT_NUMBER_R
TSI_R_DPRX_MSA_FRATE = TSI_DPRX_MSA_FRAME_RATE_R
TSI_R_DPRX_MSA_COLOR_DEPTH_BPC = TSI_DPRX_MSA_COLOR_DEPTH_BPC_R
TSI_R_DPRX_MSA_COLOR_MODE = TSI_DPRX_MSA_COLOR_MODE_R
TSI_R_DPRX_MSA_COLORIMETRY = TSI_DPRX_MSA_COLORIMETRY_R

# !CI_PARSE_DISABLE
TSI_DPTX_LOG_CONTROL_VALUE_HPD = (1 << 0)
TSI_DPTX_LOG_CONTROL_VALUE_AUX = (1 << 2)
# !CI_PARSE_ENABLE

TSI_DPTX_LINK_CFG_LANES = TSI_BASE_LEGACY_DPTX(0x0)
TSI_DPTX_LINK_CFG_BIT_RATE = TSI_BASE_LEGACY_DPTX(0x1)
TSI_DPTX_LINK_CFG_FLAGS = TSI_BASE_LEGACY_DPTX(0x2)
TSI_DPTX_OVERRIDE_VOLTAGE_SWING = TSI_BASE_LEGACY_DPTX(0x3)
TSI_DPTX_OVERRIDE_PRE_EMPHASIS = TSI_BASE_LEGACY_DPTX(0x4)
TSI_DPTX_LINK_PATTERN = TSI_BASE_LEGACY_DPTX(0x5)
TSI_DPTX_COMMAND_W = TSI_BASE_LEGACY_DPTX(0x6)
TSI_DPTX_HPD_STATUS_R = TSI_BASE_LEGACY_DPTX(0x7)
TSI_DPTX_LT_RESULT_R = TSI_BASE_LEGACY_DPTX(0x8)
TSI_DPTX_LINK_STATUS_BITS_R = TSI_BASE_LEGACY_DPTX(0x9)
TSI_DPTX_LINK_VOLTAGE_SWING_R = TSI_BASE_LEGACY_DPTX(0xa)
TSI_DPTX_LINK_LANE_COUNT_R = TSI_BASE_LEGACY_DPTX(0xb)
TSI_DPTX_LINK_RATE_R = TSI_BASE_LEGACY_DPTX(0xc)
TSI_DPTX_LINK_PRE_EMPHASIS_R = TSI_BASE_LEGACY_DPTX(0xd)
TSI_DPTX_CRC_R_R = TSI_BASE_LEGACY_DPTX(0x10)
TSI_DPTX_CRC_G_R = TSI_BASE_LEGACY_DPTX(0x11)
TSI_DPTX_CRC_B_R = TSI_BASE_LEGACY_DPTX(0x12)
TSI_DPTX_DPCD_BASE_W = TSI_BASE_LEGACY_DPTX(0x13)
TSI_DPTX_DPCD_DATA = TSI_BASE_LEGACY_DPTX(0x14)
TSI_DPTX_HW_CAPS_R = TSI_BASE_LEGACY_DPTX(0x15)
TSI_DPTX_AUX_SWING_CAPS_R = TSI_BASE_LEGACY_DPTX(0x16)
TSI_DPTX_AUX_SWING_CONTROL = TSI_BASE_LEGACY_DPTX(0x17)
TSI_DP2TX_CUSTOM_RATE_CAPS_R = TSI_BASE_LEGACY_DPTX(0x18)
TSI_DP2TX_CUSTOM_RATE_MAP = TSI_BASE_LEGACY_DPTX(0x19)
TSI_DPTX_HDCP_CAPS_R = TSI_BASE_LEGACY_DPTX(0x20)
TSI_DPTX_HDCP_STATUS_R = TSI_BASE_LEGACY_DPTX(0x21)

TSI_DPTX_LT_FEATURES = TSI_BASE_DPTX(0x02)
TSI_DPTX_OUTPUT_PATTERN = TSI_BASE_DPTX(0x04)
TSI_DPTX_LT_STATUS_R = TSI_BASE_DPTX(0x08)
TSI_DPTX_LINK_STATUS_R = TSI_BASE_DPTX(0x0F)
TSI_DPTX_MST_STATUS_R = TSI_BASE_DPTX(0x1B)
TSI_DPTX_VCP_TABLE_R = TSI_BASE_DPTX(0x1D)
TSI_DPTX_LOG_CONTROL = TSI_BASE_DPTX(0x22)
TSI_DPTX_FEC_CONTROL = TSI_BASE_DPTX(0x26)
TSI_DPTX_FEC_STATUS_R = TSI_BASE_DPTX(0x27)
TSI_DPTX_DSC_STATUS_R = TSI_BASE_DPTX(0x2A)
TSI_DPTX_LTTPR_CONTROL = TSI_BASE_DPTX(0x30)
TSI_DPTX_LTTPR_STATUS_R = TSI_BASE_DPTX(0x31)
TSI_DPTX_CRC_R = TSI_BASE_DPTX(0x38)
TSI_DPTX_DSC_CRC_R = TSI_BASE_DPTX(0x39)
TSI_DPTX_LINK_MODE_R = TSI_BASE_DPTX(0x3A)
TSI_DPTX_DOWNSPREAD_CONTROL = TSI_BASE_DPTX(0x41)
TSI_DPTX_EDP_LT_SBR = TSI_BASE_DPTX(0x42)
TSI_DPTX_DOWNSPREAD_AMP = TSI_BASE_DPTX(0x43)
TSI_DPTX_DOWNSPREAD_FREQ = TSI_BASE_DPTX(0x44)
TSI_DPTX_EDP_LT_RATE_R = TSI_BASE_DPTX(0x45)
TSI_DPTX_DOWNSPREAD_STATUS_R = TSI_BASE_DPTX(0x46)
TSI_DPTX_SQUARE_PATTERN_NUMBER = TSI_BASE_DPTX(0x4f)
TSI_DPTX_GENERIC_CONTROL_W = TSI_BASE_DPTX(0x51)
TSI_DPTX_MSA_INFO_R = TSI_BASE_DPTX(0x58)
TSI_DPTX_SCR_SEED = TSI_BASE_DPTX(0x5f)
TSI_DPTX_MST_COMMAND_W = TSI_BASE_DPTX(0x70)
TSI_DP2TX_LT_FFE_PRESET_R = TSI_BASE_DPTX(0x3B)
TSI_DP2TX_LT_SLC = TSI_BASE_DPTX(0x3C)
TSI_DP2TX_LT_SBR = TSI_BASE_DPTX(0x3D)
TSI_DP2TX_LT_RATE_R = TSI_BASE_DPTX(0x3F)
TSI_DP2TX_OUT_FFE = TSI_BASE_DPTX(0x50)
TSI_DPTX_EXTRA_DP14_RATES = TSI_BASE_DPTX(0x69)
TSI_DPTX_DISPLAYID_CTRL = TSI_BASE_DPTX(0x78)

TSI_SRC_DP_LINK_CFG_LANES = TSI_DPTX_LINK_CFG_LANES
TSI_SRC_DP_LINK_CFG_BIT_RATE = TSI_DPTX_LINK_CFG_BIT_RATE
TSI_SRC_DP_CFG_FLAGS = TSI_DPTX_LINK_CFG_FLAGS
TSI_SRC_DP_OVERRIDE_VOLTAGE_SWING = TSI_DPTX_OVERRIDE_VOLTAGE_SWING
TSI_SRC_DP_OVERRIDE_PRE_EMPHASIS = TSI_DPTX_OVERRIDE_PRE_EMPHASIS
TSI_SRC_DP_LINK_PATTERN = TSI_DPTX_LINK_PATTERN
TSI_W_SRC_DP_COMMAND = TSI_DPTX_COMMAND_W
TSI_R_SRC_DP_HPD_STATUS = TSI_DPTX_HPD_STATUS_R
TSI_R_SRC_DP_LT_RESULT = TSI_DPTX_LT_RESULT_R
TSI_R_SRC_DP_LINK_STATUS_BITS = TSI_DPTX_LINK_STATUS_BITS_R
TSI_R_SRC_DP_LINK_STATUS_VOLT_SWING = TSI_DPTX_LINK_VOLTAGE_SWING_R
TSI_R_SRC_DP_LINK_STATUS_LANE_COUNT = TSI_DPTX_LINK_LANE_COUNT_R
TSI_R_SRC_DP_LINK_STATUS_BIT_RATE = TSI_DPTX_LINK_RATE_R
TSI_R_SRC_DP_LINK_STATUS_PRE_EMP = TSI_DPTX_LINK_PRE_EMPHASIS_R
TSI_R_SRC_DP_CRC_R = TSI_DPTX_CRC_R_R
TSI_R_SRC_DP_CRC_G = TSI_DPTX_CRC_G_R
TSI_R_SRC_DP_CRC_B = TSI_DPTX_CRC_B_R
TSI_DP2TX_LT_BR_R = TSI_DP2TX_LT_RATE_R
TSI_DPTX_EDP_LT_BR_R = TSI_DPTX_EDP_LT_RATE_R
TSI_W_DPTX_COMMAND = TSI_DPTX_COMMAND_W
TSI_R_DPTX_HPD_STATUS = TSI_DPTX_HPD_STATUS_R
TSI_R_DPTX_LT_RESULT = TSI_DPTX_LT_RESULT_R
TSI_R_DPTX_LINK_STATUS_BITS = TSI_DPTX_LINK_STATUS_BITS_R
TSI_R_DPTX_LINK_STATUS_VOLT_SWING = TSI_DPTX_LINK_VOLTAGE_SWING_R
TSI_R_DPTX_LINK_STATUS_LANE_COUNT = TSI_DPTX_LINK_LANE_COUNT_R
TSI_R_DPTX_LINK_STATUS_BIT_RATE = TSI_DPTX_LINK_RATE_R
TSI_R_DPTX_LINK_STATUS_PRE_EMP = TSI_DPTX_LINK_PRE_EMPHASIS_R
TSI_R_DPTX_CRC_R = TSI_DPTX_CRC_R_R
TSI_R_DPTX_CRC_G = TSI_DPTX_CRC_G_R
TSI_R_DPTX_CRC_B = TSI_DPTX_CRC_B_R
TSI_W_DPTX_DPCD_BASE = TSI_DPTX_DPCD_BASE_W
TSI_R_DPTX_HW_CAPS = TSI_DPTX_HW_CAPS_R
TSI_DPTX_LOG_CTRL_RW = TSI_DPTX_LOG_CONTROL
TSI_DPTX_FEC_CTRL = TSI_DPTX_FEC_CONTROL
TSI_DPTX_FEC_STATUS = TSI_DPTX_FEC_STATUS_R
TSI_DPTX_DOWNSPREAD_CTRL_RW = TSI_DPTX_DOWNSPREAD_CONTROL
TSI_DPTX_DOWNSPREAD_AMP_RW = TSI_DPTX_DOWNSPREAD_AMP
TSI_DPTX_DOWNSPREAD_FREQ_RW = TSI_DPTX_DOWNSPREAD_FREQ
TSI_DPTX_AUX_SWING_CTRL_RW = TSI_DPTX_AUX_SWING_CONTROL
TSI_DP2TX_CUSTOM_RATE_MAP_RW = TSI_DP2TX_CUSTOM_RATE_MAP
TSI_DPTX_OUT_PATTERN = TSI_DPTX_OUTPUT_PATTERN
TSI_DPTX_SYS_CTRL_W = TSI_DPTX_GENERIC_CONTROL_W
TSI_DPTX_SQUARE_PAT_NUM = TSI_DPTX_SQUARE_PATTERN_NUMBER
TSI_DPTX_DP_LINK_PATTERN = TSI_DPTX_LINK_PATTERN
TSI_DPTX_CFG_FLAGS = TSI_DPTX_LINK_CFG_FLAGS

# !CI_PARSE_DISABLE
TSI_HDRX_LOG_CTRL_VALUE_HPD = (1 << 0)
TSI_HDRX_LOG_CTRL_VALUE_INFO = (1 << 1)
TSI_HDRX_LOG_CTRL_VALUE_I2C = (1 << 2)
TSI_HDRX_LOG_CTRL_VALUE_CEC = (1 << 3)
TSI_HDRX_LOG_CTRL_VALUE_FRAME_INFO = (1 << 4)
# !CI_PARSE_ENABLE

TSI_HDRX_LINK_STATUS_R = TSI_BASE_LEGACY_HDRX(0x0)
TSI_HDRX_ARC_STATUS_R = TSI_BASE_LEGACY_HDRX(0x2)
TSI_HDRX_CRC_R_R = TSI_BASE_LEGACY_HDRX(0x3)
TSI_HDRX_CRC_G_R = TSI_BASE_LEGACY_HDRX(0x4)
TSI_HDRX_CRC_B_R = TSI_BASE_LEGACY_HDRX(0x5)
TSI_HDRX_VIDEO_MODE_R = TSI_BASE_LEGACY_HDRX(0x7)
TSI_HDRX_EVENTS_R = TSI_BASE_HDRX(0x00)
TSI_HDRX_HPD_CONTROL_W = TSI_BASE_HDRX(0x02)
TSI_HDRX_HPD_STATUS_R = TSI_BASE_HDRX(0x02)

# RM9124 BELOW
TSI_HDRX_ARC_SOURCE = TSI_BASE_HDRX(0x18)
TSI_HDRX_ARC_MODE = TSI_BASE_HDRX(0x19)
TSI_HDRX_ARC_CONTROL_W = TSI_BASE_HDRX(0x1A)
TSI_HDRX_ARC_SUPPORTED_R = TSI_BASE_HDRX(0x1B)

TSI_HDRX_EARC_CTRL = TSI_BASE_HDRX(0x50)
TSI_HDRX_EARC_STS_R = TSI_BASE_HDRX(0x51)
TSI_HDRX_EARC_EDID_OFFSET = TSI_BASE_HDRX(0x52)
TSI_HDRX_EARC_EDID_DATA = TSI_BASE_HDRX(0x53)
TSI_HDRX_EARC_LATENCY = TSI_BASE_HDRX(0x54)
TSI_HDRX_EARC_LATENCY_REQ = TSI_BASE_HDRX(0x55)
# RM9124 ABOVE
TSI_HDRX_HDCP_CAPS_R = TSI_BASE_HDRX(0x10)
TSI_HDRX_HDCP_STATUS_R = TSI_BASE_HDRX(0x11)
TSI_HDRX_LOG_IF_SEL = TSI_BASE_HDRX(0x021)
TSI_HDRX_LOG_CONTROL = TSI_BASE_HDRX(0x023)
TSI_HDRX_FRL_CAPABILITY = TSI_BASE_HDRX(0x024)
TSI_HDRX_FRL_PATTERN = TSI_BASE_HDRX(0x025)
TSI_HDRX_FRL_FFE_R = TSI_BASE_HDRX(0x026)
TSI_HDRX_LANES_ERR_COUNTERS_R = TSI_BASE_HDRX(0x027)
TSI_HDRX_CAPABILITY_R = TSI_BASE_HDRX(0x029)
TSI_HDRX_BEHAVIOR = TSI_BASE_HDRX(0x02A)

TSI_HDRX_CEC_CONTROL = TSI_BASE_HDRX(0x030)
TSI_HDRX_CEC_COMMAND = TSI_BASE_HDRX(0x031)
TSI_HDRX_CEC_VERSION_R = TSI_BASE_HDRX(0x032)
TSI_HDRX_CEC_LOGICAL_ADDRESS = TSI_BASE_HDRX(0x033)
TSI_HDRX_CEC_PHYSICAL_ADDRESS = TSI_BASE_HDRX(0x034)
TSI_HDRX_CEC_OP_CODE = TSI_BASE_HDRX(0x035)
TSI_HDRX_CEC_OP_CODE_PARAM = TSI_BASE_HDRX(0x036)
TSI_HDRX_CEC_DEVICE_TYPE = TSI_BASE_HDRX(0x037)
TSI_HDRX_CEC_RECEIVED_CNT_R = TSI_BASE_HDRX(0x038)
TSI_HDRX_CEC_STATUS_R = TSI_BASE_HDRX(0x039)
TSI_HDRX_CEC_DATA_RECEIVED_R = TSI_BASE_HDRX(0x03A)
TSI_HDRX_CEC_DATA_RESET_W = TSI_BASE_HDRX(0x03A)
TSI_HDRX_CEC_DATA_SIZE_R = TSI_BASE_HDRX(0x03B)
TSI_HDRX_CEC_DESTINATION = TSI_BASE_HDRX(0x03F)

TSI_HDRX_TIM_COMMAND_W = TSI_BASE_LEGACY_HDRX_TIM(0x0)
TSI_HDRX_TIM_HTOTAL_R = TSI_BASE_LEGACY_HDRX_TIM(0x1)
TSI_HDRX_TIM_VTOTAL_R = TSI_BASE_LEGACY_HDRX_TIM(0x2)
TSI_HDRX_TIM_HACTIVE_R = TSI_BASE_LEGACY_HDRX_TIM(0x3)
TSI_HDRX_TIM_VACTIVE_R = TSI_BASE_LEGACY_HDRX_TIM(0x4)
TSI_HDRX_TIM_HSTART_R = TSI_BASE_LEGACY_HDRX_TIM(0x5)
TSI_HDRX_TIM_VSTART_R = TSI_BASE_LEGACY_HDRX_TIM(0x6)
TSI_HDRX_TIM_HSYNC_WIDTH_R = TSI_BASE_LEGACY_HDRX_TIM(0x7)
TSI_HDRX_TIM_VSYNC_WIDTH_R = TSI_BASE_LEGACY_HDRX_TIM(0x8)
TSI_HDRX_TIM_COLOR_DEPTH_R = TSI_BASE_LEGACY_HDRX_TIM(0x9)
TSI_HDRX_TIM_FRAME_RATE_R = TSI_BASE_LEGACY_HDRX_TIM(0xa)
TSI_HDRX_TIM_COLOR_MODE_R = TSI_BASE_LEGACY_HDRX_TIM(0xb)
TSI_HDRX_TIM_COLORIMETRY_R = TSI_BASE_LEGACY_HDRX_TIM(0xc)
TSI_HDRX_TIM_COLOR_DEPTH_BPC_R = TSI_BASE_LEGACY_HDRX_TIM(0xd)

TSI_HDRX_PIX_CAP_CONTROL = TSI_BASE_HDRX(0x040)
TSI_HDRX_PIX_CAP_STATUS_R = TSI_BASE_HDRX(0x041)
TSI_HDRX_PIX_CAP_TIMESTAMP_0_R = TSI_BASE_HDRX(0x042)
TSI_HDRX_PIX_CAP_TIMESTAMP_1_R = TSI_BASE_HDRX(0x043)
TSI_HDRX_PIX_CAP_COORDINATES_W = TSI_BASE_HDRX(0x044)
TSI_HDRX_PIX_CAP_DATA_R = TSI_BASE_HDRX(0x045)

TSI_R_SINK_HDMI_FPERIOD = TSI_BASE_LEGACY_HDRX(0x6)
TSI_R_SINK_HDMI_VIDEO_MODE = TSI_HDRX_VIDEO_MODE_R
TSI_R_HDRX_LINK_STATUS = TSI_HDRX_LINK_STATUS_R
TSI_HDRX_CEC_CTRL_RW = TSI_HDRX_CEC_CONTROL
TSI_HDRX_CEC_CMD_RW = TSI_HDRX_CEC_COMMAND
TSI_HDRX_CEC_LOGICAL_ADDRESS_RW = TSI_HDRX_CEC_LOGICAL_ADDRESS
TSI_HDRX_CEC_PHYSICAL_ADDRESS_RW = TSI_HDRX_CEC_PHYSICAL_ADDRESS
TSI_HDRX_CEC_OP_CODE_RW = TSI_HDRX_CEC_OP_CODE
TSI_HDRX_CEC_OP_CODE_PARAM_RW = TSI_HDRX_CEC_OP_CODE_PARAM
TSI_HDRX_CEC_DEVICE_TYPE_RW = TSI_HDRX_CEC_DEVICE_TYPE
TSI_HDRX_CEC_RECIVED_CNT = TSI_HDRX_CEC_RECEIVED_CNT_R
TSI_HDRX_CEC_OP_CODE_RECIEVED = TSI_HDRX_CEC_STATUS_R
TSI_HDRX_CEC_DATA_RECIEVED = TSI_HDRX_CEC_DATA_RECEIVED_R
TSI_W_HDRX_TIM_COMMAND = TSI_HDRX_TIM_COMMAND_W
TSI_R_HDRX_TIM_HTOTAL = TSI_HDRX_TIM_HTOTAL_R
TSI_R_HDRX_TIM_VTOTAL = TSI_HDRX_TIM_VTOTAL_R
TSI_R_HDRX_TIM_HACTIVE = TSI_HDRX_TIM_HACTIVE_R
TSI_R_HDRX_TIM_VACTIVE = TSI_HDRX_TIM_VACTIVE_R
TSI_R_HDRX_TIM_HSTART = TSI_HDRX_TIM_HSTART_R
TSI_R_HDRX_TIM_VSTART = TSI_HDRX_TIM_VSTART_R
TSI_R_HDRX_TIM_HSYNC_WIDTH = TSI_HDRX_TIM_HSYNC_WIDTH_R
TSI_R_HDRX_TIM_VSYNC_WIDTH = TSI_HDRX_TIM_VSYNC_WIDTH_R
TSI_R_HDRX_TIM_COLOR_DEPTH = TSI_HDRX_TIM_COLOR_DEPTH_R
TSI_R_HDRX_TIM_FRATE = TSI_HDRX_TIM_FRAME_RATE_R
TSI_R_HDRX_TIM_COLOR_MODE = TSI_HDRX_TIM_COLOR_MODE_R
TSI_R_HDRX_TIM_COLORIMETRY = TSI_HDRX_TIM_COLORIMETRY_R
TSI_HDRX_LOG_IF_SEL_RW = TSI_HDRX_LOG_IF_SEL
TSI_HDRX_LOG_CTRL_RW = TSI_HDRX_LOG_CONTROL
TSI_HDRX_FRL_CAPABILITY_RW = TSI_HDRX_FRL_CAPABILITY
TSI_HDRX_FRL_PATTERN_RW = TSI_HDRX_FRL_PATTERN
TSI_HDRX_HPD_CTRL_W = TSI_HDRX_HPD_CONTROL_W
TSI_HDRX_BEHAVIOR_RW = TSI_HDRX_BEHAVIOR
TSI_R_HDRX_CRC_R = TSI_HDRX_CRC_R_R
TSI_R_HDRX_CRC_G = TSI_HDRX_CRC_G_R
TSI_R_HDRX_CRC_B = TSI_HDRX_CRC_B_R
TSI_W_HDRX_LINK_CONTROL = TSI_HDRX_HPD_CONTROL_W
TSI_R_HDRX_ARC_STATUS = TSI_HDRX_ARC_STATUS_R
TSI_HDRX_PIX_CAP_CTRL_RW = TSI_HDRX_PIX_CAP_CONTROL
TSI_HDRX_PIX_CAP_STS_R = TSI_HDRX_PIX_CAP_STATUS_R

# !CI_PARSE_DISABLE
TSI_HDTX_LOG_CTRL_VALUE_HPD = (1 << 0)
TSI_HDTX_LOG_CTRL_VALUE_I2C = (1 << 1)
TSI_HDTX_LOG_CTRL_VALUE_CEC = (1 << 2)
# !CI_PARSE_ENABLE

TSI_HDTX_CONTROL_W = TSI_BASE_HDTX(0x00)
TSI_HDTX_STATUS_R = TSI_BASE_HDTX(0x00)
TSI_HDTX_SINK_CAPS_R = TSI_BASE_HDTX(0x01)
TSI_HDTX_SINK_FEATURE_W = TSI_BASE_HDTX(0x02)
TSI_HDTX_SINK_STATUS_R = TSI_BASE_HDTX(0x02)
TSI_HDTX_HPD_STATUS_R = TSI_BASE_HDTX(0x0d)
TSI_HDTX_EVENTS_R = TSI_BASE_HDTX(0x0e)
TSI_HDTX_SCDC_OFFSET = TSI_BASE_HDTX(0x12)
TSI_HDTX_SCDC_DATA = TSI_BASE_HDTX(0x13)
TSI_HDTX_HDCP_CAPS_R = TSI_BASE_HDTX(0x020)
TSI_HDTX_HDCP_STATUS_R = TSI_BASE_HDTX(0x021)
TSI_HDTX_LOG_CONTROL = TSI_BASE_HDTX(0x022)
TSI_HDTX_PKT_INFO_R = TSI_BASE_HDTX(0x023)
TSI_HDTX_FRL_CAPABILITY = TSI_BASE_HDTX(0x025)
TSI_HDTX_FRL_STATUS_R = TSI_BASE_HDTX(0x026)
TSI_HDTX_FRL_PATTERN_R = TSI_BASE_HDTX(0x027)
TSI_HDTX_FRL_TIMERS = TSI_BASE_HDTX(0x028)
TSI_HDTX_LANES_ERR_COUNTERS_R = TSI_BASE_HDTX(0x029)
TSI_HDTX_CAPABILITY_R = TSI_BASE_HDTX(0x02B)
TSI_HDTX_CEC_CONTROL = TSI_BASE_HDTX(0x031)
TSI_HDTX_CEC_COMMAND = TSI_BASE_HDTX(0x032)
TSI_HDTX_CEC_VERSION_R = TSI_BASE_HDTX(0x033)
TSI_HDTX_CEC_LOGICAL_ADDRESS = TSI_BASE_HDTX(0x034)
TSI_HDTX_CEC_PHYSICAL_ADDRESS = TSI_BASE_HDTX(0x035)
TSI_HDTX_CEC_OP_CODE = TSI_BASE_HDTX(0x036)
TSI_HDTX_CEC_OP_CODE_PARAM = TSI_BASE_HDTX(0x037)
TSI_HDTX_CEC_DEVICE_TYPE = TSI_BASE_HDTX(0x038)
TSI_HDTX_CEC_RECEIVED_CNT_R = TSI_BASE_HDTX(0x039)
TSI_HDTX_CEC_STATUS_R = TSI_BASE_HDTX(0x03A)
TSI_HDTX_CEC_DATA_RECEIVED_R = TSI_BASE_HDTX(0x03B)
TSI_HDTX_CEC_DATA_RESET_W = TSI_BASE_HDTX(0x03B)
TSI_HDTX_CEC_DATA_SIZE_R = TSI_BASE_HDTX(0x03C)
TSI_HDTX_CEC_DESTINATION = TSI_BASE_HDTX(0x03F)
TSI_HDTX_LEGACY_CONTROL_W = TSI_BASE_LEGACY_HDTX(0x0)
TSI_HDTX_LEGACY_STATUS_R = TSI_BASE_LEGACY_HDTX(0x1)

TSI_SRC_HDMI_SCDC_ADDRESS = TSI_HDTX_SCDC_OFFSET
TSI_SRC_HDMI_SCDC_DATA = TSI_HDTX_SCDC_DATA
TSI_W_SRC_HDMI_CONTROL = TSI_HDTX_LEGACY_CONTROL_W
TSI_R_SRC_HDMI_STATUS = TSI_HDTX_LEGACY_STATUS_R
TSI_R_SRC_HDMI_DUT_CAPS = TSI_HDTX_SINK_CAPS_R
TSI_HDTX_SCDC_OFFSET_RW = TSI_HDTX_SCDC_OFFSET
TSI_HDTX_SCDC_DATA_RW = TSI_HDTX_SCDC_DATA
TSI_HDTX_LOG_CTRL_RW = TSI_HDTX_LOG_CONTROL
TSI_HDTX_FRL_CAPABILITY_RW = TSI_HDTX_FRL_CAPABILITY
TSI_HDTX_FRL_TIMERS_RW = TSI_HDTX_FRL_TIMERS
TSI_HDTX_CEC_CTRL_RW = TSI_HDTX_CEC_CONTROL
TSI_HDTX_CEC_CMD_RW = TSI_HDTX_CEC_COMMAND
TSI_HDTX_CEC_LOGICAL_ADDRESS_RW = TSI_HDTX_CEC_LOGICAL_ADDRESS
TSI_HDTX_CEC_PHYSICAL_ADDRESS_RW = TSI_HDTX_CEC_PHYSICAL_ADDRESS
TSI_HDTX_CEC_OP_CODE_RW = TSI_HDTX_CEC_OP_CODE
TSI_HDTX_CEC_OP_CODE_PARAM_RW = TSI_HDTX_CEC_OP_CODE_PARAM
TSI_HDTX_CEC_DEVICE_TYPE_RW = TSI_HDTX_CEC_DEVICE_TYPE

TSI_USBC_CABLE_CONTROL_W = TSI_BASE_LEGACY_USBC(0x0)
TSI_USBC_INITIAL_ROLE_W = TSI_BASE_LEGACY_USBC(0x1)
TSI_USBC_DP_ALT_MODE_SETUP = TSI_BASE_LEGACY_USBC(0x2)
TSI_USBC_ROLE_CONTROL_W = TSI_BASE_LEGACY_USBC(0x3)
TSI_USBC_DP_ALT_MODE_COMMAND_W = TSI_BASE_LEGACY_USBC(0x4)
TSI_USBC_TE_HW_CONFIGURATION_R = TSI_BASE_LEGACY_USBC(0x5)
TSI_USBC_CABLE_STATUS_R = TSI_BASE_LEGACY_USBC(0x6)
TSI_USBC_ROLE_STATUS_R = TSI_BASE_LEGACY_USBC(0x7)
TSI_USBC_DP_ALT_MODE_STATUS_R = TSI_BASE_LEGACY_USBC(0x8)
TSI_USBC_POWER_STATUS_R = TSI_BASE_LEGACY_USBC(0x9)
TSI_USBC_POWER_SOURCE_PDO_R = TSI_BASE_LEGACY_USBC(0xa)
TSI_USBC_POWER_SINK_RDO_R = TSI_BASE_LEGACY_USBC(0xb)
TSI_USBC_IDO_TABLE_R = TSI_BASE_LEGACY_USBC(0xc)  # !CI_PARSE_SIZE 24
TSI_USBC_EPU_LOAD_CONTROL = TSI_BASE_LEGACY_USBC(0xd)

TSI_USBC_PWR_CONTRACT_CONTROL = TSI_BASE_LEGACY_USBC(0xe)
TSI_USBC_PWR_CONTRACT_SELECT = TSI_BASE_LEGACY_USBC(0xf)
TSI_USBC_PWR_LOCAL_SINK_PDO = TSI_BASE_LEGACY_USBC(0x10)  # !CI_PARSE_SIZE 28
TSI_USBC_PWR_LOCAL_SOURCE_PDO = TSI_BASE_LEGACY_USBC(0x11)  # !CI_PARSE_SIZE 28
TSI_USBC_PWR_REMOTE_SINK_PDO_R = TSI_BASE_LEGACY_USBC(0x12)  # !CI_PARSE_SIZE 28
TSI_USBC_PWR_REMOTE_SOURCE_PDO_R = TSI_BASE_LEGACY_USBC(0x13)  # !CI_PARSE_SIZE 28

TSI_USBC_PD_STATUS_R = TSI_BASE_LEGACY_USBC(0x14)
TSI_USBC_PD_COMMAND_W = TSI_BASE_LEGACY_USBC(0x15)

TSI_USBC_RESISTANCE_CONTROL = TSI_BASE_LEGACY_USBC(0x16)
TSI_USBC_INT_RESISTANCE_STATUS_R = TSI_BASE_LEGACY_USBC(0x17)
TSI_USBC_EXT_RESISTANCE_STATUS_R = TSI_BASE_LEGACY_USBC(0x18)

TSI_USBC_ROLE_CONTROL_SWAP_W = TSI_BASE_LEGACY_USBC(0x27)  # Warning - TSIX is 0x619!
TSI_USBC_ROLE_CONTROL_SWAP_R = TSI_BASE_LEGACY_USBC(0x28)  # Warning - TSIX is 0x620!

TSI_USBC_PWR_COMMAND = TSI_BASE_LEGACY_PDO(0x0)
TSI_USBC_PWR_LOCAL_SOURCE_PDO_SELECT = TSI_BASE_LEGACY_PDO(0x1)
TSI_USBC_PWR_LOCAL_SOURCE_PDO_TYPE = TSI_BASE_LEGACY_PDO(0x2)
TSI_USBC_PWR_LOCAL_SOURCE_PDO_MAX_CURRENT = TSI_BASE_LEGACY_PDO(0x3)
TSI_USBC_PWR_LOCAL_SOURCE_PDO_VOLTAGE = TSI_BASE_LEGACY_PDO(0x4)
TSI_USBC_PWR_LOCAL_SOURCE_PDO_PEAK_CURRENT = TSI_BASE_LEGACY_PDO(0x5)
TSI_USBC_PWR_LOCAL_SOURCE_PDO_MAX_POWER = TSI_BASE_LEGACY_PDO(0x6)
TSI_USBC_PWR_LOCAL_SOURCE_PDO_MAX_VOLTAGE = TSI_BASE_LEGACY_PDO(0x7)
TSI_USBC_PWR_LOCAL_SOURCE_PDO_MIN_VOLTAGE = TSI_BASE_LEGACY_PDO(0x8)

TSI_USBC_PWR_LOCAL_SINK_PDO_SELECT = TSI_BASE_LEGACY_PDO(0x9)
TSI_USBC_PWR_LOCAL_SINK_PDO_TYPE = TSI_BASE_LEGACY_PDO(0xa)
TSI_USBC_PWR_LOCAL_SINK_PDO_MAX_CURRENT = TSI_BASE_LEGACY_PDO(0xb)
TSI_USBC_PWR_LOCAL_SINK_PDO_VOLTAGE = TSI_BASE_LEGACY_PDO(0xc)
TSI_USBC_PWR_LOCAL_SINK_PDO_MAX_POWER = TSI_BASE_LEGACY_PDO(0xd)
TSI_USBC_PWR_LOCAL_SINK_PDO_MAX_VOLTAGE = TSI_BASE_LEGACY_PDO(0xe)
TSI_USBC_PWR_LOCAL_SINK_PDO_MIN_VOLTAGE = TSI_BASE_LEGACY_PDO(0xf)

TSI_USBC_PWR_LOCAL_SOURCE_PDO_FIXED_SUPPLY_BITS_25_TO_29 = TSI_BASE_LEGACY_PDO(0x10)
TSI_USBC_PWR_LOCAL_SINK_PDO_FIXED_SUPPLY_BITS_25_TO_29 = TSI_BASE_LEGACY_PDO(0x11)

TSI_W_USBC_CABLE_CONTROL = TSI_USBC_CABLE_CONTROL_W
TSI_W_USBC_INITIAL_ROLE = TSI_USBC_INITIAL_ROLE_W
TSI_W_USBC_ROLE_CONTROL = TSI_USBC_ROLE_CONTROL_W
TSI_W_USBC_DP_ALT_MODE_COMMAND = TSI_USBC_DP_ALT_MODE_COMMAND_W
TSI_R_USBC_TE_HW_CONFIGURATION = TSI_USBC_TE_HW_CONFIGURATION_R
TSI_R_USBC_CABLE_STATUS = TSI_USBC_CABLE_STATUS_R
TSI_R_USBC_ROLE_STATUS = TSI_USBC_ROLE_STATUS_R
TSI_R_USBC_DP_ALT_MODE_STATUS = TSI_USBC_DP_ALT_MODE_STATUS_R
TSI_R_USBC_POWER_STATUS = TSI_USBC_POWER_STATUS_R
TSI_R_USBC_POWER_SOURCE_PDO = TSI_USBC_POWER_SOURCE_PDO_R
TSI_R_USBC_POWER_SINK_RDO = TSI_USBC_POWER_SINK_RDO_R
TSI_R_USBC_IDO_TABLE = TSI_USBC_IDO_TABLE_R  # !CI_PARSE_SIZE 24
TSI_R_USBC_PWR_REMOTE_SINK_PDO = TSI_USBC_PWR_REMOTE_SINK_PDO_R
TSI_R_USBC_PWR_REMOTE_SOURCE_PDO = TSI_USBC_PWR_REMOTE_SOURCE_PDO_R
TSI_R_USBC_PD_STATUS = TSI_USBC_PD_STATUS_R
TSI_W_USBC_PD_COMMAND = TSI_USBC_PD_COMMAND_W
TSI_R_USBC_INT_RESISTANCE_STATUS = TSI_USBC_INT_RESISTANCE_STATUS_R
TSI_R_USBC_EXT_RESISTANCE_STATUS = TSI_USBC_EXT_RESISTANCE_STATUS_R
TSI_W_USBC_ROLE_CONTROL_SWAP = TSI_USBC_ROLE_CONTROL_SWAP_W
TSI_R_USBC_ROLE_CONTROL_SWAP = TSI_USBC_ROLE_CONTROL_SWAP_R
TSI_USBC_RESISTANCE_CTRL = TSI_USBC_RESISTANCE_CONTROL

# !CI_PARSE_DISABLE
TSI_PDC_LOG_CTRL_VALUE_PD = (1 << 0)
TSI_PDC_LOG_CTRL_VALUE_USBC_VOLTAGE = (1 << 1)
TSI_PDC_LOG_CTRL_VALUE_USBC_EVENT = (1 << 2)
TSI_PDC_LOG_CTRL_VALUE_USBC_STATE = (1 << 3)
# !CI_PARSE_ENABLE

TSI_PDC_HW_CONTROL_W = TSI_BASE_PDC(0x01)
TSI_PDC_HW_STATUS_R = TSI_BASE_PDC(0x01)
TSI_PDC_STATUS_R = TSI_BASE_PDC(0x03)
TSI_PDC_CONTROL_W = TSI_BASE_PDC(0x04)
TSI_PDC_STATE_R = TSI_BASE_PDC(0x04)
TSI_PDC_CAPS_R = TSI_BASE_PDC(0x06)
TSI_PDC_LOG_CAPS_R = TSI_BASE_PDC(0x07)
TSI_PDC_DPAM_CONTROL_W = TSI_BASE_PDC(0x34)
TSI_PDC_DPAM_STATE_R = TSI_BASE_PDC(0x34)
TSI_PDC_DPAM_CAPS = TSI_BASE_PDC(0x35)
TSI_PDC_DPAM_CAPS2 = TSI_BASE_PDC(0x36)
TSI_PDC_LOG_CONTROL = TSI_BASE_PDC(0x44)
TSI_PDC_USBC_LOG_CFG = TSI_BASE_PDC(0x48)
TSI_PDC_USBC_LOG_THRESH = TSI_BASE_PDC(0x49)  # !CI_PARSE_SIZE 20

TSI_PDC_RX_ID_VDO_COUNT_R = TSI_BASE_LEGACY_USBC(0x19)
TSI_PDC_RX_ID_VDO = TSI_BASE_LEGACY_USBC(0x20)  # !CI_PARSE_SIZE 48
TSI_PDC_RX_SVID_COUNT_R = TSI_BASE_LEGACY_USBC(0x21)
TSI_PDC_RX_SVID = TSI_BASE_LEGACY_USBC(0x22)  # !CI_PARSE_SIZE 48
TSI_PDC_DPAM_RECV_STATUS_R = TSI_BASE_LEGACY_USBC(0x23)
TSI_PDC_DPAM_SENT_STATUS_R = TSI_BASE_LEGACY_USBC(0x24)
TSI_PDC_DPAM_DISC_MODES_R = TSI_BASE_LEGACY_USBC(0x25)
TSI_PDC_TYPE_R = TSI_BASE_LEGACY_USBC(0x26)
TSI_PDO_COUNT_R = TSI_BASE_LEGACY_USBC(0x29)  # Warning - value has been changed due to overlapping!

TSI_PDC_HW_CTRL = TSI_PDC_HW_CONTROL_W
TSI_PDC_HW_STATUS = TSI_PDC_HW_STATUS_R
TSI_PDC_CONTROL = TSI_PDC_CONTROL_W
TSI_PDC_STATE = TSI_PDC_STATE_R
TSI_PDC_CAPS = TSI_PDC_CAPS_R
TSI_PDC_LOG_CTRL_RW = TSI_PDC_LOG_CONTROL
TSI_PDC_RX_ID_VDO_RW = TSI_PDC_RX_ID_VDO  # !CI_PARSE_SIZE 48
TSI_PDC_RX_SVID_RW = TSI_PDC_RX_SVID  # !CI_PARSE_SIZE 48
TSI_PDC_DPAM_RECV_STS_R = TSI_PDC_DPAM_RECV_STATUS_R
TSI_PDC_DPAM_SENT_STS_R = TSI_PDC_DPAM_SENT_STATUS_R
TSI_PDC_RX_ID_VDO_CNT_R = TSI_PDC_RX_ID_VDO_COUNT_R
TSI_PDC_RX_SVID_CNT_R = TSI_PDC_RX_SVID_COUNT_R

TSI_ADC_BLOCK_SIZE_WORDS = 0x08
TSI_ADC_FIRST = TSI_BASE_LEGACY_ADC(0x0)
TSI_ADC_LAST = TSI_BASE_LEGACY_ADC(0xff)
# !CI_PARSE_DISABLE
TSI_R_ADC_FIRST = TSI_ADC_FIRST
TSI_R_ADC_LAST = TSI_ADC_LAST
TSI_ADC_WORD_COUNT = (1 + TSI_R_ADC_LAST - TSI_R_ADC_FIRST)
# !CI_PARSE_ENABLE

TSI_ADC_VBUS_VOLTAGE_R = TSI_BASE_LEGACY_ADC(0x0)
TSI_ADC_VBUS_CURRENT_R = TSI_BASE_LEGACY_ADC(0x1)
TSI_ADC_VCC1_VOLTAGE_R = TSI_BASE_LEGACY_ADC(0x2)
TSI_ADC_VCC2_VOLTAGE_R = TSI_BASE_LEGACY_ADC(0x3)
TSI_ADC_VCONN_VOLTAGE_R = TSI_BASE_LEGACY_ADC(0x4)
TSI_ADC_VCONN_CURRENT_R = TSI_BASE_LEGACY_ADC(0x5)
TSI_ADC_SBU1_VOLTAGE_R = TSI_BASE_LEGACY_ADC(0x6)
TSI_ADC_SBU2_VOLTAGE_R = TSI_BASE_LEGACY_ADC(0x7)

TSI_USBC_ADC_DATA_R = TSI_BASE_LEGACY_ADC(0x1)
TSI_USBC_ADC_CONTROL_W = TSI_BASE_LEGACY_ADC(0x100)
TSI_USBC_ADC_TIMEOUT_W = TSI_BASE_LEGACY_ADC(0x101)
TSI_USBC_ADC_STATUS_R = TSI_BASE_LEGACY_ADC(0x102)

TSI_R_ADC_WORD_COUNT = TSI_ADC_WORD_COUNT
TSI_USBC_ADC_BLOCK_SIZE_R = TSI_ADC_BLOCK_SIZE_WORDS
TSI_R_ADC_FIRST = TSI_ADC_FIRST
TSI_R_ADC_LAST = TSI_ADC_LAST
TSI_W_USBC_ADC_CTRL = TSI_USBC_ADC_CONTROL_W
TSI_W_USBC_ADC_TIMEOUT = TSI_USBC_ADC_TIMEOUT_W
TSI_R_USBC_ADC_DATA = TSI_USBC_ADC_DATA_R
TSI_R_USBC_ADC_BLOCK_SIZE = TSI_USBC_ADC_BLOCK_SIZE_R
TSI_R_ADC_VBUS_VOLTAGE = TSI_ADC_VBUS_VOLTAGE_R
TSI_R_ADC_VBUS_CURRENT = TSI_ADC_VBUS_CURRENT_R
TSI_R_ADC_VCC1_VOLTAGE = TSI_ADC_VCC1_VOLTAGE_R
TSI_R_ADC_VCC2_VOLTAGE = TSI_ADC_VCC2_VOLTAGE_R
TSI_R_ADC_VCONN_VOLTAGE = TSI_ADC_VCONN_VOLTAGE_R
TSI_R_ADC_VCONN_CURRENT = TSI_ADC_VCONN_CURRENT_R
TSI_R_ADC_SBU1_VOLTAGE = TSI_ADC_SBU1_VOLTAGE_R
TSI_R_ADC_SBU2_VOLTAGE = TSI_ADC_SBU2_VOLTAGE_R

# TODO PI:! unpublished API to test Playback, dont send to customers until finalized

# !CI_PARSE_DISABLE
TSI_PLAYBACK_STOP = 0
TSI_PLAYBACK_START = 1

TSI_PLAYBACK_ENABLE_VIDEO = 1
TSI_PLAYBACK_ENABLE_PACKETS = 2
TSI_PLAYBACK_ENABLE_AUDIO = 4
TSI_PLAYBACK_ENABLE_DSC = 8
TSI_PLAYBACK_ENABLE_PCIE = 16
# !CI_PARSE_ENABLE

TSI_PLAYBACK_CONTROL = TSI_BASE_PLAYBACK(0x00)
TSI_PLAYBACK_CONFIG = TSI_BASE_PLAYBACK(0x01)
TSI_PLAYBACK_PACKET_BLOCK = TSI_BASE_PLAYBACK(0x02)
TSI_PLAYBACK_STEP_R = TSI_BASE_PLAYBACK(0x03)

TSI_SCENARIO_STEP_AMOUNT = TSI_BASE_PLAYBACK(0x04)
TSI_SCENARIO_CURRENT_STEP = TSI_BASE_PLAYBACK(0x05)
TSI_SCENARIO_STEP_IMAGE_INDEX = TSI_BASE_PLAYBACK(0x06)
TSI_SCENARIO_STEP_REPETITION = TSI_BASE_PLAYBACK(0x07)
TSI_SCENARIO_STEP_COLOR_FORMAT = TSI_BASE_PLAYBACK(0x08)
TSI_SCENARIO_STEP_COLOR_DEPTH = TSI_BASE_PLAYBACK(0x09)
TSI_SCENARIO_STEP_VRR = TSI_BASE_PLAYBACK(0x0a)
TSI_SCENARIO_STEP_FLAGS = TSI_BASE_PLAYBACK(0x0b)
TSI_SCENARIO_STEP_PACKETS_ADD = TSI_BASE_PLAYBACK(0x0c)
TSI_SCENARIO_STEP_PACKETS_CLEAR = TSI_BASE_PLAYBACK(0x0d)
TSI_SCENARIO_STRING = TSI_BASE_PLAYBACK(0x0e)
TSI_SCENARIO_STEP_SIZE_R = TSI_BASE_PLAYBACK(0x0f)
TSI_SCENARIO_VSC_FLAGS = TSI_BASE_PLAYBACK(0x10)

# TODO PI:! end unpublished API to test Playback


# !CI_PARSE_DISABLE
TSI_TEST_NONE = 0x00000000  # NO Test (Used for configuration through TSI_TST_RunTest, for example).
TSI_TEST_VIDEO_NO_PXL_TOLERANCE = 0x00000001  # TEST ID (Generic)
TSI_TEST_VIDEO_PXL_TOLERANCE = 0x00000002  # TEST ID (Generic)
TSI_TEST_AUDIO_KILOHERTZ = 0x00000003  # TEST ID (Generic, with audio capability)
TSI_TEST_CEC_DISCOVERY = 0x00000004  # TEST ID (UFG-06 Specific)
TSI_TEST_HDR10_SSTM_SRC1 = 0x00000100  # TEST ID (Generic)
TSI_TEST_HDR10_SSTM_SRC2 = 0x00000101  # TEST ID (Generic)
TSI_TEST_HDR10_SSTM_SRC3 = 0x00000102  # TEST ID (Generic)
TSI_TEST_HDR10_SSTM_SRC4 = 0x00000103  # TEST ID (Generic)
TSI_TEST_HDR10_SSTM_SRC5 = 0x00000104  # TEST ID (Generic)
TSI_TEST_HDR10_SSTM_SRC6 = 0x00000105  # TEST ID (Generic)
TSI_TEST_HDR10_SRC1 = 0x00000200  # TEST ID (Generic)
TSI_TEST_HDR10_SRC2 = 0x00000201  # TEST ID (Generic)
TSI_TEST_HDR10_SRC3 = 0x00000202  # TEST ID (Generic)
TSI_TEST_HDR10_SRC4 = 0x00000203  # TEST ID (Generic)
TSI_TEST_HDR10_SRC5 = 0x00000204  # TEST ID (Generic)
TSI_TEST_HDR10_SRC6 = 0x00000205  # TEST ID (Generic)
TSI_TEST_HDR10_SRC7 = 0x00000206  # TEST ID (Generic)
TSI_TEST_HDR10_SRC8 = 0x00000207  # TEST ID (Generic)
TSI_TEST_HDR10_SRC9 = 0x00000208  # TEST ID (Generic)
TSI_TEST_HDR10_SRC10 = 0x00000209  # TEST ID (Generic)
TSI_TEST_HDR10_SRC11 = 0x0000020A  # TEST ID (Generic)
TSI_TEST_HDR10_SRC12 = 0x0000020B  # TEST ID (Generic)
TSI_TEST_HDR10_SRC13 = 0x0000020C  # TEST ID (Generic)
TSI_TEST_HDR10_SRC14 = 0x0000020D  # TEST ID (Generic)
TSI_TEST_HDR10_SRC15 = 0x0000020E  # TEST ID (Generic)
TSI_TEST_HDR10_SRC16 = 0x0000020F  # TEST ID (Generic)
TSI_TEST_HDR10_SRC17 = 0x00000210  # TEST ID (Generic)
TSI_TEST_HDR10_SRC18 = 0x00000211  # TEST ID (Generic)
TSI_TEST_HDR10_SRC19 = 0x00000212  # TEST ID (Generic)
TSI_TEST_HDR10_SRC20 = 0x00000213  # TEST ID (Generic)
TSI_TEST_HDR10_SRC21 = 0x00000214  # TEST ID (Generic)
TSI_TEST_HDR10_SRC22 = 0x00000215  # TEST ID (Generic)
TSI_TEST_HDR10_SRC23 = 0x00000216  # TEST ID (Generic)
TSI_TEST_HDR10_SRC24 = 0x00000217  # TEST ID (Generic)
TSI_TEST_HDR10_SRC25 = 0x00000218  # TEST ID (Generic)
TSI_TEST_HDR10_SRC26 = 0x00000219  # TEST ID (Generic)
TSI_TEST_HDR10_SRC27 = 0x0000021A  # TEST ID (Generic)
TSI_TEST_HDR10_SRC28 = 0x0000021B  # TEST ID (Generic)
TSI_TEST_HDR10_SRC29 = 0x0000021C  # TEST ID (Generic)
TSI_TEST_HDR10_SRC30 = 0x0000021D  # TEST ID (Generic)
TSI_TEST_HDR10_SRC31 = 0x0000021E  # TEST ID (Generic)
TSI_TEST_HDR10_SRC32 = 0x0000021F  # TEST ID (Generic)
TSI_TEST_HDR10_SRC33 = 0x00000220  # TEST ID (Generic)
TSI_TEST_HDR10_SRC34 = 0x00000221  # TEST ID (Generic)
TSI_TEST_HDR10_SRC35 = 0x00000222  # TEST ID (Generic)

TSI_TEST_HDMI_EL_POWER_LINE = 0x00020000  # TEST ID (UCD-301 HDMI specific)
TSI_TEST_HDMI_EL_HPD_LINE = 0x00020002  # TEST ID (UCD-301 HDMI specific)
TSI_TEST_HDMI_EL_DDC_CEC_LINES = 0x00020003  # TEST ID (UCD-301 HDMI specific)
TSI_TEST_HDMI_EL_TMDS_LINES = 0x00020001  # TEST ID (UCD-301 HDMI specific)
TSI_TEST_HDMI_CEC = 0x00050000  # TEST ID (UCD-301 HDMI specific)
TSI_TEST_DP_EL_MAIN_LINK = 0x00010001  # TEST ID (UCD-301 DP specific)
TSI_TEST_DP_EL_AUX_LINE = 0x00010002  # TEST ID (UCD-301 DP specific)
TSI_TEST_DP_EL_HPD_LINE = 0x00010000  # TEST ID (UCD-301 DP specific)
TSI_TEST_DP_SIMPLE_LINK = 0x00070000  # TEST ID (UCD-300 DP specific)
TSI_TEST_USBC_CC_VCON = 0x000c0000  # TEST ID (UCD-340 specific)
TSI_TEST_USBC_SBU_DP_AUX = 0x000c0001  # TEST ID (UCD-340 specific)
TSI_TEST_USBC_DUT_PWR_SINK = 0x000c0002  # TEST ID (UCD-340 specific)
TSI_TEST_USBC_DUT_PWR_SOURCE = 0x000c0003  # TEST ID (UCD-340 specific)
TSI_TEST_DP_VIDEO_CRC_SINGLE_REF = 0x00060000  # TEST ID (UCD-300 DP specific)
TSI_TEST_DP_CRC_VIDEO_STABILITY = 0x00060001  # TEST ID (UCD-300 DP specific)
TSI_TEST_DP_CRC_VIDEO_SEQUENCE = 0x00060002  # TEST ID (UCD-300 DP specific)
TSI_TEST_DP_CRC_CONT_VIDEO_SEQUENCE = 0x00060003  # TEST ID (UCD-300 DP specific)
TSI_TEST_HD_VIDEO_CRC_SINGLE_REF = 0x000b0000  # TEST ID (UCD-300 HDMI specific)
TSI_TEST_HD_CRC_VIDEO_STABILITY = 0x000b0001  # TEST ID (UCD-300 HDMI specific)
TSI_TEST_HD_CRC_VIDEO_SEQUENCE = 0x000b0002  # TEST ID (UCD-300 HDMI specific)
TSI_TEST_HD_CRC_CONT_VIDEO_SEQUENCE = 0x000b0003  # TEST ID (UCD-300 HDMI specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_1_1 = 0x000e0000  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_1_2 = 0x000e0001  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_1 = 0x000e0002  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_2 = 0x000e0003  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_3 = 0x000e0004  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_4 = 0x000e0005  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_5 = 0x000e0006  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_6 = 0x000e0007  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_7 = 0x000e0008  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_8 = 0x000e0009  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_9 = 0x000e000a  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_2_2_10 = 0x000e000b  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_1 = 0x000e000c  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_2 = 0x000e000d  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_3 = 0x000e000e  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_4 = 0x000e000f  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_5 = 0x000e0010  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_6 = 0x000e0011  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_7 = 0x000e0012  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_8 = 0x000e0013  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_9 = 0x000e0014  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_10 = 0x000e0015  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_1_11 = 0x000e0016  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_2_1 = 0x000e0017  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_2_2 = 0x000e0018  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_2_3 = 0x000e0019  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_2_4 = 0x000e001a  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_2_5 = 0x000e001b  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_3_3_1 = 0x000e001c  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_4_1_1 = 0x000e001d  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_4_1_2 = 0x000e001e  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_4_1_3 = 0x000e001f  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_4_2 = 0x000e0020  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_4_4_3 = 0x000e0021  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_400_1_1 = 0x000e0022  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_400_1_2 = 0x000e0023  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_400_1_3 = 0x000e0024  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_400_2_1 = 0x000e0025  # TEST ID (UCD-400 DP sink specific)
TSI_DP14_LL_CTS_SRC_DUT_400_2_2 = 0x000e0026  # TEST ID (UCD-400 DP sink specific)
# !CI_PARSE_ENABLE


# !CI_PARSE_DISABLE
TSI_TEST_VIDEO_CRC_SINGLE_REF = TSI_TEST_DP_VIDEO_CRC_SINGLE_REF
TSI_TEST_CRC_VIDEO_STABILITY = TSI_TEST_DP_CRC_VIDEO_STABILITY
TSI_TEST_CRC_VIDEO_SEQUENCE = TSI_TEST_DP_CRC_VIDEO_SEQUENCE
TSI_TEST_CRC_CONT_VIDEO_SEQUENCE = TSI_TEST_DP_CRC_CONT_VIDEO_SEQUENCE
# !CI_PARSE_ENABLE


# !CI_PARSE_DISABLE
TSI_OFMODE_RUN_EXTERNAL = 1
TSI_OFMODE_RUN_INTERNAL = 2
TSI_OFMODE_RUN_CALL_PROCEEDURE = 3
TSI_OFMODE_RUN_CALL_STRUCT_PROCEDURE = 4
TSI_OFMODE_RUN_CALL_STRUCT_PROCEDURE_AND_RESULT = 5

TSI_OPF_RETURN_CODE_ABORT = 0
TSI_OPF_RETURN_CODE_FAIL = 1
TSI_OPF_RETURN_CODE_PASS = 2
TSI_OPF_RETURN_CODE_PROCEED = 3
TSI_OPF_RETURN_CODE_AUTO_CLOSED = 4

TSI_OPF_LED_NONE = 0
TSI_OPF_LED_GRAY = 1
TSI_OPF_LED_RED = 2
TSI_OPF_LED_GREEN = 3

TSI_OPF_CONTROL_ABORT = 1
TSI_OPF_CONTROL_FAIL = 2
TSI_OPF_CONTROL_PASS = 4
TSI_OPF_CONTROL_PROCEED = 8


class TSI_OPF_PARAMETER(Structure):
    _fields_ = [
        ('StatusLED', c_int),
        ('Name', c_char_p),
        ('Description', c_char_p),
    ]

    @property
    def name(self):
        return self.Name.decode('UTF-8')

    @property
    def description(self):
        return self.Description.decode('UTF-8')


class TSI_OPF_DATA_BLOCK(Structure):
    _fields_ = [
        ('Sync', c_uint),
        ('Length', c_uint),
        ('Data', c_void_p)
    ]


class TSI_OPF_CALLBACK_STRUCT(Structure):
    _fields_ = [

        ('ID', c_uint),
        ('Title', c_char_p),
        ('Request', c_char_p),
        ('Request2', c_char_p),

        ('Parameters', POINTER(TSI_OPF_PARAMETER)),
        ('ParameterCount', c_uint),

        ('DialogControls', c_int),

        ('OwnerObject', c_void_p),
        ('UpdateParameters', WINFUNCTYPE(c_bool, c_void_p, POINTER(TSI_OPF_PARAMETER), c_uint) if platform.system() == 'Windows' else CFUNCTYPE(c_bool, c_void_p, POINTER(TSI_OPF_PARAMETER), c_uint)),
        ('IsDialogStillShown', WINFUNCTYPE(c_bool, c_void_p) if platform.system() == 'Windows' else CFUNCTYPE(c_bool, c_void_p)),
        ('WriteOpfDialogReply', WINFUNCTYPE(c_bool, c_void_p, c_uint32, c_uint32, c_int) if platform.system() == 'Windows' else CFUNCTYPE(c_bool, c_void_p, c_uint32, c_uint32, c_int)),

        ('DataBlocks', POINTER(TSI_OPF_DATA_BLOCK)),
        ('DataBlocksCount', c_uint),

        ('SessionId', c_uint)
    ]

    def id(self) -> int:
        return self.ID

    def parameters(self) -> List[TSI_OPF_PARAMETER]:
        return list(self.Parameters[:self.ParameterCount])

    def title(self) -> str:
        return self.Title.decode("utf-8")

    def request1(self) -> str:
        return self.Request.decode("utf-8")

    def request2(self) -> str:
        return self.Request2.decode("utf-8")

    def write_opf_result(self, opf_reply: int) -> int:
        return TSI_OPF_CONTROL_PASS if self.WriteOpfDialogReply(self.OwnerObject, self.ID, self.SessionId, c_int(opf_reply)) else TSI_OPF_CONTROL_ABORT

    def session_id(self) -> int:
        return self.SessionId


# !CI_PARSE_ENABLE


# !CI_PARSE_DISABLE
TSI_TEST_PASSED = TSI_SUCCESS  # Test completed with success.
TSI_TEST_FAILED = 1  # Test failed: (Too many) errors found.
TSI_TEST_NOT_STARTED = 2  # Test skipped: non-error situation preventing test to run.
TSI_TEST_ABORTED = 3  # Test aborted: by user command or automatically by device.
TSI_TEST_NOT_PASSED = TSI_TEST_FAILED  # Provided for compatibility.

TSI_GT_CFG_FIRST = 0x00000000  # Normal config parameters: 3200 DWORDs available.
TSI_GT_CFG_LAST = 0x00000c7f  # Last valid normal parameter CI.
TSI_GT_CFG_EXT_FIRST = 0x00001000  # Extended parameters per test: 61440 DWORDS available.
TSI_GT_CFG_EXT_LAST = 0x0000ffff  # Last valid EXTENDED parameter CI
# !CI_PARSE_ENABLE

TSI_GT_CONFIG_START = 0x01000000  # Start of Reserved CI range for generic tests
TSI_GT_CONFIG_END = 0x01ffffff  # End of Reserved CI range for generic tests
TSI_GT_SET_MASK = 0x00ff0000  # AND with a test ID -> test set ID at bits 23:16
TSI_GT_NORMAL_CONFIG_CI_COUNT_R = 0x01000ff0  # OR with test set ID to access.
TSI_GT_EXTENDED_CONFIG_CI_COUNT = 0x01000ff1  # OR with test set ID to access.
# NOTE TSI_GT_EXTENDED_CONFIG_CI_COUNT returns maximum number of extended parameters.
# Write sets actual number of extended configuration sent to the device.

TSI_R_GT_NORMAL_CONFIG_CI_COUNT = TSI_GT_NORMAL_CONFIG_CI_COUNT_R

TSI_TEST_LENGTH = TSI_BASE_LEGACY_VIDTEST(0x0)  # As number of consequent frames
TSI_LIM_FRAME_MISMATCHES = TSI_BASE_LEGACY_VIDTEST(0x1)  # As number of frames.
TSI_LIM_PIXEL_MISMATCHES = TSI_BASE_LEGACY_VIDTEST(0x2)  # As number of pixels.
TSI_PIXEL_TOLERANCE = TSI_BASE_LEGACY_VIDTEST(0x3)  # As absolute difference vs. reference.
TSI_VIDEO_TEST_RAW_RESULTS_DATA_R = TSI_BASE_LEGACY_VIDTEST(
    0x8)  # Raw results data. Please refer to TSI reference manual for data format info.
TSI_HDCP_REQUIREMENT = TSI_BASE_LEGACY_VIDTEST(
    0x9)  # Input HDCP capability state. -1 = Require NO HDCP, 0 = Don't care (Default), 1 = Require HDCP 1.x

TSI_MAX_AUTO_SAVE_FAILED = TSI_BASE_LEGACY_VIDTEST(
    0x80)  # Max. number of failed frames to save into target folder per test.
TSI_FAILED_FRAME_TARGET_FOLDER = TSI_BASE_LEGACY_VIDTEST(0x81)  # String: Target folder for save frames.
TSI_MAX_EXPORT_FAILED = TSI_BASE_LEGACY_VIDTEST(0x82)  # Max. number of failed frames to export per test.
TSI_EXPORT_TO_PPM = 0x1083  # Export frames to ppm format. Obsolete use TSI_EXPORT_FORMAT instead
TSI_EXPORT_FORMAT = 0x1084
TSI_EXPORT_ALIGN_12 = 0x1085

TSI_EXPORTED_FRAME_COUNT_R = TSI_BASE_LEGACY_VIDTEST(0x8e)  # Number of exported frames available.
TSI_EXPORT_ACCESS_INDEX_W = TSI_BASE_LEGACY_VIDTEST(
    0x8f)  # Which exported frame to access with config ID values 0x1090 to 0x1097
TSI_EXPORT_WIDTH_R = TSI_BASE_LEGACY_VIDTEST(0x90)  # As number of elements.
TSI_EXPORT_HEIGHT_R = TSI_BASE_LEGACY_VIDTEST(0x91)  # As number of elements.
TSI_EXPORT_ELEMENT_SIZE_R = TSI_BASE_LEGACY_VIDTEST(0x92)  # As number of bytes.
TSI_EXPORT_ELEMENT_WIDTH_R = TSI_BASE_LEGACY_VIDTEST(0x93)
TSI_EXPORT_ELEMENT_HEIGHT_R = TSI_BASE_LEGACY_VIDTEST(0x94)
TSI_EXPORT_COLOR_DEPTH_R = TSI_BASE_LEGACY_VIDTEST(0x95)  # As bits per color-channel
TSI_EXPORT_ELEMENT_FORMAT_R = TSI_BASE_LEGACY_VIDTEST(0x96)
TSI_EXPORT_FRAME_DATA_R = TSI_BASE_LEGACY_VIDTEST(0x97)  # Pointer to image data.

TSI_EXPORT_PIXELS_PER_ELEMENT = TSI_EXPORT_ELEMENT_WIDTH_R
TSI_EXPORT_LINES_PER_ELEMENT = TSI_EXPORT_ELEMENT_HEIGHT_R
TSI_EXPORT_PIXEL_FORMAT = TSI_EXPORT_ELEMENT_FORMAT_R
TSI_R_VIDEO_TEST_RAW_RESULTS_DATA = TSI_VIDEO_TEST_RAW_RESULTS_DATA_R
TSI_EXPORTED = TSI_EXPORTED_FRAME_COUNT_R
TSI_EXPORT_ACCESS_INDEX = TSI_EXPORT_ACCESS_INDEX_W
TSI_EXPORT_WIDTH = TSI_EXPORT_WIDTH_R
TSI_EXPORT_HEIGHT = TSI_EXPORT_HEIGHT_R
TSI_EXPORT_ELEMENT_SIZE = TSI_EXPORT_ELEMENT_SIZE_R
TSI_EXPORT_ELEMENT_WIDTH = TSI_EXPORT_ELEMENT_WIDTH_R
TSI_EXPORT_ELEMENT_HEIGHT = TSI_EXPORT_ELEMENT_HEIGHT_R
TSI_EXPORT_COLOR_DEPTH = TSI_EXPORT_COLOR_DEPTH_R
TSI_EXPORT_ELEMENT_FORMAT = TSI_EXPORT_ELEMENT_FORMAT_R
TSI_EXPORT_FRAME_DATA = TSI_EXPORT_FRAME_DATA_R

TSI_AUDIO_TEST_SAVE_NONE = 0
TSI_AUDIO_TEST_SAVE_FAILED = 1
TSI_AUDIO_TEST_SAVE_ALL = 2

TSI_EXPECTED_SAMPLE_RATE = TSI_BASE_LEGACY_AUDTEST(0x0)
TSI_EXPECTED_AUDIO_FREQUENCY = TSI_BASE_LEGACY_AUDTEST(0x1)
TSI_AUDIO_FREQUENCY_TOLERANCE = TSI_BASE_LEGACY_AUDTEST(0x2)
TSI_AUDIO_GLITCH_DETECT_TRESHOLD = TSI_BASE_LEGACY_AUDTEST(
    0x3)  # Treshold value used to detect audible clicks caused by dropped or duplicated samples.
# FIXED POINT: Default 5.0 (Encoded with 16 bit scaling Actual value is 327680)
TSI_AUDIO_GLITCHES_ALLOWED = TSI_BASE_LEGACY_AUDTEST(0x4)
TSI_AUDIO_TEST_SAVE_CONDITIONS = TSI_BASE_LEGACY_AUDTEST(0x5)
TSI_AUDIO_TEST_STORAGE_FOLDER = TSI_BASE_LEGACY_AUDTEST(0x6)

TSI_TDATA_BLOCK_FIRST_R = 0x0000f800
TSI_TDATA_BLOCK_LAST_R = 0x0000ffd0
# !CI_PARSE_DISABLE
TSI_TDATA_BLOCK_WORD_COUNT_R = (1 + TSI_TDATA_BLOCK_LAST_R - TSI_TDATA_BLOCK_FIRST_R)
# !CI_PARSE_ENABLE
# HDR10+ CTS parameters
TSI_HDR10_CTS_DISTR_SAME_FRAME = 0x202A  # Metadata at the same frame of associated video (0) or at one frame advance (1). Default 0
TSI_HDR10_CTS_DISTR_TIMEOUT = 0x202B  # Test timeout, sec
TSI_HDR10_TEMP_FOLDER = 0x202C  # Folder to save captured events and video of test #13

TSI_TDATA_BLOCK_SIZE_R = 0x0000ffff  # Number of bytes available from TDATA CI 0xf800.

# Low-level test specific defines.
TSI_R_TDATA_BLOCK_FIRST = TSI_TDATA_BLOCK_FIRST_R
TSI_TDATA_GENERIC_STRUCT_VERSION_R = TSI_R_TDATA_BLOCK_FIRST + 0

# Applicable to test 0x000c0000 "Up Face Port CC and VCONN test"
TSI_TDATA_USBC_EL_VCC1_R = TSI_R_TDATA_BLOCK_FIRST + 1  # CC1 line voltage, in mV
TSI_TDATA_USBC_EL_VCONN1_R = TSI_R_TDATA_BLOCK_FIRST + 2  # CC2 line voltage when in Vconn role, in mV
TSI_TDATA_USBC_EL_VCC2_R = TSI_R_TDATA_BLOCK_FIRST + 3  # CC2 line voltage, in mV
TSI_TDATA_USBC_EL_VCONN2_R = TSI_R_TDATA_BLOCK_FIRST + 4  # CC1 line voltage when in Vconn role, in mV

# Applicable to test 0x000c0001 "AUX (SBU) lines test"
TSI_TDATA_USBC_VAUX1_P_R = TSI_R_TDATA_BLOCK_FIRST + 1  # Voltage level on positive AUX line (direct cable mode), in mV
TSI_TDATA_USBC_VAUX1_N_R = TSI_R_TDATA_BLOCK_FIRST + 2  # Voltage level on negative AUX line (direct cable mode), in mV
TSI_TDATA_USBC_VAUX2_P_R = TSI_R_TDATA_BLOCK_FIRST + 3  # Voltage level on positive AUX line (crossed cable mode), in mV
TSI_TDATA_USBC_VAUX2_N_R = TSI_R_TDATA_BLOCK_FIRST + 4  # Voltage level on negative AUX line (crossed cable mode), in mV

# Applicable to tests 0x000c0002 "DUT as Power Sink"
#                     0x000c0003 "DUT as Power Source"
TSI_TDATA_USBC_EL_VBUS_V_R = TSI_R_TDATA_BLOCK_FIRST + 1  # Vbus voltage, in mV.
TSI_TDATA_USBC_EL_VBUS_I1_R = TSI_R_TDATA_BLOCK_FIRST + 2  # Vbus current, line 1, in mA.
TSI_TDATA_USBC_EL_VBUS_I2_R = TSI_R_TDATA_BLOCK_FIRST + 3  # Vbus current, line 2, in mA.
TSI_TDATA_USBC_EL_VBUS_I3_R = TSI_R_TDATA_BLOCK_FIRST + 4  # Vbus current, line 3, in mA.
TSI_TDATA_USBC_EL_VBUS_I4_R = TSI_R_TDATA_BLOCK_FIRST + 5  # Vbus current, line 4, in mA.
TSI_TDATA_USBC_EL_GND_I1_R = TSI_R_TDATA_BLOCK_FIRST + 6  # Gnd current, line 1, in mA.
TSI_TDATA_USBC_EL_GND_I2_R = TSI_R_TDATA_BLOCK_FIRST + 7  # Gnd current, line 2, in mA.
TSI_TDATA_USBC_EL_GND_I3_R = TSI_R_TDATA_BLOCK_FIRST + 8  # Gnd current, line 3, in mA.
TSI_TDATA_USBC_EL_GND_I4_R = TSI_R_TDATA_BLOCK_FIRST + 9  # Gnd current, line 4, in mA.

TSI_R_TDATA_BLOCK_LAST = TSI_TDATA_BLOCK_LAST_R
TSI_R_TDATA_BLOCK_WORD_COUNT = TSI_TDATA_BLOCK_WORD_COUNT_R
TSI_R_TDATA_BLOCK_SIZE = TSI_TDATA_BLOCK_SIZE_R
TSI_R_TDATA_GENERIC_STRUCT_VERSION = TSI_TDATA_GENERIC_STRUCT_VERSION_R
TSI_R_TDATA_USBC_EL_VCC1 = TSI_TDATA_USBC_EL_VCC1_R
TSI_R_TDATA_USBC_EL_VCONN1 = TSI_TDATA_USBC_EL_VCONN1_R
TSI_R_TDATA_USBC_EL_VCC2 = TSI_TDATA_USBC_EL_VCC2_R
TSI_R_TDATA_USBC_EL_VCONN2 = TSI_TDATA_USBC_EL_VCONN2_R
TSI_R_TDATA_USBC_VAUX1_P = TSI_TDATA_USBC_VAUX1_P_R
TSI_R_TDATA_USBC_VAUX1_N = TSI_TDATA_USBC_VAUX1_N_R
TSI_R_TDATA_USBC_VAUX2_P = TSI_TDATA_USBC_VAUX2_P_R
TSI_R_TDATA_USBC_VAUX2_N = TSI_TDATA_USBC_VAUX2_N_R
TSI_R_TDATA_USBC_EL_VBUS_V = TSI_TDATA_USBC_EL_VBUS_V_R
TSI_R_TDATA_USBC_EL_VBUS_I1 = TSI_TDATA_USBC_EL_VBUS_I1_R
TSI_R_TDATA_USBC_EL_VBUS_I2 = TSI_TDATA_USBC_EL_VBUS_I2_R
TSI_R_TDATA_USBC_EL_VBUS_I3 = TSI_TDATA_USBC_EL_VBUS_I3_R
TSI_R_TDATA_USBC_EL_VBUS_I4 = TSI_TDATA_USBC_EL_VBUS_I4_R
TSI_R_TDATA_USBC_EL_GND_I1 = TSI_TDATA_USBC_EL_GND_I1_R
TSI_R_TDATA_USBC_EL_GND_I2 = TSI_TDATA_USBC_EL_GND_I2_R
TSI_R_TDATA_USBC_EL_GND_I3 = TSI_TDATA_USBC_EL_GND_I3_R
TSI_R_TDATA_USBC_EL_GND_I4 = TSI_TDATA_USBC_EL_GND_I4_R

TSI_DP_RX_TEST_TIMEOUT = TSI_BASE_DP_RX(0x0)
TSI_DP_RX_LINKS_LOW_VOLTAGE = TSI_BASE_DP_RX(0x1)
TSI_DP_RX_LINKS_HI_VOLTAGE = TSI_BASE_DP_RX(0x2)
TSI_DP_RX_HPD_ZERO_LOW_VOLTAGE = TSI_BASE_DP_RX(0x3)
TSI_DP_RX_HPD_ZERO_HI_VOLTAGE = TSI_BASE_DP_RX(0x4)
TSI_DP_RX_HPD_ONE_LOW_VOLTAGE = TSI_BASE_DP_RX(0x5)
TSI_DP_RX_HPD_ONE_HI_VOLTAGE = TSI_BASE_DP_RX(0x6)
TSI_DP_RX_AUX_P_IDLE_LOW_VOLTAGE = TSI_BASE_DP_RX(0x7)
TSI_DP_RX_AUX_P_IDLE_HI_VOLTAGE = TSI_BASE_DP_RX(0x8)
TSI_DP_RX_AUX_N_IDLE_LOW_VOLTAGE = TSI_BASE_DP_RX(0x9)
TSI_DP_RX_AUX_N_IDLE_HI_VOLTAGE = TSI_BASE_DP_RX(0xa)
TSI_DP_RX_AUX_P_TRIG_VOLTAGE = TSI_BASE_DP_RX(0xb)
TSI_DP_RX_AUX_N_TRIG_VOLTAGE = TSI_BASE_DP_RX(0xc)
TSI_DP_RX_AUX_SIGNAL_CAPT_TIMEOUT = TSI_BASE_DP_RX(0xd)
TSI_DP_RX_AUX_SIGNAL_CAPT_TRIES = TSI_BASE_DP_RX(0xe)
TSI_DP_RX_DUT_MAX_LANE_COUNT = TSI_BASE_DP_RX(0xf)
TSI_DP_RX_DUT_MAX_LINK_RATE = TSI_BASE_DP_RX(0x10)
TSI_DP_RX_DUT_TA_CAPS = TSI_BASE_DP_RX(0x12)

TSI_DP_RX_DUT_CAPS = TSI_BASE_DP_RX(0x11)
TSI_DP_RX_MAX_DUT_MAX_LANES = TSI_DP_RX_DUT_MAX_LANE_COUNT
TSI_DP_RX_MAX_DUT_LANE_RATE = TSI_DP_RX_DUT_MAX_LINK_RATE

TSI_HDMI_RX_TIMEOUT = TSI_BASE_HDMI_RX(0x0)
TSI_HDMI_RX_POWER_LOW_LIMIT = TSI_BASE_HDMI_RX(0x1)
TSI_HDMI_RX_POWER_HIGH_LIMIT = TSI_BASE_HDMI_RX(0x2)
TSI_HDMI_RX_LINK_LOW_LIMIT = TSI_BASE_HDMI_RX(0x3)
TSI_HDMI_RX_LINK_HIGH_LIMIT = TSI_BASE_HDMI_RX(0x4)
TSI_HDMI_RX_HPD_ZERO_LOW_LIMIT = TSI_BASE_HDMI_RX(0x5)
TSI_HDMI_RX_HPD_ZERO_HIGH_LIMIT = TSI_BASE_HDMI_RX(0x6)
TSI_HDMI_RX_HPD_ONE_LOW_LIMIT = TSI_BASE_HDMI_RX(0x7)
TSI_HDMI_RX_HPD_ONE_HIGHT_LIMIT = TSI_BASE_HDMI_RX(0x8)
TSI_HDMI_RX_DDC_LOW_LIMIT = TSI_BASE_HDMI_RX(0x9)
TSI_HDMI_RX_DDC_HIGH_LIMIT = TSI_BASE_HDMI_RX(0xa)
TSI_HDMI_RX_CEC_ZERO_LOW_LIMIT = TSI_BASE_HDMI_RX(0xb)
TSI_HDMI_RX_CEC_ZERO_HIGH_LIMIT = TSI_BASE_HDMI_RX(0xc)
TSI_HDMI_RX_CEC_ONE_LOW_LIMIT = TSI_BASE_HDMI_RX(0xd)
TSI_HDMI_RX_CEC_ONE_HIGH_LIMIT = TSI_BASE_HDMI_RX(0xe)

TSI_CRC_TIMEOUT = TSI_BASE_CRC_VIDEO(0x0)
TSI_CRC_FRAMES_TO_TEST = TSI_BASE_CRC_VIDEO(0x1)
TSI_CRC_REF_FRAME_COUNT = TSI_BASE_CRC_VIDEO(0x2)
TSI_CRC_LIM_FRAME_MISMATCHES = TSI_BASE_CRC_VIDEO(0x3)
TSI_CRC_REF_WIDTH = TSI_BASE_CRC_VIDEO(0x4)
TSI_CRC_REF_HEIGHT = TSI_BASE_CRC_VIDEO(0x5)
TSI_CRC_REF_COLORDEPTH = TSI_BASE_CRC_VIDEO(0x6)
TSI_CRC_REQUIRED_FRAME_RATE = TSI_BASE_CRC_VIDEO(0x7)
TSI_CRC_FRAME_RATE_TOLERANCE = TSI_BASE_CRC_VIDEO(0x8)
TSI_CRC_REFERENCE_CRC_VALUES = TSI_BASE_CRC_VIDEO(0x9)
TSI_CRC_MOTION_TEST_ITERATIONS = TSI_BASE_CRC_VIDEO(0xc)
TSI_CRC_COLOR_FORMAT = TSI_BASE_CRC_VIDEO(0xd)
TSI_CRC_DATA_TRANSFER_TIMEOUT = TSI_BASE_CRC_VIDEO(0x17)
TSI_CRC_FAILED_FRAME_TARGET_FOLDER = TSI_BASE_CRC_VIDEO(0x20)  # Directory to save failed video frames to
TSI_CRC_MAX_EXPORT_FAILED = TSI_BASE_CRC_VIDEO(0x22)  # Max number of failed frames to save
TSI_CRC_EXPORT_FORMAT = TSI_BASE_CRC_VIDEO(0x23)  # Export format (0 - bin, 1 - ppm, 2 - bmp)
TSI_CRC_ALIGN_12 = TSI_BASE_CRC_VIDEO(0x21)  # Align exported bin images to msb

TSI_HDMI_RX_CEC_TIMEOUT = TSI_BASE_HDMI_RX_CEC(0x0)
TSI_HDMI_RX_CEC_LOCAL_PHY_ADDR = TSI_BASE_HDMI_RX_CEC(0x1)

TSI_USBC_EL_TIMEOUT = TSI_BASE_USBC_EL(0x0)
TSI_USBC_EL_DUT_CAPS = TSI_BASE_USBC_EL(0x1)
TSI_USBC_EL_REPLUG_TIME = TSI_BASE_USBC_EL(0x2)
TSI_USBC_EL_DUT_ATTACH_TIMEOUT = TSI_BASE_USBC_EL(0x3)
TSI_USBC_EL_PWR_CONTRACT_TIMEOUT = TSI_BASE_USBC_EL(0x4)
TSI_USBC_EL_CC_LOW_VOLTAGE_1 = TSI_BASE_USBC_EL(0x5)
TSI_USBC_EL_CC_HI_VOLTAGE_1 = TSI_BASE_USBC_EL(0x6)
TSI_USBC_EL_CC_LOW_VOLTAGE_2 = TSI_BASE_USBC_EL(0x7)
TSI_USBC_EL_CC_HI_VOLTAGE_2 = TSI_BASE_USBC_EL(0x8)
TSI_USBC_EL_CC_LOW_VOLTAGE_3 = TSI_BASE_USBC_EL(0x9)
TSI_USBC_EL_CC_HI_VOLTAGE_3 = TSI_BASE_USBC_EL(0xa)
TSI_USBC_EL_VCON_LOW_VOLTAGE = TSI_BASE_USBC_EL(0xb)
TSI_USBC_EL_VCON_HI_VOLTAGE = TSI_BASE_USBC_EL(0xc)
TSI_USBC_EL_DP_ALT_TIMEOUT = TSI_BASE_USBC_EL(0xd)
TSI_USBC_EL_AUX_P_IDLE_LOW_VOLTAGE = TSI_BASE_USBC_EL(0xe)
TSI_USBC_EL_AUX_P_IDLE_HI_VOLTAGE = TSI_BASE_USBC_EL(0xf)
TSI_USBC_EL_AUX_N_IDLE_LOW_VOLTAGE = TSI_BASE_USBC_EL(0x10)
TSI_USBC_EL_AUX_N_IDLE_HI_VOLTAGE = TSI_BASE_USBC_EL(0x11)
TSI_USBC_EL_VBUS_LOW_VOLTAGE = TSI_BASE_USBC_EL(0x12)
TSI_USBC_EL_VBUS_HI_VOLTAGE = TSI_BASE_USBC_EL(0x13)
TSI_USBC_EL_VBUS_CURRENT_MAX_DEV = TSI_BASE_USBC_EL(0x14)
TSI_USBC_EL_GND_CURRENT_MAX_DEV = TSI_BASE_USBC_EL(0x15)
TSI_USBC_EL_PWR_MEASURE_DELAY = TSI_BASE_USBC_EL(0x16)
TSI_USBC_EL_MIN_DUT_CURRENT = TSI_BASE_USBC_EL(0x17)
TSI_USBC_EL_RES_ON_DELAY = TSI_BASE_USBC_EL(0x18)
TSI_USBC_EL_CC_MEASURE_DELAY = TSI_BASE_USBC_EL(0x19)

TSI_DP_LTT_TIMEOUT = TSI_BASE_DP_LTT(0x00)
TSI_DP_LTT_MAX_LANE_COUNT = TSI_BASE_DP_LTT(0x01)
TSI_DP_LTT_MAX_RATE = TSI_BASE_DP_LTT(0x02)
TSI_DP_LTT_HPD_PULSE_DURATION = TSI_BASE_DP_LTT(0x05)
TSI_DP_LTT_LT_START_TIMEOUT = TSI_BASE_DP_LTT(0x06)
TSI_DP_LTT_TEST_LOOP_DELAY = TSI_BASE_DP_LTT(0x07)

TSI_DP14_SRCCTS_TIMEOUT = TSI_BASE_DP14_SRCCTS(0)
TSI_DP14_SRCCTS_MAX_LANES = TSI_BASE_DP14_SRCCTS(1)
TSI_DP14_SRCCTS_MAX_LINK_RATE = TSI_BASE_DP14_SRCCTS(2)
TSI_DP14_SRCCTS_DUT_CAPS = TSI_BASE_DP14_SRCCTS(3)
TSI_DP14_SRCCTS_DUT_TA = TSI_BASE_DP14_SRCCTS(4)
TSI_DP14_SRCCTS_LONG_HPD_PULSE = TSI_BASE_DP14_SRCCTS(5)
TSI_DP14_SRCCTS_LT_START_TIMEOUT = TSI_BASE_DP14_SRCCTS(6)
TSI_DP14_SRCCTS_TEST_CYCLE_DELAY = TSI_BASE_DP14_SRCCTS(7)
TSI_DP14_SRCCTS_COLOR_FORMATS = TSI_BASE_DP14_SRCCTS(8)
TSI_DP14_SRCCTS_FAILSAFE_MODE = TSI_BASE_DP14_SRCCTS(9)
TSI_DP14_SRCCTS_MAX_RESOLUTION = TSI_BASE_DP14_SRCCTS(10)
TSI_DP14_SRCCTS_DUT_LINK_RATES = TSI_BASE_DP14_SRCCTS(11)
TSI_DP14_SRCCTS_LTTPR_DEVICE_COUNT = TSI_BASE_DP14_SRCCTS(12)
TSI_DP14_SRCCTS_MIN_SAMPLE_RATE = TSI_BASE_DP14_SRCCTS(16)
TSI_DP14_SRCCTS_MAX_SAMPLE_RATE = TSI_BASE_DP14_SRCCTS(17)
TSI_DP14_SRCCTS_CHANNELS1 = TSI_BASE_DP14_SRCCTS(18)
TSI_DP14_SRCCTS_CH_ALLOC1 = TSI_BASE_DP14_SRCCTS(19)
TSI_DP14_SRCCTS_CHANNELS2 = TSI_BASE_DP14_SRCCTS(20)
TSI_DP14_SRCCTS_CH_ALLOC2 = TSI_BASE_DP14_SRCCTS(21)
TSI_DP14_SRCCTS_CHANNELS3 = TSI_BASE_DP14_SRCCTS(22)
TSI_DP14_SRCCTS_CH_ALLOC3 = TSI_BASE_DP14_SRCCTS(23)
TSI_DP14_SRCCTS_CHANNELS4 = TSI_BASE_DP14_SRCCTS(24)
TSI_DP14_SRCCTS_CH_ALLOC4 = TSI_BASE_DP14_SRCCTS(25)
TSI_DP14_SRCCTS_AUDIO_TEST_PATTERN = TSI_BASE_DP14_SRCCTS(26)
TSI_DP14_SRCCTS_EDID_SAMPLE_SIZE = TSI_BASE_DP14_SRCCTS(27)
TSI_DP14_SRCCTS_1L_MOST_PACKED = TSI_BASE_DP14_SRCCTS(32)
TSI_DP14_SRCCTS_2L_MOST_PACKED = TSI_BASE_DP14_SRCCTS(33)
TSI_DP14_SRCCTS_4L_MOST_PACKED = TSI_BASE_DP14_SRCCTS(34)
TSI_DP14_SRCCTS_1L_RBB = TSI_BASE_DP14_SRCCTS(35)
TSI_DP14_SRCCTS_2L_RBB = TSI_BASE_DP14_SRCCTS(36)
TSI_DP14_SRCCTS_4L_RBB = TSI_BASE_DP14_SRCCTS(37)
TSI_DP14_SRCCTS_1L_HBR = TSI_BASE_DP14_SRCCTS(38)
TSI_DP14_SRCCTS_2L_HBR = TSI_BASE_DP14_SRCCTS(39)
TSI_DP14_SRCCTS_4L_HBR = TSI_BASE_DP14_SRCCTS(40)
TSI_DP14_SRCCTS_1L_HBR2 = TSI_BASE_DP14_SRCCTS(41)
TSI_DP14_SRCCTS_2L_HBR2 = TSI_BASE_DP14_SRCCTS(42)
TSI_DP14_SRCCTS_4L_HBR2 = TSI_BASE_DP14_SRCCTS(43)
TSI_DP14_SRCCTS_1L_HBR3 = TSI_BASE_DP14_SRCCTS(44)
TSI_DP14_SRCCTS_2L_HBR3 = TSI_BASE_DP14_SRCCTS(45)
TSI_DP14_SRCCTS_4L_HBR3 = TSI_BASE_DP14_SRCCTS(46)
TSI_DP14_SRCCTS_COLOR_MODE_0 = TSI_BASE_DP14_SRCCTS(56)
TSI_DP14_SRCCTS_COLOR_MODE_1 = TSI_BASE_DP14_SRCCTS(57)
TSI_DP14_SRCCTS_COLOR_MODE_2 = TSI_BASE_DP14_SRCCTS(58)
TSI_DP14_SRCCTS_COLOR_MODE_3 = TSI_BASE_DP14_SRCCTS(59)
TSI_DP14_SRCCTS_COLOR_MODE_4 = TSI_BASE_DP14_SRCCTS(60)
TSI_DP14_SRCCTS_COLOR_MODE_5 = TSI_BASE_DP14_SRCCTS(61)
TSI_DP14_SRCCTS_COLOR_MODE_6 = TSI_BASE_DP14_SRCCTS(62)
TSI_DP14_SRCCTS_COLOR_MODE_7 = TSI_BASE_DP14_SRCCTS(63)
TSI_DP14_SRCCTS_COLOR_MODE_8 = TSI_BASE_DP14_SRCCTS(64)
TSI_DP14_SRCCTS_COLOR_MODE_9 = TSI_BASE_DP14_SRCCTS(65)
TSI_DP14_SRCCTS_COLOR_MODE_10 = TSI_BASE_DP14_SRCCTS(66)
TSI_DP14_SRCCTS_COLOR_MODE_11 = TSI_BASE_DP14_SRCCTS(67)
TSI_DP14_SRCCTS_COLOR_MODE_12 = TSI_BASE_DP14_SRCCTS(68)
TSI_DP14_SRCCTS_COLOR_MODE_13 = TSI_BASE_DP14_SRCCTS(69)
TSI_DP14_SRCCTS_COLOR_MODE_14 = TSI_BASE_DP14_SRCCTS(70)
TSI_DP14_SRCCTS_COLOR_MODE_15 = TSI_BASE_DP14_SRCCTS(71)
TSI_DP14_SRCCTS_COLOR_MODE_16 = TSI_BASE_DP14_SRCCTS(72)
TSI_DP14_SRCCTS_COLOR_MODE_17 = TSI_BASE_DP14_SRCCTS(73)
TSI_DP14_SRCCTS_COLOR_MODE_18 = TSI_BASE_DP14_SRCCTS(74)
TSI_DP14_SRCCTS_COLOR_MODE_19 = TSI_BASE_DP14_SRCCTS(75)
TSI_DP14_SRCCTS_COLOR_MODE_20 = TSI_BASE_DP14_SRCCTS(76)
TSI_DP14_SRCCTS_COLOR_MODE_21 = TSI_BASE_DP14_SRCCTS(77)
TSI_DP14_SRCCTS_COLOR_MODE_22 = TSI_BASE_DP14_SRCCTS(78)
TSI_DP14_SRCCTS_COLOR_MODE_23 = TSI_BASE_DP14_SRCCTS(79)
TSI_DP14_SRCCTS_COLOR_MODE_24 = TSI_BASE_DP14_SRCCTS(80)
TSI_DP14_SRCCTS_COLOR_MODE_25 = TSI_BASE_DP14_SRCCTS(81)
TSI_DP14_SRCCTS_COLOR_MODE_26 = TSI_BASE_DP14_SRCCTS(82)
TSI_DP14_SRCCTS_COLOR_MODE_27 = TSI_BASE_DP14_SRCCTS(83)
TSI_DP14_SRCCTS_COLOR_MODE_28 = TSI_BASE_DP14_SRCCTS(84)
TSI_DP14_SRCCTS_COLOR_MODE_29 = TSI_BASE_DP14_SRCCTS(85)
TSI_DP14_SRCCTS_COLOR_MODE_30 = TSI_BASE_DP14_SRCCTS(86)
TSI_DP14_SRCCTS_COLOR_MODE_31 = TSI_BASE_DP14_SRCCTS(87)
TSI_DP14_SRCCTS_DSC_DUT_MAX_SLICE = TSI_BASE_DP14_SRCCTS(88)
TSI_DP14_SRCCTS_DSC_VERSION = TSI_BASE_DP14_SRCCTS(89)
TSI_DP14_SRCCTS_DSC_VMT_0_ID = TSI_BASE_DP14_SRCCTS(90)
TSI_DP14_SRCCTS_DSC_VMT_0_LC_LR = TSI_BASE_DP14_SRCCTS(91)
TSI_DP14_SRCCTS_DSC_VMT_0_TIMINGS = TSI_BASE_DP14_SRCCTS(92)
TSI_DP14_SRCCTS_DSC_VMT_1_ID = TSI_BASE_DP14_SRCCTS(93)
TSI_DP14_SRCCTS_DSC_VMT_1_LC_LR = TSI_BASE_DP14_SRCCTS(94)
TSI_DP14_SRCCTS_DSC_VMT_1_TIMINGS = TSI_BASE_DP14_SRCCTS(95)
TSI_DP14_SRCCTS_DSC_VMT_2_ID = TSI_BASE_DP14_SRCCTS(96)
TSI_DP14_SRCCTS_DSC_VMT_2_LC_LR = TSI_BASE_DP14_SRCCTS(97)
TSI_DP14_SRCCTS_DSC_VMT_2_TIMINGS = TSI_BASE_DP14_SRCCTS(98)
TSI_DP14_SRCCTS_DSC_VMT_3_ID = TSI_BASE_DP14_SRCCTS(99)
TSI_DP14_SRCCTS_DSC_VMT_3_LC_LR = TSI_BASE_DP14_SRCCTS(100)
TSI_DP14_SRCCTS_DSC_VMT_3_TIMINGS = TSI_BASE_DP14_SRCCTS(101)
TSI_DP14_SRCCTS_DSC_VMT_4_ID = TSI_BASE_DP14_SRCCTS(102)
TSI_DP14_SRCCTS_DSC_VMT_4_LC_LR = TSI_BASE_DP14_SRCCTS(103)
TSI_DP14_SRCCTS_DSC_VMT_4_TIMINGS = TSI_BASE_DP14_SRCCTS(104)
TSI_DP14_SRCCTS_DSC_VMT_5_ID = TSI_BASE_DP14_SRCCTS(105)
TSI_DP14_SRCCTS_DSC_VMT_5_LC_LR = TSI_BASE_DP14_SRCCTS(106)
TSI_DP14_SRCCTS_DSC_VMT_5_TIMINGS = TSI_BASE_DP14_SRCCTS(107)
TSI_DP14_SRCCTS_DSC_VMT_6_ID = TSI_BASE_DP14_SRCCTS(108)
TSI_DP14_SRCCTS_DSC_VMT_6_LC_LR = TSI_BASE_DP14_SRCCTS(109)
TSI_DP14_SRCCTS_DSC_VMT_6_TIMINGS = TSI_BASE_DP14_SRCCTS(110)
TSI_DP14_SRCCTS_DSC_VMT_7_ID = TSI_BASE_DP14_SRCCTS(111)
TSI_DP14_SRCCTS_DSC_VMT_7_LC_LR = TSI_BASE_DP14_SRCCTS(112)
TSI_DP14_SRCCTS_DSC_VMT_7_TIMINGS = TSI_BASE_DP14_SRCCTS(113)
TSI_DP14_SRCCTS_DSC_VMT_8_ID = TSI_BASE_DP14_SRCCTS(114)
TSI_DP14_SRCCTS_DSC_VMT_8_LC_LR = TSI_BASE_DP14_SRCCTS(115)
TSI_DP14_SRCCTS_DSC_VMT_8_TIMINGS = TSI_BASE_DP14_SRCCTS(116)
TSI_DP14_SRCCTS_DSC_VMT_9_ID = TSI_BASE_DP14_SRCCTS(117)
TSI_DP14_SRCCTS_DSC_VMT_9_LC_LR = TSI_BASE_DP14_SRCCTS(118)
TSI_DP14_SRCCTS_DSC_VMT_9_TIMINGS = TSI_BASE_DP14_SRCCTS(119)
TSI_DP14_SRCCTS_DSC_VMT_10_ID = TSI_BASE_DP14_SRCCTS(120)
TSI_DP14_SRCCTS_DSC_VMT_10_LC_LR = TSI_BASE_DP14_SRCCTS(121)
TSI_DP14_SRCCTS_DSC_VMT_10_TIMINGS = TSI_BASE_DP14_SRCCTS(122)
TSI_DP14_SRCCTS_DSC_VMT_11_ID = TSI_BASE_DP14_SRCCTS(123)
TSI_DP14_SRCCTS_DSC_VMT_11_LC_LR = TSI_BASE_DP14_SRCCTS(124)
TSI_DP14_SRCCTS_DSC_VMT_11_TIMINGS = TSI_BASE_DP14_SRCCTS(125)
TSI_DP14_SRCCTS_DSC_COLOR_FORMATS = TSI_BASE_DP14_SRCCTS(126)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_0 = TSI_BASE_DP14_SRCCTS(127)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_1 = TSI_BASE_DP14_SRCCTS(128)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_2 = TSI_BASE_DP14_SRCCTS(129)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_3 = TSI_BASE_DP14_SRCCTS(130)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_4 = TSI_BASE_DP14_SRCCTS(131)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_5 = TSI_BASE_DP14_SRCCTS(132)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_6 = TSI_BASE_DP14_SRCCTS(133)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_7 = TSI_BASE_DP14_SRCCTS(134)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_8 = TSI_BASE_DP14_SRCCTS(135)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_9 = TSI_BASE_DP14_SRCCTS(136)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_10 = TSI_BASE_DP14_SRCCTS(137)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_11 = TSI_BASE_DP14_SRCCTS(138)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_12 = TSI_BASE_DP14_SRCCTS(139)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_13 = TSI_BASE_DP14_SRCCTS(140)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_14 = TSI_BASE_DP14_SRCCTS(141)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_15 = TSI_BASE_DP14_SRCCTS(142)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_16 = TSI_BASE_DP14_SRCCTS(143)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_17 = TSI_BASE_DP14_SRCCTS(144)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_18 = TSI_BASE_DP14_SRCCTS(145)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_19 = TSI_BASE_DP14_SRCCTS(146)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_20 = TSI_BASE_DP14_SRCCTS(147)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_21 = TSI_BASE_DP14_SRCCTS(148)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_22 = TSI_BASE_DP14_SRCCTS(149)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_23 = TSI_BASE_DP14_SRCCTS(150)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_24 = TSI_BASE_DP14_SRCCTS(151)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_25 = TSI_BASE_DP14_SRCCTS(152)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_26 = TSI_BASE_DP14_SRCCTS(153)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_27 = TSI_BASE_DP14_SRCCTS(154)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_28 = TSI_BASE_DP14_SRCCTS(155)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_29 = TSI_BASE_DP14_SRCCTS(156)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_30 = TSI_BASE_DP14_SRCCTS(157)
TSI_DP14_SRCCTS_DSC_COLOR_MODE_31 = TSI_BASE_DP14_SRCCTS(158)
TSI_DP14_SRCCTS_MAX_STREAM_HACTIVE = TSI_BASE_DP14_SRCCTS(159)
TSI_DP14_SRCCTS_MAX_STREAM_VACTIVE = TSI_BASE_DP14_SRCCTS(160)
TSI_DP14_SRCCTS_MAX_STREAM_PIXEL_CLOCK = TSI_BASE_DP14_SRCCTS(161)
TSI_DP14_SRCCTS_TESTED_AUDIO_MODE_0 = TSI_BASE_DP14_SRCCTS(162)
TSI_DP14_SRCCTS_TESTED_AUDIO_MODE_1 = TSI_BASE_DP14_SRCCTS(163)
TSI_DP14_SRCCTS_TESTED_AUDIO_MODE_2 = TSI_BASE_DP14_SRCCTS(164)
TSI_DP14_SRCCTS_TESTED_AUDIO_MODE_3 = TSI_BASE_DP14_SRCCTS(165)
TSI_DP14_SRCCTS_TESTED_AUDIO_MODE_4 = TSI_BASE_DP14_SRCCTS(166)
TSI_DP14_SRCCTS_TESTED_AUDIO_MODE_5 = TSI_BASE_DP14_SRCCTS(167)
TSI_DP14_SRCCTS_TESTED_AUDIO_MODE_6 = TSI_BASE_DP14_SRCCTS(168)
TSI_DP14_SRCCTS_TESTED_AUDIO_MODE_7 = TSI_BASE_DP14_SRCCTS(169)
TSI_DP14_SRCCTS_DMT_TIMING = TSI_BASE_DP14_SRCCTS(170)
TSI_DP14_SRCCTS_CTA_TIMING = TSI_BASE_DP14_SRCCTS(171)
TSI_DP14_SRCCTS_CVT_TIMING = TSI_BASE_DP14_SRCCTS(172)
TSI_DP14_SRCCTS_AS_DUT_CAPS = TSI_BASE_DP14_SRCCTS(173)
TSI_DP14_SRCCTS_AS_RANGE_MIN_RATE = TSI_BASE_DP14_SRCCTS(174)
TSI_DP14_SRCCTS_AS_RANGE_MAX_RATE_0 = TSI_BASE_DP14_SRCCTS(175)
TSI_DP14_SRCCTS_AS_RANGE_MAX_RATE_1 = TSI_BASE_DP14_SRCCTS(176)
TSI_DP14_SRCCTS_AS_RANGE_MAX_RATE_2 = TSI_BASE_DP14_SRCCTS(177)
TSI_DP14_SRCCTS_AS_RANGE_MAX_RATE_3 = TSI_BASE_DP14_SRCCTS(178)
TSI_DP14_SRCCTS_AS_RANGE_MAX_RATE_4 = TSI_BASE_DP14_SRCCTS(179)
TSI_DP14_SRCCTS_AS_RANGE_MAX_RATE_5 = TSI_BASE_DP14_SRCCTS(180)
TSI_DP14_SRCCTS_AS_RANGE_MAX_RATE_6 = TSI_BASE_DP14_SRCCTS(181)
TSI_DP14_SRCCTS_AS_RANGE_MAX_RATE_7 = TSI_BASE_DP14_SRCCTS(182)

TSI_DP14_SINKCTS_TIMEOUT = TSI_BASE_DP14_SINKCTS(0)
TSI_DP14_SINKCTS_DSC_VM_0 = TSI_BASE_DP14_SINKCTS(1)
TSI_DP14_SINKCTS_DSC_VM_T_0 = TSI_BASE_DP14_SINKCTS(2)
TSI_DP14_SINKCTS_DSC_VM_1 = TSI_BASE_DP14_SINKCTS(3)
TSI_DP14_SINKCTS_DSC_VM_T_1 = TSI_BASE_DP14_SINKCTS(4)
TSI_DP14_SINKCTS_DSC_VM_2 = TSI_BASE_DP14_SINKCTS(5)
TSI_DP14_SINKCTS_DSC_VM_T_2 = TSI_BASE_DP14_SINKCTS(6)
TSI_DP14_SINKCTS_DSC_VM_3 = TSI_BASE_DP14_SINKCTS(7)
TSI_DP14_SINKCTS_DSC_VM_T_3 = TSI_BASE_DP14_SINKCTS(8)
TSI_DP14_SINKCTS_DSC_VM_4 = TSI_BASE_DP14_SINKCTS(9)
TSI_DP14_SINKCTS_DSC_VM_T_4 = TSI_BASE_DP14_SINKCTS(10)
TSI_DP14_SINKCTS_DSC_VM_5 = TSI_BASE_DP14_SINKCTS(11)
TSI_DP14_SINKCTS_DSC_VM_T_5 = TSI_BASE_DP14_SINKCTS(12)
TSI_DP14_SINKCTS_DSC_VM_6 = TSI_BASE_DP14_SINKCTS(13)
TSI_DP14_SINKCTS_DSC_VM_T_6 = TSI_BASE_DP14_SINKCTS(14)
TSI_DP14_SINKCTS_DSC_VM_7 = TSI_BASE_DP14_SINKCTS(15)
TSI_DP14_SINKCTS_DSC_VM_T_7 = TSI_BASE_DP14_SINKCTS(16)
TSI_DP14_SINKCTS_DSC_VM_8 = TSI_BASE_DP14_SINKCTS(17)
TSI_DP14_SINKCTS_DSC_VM_T_8 = TSI_BASE_DP14_SINKCTS(18)
TSI_DP14_SINKCTS_DSC_VM_9 = TSI_BASE_DP14_SINKCTS(19)
TSI_DP14_SINKCTS_DSC_VM_T_9 = TSI_BASE_DP14_SINKCTS(20)
TSI_DP14_SINKCTS_DSC_VM_10 = TSI_BASE_DP14_SINKCTS(21)
TSI_DP14_SINKCTS_DSC_VM_T_10 = TSI_BASE_DP14_SINKCTS(22)
TSI_DP14_SINKCTS_DSC_VM_11 = TSI_BASE_DP14_SINKCTS(23)
TSI_DP14_SINKCTS_DSC_VM_T_11 = TSI_BASE_DP14_SINKCTS(24)
TSI_DP14_SINKCTS_DSC_SOURCE = TSI_BASE_DP14_SINKCTS(25)
TSI_DP14_SINKCTS_SUPPORT_444CRC = TSI_BASE_DP14_SINKCTS(26)
TSI_DP14_SINKCTS_PACKET_SOURCE = TSI_BASE_DP14_SINKCTS(27)
TSI_DP14_SINKCTS_VIDEO_MODE_0 = TSI_BASE_DP14_SINKCTS(28)
TSI_DP14_SINKCTS_VIDEO_MODE_1 = TSI_BASE_DP14_SINKCTS(29)
TSI_DP14_SINKCTS_VIDEO_MODE_2 = TSI_BASE_DP14_SINKCTS(30)
TSI_DP14_SINKCTS_VIDEO_MODE_3 = TSI_BASE_DP14_SINKCTS(31)
TSI_DP14_SINKCTS_VIDEO_MODE_4 = TSI_BASE_DP14_SINKCTS(32)
TSI_DP14_SINKCTS_VIDEO_MODE_5 = TSI_BASE_DP14_SINKCTS(33)
TSI_DP14_SINKCTS_VIDEO_MODE_6 = TSI_BASE_DP14_SINKCTS(34)
TSI_DP14_SINKCTS_VIDEO_MODE_7 = TSI_BASE_DP14_SINKCTS(35)
TSI_DP14_SINKCTS_VIDEO_MODE_8 = TSI_BASE_DP14_SINKCTS(36)
TSI_DP14_SINKCTS_VIDEO_MODE_9 = TSI_BASE_DP14_SINKCTS(37)
TSI_DP14_SINKCTS_VIDEO_MODE_10 = TSI_BASE_DP14_SINKCTS(38)
TSI_DP14_SINKCTS_VIDEO_MODE_11 = TSI_BASE_DP14_SINKCTS(39)
TSI_DP14_SINKCTS_VIDEO_MODE_12 = TSI_BASE_DP14_SINKCTS(40)
TSI_DP14_SINKCTS_VIDEO_MODE_13 = TSI_BASE_DP14_SINKCTS(41)
TSI_DP14_SINKCTS_VIDEO_MODE_14 = TSI_BASE_DP14_SINKCTS(42)
TSI_DP14_SINKCTS_VIDEO_MODE_15 = TSI_BASE_DP14_SINKCTS(43)
TSI_DP14_SINKCTS_VIDEO_MODE_16 = TSI_BASE_DP14_SINKCTS(44)
TSI_DP14_SINKCTS_VISUAL_TEST_CHECK = TSI_BASE_DP14_SINKCTS(45)

TSI_DP20_SRCCTS_TIMEOUT = TSI_BASE_DP20_SRCCTS(0)
TSI_DP20_SRCCTS_MAX_LANES = TSI_BASE_DP20_SRCCTS(1)
TSI_DP20_SRCCTS_MAX_LINK_RATE = TSI_BASE_DP20_SRCCTS(2)
TSI_DP20_SRCCTS_DUT_CAPS = TSI_BASE_DP20_SRCCTS(3)
TSI_DP20_SRCCTS_DUT_TA = TSI_BASE_DP20_SRCCTS(4)
TSI_DP20_SRCCTS_LONG_HPD_PULSE = TSI_BASE_DP20_SRCCTS(5)
TSI_DP20_SRCCTS_LT_START_TIMEOUT = TSI_BASE_DP20_SRCCTS(6)
TSI_DP20_SRCCTS_TEST_CYCLE_DELAY = TSI_BASE_DP20_SRCCTS(7)
TSI_DP20_SRCCTS_COLOR_FORMATS = TSI_BASE_DP20_SRCCTS(8)
TSI_DP20_SRCCTS_FAILSAFE_MODE = TSI_BASE_DP20_SRCCTS(9)
TSI_DP20_SRCCTS_MAX_RESOLUTION = TSI_BASE_DP20_SRCCTS(10)
TSI_DP20_SRCCTS_DUT_LINK_RATES = TSI_BASE_DP20_SRCCTS(11)
TSI_DP20_SRCCTS_LTTPR_DEVICE_COUNT = TSI_BASE_DP20_SRCCTS(12)
TSI_DP20_SRCCTS_MAX_LINK_BW_POLICY = TSI_BASE_DP20_SRCCTS(13)
TSI_DP20_SRCCTS_MIN_SAMPLE_RATE = TSI_BASE_DP20_SRCCTS(16)
TSI_DP20_SRCCTS_MAX_SAMPLE_RATE = TSI_BASE_DP20_SRCCTS(17)
TSI_DP20_SRCCTS_CHANNELS1 = TSI_BASE_DP20_SRCCTS(18)
TSI_DP20_SRCCTS_CH_ALLOC1 = TSI_BASE_DP20_SRCCTS(19)
TSI_DP20_SRCCTS_CHANNELS2 = TSI_BASE_DP20_SRCCTS(20)
TSI_DP20_SRCCTS_CH_ALLOC2 = TSI_BASE_DP20_SRCCTS(21)
TSI_DP20_SRCCTS_CHANNELS3 = TSI_BASE_DP20_SRCCTS(22)
TSI_DP20_SRCCTS_CH_ALLOC3 = TSI_BASE_DP20_SRCCTS(23)
TSI_DP20_SRCCTS_CHANNELS4 = TSI_BASE_DP20_SRCCTS(24)
TSI_DP20_SRCCTS_CH_ALLOC4 = TSI_BASE_DP20_SRCCTS(25)
TSI_DP20_SRCCTS_AUDIO_TEST_PATTERN = TSI_BASE_DP20_SRCCTS(26)
TSI_DP20_SRCCTS_EDID_SAMPLE_SIZE = TSI_BASE_DP20_SRCCTS(27)
TSI_DP20_SRCCTS_1L_MOST_PACKED = TSI_BASE_DP20_SRCCTS(32)
TSI_DP20_SRCCTS_2L_MOST_PACKED = TSI_BASE_DP20_SRCCTS(33)
TSI_DP20_SRCCTS_4L_MOST_PACKED = TSI_BASE_DP20_SRCCTS(34)
TSI_DP20_SRCCTS_1L_RBB = TSI_BASE_DP20_SRCCTS(35)
TSI_DP20_SRCCTS_2L_RBB = TSI_BASE_DP20_SRCCTS(36)
TSI_DP20_SRCCTS_4L_RBB = TSI_BASE_DP20_SRCCTS(37)
TSI_DP20_SRCCTS_1L_HBR = TSI_BASE_DP20_SRCCTS(38)
TSI_DP20_SRCCTS_2L_HBR = TSI_BASE_DP20_SRCCTS(39)
TSI_DP20_SRCCTS_4L_HBR = TSI_BASE_DP20_SRCCTS(40)
TSI_DP20_SRCCTS_1L_HBR2 = TSI_BASE_DP20_SRCCTS(41)
TSI_DP20_SRCCTS_2L_HBR2 = TSI_BASE_DP20_SRCCTS(42)
TSI_DP20_SRCCTS_4L_HBR2 = TSI_BASE_DP20_SRCCTS(43)
TSI_DP20_SRCCTS_1L_HBR3 = TSI_BASE_DP20_SRCCTS(44)
TSI_DP20_SRCCTS_2L_HBR3 = TSI_BASE_DP20_SRCCTS(45)
TSI_DP20_SRCCTS_4L_HBR3 = TSI_BASE_DP20_SRCCTS(46)
TSI_DP20_SRCCTS_COLOR_MODE_0 = TSI_BASE_DP20_SRCCTS(56)
TSI_DP20_SRCCTS_COLOR_MODE_1 = TSI_BASE_DP20_SRCCTS(57)
TSI_DP20_SRCCTS_COLOR_MODE_2 = TSI_BASE_DP20_SRCCTS(58)
TSI_DP20_SRCCTS_COLOR_MODE_3 = TSI_BASE_DP20_SRCCTS(59)
TSI_DP20_SRCCTS_COLOR_MODE_4 = TSI_BASE_DP20_SRCCTS(60)
TSI_DP20_SRCCTS_COLOR_MODE_5 = TSI_BASE_DP20_SRCCTS(61)
TSI_DP20_SRCCTS_COLOR_MODE_6 = TSI_BASE_DP20_SRCCTS(62)
TSI_DP20_SRCCTS_COLOR_MODE_7 = TSI_BASE_DP20_SRCCTS(63)
TSI_DP20_SRCCTS_COLOR_MODE_8 = TSI_BASE_DP20_SRCCTS(64)
TSI_DP20_SRCCTS_COLOR_MODE_9 = TSI_BASE_DP20_SRCCTS(65)
TSI_DP20_SRCCTS_COLOR_MODE_10 = TSI_BASE_DP20_SRCCTS(66)
TSI_DP20_SRCCTS_COLOR_MODE_11 = TSI_BASE_DP20_SRCCTS(67)
TSI_DP20_SRCCTS_COLOR_MODE_12 = TSI_BASE_DP20_SRCCTS(68)
TSI_DP20_SRCCTS_COLOR_MODE_13 = TSI_BASE_DP20_SRCCTS(69)
TSI_DP20_SRCCTS_COLOR_MODE_14 = TSI_BASE_DP20_SRCCTS(70)
TSI_DP20_SRCCTS_COLOR_MODE_15 = TSI_BASE_DP20_SRCCTS(71)
TSI_DP20_SRCCTS_COLOR_MODE_16 = TSI_BASE_DP20_SRCCTS(72)
TSI_DP20_SRCCTS_COLOR_MODE_17 = TSI_BASE_DP20_SRCCTS(73)
TSI_DP20_SRCCTS_COLOR_MODE_18 = TSI_BASE_DP20_SRCCTS(74)
TSI_DP20_SRCCTS_COLOR_MODE_19 = TSI_BASE_DP20_SRCCTS(75)
TSI_DP20_SRCCTS_COLOR_MODE_20 = TSI_BASE_DP20_SRCCTS(76)
TSI_DP20_SRCCTS_COLOR_MODE_21 = TSI_BASE_DP20_SRCCTS(77)
TSI_DP20_SRCCTS_COLOR_MODE_22 = TSI_BASE_DP20_SRCCTS(78)
TSI_DP20_SRCCTS_COLOR_MODE_23 = TSI_BASE_DP20_SRCCTS(79)
TSI_DP20_SRCCTS_COLOR_MODE_24 = TSI_BASE_DP20_SRCCTS(80)
TSI_DP20_SRCCTS_COLOR_MODE_25 = TSI_BASE_DP20_SRCCTS(81)
TSI_DP20_SRCCTS_COLOR_MODE_26 = TSI_BASE_DP20_SRCCTS(82)
TSI_DP20_SRCCTS_COLOR_MODE_27 = TSI_BASE_DP20_SRCCTS(83)
TSI_DP20_SRCCTS_COLOR_MODE_28 = TSI_BASE_DP20_SRCCTS(84)
TSI_DP20_SRCCTS_COLOR_MODE_29 = TSI_BASE_DP20_SRCCTS(85)
TSI_DP20_SRCCTS_COLOR_MODE_30 = TSI_BASE_DP20_SRCCTS(86)
TSI_DP20_SRCCTS_COLOR_MODE_31 = TSI_BASE_DP20_SRCCTS(87)
TSI_DP20_SRCCTS_DSC_DUT_MAX_SLICE = TSI_BASE_DP20_SRCCTS(88)
TSI_DP20_SRCCTS_DSC_VERSION = TSI_BASE_DP20_SRCCTS(89)
TSI_DP20_SRCCTS_DSC_VMT_0_ID = TSI_BASE_DP20_SRCCTS(90)
TSI_DP20_SRCCTS_DSC_VMT_0_LC_LR = TSI_BASE_DP20_SRCCTS(91)
TSI_DP20_SRCCTS_DSC_VMT_0_TIMINGS = TSI_BASE_DP20_SRCCTS(92)
TSI_DP20_SRCCTS_DSC_VMT_1_ID = TSI_BASE_DP20_SRCCTS(93)
TSI_DP20_SRCCTS_DSC_VMT_1_LC_LR = TSI_BASE_DP20_SRCCTS(94)
TSI_DP20_SRCCTS_DSC_VMT_1_TIMINGS = TSI_BASE_DP20_SRCCTS(95)
TSI_DP20_SRCCTS_DSC_VMT_2_ID = TSI_BASE_DP20_SRCCTS(96)
TSI_DP20_SRCCTS_DSC_VMT_2_LC_LR = TSI_BASE_DP20_SRCCTS(97)
TSI_DP20_SRCCTS_DSC_VMT_2_TIMINGS = TSI_BASE_DP20_SRCCTS(98)
TSI_DP20_SRCCTS_DSC_VMT_3_ID = TSI_BASE_DP20_SRCCTS(99)
TSI_DP20_SRCCTS_DSC_VMT_3_LC_LR = TSI_BASE_DP20_SRCCTS(100)
TSI_DP20_SRCCTS_DSC_VMT_3_TIMINGS = TSI_BASE_DP20_SRCCTS(101)
TSI_DP20_SRCCTS_DSC_VMT_4_ID = TSI_BASE_DP20_SRCCTS(102)
TSI_DP20_SRCCTS_DSC_VMT_4_LC_LR = TSI_BASE_DP20_SRCCTS(103)
TSI_DP20_SRCCTS_DSC_VMT_4_TIMINGS = TSI_BASE_DP20_SRCCTS(104)
TSI_DP20_SRCCTS_DSC_VMT_5_ID = TSI_BASE_DP20_SRCCTS(105)
TSI_DP20_SRCCTS_DSC_VMT_5_LC_LR = TSI_BASE_DP20_SRCCTS(106)
TSI_DP20_SRCCTS_DSC_VMT_5_TIMINGS = TSI_BASE_DP20_SRCCTS(107)
TSI_DP20_SRCCTS_DSC_VMT_6_ID = TSI_BASE_DP20_SRCCTS(108)
TSI_DP20_SRCCTS_DSC_VMT_6_LC_LR = TSI_BASE_DP20_SRCCTS(109)
TSI_DP20_SRCCTS_DSC_VMT_6_TIMINGS = TSI_BASE_DP20_SRCCTS(110)
TSI_DP20_SRCCTS_DSC_VMT_7_ID = TSI_BASE_DP20_SRCCTS(111)
TSI_DP20_SRCCTS_DSC_VMT_7_LC_LR = TSI_BASE_DP20_SRCCTS(112)
TSI_DP20_SRCCTS_DSC_VMT_7_TIMINGS = TSI_BASE_DP20_SRCCTS(113)
TSI_DP20_SRCCTS_DSC_VMT_8_ID = TSI_BASE_DP20_SRCCTS(114)
TSI_DP20_SRCCTS_DSC_VMT_8_LC_LR = TSI_BASE_DP20_SRCCTS(115)
TSI_DP20_SRCCTS_DSC_VMT_8_TIMINGS = TSI_BASE_DP20_SRCCTS(116)
TSI_DP20_SRCCTS_DSC_VMT_9_ID = TSI_BASE_DP20_SRCCTS(117)
TSI_DP20_SRCCTS_DSC_VMT_9_LC_LR = TSI_BASE_DP20_SRCCTS(118)
TSI_DP20_SRCCTS_DSC_VMT_9_TIMINGS = TSI_BASE_DP20_SRCCTS(119)
TSI_DP20_SRCCTS_DSC_VMT_10_ID = TSI_BASE_DP20_SRCCTS(120)
TSI_DP20_SRCCTS_DSC_VMT_10_LC_LR = TSI_BASE_DP20_SRCCTS(121)
TSI_DP20_SRCCTS_DSC_VMT_10_TIMINGS = TSI_BASE_DP20_SRCCTS(122)
TSI_DP20_SRCCTS_DSC_VMT_11_ID = TSI_BASE_DP20_SRCCTS(123)
TSI_DP20_SRCCTS_DSC_VMT_11_LC_LR = TSI_BASE_DP20_SRCCTS(124)
TSI_DP20_SRCCTS_DSC_VMT_11_TIMINGS = TSI_BASE_DP20_SRCCTS(125)
TSI_DP20_SRCCTS_DSC_COLOR_FORMATS = TSI_BASE_DP20_SRCCTS(126)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_0 = TSI_BASE_DP20_SRCCTS(127)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_1 = TSI_BASE_DP20_SRCCTS(128)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_2 = TSI_BASE_DP20_SRCCTS(129)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_3 = TSI_BASE_DP20_SRCCTS(130)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_4 = TSI_BASE_DP20_SRCCTS(131)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_5 = TSI_BASE_DP20_SRCCTS(132)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_6 = TSI_BASE_DP20_SRCCTS(133)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_7 = TSI_BASE_DP20_SRCCTS(134)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_8 = TSI_BASE_DP20_SRCCTS(135)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_9 = TSI_BASE_DP20_SRCCTS(136)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_10 = TSI_BASE_DP20_SRCCTS(137)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_11 = TSI_BASE_DP20_SRCCTS(138)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_12 = TSI_BASE_DP20_SRCCTS(139)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_13 = TSI_BASE_DP20_SRCCTS(140)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_14 = TSI_BASE_DP20_SRCCTS(141)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_15 = TSI_BASE_DP20_SRCCTS(142)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_16 = TSI_BASE_DP20_SRCCTS(143)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_17 = TSI_BASE_DP20_SRCCTS(144)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_18 = TSI_BASE_DP20_SRCCTS(145)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_19 = TSI_BASE_DP20_SRCCTS(146)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_20 = TSI_BASE_DP20_SRCCTS(147)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_21 = TSI_BASE_DP20_SRCCTS(148)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_22 = TSI_BASE_DP20_SRCCTS(149)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_23 = TSI_BASE_DP20_SRCCTS(150)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_24 = TSI_BASE_DP20_SRCCTS(151)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_25 = TSI_BASE_DP20_SRCCTS(152)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_26 = TSI_BASE_DP20_SRCCTS(153)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_27 = TSI_BASE_DP20_SRCCTS(154)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_28 = TSI_BASE_DP20_SRCCTS(155)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_29 = TSI_BASE_DP20_SRCCTS(156)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_30 = TSI_BASE_DP20_SRCCTS(157)
TSI_DP20_SRCCTS_DSC_COLOR_MODE_31 = TSI_BASE_DP20_SRCCTS(158)
TSI_DP20_SRCCTS_MAX_STREAM_HACTIVE = TSI_BASE_DP20_SRCCTS(159)
TSI_DP20_SRCCTS_MAX_STREAM_VACTIVE = TSI_BASE_DP20_SRCCTS(160)
TSI_DP20_SRCCTS_MAX_STREAM_PIXEL_CLOCK = TSI_BASE_DP20_SRCCTS(161)
TSI_DP20_SRCCTS_TESTED_AUDIO_MODE_0 = TSI_BASE_DP20_SRCCTS(162)
TSI_DP20_SRCCTS_TESTED_AUDIO_MODE_1 = TSI_BASE_DP20_SRCCTS(163)
TSI_DP20_SRCCTS_TESTED_AUDIO_MODE_2 = TSI_BASE_DP20_SRCCTS(164)
TSI_DP20_SRCCTS_TESTED_AUDIO_MODE_3 = TSI_BASE_DP20_SRCCTS(165)
TSI_DP20_SRCCTS_TESTED_AUDIO_MODE_4 = TSI_BASE_DP20_SRCCTS(166)
TSI_DP20_SRCCTS_TESTED_AUDIO_MODE_5 = TSI_BASE_DP20_SRCCTS(167)
TSI_DP20_SRCCTS_TESTED_AUDIO_MODE_6 = TSI_BASE_DP20_SRCCTS(168)
TSI_DP20_SRCCTS_TESTED_AUDIO_MODE_7 = TSI_BASE_DP20_SRCCTS(169)
TSI_DP20_SRCCTS_DMT_TIMING = TSI_BASE_DP20_SRCCTS(170)
TSI_DP20_SRCCTS_CTA_TIMING = TSI_BASE_DP20_SRCCTS(171)
TSI_DP20_SRCCTS_CVT_TIMING = TSI_BASE_DP20_SRCCTS(172)
TSI_DP20_SRCCTS_AS_DUT_CAPS = TSI_BASE_DP20_SRCCTS(173)
TSI_DP20_SRCCTS_AS_RANGE_MIN_RATE = TSI_BASE_DP20_SRCCTS(174)
TSI_DP20_SRCCTS_AS_RANGE_MAX_RATE_0 = TSI_BASE_DP20_SRCCTS(175)
TSI_DP20_SRCCTS_AS_RANGE_MAX_RATE_1 = TSI_BASE_DP20_SRCCTS(176)
TSI_DP20_SRCCTS_AS_RANGE_MAX_RATE_2 = TSI_BASE_DP20_SRCCTS(177)
TSI_DP20_SRCCTS_AS_RANGE_MAX_RATE_3 = TSI_BASE_DP20_SRCCTS(178)
TSI_DP20_SRCCTS_AS_RANGE_MAX_RATE_4 = TSI_BASE_DP20_SRCCTS(179)
TSI_DP20_SRCCTS_AS_RANGE_MAX_RATE_5 = TSI_BASE_DP20_SRCCTS(180)
TSI_DP20_SRCCTS_AS_RANGE_MAX_RATE_6 = TSI_BASE_DP20_SRCCTS(181)
TSI_DP20_SRCCTS_AS_RANGE_MAX_RATE_7 = TSI_BASE_DP20_SRCCTS(182)

TSI_DP20_SINKCTS_TIMEOUT = TSI_BASE_DP20_SINKCTS(0)
TSI_DP20_SINKCTS_DSC_VM_0 = TSI_BASE_DP20_SINKCTS(1)
TSI_DP20_SINKCTS_DSC_VM_T_0 = TSI_BASE_DP20_SINKCTS(2)
TSI_DP20_SINKCTS_DSC_VM_1 = TSI_BASE_DP20_SINKCTS(3)
TSI_DP20_SINKCTS_DSC_VM_T_1 = TSI_BASE_DP20_SINKCTS(4)
TSI_DP20_SINKCTS_DSC_VM_2 = TSI_BASE_DP20_SINKCTS(5)
TSI_DP20_SINKCTS_DSC_VM_T_2 = TSI_BASE_DP20_SINKCTS(6)
TSI_DP20_SINKCTS_DSC_VM_3 = TSI_BASE_DP20_SINKCTS(7)
TSI_DP20_SINKCTS_DSC_VM_T_3 = TSI_BASE_DP20_SINKCTS(8)
TSI_DP20_SINKCTS_DSC_VM_4 = TSI_BASE_DP20_SINKCTS(9)
TSI_DP20_SINKCTS_DSC_VM_T_4 = TSI_BASE_DP20_SINKCTS(10)
TSI_DP20_SINKCTS_DSC_VM_5 = TSI_BASE_DP20_SINKCTS(11)
TSI_DP20_SINKCTS_DSC_VM_T_5 = TSI_BASE_DP20_SINKCTS(12)
TSI_DP20_SINKCTS_DSC_VM_6 = TSI_BASE_DP20_SINKCTS(13)
TSI_DP20_SINKCTS_DSC_VM_T_6 = TSI_BASE_DP20_SINKCTS(14)
TSI_DP20_SINKCTS_DSC_VM_7 = TSI_BASE_DP20_SINKCTS(15)
TSI_DP20_SINKCTS_DSC_VM_T_7 = TSI_BASE_DP20_SINKCTS(16)
TSI_DP20_SINKCTS_DSC_VM_8 = TSI_BASE_DP20_SINKCTS(17)
TSI_DP20_SINKCTS_DSC_VM_T_8 = TSI_BASE_DP20_SINKCTS(18)
TSI_DP20_SINKCTS_DSC_VM_9 = TSI_BASE_DP20_SINKCTS(19)
TSI_DP20_SINKCTS_DSC_VM_T_9 = TSI_BASE_DP20_SINKCTS(20)
TSI_DP20_SINKCTS_DSC_VM_10 = TSI_BASE_DP20_SINKCTS(21)
TSI_DP20_SINKCTS_DSC_VM_T_10 = TSI_BASE_DP20_SINKCTS(22)
TSI_DP20_SINKCTS_DSC_VM_11 = TSI_BASE_DP20_SINKCTS(23)
TSI_DP20_SINKCTS_DSC_VM_T_11 = TSI_BASE_DP20_SINKCTS(24)
TSI_DP20_SINKCTS_DSC_SOURCE = TSI_BASE_DP20_SINKCTS(25)
TSI_DP20_SINKCTS_SUPPORT_444CRC = TSI_BASE_DP20_SINKCTS(26)
TSI_DP20_SINKCTS_PACKET_SOURCE = TSI_BASE_DP20_SINKCTS(27)
TSI_DP20_SINKCTS_VIDEO_MODE_0 = TSI_BASE_DP20_SINKCTS(28)
TSI_DP20_SINKCTS_VIDEO_MODE_1 = TSI_BASE_DP20_SINKCTS(29)
TSI_DP20_SINKCTS_VIDEO_MODE_2 = TSI_BASE_DP20_SINKCTS(30)
TSI_DP20_SINKCTS_VIDEO_MODE_3 = TSI_BASE_DP20_SINKCTS(31)
TSI_DP20_SINKCTS_VIDEO_MODE_4 = TSI_BASE_DP20_SINKCTS(32)
TSI_DP20_SINKCTS_VIDEO_MODE_5 = TSI_BASE_DP20_SINKCTS(33)
TSI_DP20_SINKCTS_VIDEO_MODE_6 = TSI_BASE_DP20_SINKCTS(34)
TSI_DP20_SINKCTS_VIDEO_MODE_7 = TSI_BASE_DP20_SINKCTS(35)
TSI_DP20_SINKCTS_VIDEO_MODE_8 = TSI_BASE_DP20_SINKCTS(36)
TSI_DP20_SINKCTS_VIDEO_MODE_9 = TSI_BASE_DP20_SINKCTS(37)
TSI_DP20_SINKCTS_VIDEO_MODE_10 = TSI_BASE_DP20_SINKCTS(38)
TSI_DP20_SINKCTS_VIDEO_MODE_11 = TSI_BASE_DP20_SINKCTS(39)
TSI_DP20_SINKCTS_VIDEO_MODE_12 = TSI_BASE_DP20_SINKCTS(40)
TSI_DP20_SINKCTS_VIDEO_MODE_13 = TSI_BASE_DP20_SINKCTS(41)
TSI_DP20_SINKCTS_VIDEO_MODE_14 = TSI_BASE_DP20_SINKCTS(42)
TSI_DP20_SINKCTS_VIDEO_MODE_15 = TSI_BASE_DP20_SINKCTS(43)
TSI_DP20_SINKCTS_VIDEO_MODE_16 = TSI_BASE_DP20_SINKCTS(44)
TSI_DP20_SINKCTS_VISUAL_TEST_CHECK = TSI_BASE_DP20_SINKCTS(45)

TSI_DP20_LTTPR_TIMEOUT = TSI_BASE_DP20_LTTPRCTS(0x0)

TSI_TEST_CFG_HDCP2_1A_TIMEOUT = TSI_BASE_TEST_HDCP2_1A(0x0)
TSI_TEST_CFG_HDCP2_1A_REVOKEID = TSI_BASE_TEST_HDCP2_1A(0x1)
TSI_TEST_CFG_HDCP2_1A_SRC_DUT_CAP = TSI_BASE_TEST_HDCP2_1A(0x2)

TSI_TEST_CFG_HDCP2_1B_TIMEOUT = TSI_BASE_TEST_HDCP2_1B(0x0)

TSI_TEST_CFG_HDCP2_2C_TIMEOUT = TSI_BASE_TEST_HDCP2_2C(0x0)

TSI_TEST_CFG_HDCP2_3A_TIMEOUT = TSI_BASE_TEST_HDCP2_3A(0x0)

TSI_TEST_CFG_HDCP2_3B_TIMEOUT = TSI_BASE_TEST_HDCP2_3B(0x0)

TSI_TEST_CFG_HDCP2_3C_TIMEOUT = TSI_BASE_TEST_HDCP2_3C(0x0)
TSI_TEST_CFG_HDCP2_3C_REPEATER_MULTIPLE_OUTPUTS = TSI_BASE_TEST_HDCP2_3C(0x1)

TSI_VRR_SINK_DUT_TIMEOUT = TSI_BASE_VRR_SINK_DUT(0x0)
TSI_VRR_SINK_DUT_VRR_MAX = TSI_BASE_VRR_SINK_DUT(0x1)
TSI_VRR_SINK_DUT_VRR_MIN = TSI_BASE_VRR_SINK_DUT(0x2)
TSI_VRR_SINK_DUT_VRR_STATIC = TSI_BASE_VRR_SINK_DUT(0x3)
TSI_VRR_SINK_DUT_VRR_STEP = TSI_BASE_VRR_SINK_DUT(0x4)
TSI_VRR_SINK_DUT_VRR_TIME_STEP = TSI_BASE_VRR_SINK_DUT(0x5)
TSI_VRR_SINK_DUT_VRR_ENABLE = TSI_BASE_VRR_SINK_DUT(0x6)
TSI_VRR_SINK_DUT_BASE_VFRONT = TSI_BASE_VRR_SINK_DUT(0x7)
TSI_VRR_SINK_DUT_BASE_RATE = TSI_BASE_VRR_SINK_DUT(0x8)

TSI_VRR_SRC_DUT_TIMEOUT = TSI_BASE_VRR_SRC_DUT(0x0)
TSI_VRR_SRC_DUT_VRR_MAX = TSI_BASE_VRR_SRC_DUT(0x1)
TSI_VRR_SRC_DUT_VRR_MIN = TSI_BASE_VRR_SRC_DUT(0x2)
TSI_VRR_SRC_DUT_VRR_STATIC = TSI_BASE_VRR_SRC_DUT(0x3)
TSI_VRR_SRC_DUT_VRR_STEP = TSI_BASE_VRR_SRC_DUT(0x4)
TSI_VRR_SRC_DUT_VRR_TIME_STEP = TSI_BASE_VRR_SRC_DUT(0x5)
TSI_VRR_SRC_DUT_VRR_ENABLE = TSI_BASE_VRR_SRC_DUT(0x6)
TSI_VRR_SRC_DUT_BASE_VFRONT = TSI_BASE_VRR_SRC_DUT(0x7)
TSI_VRR_SRC_DUT_BASE_RATE = TSI_BASE_VRR_SRC_DUT(0x8)

TSI_HDMI_SRCCTS_TIMEOUT = TSI_BASE_HDMI_SRCCTS(0x0)

TSI_HDMI_SNKCTS_TEST_MODE = TSI_BASE_HDMI_SINKCTS(0x0)
TSI_HDMI_SNKCTS_TIMEOUT = TSI_BASE_HDMI_SINKCTS(0x1)
TSI_HDMI_SNKCTS_MAX_FRL_RATE = TSI_BASE_HDMI_SINKCTS(0x2)
TSI_HDMI_SNKCTS_MAX_TMDS_CLOCK = TSI_BASE_HDMI_SINKCTS(0x3)
TSI_HDMI_SNKCTS_DUT_CAPS = TSI_BASE_HDMI_SINKCTS(0x4)
TSI_HDMI_SNKCTS_DSC_MAX_FRL_RATE = TSI_BASE_HDMI_SINKCTS(0x5)
TSI_HDMI_SNKCTS_HF_EEODB_SUPPORT = TSI_BASE_HDMI_SINKCTS(0x6)
TSI_HDMI_SNKCTS_DSC_VIDEO_FORMAT = TSI_BASE_HDMI_SINKCTS(0x7)
TSI_HDMI_SNKCTS_DSC_VIDEO_FORMAT_2 = TSI_BASE_HDMI_SINKCTS(0x8)
TSI_HDMI_SNKCTS_DSC_MAX_SLICES = TSI_BASE_HDMI_SINKCTS(0x9)
TSI_HDMI_SNKCTS_DSC_TOTAL_CHUNK_BYTES = TSI_BASE_HDMI_SINKCTS(0xA)

TSI_HDMI_SNKCTS_CABLE_TIMEOUT = TSI_BASE_HDMI_CALBE_CHECK_SINK(0x0)
TSI_HDMI_SNKCTS_CABLE_TEST_MODE = TSI_BASE_HDMI_CALBE_CHECK_SINK(0x1)
TSI_HDMI_SNKCTS_CABLE_MIN_FRL_RATE = TSI_BASE_HDMI_CALBE_CHECK_SINK(0x2)
TSI_HDMI_SNKCTS_CABLE_MAX_FRL_RATE = TSI_BASE_HDMI_CALBE_CHECK_SINK(0x3)
TSI_HDMI_SNKCTS_CABLE_ERROR_PER_LANE = TSI_BASE_HDMI_CALBE_CHECK_SINK(0x4)
TSI_HDMI_SNKCTS_CABLE_CAPTURE_TIMEOUT = TSI_BASE_HDMI_CALBE_CHECK_SINK(0x5)
TSI_HDMI_SNKCTS_CABLE_LOW_SPEED_LINE = TSI_BASE_HDMI_CALBE_CHECK_SINK(0x6)
# !CI_PARSE_COMPLETE_OK
