v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha
v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha

Basic Commands

PD_SendPacket

Call PD_SendPacket(PD_Packet $send_packet, PD_SendPacketSettings $settings)

Sends the data payload towards the device. Customize its behavior using the provided settings.

Parameters


$send_packet

Defines the payload. See Packet Templates for available templates.

$settings

Settings for sending the packet. Inherited from the PD_SendPacketSettings template, shown below:

Field Name

Possible Values (defaults in bold)

Description

OrderedSetType

PD_ORDERED_SET_TYPE_SOP

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

PD_ORDERED_SET_TYPE_HARDRESET

PD_ORDERED_SET_TYPE_CABLERESET

Defines Ordered set type.

WaitForGoodCrc

PD_TRUE

PD_FALSE

If the command should wait for peer GoodCrc message.

ResetOnError

PD_TRUE

PD_FALSE

Send Soft Reset if relative GoodCrc has not been received, in case of sending SoftReset failure, HardReset will be sent.

RetryCount

PD_DEFAULT_RETRY_COUNT_REV_2 (Rev2.0)

PD_DEFAULT_RETRY_COUNT_REV_3 (Rev3.0)

The Retry Count.

RetryDelayTime

0

Delay time between two consecutive retries.

AutoMessageId

PD_TRUE

PD_FALSE

To set MessageId automatically.

Result: Evaluate results (including sub-results) using the IfMatched/ElseMatched command.

Value

Description

PD_RESULT_OK

Command succeeded

PD_RESULT_FAILED

Command failed

PD_SUBRESULT_NO_GOODCRC

Subresult - No GoodCRC received for sent packet

PD_SUBRESULT_HARDRESET

Subresult - HardReset occurred.

PD_SUBRESULT_SOFTRESET

Subresult - SoftReset occurred.

Examples

#send a discover identity command
#################################
$send_setting = PD_SendPacketSettings
{
  # could be PD_ORDERED_SET_TYPE_SOP_PRIME for cables
  OrderedSetType = PD_ORDERED_SET_TYPE_SOP
}
$discover_identity = PD_VDM_Discover_Identity_Message    
Call PD_SendPacket( $discover_identity, $send_setting )


# Send Request message
######################
$request_data = PD_RequestDataObject_Fixed_Variable_NoGiveBack 
{ 
  MaxOperatingCurrent_10mAUnits = 90 
  OperatingCurrent_10mAUnits = 90 
}
$request_packet = PD_RequestPacket
{
  Data = $request_data
}


#calling PD_SendPacket() command using default settings
$send_packet_settings = PD_SendPacketSettings
Call PD_SendPacket($request_packet, $send_packet_settings)

PD_SendPacket_Cable

Call PD_SendPacket_Cable( PD_Packet $send_packet,
  PD_SendPacketSettings_Cable $settings )

Sends a packet as a Marked Cable toward the device.

Parameters

$send_packet

Defines the payload. See Packet Templates for available packet templates.

$settings

Settings for sending the packet. It should be derived from the PD_SendPacketSettings_Cable template.

PD_SendPacketSettings_Cable is derived from the PD_SendPacketSettings template. Default values for some fields is changed as below:

OrderedSetType = PD_ORDERED_SET_TYPE_SOP_PRIME

ResetOnErrors = PD_FALSE

RetryCount = 0


Result: Evaluate command results (including sub-results) using the IfMatched/ElseMatched command. Possible result values:

Value

Description

PD_RESULT_OK

Command succeeded

PD_RESULT_FAILED

Command failed

PD_SUBRESULT_NO_GOODCRC

Subresult - No GoodCRC received for sent packet

Examples

#send a discover identity response
####################################
$send_setting = PD_SendPacketSettings_Cable
$header_vdo = PD_VDM_Discover_Identity_ID_Header_VDO
$stat_vdo = PD_VDM_Discover_Identity_Cert_Stat_VDO
$product_vdo = PD_VDM_Discover_Identity_Product_VDO
$cable_vdo = PD_VDM_Discover_Identity_Cable_VDO
$discover_identity_response = PD_VDM_Discover_Identity_Response
{
  VDOs = $header_vdo + $stat_vdo + $product_vdo + $cable_vdo
}
Call PD_SendPacket_Cable( $discover_identity_response, $send_setting )

Pd_SendErroneousChunks

Pd_SendErroneousChunks( Pd_Packet $SentPacket, PD_SendErrChunksSettings $SendErrChunksSettings )

Applicable to PD Rev 3.0 only. Sends packet chunks toward the UUT and has the ability to skip sending some packet chunks. You can set the $PdGlobalSettings.UnchunkedSupport (See PD_Set) setting to PD_FALSE before calling this function.

Parameters

$send_packet

Defines the payload. See Packet Templates for available packet templates.

$SendErrChunksSettings

Inherited from PD_SendErrChunksSettings template. Includes all the fields of PD_SendPacketSettings (See PD_SendPacket) packet template but the default value for RetryCount field is PD_DEFAULT_RETRY_COUNT_REV_3. Additional fields shown below:

Field Name

Default Values

Description

SkipSendChunkIndex

PD_INVALID_VALUE

From which chunk number the function should stop sending chunks.

Result: Evaluate command results (including sub-results) using the IfMatched/ElseMatched command.

Value

Description

PD_RESULT_OK

Command succeeded

PD_RESULT_FAILED

Command failed

PD_SUBRESULT_NO_GOODCRC

Subresult - No GoodCRC received for sent packet

