# UniTAP.dev.ports.modules.pdc.pdc_contract_control

class PowerContractControlBase:

Class `PowerContractControlBase` allows setting and getting field related with power contract.

- Set and get Give Back flag `give_back_flag`, type `bool`.
- Set and get No USB suspend `no_usb_suspend`, type `bool`.
- Set and get PDO type priority `pdo_type_priority`, type `ContractTypePriority`.
- Set and get Maximum operation current `max_operation_current`, type `int`.
- Set FW Swap required current `fw_swap_required_current`, type `FrSwapCurrent`.

PowerContractControlBase(pdc_io: UniTAP.dev.ports.modules.pdc.pdc_io.PDCPortIO)
give_back_flag: bool

Returns state of Give back flag.

###### Returns:

> object of `bool` type

no_usb_suspend: bool

Returns state of No USB suspend flag.

###### Returns:

> object of `bool` type

def fw_swap_required_current( self, fr_swap_current: UniTAP.dev.ports.modules.pdc.pdc_types.FrSwapCurrent ):

Set FW Swap required current.

###### Arguments:

- fr_swap_current (`FrSwapCurrent`)

pdo_type_priority: UniTAP.dev.ports.modules.pdc.pdc_types.ContractTypePriority

Returns current PDO Type priority.

###### Returns:

> object of `ContractTypePriority` type

max_operation_current: int

Returns current value of maximum operation current.

###### Returns:

> object of `int` type

def established(self) -> bool:

Returns state of power contract (established or not).

###### Returns:

> object of `bool` type

class PowerContractControl340(PowerContractControlBase):

Class `PowerContractControl340` inherited from class `PowerContractControlBase`. Class `PowerContractControl340` allows setting and getting internal and external resistance, index of power contract. Also has all the `PowerContractControlBase` functionality.

- Set and get flag Selecting power contract by index `selecting_by_index`, type `bool`.
- Set and get index of power contract `index_of_power_contract`, type `int`.
- Set and get internal resistance `internal_resistance`, type `int` or `InternalResistance`.
- Set and get external resistance `external_resistance`, type `int` or `ExternalResistance`.

PowerContractControl340(pdc_io: UniTAP.dev.ports.modules.pdc.pdc_io.PDCPortIO)
selecting_by_index: bool

Returns state of Selecting by index flag.

###### Returns:

> object of `bool` type

index_of_power_contract: int

Returns index of current power contract.

###### Returns:

> object of `int` type

internal_resistance: Union[UniTAP.dev.ports.modules.pdc.pdc_types.InternalResistance, int]

Returns internal resistance.

###### Returns:

> object of `int` or `InternalResistance` type

external_resistance: Union[UniTAP.dev.ports.modules.pdc.pdc_types.ExternalResistance, int]

Returns external resistance.

###### Returns:

> object of `int` or `ExternalResistance` type

##### Inherited Members

PowerContractControlBase
  give_back_flag
  no_usb_suspend
  fw_swap_required_current
  pdo_type_priority
  max_operation_current
  established