PD_SUBRESULT_HARDRESET

Subresult - HardReset occurred.

PD_SUBRESULT_SOFTRESET

Subresult - SoftReset occurred.

Example

Packet TempExtendedPacket : Pd_Packet
{
    : Pd_MessageHeader
    : Pd_ExtendedMsgHeader
    : Pd_GenericPacket
    Extended = 1
}
Main
{
    .
    .
    .
    Pd_Set $PdGlobalSettings.UnchunkedSupport = PD_FALSE
    local $ErrChunkSettings = PD_SendErrChunksSettings
    {
        SkipSendChunkIndex = 4
    }
    local $SentPacket = TempExtendedPacket
    {
        MessageType = _00011111
        DataSize    = 260
        Data = { 00 01 02 03 }
    }
    call Pd_SendErroneousChunks($SentPacket, $ErrChunkSettings)
    .
    .
    .
}

PD_SendCorruptedPacket

Call PD_SendCorruptedPacket( PD_Packet $send_payload, 	PD_SendCorruptedPacketSettings $send_settings )

Sends a packet toward the Unit Under Test that is corrupted intentionally.

Parameters


$send_payload

The payload to be sent. See Packet Templates for available templates.


$send_settings

Settings for sending the corrupted payload. Type is PD_SendCorruptedPacketSettings, shown below:


Field Name

Possible Values (defaults in bold)

Description

PreambleBitLen

0x40

The length of Preamble in bit.

NoPreamble

PD_TRUE

PD_FALSE

Whether or not to insert the Preamble.

OrderedsetType

PD_ORDERED_SET_TYPE_SOP

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

PD_ORDERED_SET_TYPE_SOP_PRIME_DEBUG

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME_DEBUG

PD_ORDERED_SET_TYPE_HARDRESET

PD_ORDERED_SET_TYPE_CABLERESET

PD_ORDERED_SET_TYPE_INVALID

The ordered set type.

CorruptedOrderedset

PD_TRUE

PD_FALSE

If OrderedsetType field is PD_ORDERED_SET_TYPE_INVALID, the content of this field will be replaced with ordered set in the sent packet.

NoCrc

PD_TRUE

PD_FALSE

Whether or not to insert Crc in the packet.

CorruptCrc4b

PD_TRUE

PD_FALSE

Whether or not to corrupt Crc before 5-bit encoding.

CorruptCrc5b

PD_TRUE

PD_FALSE

Whether or not to corrupt Crc after 5-bit encoding.

CorruptCrc4bBitOffset

0x00

The bit offset (starting from 0) of 4-bit encoded Crc data to be corrupted. Processed if CorruptCrc4b is PD_TRUE.

CorruptCrc4bBitLen

0x00

The length of corrupted Crc value that will be injected into Crc before 4-bit encoding. Processed if CorruptCrc4b is PD_TRUE.

CorruptCrc5bBitOffset

0x00

The bit offset (starting from 0) of 5-bit encoded Crc data to be corrupted. Processed if CorruptCrc5b is PD_TRUE.

CorruptCrc5bBitLen

0x00

The length of corrupted Crc value that will be injected into Crc after 5-bit encoding. Processed if CorruptCrc5b is PD_TRUE.

CorruptCrc4bValue

0x00

Byte stream. The value to be replaced with Crc before 4-bit encoding value from CorruptCrc4bBitOffset with length of CorruptCrc4bBitLen. Processed if CorruptCrc4b is PD_TRUE.

CorruptCrc5bValue

0x00

Byte stream. The value to be replaced with Crc after 5-bit encoding value from CorruptCrc5bBitOffset with length of CorruptCrc5bBitLen. Processed if CorruptCrc5b is PD_TRUE.

CorruptPayload4b

PD_TRUE

PD_FALSE

Whether or not to corrupt Payload before 5-bit encoding.

CorruptPayload5b

PD_TRUE

PD_FALSE

Whether or not to corrupt Payload after 5-bit encoding.

CorruptPayload4bBitOffset

0x00

The bit offset of Payload (before 5-bit encoding) to get as the first data bit being corrupted (e.g. bit offset 0x08 means: get the Payload data corrupted starting from offset 0x08). Processed if CorruptPayload4b is PD_TRUE.

CorruptPaylaod4bBitLen

0x00

The bit length of Payload (before 5-bit encoding) to get corrupted.(e.g. bit length 0x03 means: corrupt Payload( before 5-bit encoding) starting from CorruptPayload4bBitOffset and length of 0x03 bits). Processed if CorruptPayload4b is PD_TRUE.

CorruptPaylaod4bValue

0x00

Byte stream. Defines the value to be replaced with the Payload (before 5-bit encoding) data. The offset and length of replacing data should be defined using CorruptPayload4bBitOffset and CorruptPaylaod4bBitLen fields. Processed if CorruptPayload4b field is PD_TRUE.

CorruptPyload5bBitOffset

0x00

The bit offset of Payload (after 5-bit encoding) to get as the first data bit being corrupted (e.g. bit offset 0x08 means: get the Payload data corrupted starting from offset 0x08). Processed if CorruptPayload5b field is PD_TRUE.

CorruptPyload5bBitLen

0x00

The bit length of Payload (after 5-bit encoding) to get corrupted.(e.g. bit length 0x03 means: corrupt Payload( after 5-bit encoding) starting from CorruptPyload5bBitOffset and length of 0x03 bits). Processed if CorruptPayload5b field is PD_TRUE.

CorruptPyload5bValue

0x00

Byte stream. Defines the value to be replaced with the Payload (after 5-bit encoding) data. The offset and length of replacing data should be defined using CorruptPyload5bBitOffset and CorruptPyload5bBitLen fields. Processed if CorruptPayload5b field is PD_TRUE.

NoEop

PD_TRUE

PD_FALSE

Whether or not to insert EOP in the packet.

CorruptEop

PD_TRUE

PD_FALSE

Whether or not to corrupt EOP in the packet.

CorruptedEopSymbol

0x00

Corrupted EOP symbol to be replaced with EOP in the packet. Processed if CorruptEop field is PD_TRUE.

OperationType

PD_CORRUPT_OPERATION_TYPE_CUSTOM_VALUE
PD_CORRUPT_OPERATION_TYPE_FLIP_ALL_BITS
PD_CORRUPT_OPERATION_TYPE_INCREMENT_MSG_ID

Defines the operation type that will be applied. Only one operation type can be chosen at a time.

Default operation replaces data from the specified offset for specified length.

PD_CORRUPT_OPERATION_TYPE_FLIP_ALL_BITS
flips all the bits between the specified offset and the specified length.

PD_CORRUPT_OPERATION_TYPE_INCREMENT_MSG_ID
increments the MsgID of the $send_message

Result: None

Examples

$GetSinkCapsPacket = PD_GetSinkCapMessage
{
    PortPowerRole_CablePlug = 1
}
$corrupted_send_settings = PD_SendCorruptedPacketSettings
{
    CorruptCrc4b = PD_TRUE
}
call PD_SendCorruptedPacket($GetSinkCapsPacket, $corrupted_send_settings)

PD_ReceivePacket

Call PD_ReceivePacket( PD_ReceivePacketSettings $receive_Settings )

Receives a packet from device. Specify the packet type using its settings.

Parameters

$receive_Settings

Settings for the receiving packet. Type is PD_ReceivePacketSettings, shown below:

Field Name

Possible Values (defaults in bold)

Description

OrderedSetType

PD_ORDERED_SET_TYPE_SOP

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

PD_ORDERED_SET_TYPE_HARDRESET

PD_ORDERED_SET_TYPE_CABLERESET

Ordered set type for receiving message.

PacketType

PD_MESSAGE_TYPE_ANY

PD_MESSAGE_TYPE_GOODCRC

PD_MESSAGE_TYPE_GOTO_MIN

PD_MESSAGE_TYPE_ACCEPT

PD_MESSAGE_TYPE_REJECT

PD_MESSAGE_TYPE_PING

PD_MESSAGE_TYPE_PS_RDY

PD_MESSAGE_TYPE_GET_SOURCE_CAP

PD_MESSAGE_TYPE_GET_SINK_CAP

PD_MESSAGE_TYPE_DR_SWAP

PD_MESSAGE_TYPE_PR_SWAP

PD_MESSAGE_TYPE_VCONN_SWAP

PD_MESSAGE_TYPE_WAIT

PD_MESSAGE_TYPE_SOFT_RESET

PD_MESSAGE_TYPE_HARD_RESET

PD_MESSAGE_TYPE_CABLE_RESET

PD_MESSAGE_TYPE_NOT_SUPPORTED

PD_MESSAGE_TYPE_GET_SRC_CAP_EXT

PD_MESSAGE_TYPE_GET_STATUS

PD_MESSAGE_TYPE_FR_SWAP

PD_MESSAGE_TYPE_GET_PPS_STATUS

PD_MESSAGE_TYPE_GET_COUNTRY_CODES

PD_MESSAGE_TYPE_GET_SNK_CAP_EXT

PD_MESSAGE_TYPE_SOURCE_CAP

PD_MESSAGE_TYPE_REQUEST

PD_MESSAGE_TYPE_BIST

PD_MESSAGE_TYPE_SINK_CAP

PD_MESSAGE_TYPE_BATTERY_STATUS

PD_MESSAGE_TYPE_ALERT

PD_MESSAGE_TYPE_GET_COUNTRY_INFO

PD_MESSAGE_TYPE_VDM

PD_MESSAGE_TYPE_SRC_CAP_EXT

PD_MESSAGE_TYPE_STATUS

PD_MESSAGE_TYPE_GET_BATTERY_CAP

PD_MESSAGE_TYPE_GET_BATTERY_STATUS

PD_MESSAGE_TYPE_BATTERY_CAP

PD_MESSAGE_TYPE_GET_MANUFACTURER_INFO

PD_MESSAGE_TYPE_MANUFACTURER_INFO

PD_MESSAGE_TYPE_SECURITY_REQUEST

PD_MESSAGE_TYPE_SECURITY_RESPONSE

PD_MESSAGE_TYPE_PPS_STATUS

PD_MESSAGE_TYPE_COUNTRY_INFO

PD_MESSAGE_TYPE_COUNTRY_CODES

PD_MESSAGE_TYPE_SNK_CAP_EXT

Message type to receive.

VdmCommand

PD_VDM_COMMAND_ANY

PD_VDM_COMMAND_DISCOVER_IDENTITY

PD_VDM_COMMAND_DISCOVER_SVIDS

PD_VDM_COMMAND_DISCOVER_MODES

PD_VDM_COMMAND_ENTER_MODE

PD_VDM_COMMAND_EXIT_MODE

PD_VDM_COMMAND_DISPLAYPORT_STATUS_UPDATE

PD_VDM_COMMAND_DISPLAYPORT_CONFIGURE

PD_VDM_COMMAND_ATTENTION

VDM command.

VdmCommandType

PD_VDM_COMMAND_TYPE_INITIATOR

PD_VDM_COMMAND_TYPE_RESPONDER_ACK

PD_VDM_COMMAND_TYPE_RESPONDER_NAK

PD_VDM_COMMAND_TYPE_RESPONDER_BUSY

PD_VDM_COMMAND_TYPE_ANY

VDM command type.

AutoGoodCrc

PD_TRUE

PD_FALSE

Send GoodCrc on receiving a message, automatically.

DelayBeforeGoodCrc

0

Or other user defined value.

Delay before sending GoodCrc message.

WaitTimeOut

PD_DEFAULT_TIMEOUT_SENDER_RESPONSE

PD_DEFAULT_TIMEOUT_INFINIT

Or other user defined value.

Receive timeout (microseconds).

DiscardPrevReceived

PD_TRUE

PD_FALSE

Discards any (unprocessed) packet received before calling PD_ReceivePacket function.

ReturnOnUnexpectedPkt

PD_TRUE

PD_FALSE

If set to PD_TRUE, causes the PD_ReceivePacket() function to return on receiving unexpected packet.

NoSoftResetResponse

PD_TRUE

PD_FALSE

If set to PD_TRUE, the PD_ReceivePacket() function will not respond to any received Soft_Resets.

NoHardResetResponse

PD_TRUE

PD_FALSE

If set to PD_TRUE, the PD_ReceivePacket() function will not respond to any received Hard_Resets.

Result: Evaluate command results (including sub-results) using the IfMatched/ElseMatched command.

Result Value

Description

PD_RESULT_OK

Command succeeded

PD_RESULT_FAILED

Command failed

PD_SUBRESULT_RECEIVE_TIMEOUT

Subresult - No packet received within specified time

PD_SUBRESULT_UNEXPECTED_MSG_RECEIVED

Subresult - Unexpected packet received

PD_SUBRESULT_HARDRESET

Subresult - HardReset received

PD_SUBRESULT_SOFTRESET

Subresult - SoftReset received

Examples

#Receive source caps
####################
# Wait to receive source capability. GoodCRC is sent automatically.
$recv_settings = PD_ReceivePacketSettings
{
    WaitTimeOut = PD_DEFAULT_TIMEOUT_INFINIT    
    PacketType = PD_MESSAGE_TYPE_SOURCE_CAP
}   
call PD_ReceivePacket($recv_settings)
#Receive VDM message
####################
$receive_settings = PD_ReceivePacketSettings 
{        
    PacketType = PD_MESSAGE_TYPE_VDM
}
call PD_ReceivePacket( $receive_settings )

PD_SendSoftReset

Call PD_SendSoftReset( orderedset_type )

Sends Soft Reset and performs the reset according to the selected ordered set Type.

Parameters

orderedset_type

Possible values:

PD_ORDERED_SET_TYPE_SOP

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

Result: The Evaluate command results (including sub-results) using the IfMatched/ElseMatched command.

If sending SoftReset succeeded, the result is PD_RESULT_OK. In case of failure, it may lead to Power Negotiation.

Example

Call PD_SendSoftReset( PD_ORDERED_SET_TYPE_SOP )

PD_SendHardReset

Call PD_SendHardReset()

Sends Hard Reset and performs the reset.

Parameters: None

Result: None

Examples

Call PD_SendHardReset()

PD_SendCableReset

Call PD_SendCableReset()

Sends Cable Reset and resets all the cable related states in protocol layer.

Parameters: None

Result: None

Example

Call PD_SendCableReset()

PD_DelayNoAutoResponse

Call PD_DelayNoAutoResponse( Micro_Sec )

Delays Exerciser execution for a specified length of time.

Parameters

Micro_Sec

Delay in microseconds.

Result: None

Example

#calling PD_DelayNoAutoResponse
Call PD_DelayNoAutoResponse(15000)

PD_Delay

Call PD_Delay( delay_value )

Delays Exerciser execution for specified amount of time.

Parameters

delay_value

Delay in microseconds.

Result: None

Examples

#calling PD_Delay
Call PD_Delay(15000)

PD_SetRoles

Call PD_SetRoles( DataRole, PowerRole )

Sets data role and power role of the Exerciser.

Parameters

DataRole

Possible values:

PD_PORT_DATA_ROLE_UFP

PD_PORT_DATA_ROLE_DFP

PowerRole

Possible values:

PD_PORT_POWER_ROLE_SINK

PD_PORT_POWER_ROLE_SOURCE

Example

Call PD_SetRoles( PD_PORT_DATA_ROLE_DFP, PD_PORT_POWER_ROLE_SOURCE )

PD_Set

PD_Set $PdGlobalSettings.<field_name> = <value>
PD_Set $PdTimers.<field_name> = <value>

Changes necessary settings or variables inside the Exerciser.

$PdGlobalSettings fields

Field Name

Possible Values (defaults in bold)

Description

PortDataRole

PD_PORT_DATA_ROLE_DFP

PD_PORT_DATA_ROLE_UFP

Defines port data role.

PortPowerRole

PD_PORT_POWER_ROLE_SINK

PD_PORT_POWER_ROLE_SOURCE

Defines port power role.

CheckMessageId

PD_FALSE

PD_TRUE

Enables/Disables received packet message id verification.

SpecificationRevision

PD_SPEC_REVISION_1

PD_SPEC_REVISION_2

PD_SPEC_REVISION_3

Any user-defined value

Changes the SpecificationRevision of all messages sent by the Exerciser.

Note (Rev.3.0 or higher, all messages except non-SOP messages which are sent by PD Exerciser to a cable plug): Applied only if the AutoSpecRev setting of PD_SetNegotiationSetting_Source (PD Exerciser operating as Source) or PD_SetNegotiationSetting_Sink (PD Exerciser operating as Sink) is PD_FALSE.

Note: To set the Specification Revision of GoodCrc messages sent by the PD Exerciser, See AutoGoodCRCSpecRev and GoodCRCSpecRev global settings.

EnableCableEmulator

PD_FALSE

PD_TRUE

Enables/Disables SOP Cable Emulator engine in Exerciser. If enabled, the Exerciser simulates a SOP Prime Marked Cable as well as source or sink PD Device. It should be set only once in the target Exerciser Script.

EnableCableDPrimeEmulator

PD_FALSE

PD_TRUE

Enables/Disables SOP Double Prime Cable Emulator engine in Exerciser. If enabled, the Exerciser simulates a SOP Double Prime Marked Cable as well as source or sink PD Device. It should be set only once in the target Exerciser Script.

EnableDeviceEmulator

PD_FALSE

PD_TRUE

If disabled, Device Emulator AutoResponse is disabled (in case of Exerciser acting as a Sink or Source device).

NegotiateAfterReset

PD_FALSE

PD_TRUE

If set to PD_TRUE, the Exerciser runs Negotiation after receiving/sending SoftReset or HardReset.

VConnPassThrough

PD_FALSE

PD_TRUE

Whether or not the Exerciser is connected to the DUT using a VCONN Pass Through cable.

PDWorkingRevision

PD_SPEC_REVISION_2

PD_SPEC_REVISION_3

Sets the Power Delivery working revision. It should be set only once in the target Exerciser Script. It's recommended to change this setting using PD_SetWorkingRevision high-level function.

UnchunkedSupport

PD_FALSE

PD_TRUE

Whether or not to support sending un-chunked messages.

StructuredVDMVersion

PD_INVALID_VALUE

Any user-defined value

The VDM version of structured VDM messages. If the value is PD_INVALID_VALUE, the Exerciser assigns the proper value for structured VDM version according to current operational Power Delivery Revision.

StructuredVDMSVID

PD_VDM_SID

Any user-defined value

The SVID of structured VDM messages.

VConnThroughConnectCCLine

CC_LINE_1

CC_LINE_2

The desired CC line which makes the PD Exerciser to try to establish the Type-C connection on this CC line. This setting is only applicable when the cable is a VConnPassThrough cable.

FRSwapSupport

PD_TRUE

PD_FALSE

Applies only if the run-time working revision is Rev.3.0 or higher. Whether or not the Fast Role Swap is supported by Pd Exerciser engine.

AutoGoodCRCSpecRev

PD_TRUE

PD_FALSE

If set to PD_TRUE, proper Specification Revision will be set in each GoodCRC message sent to peer port (SOP or non-SOP) depending on the run-time working revision and whether or not the PD Exerciser is operating as Cable Emulator. Otherwise, uses the value of $PdGlobalSettings.GoodCRCSpecRev.

GoodCRCSpecRev

PD_SPEC_REVISION_1

PD_SPEC_REVISION_2

PD_SPEC_REVISION_3

If $PdGlobalSettings.AutoGoodCRCSpecRev is PD_FALSE, this value will be used as Specification revision of all GoodCRC messages sent by PD Exerciser.

InitiateAMS

PD_TRUE

PD_FALSE

Applies if the run-time working revision is Rev.3.0 or higher. If set to PD_TRUE, the PD Exerciser will always check for SinkTxNG and SinkTxOk values, regarding to its current role as Source or Sink, before starting an AMS.

SpecificationRevisionToCable

PD_SPEC_REVISION_1

PD_SPEC_REVISION_2

PD_SPEC_REVISION_3

Applies if the run-time working revision is Rev.3.0 or higher. If AutoSpecRevCable setting of PD_SetDiscoverIdentitySetting is set to PD_FALSE, this value will be used as Specification Revision of all non-SOP messages which are sent by PD Exerciser to cable plug.

DisableVBusOn

PD_TRUE

PD_FALSE

If set to PD_TRUE, PD Exerciser will not turn the VBUS on.

CheckBatteryRef

PD_TRUE

PD_FALSE

Applies if the run-time working revision is Rev.3.0 or higher. If set to PD_TRUE, PD Exerciser will check the Battery Reference received by Get_Battery_Status, Alert, Get_Battery_Cap and Manufacturer_info messages with the number of batteries defined by PD Exerciser (using the PD_SetSrcCapExtDataBlock command) and replies with a proper message.

CheckCountryCode

PD_TRUE

PD_FALSE

Applies if the run-time working revision is Rev.3.0 or higher. If set to PD_TRUE, PD Exerciser will check the Country Codes received by Get_Country_info message with the available country codes which has been added using the Pd_SetCountryCodesDataBlock function and replies with a proper message.

Note: PD Exerciser checks the received country codes with only the first 15 codes added by the Pd_SetCountryCodesDataBlock function.

ChangeHWSettingDelay

5000

The delay (microseconds) needed to apply after changing any Hardware Setting (e.g. changing Rp/Rd/Ra resistors or inserting/removing a capacitor etc.).

SetVbusDelay

20000

The delay (microseconds) needed to apply after changing the VBus state.

AutoSinkCapsFromSourcCaps

PD_TRUE

PD_FALSE

It is used when Exerciser is Sink and you don’t want to add any Sink Caps manually. It causes all Source Caps to be added as Sink Caps Dynamically.

List of $PdTimers fields (for more details, see the Power Delivery Specification):

Field Name

Description

tTypeCSinkWaitCap

Default: 620000 us

tTypeCSendSourceCap

Default: 150000 us

tPSTransition

Default: 550000 us

tPSSourceOff

Default: 920000 us

tPSSourceOn

Default: 480000 us

tSrcTransition

Default: 25000 us

tDiscoverIdentity

Default: 45000 us

tSafe0V

Default: 650000 us

tSafe5V

Default: 275000 us

tPSHardResetMin

Default: 25000 us

tPSHardResetMax

Default: 35000 us

tPSHardReset

Default: 30000 us

tSrcRecoverMin

Default: 660000 us

tSrcRecoverMax

Default: 1000000 us

tSrcRecover

Default: 1000000 us

tReceive

Default: 1100 us

tVCONNStable

Default: 50000 us

tVCONNSourceOff

Default: 25000 us

tVCONNSourceOn

Default: 50000 us

tVCONNSourceTimeout

Default: 200000 us

tVCONNSourceTimeoutMin

Default: 100000 us

tVCONNSourceTimeoutMax

Default: 200000 us

tVCONNZero

Default: 120000 us

tSenderResponse

Default: 30000 us

tBISTContMode

Default: 60000 us

tVDMBusy

Default: 50000 us

tVDMWaitModeEntry

Default: 50000 us

tVDMWaitModeExit

Default: 50000 us

tSwapSourceStart

Default: 20000 us

tSrcSwapStdbyMax

Default: 650000 us

tNewSrcMax

Default: 275000 us

tDRP

Default: 80000 us

dcSRC_DRP

Default: 50(time percent)

tCCDebounce

Default: 100000 us

tCCDebounceMin

Default: 100000 us

tCCDebounceMax

Default: 200000 us

tDRPTry

Default: 75000 us

tDRPTryMin

Default: 75000 us

tDRPTryMax

Default: 150000 us

tDRPTryWait

Default: 400000 us

tDRPTryWaitMin

Default: 400000 us

tDRPTryWaitMax

Default: 800000 us

tPDDebounce

Default: 10000 us

tPDDebounceMin

Default: 10000 us

tPDDebounceMax

Default: 20000 us

tTryCCDebounce

Default: 20000 us

tTryTimeout

Default: 1100000 us

tSinkTx

Default: 18000 us

tFRSwapTx

Default: 110 us

tFRSwapInitMax

Default: 15000 us

tFRSwapInitMin

Default: 500 us

tFRSwapComplete

Default: 0 us

tFRSwap5V

Default: 0 us

tErrorRecovery

Default: 25000 us

tChunkSenderResponse

Default: 30000 us

tChunkingNotSupported

Default: 50000 us

Result: None

Examples

# Enables cable emulator
PD_Set $PdGLOBALSETTINGS.EnableCableEmulator = PD_TRUE
Main
{
	# Sets GoodCRC timeout
	PD_Set $PdTimers.tReceive = 950 
	Call PD_WaitForDiscoverIdentity_Cable()
}

IfMatched/ElseMatched

Ifmatched(<1st_operand>, <2nd_operand>, <operator>)
{
	#command list
}
[ 
ElseMatched(<1st_operand>, <2nd_operand>, <operator>)
{
    #command list
}
    #more optional ElseMatched(<1st_operand>, <2nd_operand>, <operator>) here
    .
    .
    .
ElseMatched

{
    #command list
}
]
IfMatchedEnd
* ElseMatched clause is optional

Compares Exerciser settings, Received Packet Fields, and Command Results to a desired value.

Use this command to compare Exerciser settings or variables to other Exerciser settings or variables or to a constant.

Parameters

1st_operand

1st operand should be in one of the following formats:

  • $PdGlobalSettings.<field_name>

  • $PdResult.<field_name>

  • $<packet_variable>.<field_name>

  • $CCLinesStatus.<field_name>

See PD_Set for available $PdGlobalSettings fields.

$CCLinesStatus fields

CC1_UUT_Float

CC1_UUT_Rp

CC1_UUT_Rd

CC1_UUT_Ra

CC1_UUT_Vconn

CC1_UUT_Rp_Cur

CC1_Exr_Rd

CC1_Exr_Ra

CC1_Exr_Rp_Cur

CC1_Exr_Vconn

CC2_UUT_Float

CC2_UUT_Rp

CC2_UUT_Rd

CC2_UUT_Ra

CC2_UUT_Vconn

CC2_UUT_Rp_Cur

CC2_Exr_Rd

CC2_Exr_Ra

CC2_Exr_Rp_Cur

CC2_Exr_Vconn

VbusVSafe0

VbusVSafe5

Parameters

2nd_operand

Could be as <1st_operand> or a constant <value>.

operator

Possible values for operator:

PD_COMPARE_EQUAL

PD_COMPARE_GREATER

PD_COMPARE_LESS

PD_COMPARE_NOT_EQUAL

Result: None

Example

$send_setting = PD_SendPacketSettings
{
	ResetOnError = PD_FALSE
    OrderedSetType = PD_ORDERED_SET_TYPE_SOP
}
$receive_settings = PD_ReceivePacketSettings 
{        
    PacketType = PD_MESSAGE_TYPE_VDM
}
#send the packet
$discover_identity = PD_VDM_Discover_Identity_Message
Call PD_SendPacket( $discover_identity, $send_setting )

#check for result
IfMatched( $PdResult.Result, PD_RESULT_OK, PD_COMPARE_EQUAL )
{
	Call PD_ReceivePacket( $receive_settings )
}
ElseMatched( $PdResult.Result, PD_RESULT_FAILED, PD_COMPARE_EQUAL )
{
	Call PD_SendHardReset()
}
ElseMatched
{
	$ping_msg = PD_PingMessage
	Call PD_SendPacket( $ping_msg, $send_setting )
}
IfMatchedEnd

PD_Loop

PD_Loop(count)
{
	#command list
}

Creates a loop containing other Exerciser commands.

Note: The limit for using nested PD_Loop() commands is 8.

Parameters

count

Loop count

Result: None

Examples

$send_setting = PD_SendPacketSettings
{
    OrderedSetType = PD_ORDERED_SET_TYPE_SOP
}
$ping_msg = PD_PingMessage

PD_Loop(3)
{
	call PD_SendPacket( $ping_msg, $send_setting )
}

PD_TimerLoop

PD_TimerLoop(timeout)
{
	#command list
}

Creates a loop (containing other Exerciser commands) that is bound to a predefined timer. On timer timeout, the loop exits.

Note: The limit for using nested PD_TimerLoop() commands is 8.

Parameters

timeout

Loop duration in microseconds.

Result: None

Example

$send_setting = PD_SendPacketSettings
{
    OrderedSetType = PD_ORDERED_SET_TYPE_SOP
}
$ping_msg = PD_PingMessage

# Sending Ping message for 200ms
PD_TimerLoop(200000)
{
	call PD_SendPacket( $ping_msg, $send_setting )
}

PD_Stop

Call PD_Stop( return_value )

Stops the Exerciser.

Parameters

return_value

Value returned to Exerciser. The possible values are 1 to 255.

Result: None

Examples

Call PD_Stop( 100 )

PD_Disconnect

Call PD_Disconnect()

Simulates cable detach.

Parameters: None

Result: None

Example

Call PD_Disconnect()

PD_StartUSBExerciser

Call PD_StartUSBExerciser( ExercisersTypes )

Starts specified Exercisers that are waiting for the PD Exerciser’s permission.

Parameters

ExercisersTypes

Possible values:

PD_USB2_EXERCISER

PD_USB3_EXERCISER

PD_USB4_EXERCISER

PD_TBT3_EXERCISER

Result: None

Example

Call PD_StartUSBExerciser( PD_USB2_EXERCISER | PD_USB3_EXERCISER )

PD_RunUSB3TermDetection

Call PD_RunUSB3TermDetection()

Directs the Exerciser to actively perform USB 3 Rx Termination detection. A TERM State (Report) event will be displayed in the trace.

Note: This command is state-agnostic. Performing Rx Termination detection in certain states could interfere with SS communication and result in unexpected link behavior.

Parameters: None

Result: None

Example

Call PD_RunUSB3TermDetection()

PD_ResumeUSB2Exerciser

Call PD_ResumeUSB2Exerciser()

Resumes USB2 Exerciser execution paused by Break command.

Parameters: None

Result: None

Example

Call PD_ResumeUSB2Exerciser()

PD_ReportUSB3TermStatus

Call PD_ReportUSB3TermStatus()

Reports the last-known USB 3 Rx Termination status, typically from when the Exerciser was most recently in eSS.Inactive, Rx.Detect, U2, or U3. A TERM State (Report) event will be displayed in the trace.

Parameters: None

Result: None

Example

Call PD_ReportUSB3TermStatus()

PD_IncreaseMsgId

Call PD_IncreaseMsgId(OrderedSetType)

Increase Message ID (Exerciser mode: DFP/UFP).

Parameters

OrderedSetType

The OrderedSet type. Possible values:

PD_ORDERED_SET_TYPE_SOP

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

Result: None

Example

Call PD_IncreaseMsgId(PD_ORDERED_SET_TYPE_SOP)

PD_DecreaseMsgId

Call PD_DecreaseMsgId(OrderedSetType)

Decreases Message ID (Exerciser mode: DFP/UFP).

Parameters

OrderedSetType

The OrderedSet type. Possible values:

PD_ORDERED_SET_TYPE_SOP

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

Result: None

Example

Call PD_DecreaseMsgId(PD_ORDERED_SET_TYPE_SOP)

PD_IncreaseMsgId_Cable

Call PD_IncreaseMsgId_Cable(OrderedSetType)

Increases Message ID (Exerciser mode: Cable Emulator).

Parameters

OrderedSetType

The OrderedSet type. Possible values:

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

Result: None

Example

Call PD_IncreaseMsgId_Cable(PD_ORDERED_SET_TYPE_SOP_PRIME)

PD_DecreaseMsgId_Cable

Call PD_DecreaseMsgId_Cable(OrderedSetType)

Decreases Message ID (Exerciser mode: Cable Emulator).

Parameters

OrderedSetType

The OrderedSet type. Possible values:

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

Result: None

Example

Call PD_DecreaseMsgId_Cable(PD_ORDERED_SET_TYPE_SOP_PRIME)

PD_SendExternalTriggerOut

Call PD_SendExternalTriggerOut()

Sends the external trigger out.

Parameters: None

Result: None

Example

Call PD_SendExternalTriggerOut()

PD_InterruptAMS

Call PD_InterruptAMS( Pd_Packet $interrupting_packet, PD_InterruptAMSSettings $settings )

Sends a packet to interrupt an AMS. This command waits to receive a packet of an AMS, then, immediately after sending the GoodCRC, sends the interrupting packet. Customize its behavior using the provided settings.

Parameters

$interrupting_packet

See Packet Templates for available templates.

$settings

Settings for sending the interrupting packet. Inherited from the PD_InterruptAMSSettings template, shown below:

Field Name

Possible Values (defaults in bold)

Description

InterruptingPktOS

PD_ORDERED_SET_TYPE_SOP

PD_ORDERED_SET_TYPE_SOP_PRIME

PD_ORDERED_SET_TYPE_SOP_DOUBLE_PRIME

PD_ORDERED_SET_TYPE_HARDRESET

PD_ORDERED_SET_TYPE_CABLERESET

The Ordered Set type for the interrupting packet.

InterruptingPktAutoMessageId

PD_TRUE

PD_FALSE

Automatically sets MessageId for the interrupting packet.

InterruptingPktResponseNeedsGoodCRC

PD_FALSE

PD_TRUE

Whether or not to send a GoodCRC to the response of the interrupting packet.

InterruptingPktDelay

0

Delay (microseconds) before sending the interrupting packet.

FirstReceivePktTimeout

PD_DEFAULT_TIMEOUT_SENDER_RESPONSE

PD_DEFAULT_TIMEOUT_INFINIT

Other user-defined values

Timeout for receiving the first packet (microseconds).

FirstReceivedPktIsGoodCRC

PD_FALSE

PD_TRUE

Whether or not the first received packet is a GoodCRC message.

FirstReceivedPktNeedsGoodCRC

PD_TRUE

PD_FALSE

Whether or not to send a GoodCRC to the first received message.

GoodCRCCorruptCrc4b

PD_FALSE

PD_TRUE

Corrupts CRC32 of the GoodCRC packet of the first received packet before 5-bit encoding. Flips all the bits specified by GoodCRCCorruptCrc4bBitOffset and GoodCRCCorruptCrc4bBitLen. Processed if FirstReceivedPktNeedsGoodCRC is PD_TRUE.

GoodCRCCorruptCrc4bBitOffset

0x00

The bit offset (starting from 0) of 4-bit encoded CRC32 data to be corrupted. Processed if GoodCRCCorruptCrc4b is PD_TRUE.

GoodCRCCorruptCrc4bBitLen

0x00

The length of corrupted CRC32 value that will be injected into CRC32 before 4-bit encoding. Processed if GoodCRCCorruptCrc4b is PD_TRUE.

GoodCRCCorruptCrc5b

PD_FALSE

PD_TRUE

Used to corrupt CRC32 of the GoodCRC packet of the first received packet after 5-bit encoding. Fips all the bits specified by GoodCRCCorruptCrc5bBitOffset and GoodCRCCorruptCrc5bBitLen. Processed if FirstReceivedPktNeedsGoodCRC is PD_TRUE.

GoodCRCCorruptCrc5bBitOffset

0x00

The bit offset (starting from 0) of 5-bit encoded CRC32 data to be corrupted. Processed if GoodCRCCorruptCrc5b is PD_TRUE.

GoodCRCCorruptCrc5bBitLen

0x00

The length of corrupted CRC32 value that will be injected into CRC32 after 5-bit encoding. Processed if GoodCRCCorruptCrc5b is PD_TRUE.

Result: Evaluate command results (including sub-results) using the IfMatched/ElseMatched command.

Value

Description

PD_RESULT_OK

Command succeeded

PD_RESULT_FAILED

Command failed

PD_SUBRESULT_RECEIVE_TIMEOUT

Sub-result: No packet received within specified time

PD_SUBRESULT_NO_GOODCRC

Sub-result: No GoodCRC received for sent packet

PD_SUBRESULT_HARDRESET

Sub-result: Hard reset occurred.

PD_SUBRESULT_SOFTRESET

Sub-result: Soft reset occurred.

Example

# The following code interrupts EPR_Mode(Enter) sequence with EPR_Get_Sink_Cap message 
# after receiving EPR_Mode(Enter Acknowledged) 

local $SendSettings   = PD_SendPacketSettings
local $EPREnterPacket = PD_EPRModePacket
{
    Action = PD_EPR_MODE_ACTION_ENTER
}
call PD_SendPacket( $EPREnterPacket, $SendSettings )

local $GetEPRSnkCapPacket   = PD_GetEPRSinkCapMsg
local $InterruptAMSSettings = PD_InterruptAMSSettings

Call PD_InterrupAMS( $GetEPRSnkCapPacket, $InterruptAMSSettings )

PD_ReceiveCableAutoresponse

Call PD_ReceiveCableAutoresponse( PD_ReceivePacketSettings $receive_Settings )

Waits to receive the specified packet type in the $receive_Settings parameter and, while waiting for the packet to be received, automatically responds to other packets received from the cable. Incorporates all the features of PD_ReceivePacket.

Parameters

$receive_Settings

Type is PD_ReceivePacketSettings, defined in PD_ReceivePacket.

Example

$recv_settings = PD_ReceivePacketSettings
{
    WaitTimeOut = PD_DEFAULT_TIMEOUT_INFINIT
    PacketType  = PD_MESSAGE_TYPE_SOURCE_CAP
}
call PD_ReceiveCableAutoresponse($recv_settings)