Newer
Older
mbed-os / targets / TARGET_Cypress / TARGET_PSOC6 / mtb-pdl-cat1 / personalities / peripheral / counter_ver2-1.0.cypersonality
@Dustin Crossman Dustin Crossman on 4 Jun 2021 34 KB Fix file modes.
<?xml version="1.0" encoding="utf-8"?>


<!--****************************************************************************
* \file counter_ver2.cypersonality
* \version 1.0
*
* \brief
* Timer - Counter personality description file.
*
********************************************************************************
* \copyright
* Copyright 2018-2020 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************-->

<Personality id="mxs40timercounter_ver2" name="Timer - Counter" version="1.0" path="Digital/Functions" xmlns="http://cypress.com/xsd/cyhwpersonality_v1">
  <Dependencies>
    <IpBlock name="mxtcpwm_ver2" />
    <Resource name="tcpwm\.group\.cnt" used="true" />
  </Dependencies>
  <ExposedMembers />
  <Parameters>
    <!-- PDL documentation -->
    <ParamDoc id="pdlDoc" name="Configuration Help" group="Peripheral Documentation" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__tcpwm__counter.html" linkText="Open Timer - Counter (TCPWM) Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
  
    <!--General-->
    <ParamRange id="pCntGroup" name="pCntGroup" desc="pCntGroup" group="Internal"  default="`${getInstNumber(&quot;group&quot;)}`" min="0" max="3" resolution="1" visible="false" editable="false" />
    <ParamString id="pCntWidthEx" name="pCntWidthEx" desc="pCntWidthEx" group="Internal"  default="GRP_NR[`${pCntGroup}`].CNT.GRP_CNT_WIDTH" visible="false" editable="false" />
    <ParamRange id="pCntWidth" name="pCntWidth" desc="pCntWidth" group="Internal"  default="`${lookupExpression(pCntWidthEx)}`" min="0" max="32" resolution="1" visible="false" editable="false" />
    <ParamRange id="pCntWidthMax" name="pCntWidthMax" desc="pCntWidthMax" group="Internal"  default="`${pow(2, pCntWidth)-1}`" min="0" max="4294967296" resolution="1" visible="false" editable="false" />
    <ParamRange id="tcpwmInst" name="TCPWM Number" group="Internal" default="`${getInstNumber(&quot;tcpwm&quot;)}`" min="0" max="3" resolution="1" visible="false" editable="false" desc="" />
    <ParamRange id="cntInst" name="CNT Number" group="Internal" default="`${getInstNumber(&quot;cnt&quot;) + pCntGroup * 256}`" min="0" max="1023" resolution="1" visible="false" editable="false" desc="" />    
	<ParamString id="pCntCC1Ex" name="pCntCC1Ex" desc="pCntCC1Ex" group="Internal" default="GRP_NR[`${pCntGroup}`].CNT.GRP_CC1_PRESENT" visible="false" editable="false" />
    <ParamBool id="pCntCC1" name="pCntCC1" desc="pCntCC1" group="Internal" default="`${lookupExpression(pCntCC1Ex) eq 1}`" visible="false" editable="false" />
    <ParamString id="TCPWM_version" name="TCPWM version" group="General" default="TCPWM_ver2" visible="true" editable="false" desc="Version of the TCPWM hardware block"/>
    <ParamChoice id="ClockPrescaler" name="Clock Prescaler" group="General" default="CY_TCPWM_COUNTER_PRESCALER_DIVBY_1" visible="true" editable="true" desc="Divides down the input clock." >
      <Entry name="Divide by 1" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_1" visible="true" />
      <Entry name="Divide by 2" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_2" visible="true" />
      <Entry name="Divide by 4" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_4" visible="true" />
      <Entry name="Divide by 8" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_8" visible="true" />
      <Entry name="Divide by 16" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_16" visible="true" />
      <Entry name="Divide by 32" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_32" visible="true" />
      <Entry name="Divide by 64" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_64" visible="true" />
      <Entry name="Divide by 128" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_128" visible="true" />
    </ParamChoice>
    <ParamChoice id="Resolution" name="Counter Resolution" group="General" default="`${(pCntWidth eq 16) ? &quot;CY_TCPWM_COUNTER_RESOLUTION_WIDTH_16_BITS&quot; : &quot;CY_TCPWM_COUNTER_RESOLUTION_WIDTH_32_BITS&quot;}`" visible="true" editable="false" desc="Selects the size of the counter.">
      <Entry name="16-bits" value="CY_TCPWM_COUNTER_RESOLUTION_WIDTH_16_BITS" visible="true" />
      <Entry name="32-bits" value="CY_TCPWM_COUNTER_RESOLUTION_WIDTH_32_BITS" visible="true" />
    </ParamChoice>
    <ParamChoice id="RunMode" name="Run Mode" group="General" default="CY_TCPWM_COUNTER_CONTINUOUS" visible="true" editable="true" desc="If Continuous is selected counter runs forever. If One Shot is selected counter runs for one period and stops.">
      <Entry name="Continuous" value="CY_TCPWM_COUNTER_CONTINUOUS" visible="true" />
      <Entry name="One Shot" value="CY_TCPWM_COUNTER_ONESHOT" visible="true" />
    </ParamChoice>
    <ParamChoice id="CountDirection" name="Count Direction" group="General" default="CY_TCPWM_COUNTER_COUNT_UP" visible="true" editable="true" desc="Selects the direction the counter counts." >
      <Entry name="Up" value="CY_TCPWM_COUNTER_COUNT_UP" visible="true" />
      <Entry name="Down" value="CY_TCPWM_COUNTER_COUNT_DOWN" visible="true" />
      <Entry name="Up/Down1" value="CY_TCPWM_COUNTER_COUNT_UP_DOWN_1" visible="true" />
      <Entry name="Up/Down2" value="CY_TCPWM_COUNTER_COUNT_UP_DOWN_2" visible="true" />
    </ParamChoice>
    <ParamRange id="Period" name="Period" group="General" default="32768" min="0" max="`${pCntWidthMax}`" resolution="1" visible="true" editable="true" desc="Sets the period of the Timer/Counter. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." />
    <ParamChoice id="CompareOrCapture" name="Compare or Capture" group="General" default="CY_TCPWM_COUNTER_MODE_CAPTURE" visible="true" editable="true" desc="Selects the mode for the compare capture register.">
      <Entry name="Capture" value="CY_TCPWM_COUNTER_MODE_CAPTURE" visible="true" />
      <Entry name="Compare" value="CY_TCPWM_COUNTER_MODE_COMPARE" visible="true" />
    </ParamChoice>
    <ParamBool id="pCCeqCompare" name="pCCeqCompare" desc="pCCeqCompare" group="Internal" default="`${CompareOrCapture eq CY_TCPWM_COUNTER_MODE_COMPARE}`" visible="false" editable="false" />
        
    <!--Compare-->
    <ParamBool id="EnableCompare0Swap" name="Enable Compare 0 Swap" group="Compare" default="false" visible="`${pCCeqCompare}`" editable="true" desc="When selected the compare register is swapped between compare 0 and compare 0 buffer each time the comparison is true." />
    <ParamRange id="Compare0" name="`${EnableCompare0Swap ? &quot;Compare 0&quot; : &quot;Compare&quot;}`" group="Compare" default="16384" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${pCCeqCompare}`" editable="true" desc="Sets the compare value. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." />
    <ParamRange id="Compare1" name="Compare 0 Buff" group="Compare" default="16384" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${pCCeqCompare &amp;&amp; EnableCompare0Swap}`" editable="true" desc="Sets the compare value. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." />
    <ParamBool id="EnableCompare1Swap" name="Enable Compare 1 Swap" group="Compare" default="false" visible="`${pCCeqCompare &amp;&amp; pCntCC1}`" editable="true" desc="When selected the compare register is swapped between compare 1 and compare 1 buffer each time the comparison is true." />
    <ParamRange id="Compare2" name="Compare 1" group="Compare" default="16384" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${pCCeqCompare &amp;&amp; pCntCC1}`" editable="true" desc="Sets the compare value. When the count value equals the compare the compare output pulses high. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." />
    <ParamRange id="Compare3" name="Compare 1 Buff" group="Compare" default="16384" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${pCCeqCompare &amp;&amp; EnableCompare1Swap &amp;&amp; pCntCC1}`" editable="true" desc="Sets the buffered compare value. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." />
    
    <!--Capture-->
    <ParamChoice id="Capture0Input" name="Capture 0 Input" group="Capture" default="CY_TCPWM_INPUT_DISABLED" visible="`${CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE}`" editable="true" desc="This parameter determines if a Capture 0 terminal is displayed." >
      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
    </ParamChoice>
    <ParamSignal port="capture0[0]" name="Capture 0 Signal" group="Capture" visible="`${Capture0Input ne CY_TCPWM_INPUT_DISABLED}`" desc="This input triggers a capture of the current count value." canBeEmpty="`${Capture0Input eq CY_TCPWM_INPUT_DISABLED}`" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>

    <ParamChoice id="Capture1Input" name="Capture 1 Input" group="Capture" default="CY_TCPWM_INPUT_DISABLED" visible="`${pCntCC1 &amp;&amp; (CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE)}`" editable="true" desc="This parameter determines if a Capture 1 terminal is displayed." >
      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
    </ParamChoice>
    <ParamSignal port="capture1[0]" name="Capture 1 Signal" group="Capture" visible="`${Capture1Input ne CY_TCPWM_INPUT_DISABLED}`" desc="This input triggers a capture of the current count value." canBeEmpty="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED}`" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>
	
    <!--Interrupts-->
    <ParamBool id="InterruptTC" name="Overflow &amp; Underflow" group="Interrupt Source" default="false" visible="true" editable="true" desc="Generate interrupt on Overflow &amp; Underflow events" />
    <ParamBool id="InterruptCC0" name="Compare 0 &amp; Capture 0" group="Interrupt Source" default="false" visible="true" editable="true" desc="Generate interrupt on Compare &amp; Capture 0 events" />
    <ParamBool id="InterruptCC1" name="Compare 1 &amp; Capture 1" group="Interrupt Source" default="false" visible="`${pCntCC1}`" editable="true" desc="Generate interrupt on Compare1 event" />
    <ParamString id="InterruptSource" name="InterruptSource" desc="InterruptSource" group="Interrupt Source" default="(CY_TCPWM_INT_ON_TC `${(InterruptTC)? &quot;&quot; : &quot;&amp; 0U&quot;}`) | (CY_TCPWM_INT_ON_CC0 `${(InterruptCC0)? &quot;&quot; : &quot;&amp; 0U&quot;}`) | (CY_TCPWM_INT_ON_CC1 `${(InterruptCC1)? &quot;&quot; : &quot;&amp; 0U&quot;}`)" visible="false" editable="false" />

    <!--Inputs-->
    <ParamSignal port="clock[0]" name="Clock Signal" group="Inputs" visible="true" desc="The clock input defines the operating frequency." canBeEmpty="false" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>
    <ParamChoice id="CountInput" name="Count Input" group="Inputs" default="CY_TCPWM_INPUT_DISABLED" visible="true" editable="true" desc="Determines if a count input is needed and how that input is registered." >
      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
      <Entry name="Level" value="CY_TCPWM_INPUT_LEVEL" visible="true" />
      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
    </ParamChoice>
    <ParamSignal port="count[0]" name="Count Signal" group="Inputs" visible="`${CountInput ne CY_TCPWM_INPUT_DISABLED}`" desc="This input causes the counter to count depending on how the input is configured. For example, if this input is configured for level sensitive, the counter will change its count on each pre-scaled clock edge." canBeEmpty="`${CountInput eq CY_TCPWM_INPUT_DISABLED}`" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>
    <ParamChoice id="StopInput" name="Stop Input" group="Inputs" default="CY_TCPWM_INPUT_DISABLED" visible="true" editable="true" desc="Determines if a stop input is needed and how that input is registered." >
      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
    </ParamChoice>
    <ParamSignal port="stop[0]" name="Stop Signal" group="Inputs" visible="`${StopInput ne CY_TCPWM_INPUT_DISABLED}`" desc="This input stops the counter." canBeEmpty="`${StopInput eq CY_TCPWM_INPUT_DISABLED}`" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 
    </ParamSignal>
    <ParamChoice id="ReloadInput" name="Reload Input" group="Inputs" default="CY_TCPWM_INPUT_DISABLED" visible="true" editable="true" desc="Determines if a reload input is needed and how the reload signal input is registered." >
      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
    </ParamChoice>
    <ParamSignal port="reload[0]" name="Reload Signal" group="Inputs" visible="`${ReloadInput ne CY_TCPWM_INPUT_DISABLED}`" desc="This input triggers a reload of the counter, and starts the counter." canBeEmpty="`${ReloadInput eq CY_TCPWM_INPUT_DISABLED}`" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>
    <ParamChoice id="StartInput" name="Start Input" group="Inputs" default="CY_TCPWM_INPUT_DISABLED" visible="true" editable="true" desc="Determines if a start input is needed and how that input is registered." >
      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
    </ParamChoice>
    <ParamSignal port="start[0]" name="Start Signal" group="Inputs" visible="`${StartInput ne CY_TCPWM_INPUT_DISABLED}`" desc="This input starts the counter." canBeEmpty="`${StartInput eq CY_TCPWM_INPUT_DISABLED}`" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_HIGHZ" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>

    <!--Trigger Outputs-->
    <ParamChoice id="trigger0Event" name="Trigger 0 Event" group="Trigger Outputs" default="CY_TCPWM_CNT_TRIGGER_ON_DISABLED" visible="true" editable="true" desc="This output used to connect TCPWM event signals to other peripherals." >
      <Entry name="Overflow" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" visible="true" />
      <Entry name="Underflow" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" visible="true" />
      <Entry name="Terminal Count" value="CY_TCPWM_CNT_TRIGGER_ON_TC" visible="true" />
      <Entry name="Compare 0 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" visible="true" />
      <Entry name="Compare 1 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" visible="false" />
      <Entry name="Disabled" value="CY_TCPWM_CNT_TRIGGER_ON_DISABLED" visible="true" />
    </ParamChoice>
    <ParamSignal port="tr_out0[0]" name="Trigger 0 Signal" group="Trigger Outputs" visible="`${trigger0Event ne CY_TCPWM_CNT_TRIGGER_ON_DISABLED}`" desc="Signals to connect on Trigger 0 Event" canBeEmpty="`${trigger0Event eq CY_TCPWM_CNT_TRIGGER_ON_DISABLED}`">
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>
    <ParamChoice id="trigger1Event" name="Trigger 1 Event" group="Trigger Outputs" default="CY_TCPWM_CNT_TRIGGER_ON_DISABLED" visible="true" editable="true" desc="This output used to connect TCPWM event signals to other peripherals." >
      <Entry name="Overflow" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" visible="true" />
      <Entry name="Underflow" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" visible="true" />
      <Entry name="Terminal Count" value="CY_TCPWM_CNT_TRIGGER_ON_TC" visible="true" />
      <Entry name="Compare 0 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" visible="true" />
      <Entry name="Compare 1 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" visible="false" />
      <Entry name="Disabled" value="CY_TCPWM_CNT_TRIGGER_ON_DISABLED" visible="true" />
    </ParamChoice>
    <ParamSignal port="tr_out1[0]" name="Trigger 1 Signal" group="Trigger Outputs" visible="`${trigger1Event ne CY_TCPWM_CNT_TRIGGER_ON_DISABLED}`" desc="Signals to connect on Trigger 1 Event" canBeEmpty="`${trigger1Event eq CY_TCPWM_CNT_TRIGGER_ON_DISABLED}`" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>
  
    
    <!--Config-->
    <ParamBool id="inFlash" name="Store Config in Flash" group="Advanced" default="true" visible="true" editable="true" desc="Controls whether the configuration structure is stored in flash (const, true) or SRAM (not const, false)." />
 
    <!-- Peripheral clock divider connection -->
    <ParamString id="definePrefix" name="Define prefix" group="Internal" default="`${&quot;TCPWM&quot; . tcpwmInst . &quot;_GRP&quot; . pCntGroup . &quot;_CNT&quot; . getInstNumber(&quot;cnt&quot;)}`" visible="false" editable="false" desc="" />
    <ParamString id="defineInputDisabled" name="Define input disabled" group="Internal" default="`${INST_NAME . &quot;_INPUT_DISABLED &amp; 0x3U&quot;}`" visible="false" editable="false" desc="" />    
    <ParamString id="pclk" name="PCLK" group="Internal" default="`${getBlockFromSignal(&quot;clock[0]&quot;)}`" visible="false" editable="false" desc="Connected peripheral clock divider (PCLK)" />
    <ParamBool id="pclkOk" name="PCLK Valid" group="Internal" default="`${hasConnection(&quot;clock&quot;, 0) &amp;&amp; isBlockUsed(pclk)}`" visible="false" editable="false" desc="Checks whether there is a PCLK connected and enabled" />
    <ParamString id="pclkDst" name="PCLK Destination" group="Internal" default="PCLK_TCPWM`${tcpwmInst}`_CLOCKS`${cntInst}`" visible="false" editable="false" desc="" />
    
  </Parameters>

  <DRCs>
    <!--Compare0 DRCs-->
    <DRC type="ERROR" text="Compare 0 value must be less or equal to period." condition="`${pCCeqCompare &amp;&amp; (Compare0 &gt; Period)}`" paramId="Compare0" />
    
    <!--CompareBuff0 DRCs-->
    <DRC type="ERROR" text="Compare 0 Buffer value must be less or equal to period." condition="`${pCCeqCompare &amp;&amp; EnableCompare0Swap &amp;&amp; (Compare1 &gt; Period)}`" paramId="Compare1" />

    <!--Compare1 DRCs-->
    <DRC type="ERROR" text="Compare 1 value must be less or equal to period." condition="`${pCntCC1 &amp;&amp; pCCeqCompare &amp;&amp; (Compare2 &gt; Period)}`" paramId="Compare2" />

    <!--CompareBuff1 DRCs-->
    <DRC type="ERROR" text="Compare 1 Buffer value must be less or equal to period." condition="`${pCntCC1 &amp;&amp; pCCeqCompare &amp;&amp; EnableCompare1Swap &amp;&amp; (Compare3 &gt; Period)}`" paramId="Compare3" />

    <!--CountInput DRCs-->
    <DRC type="ERROR" text="Count Event has to be enabled to use Count Signal." condition="`${hasConnection(&quot;count&quot;, 0) &amp;&amp; (CountInput eq CY_TCPWM_INPUT_DISABLED)}`" paramId="CountInput">
        <FixIt action="SET_PARAM" target="CountInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="CountInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="CountInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="CountInput" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
	</DRC>

    <!--ReloadInput DRCs-->
    <DRC type="ERROR" text="Reload Event has to be enabled to use Reload Signal." condition="`${hasConnection(&quot;reload&quot;, 0) &amp;&amp; (ReloadInput eq CY_TCPWM_INPUT_DISABLED)}`" paramId="ReloadInput">
	    <FixIt action="SET_PARAM" target="ReloadInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="ReloadInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="ReloadInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="ReloadInput" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
	</DRC>

    <!--StartInput DRCs-->
    <DRC type="ERROR" text="Start Event has to be enabled to use Start Signal." condition="`${hasConnection(&quot;start&quot;, 0) &amp;&amp; (StartInput eq CY_TCPWM_INPUT_DISABLED)}`" paramId="StartInput">
	    <FixIt action="SET_PARAM" target="StartInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="StartInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="StartInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="StartInput" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
	</DRC>

    <!--Capture0Input DRCs-->
    <DRC type="ERROR" text="Capture 0 Event has to be enabled to use Capture 0 Signal." condition="`${hasConnection(&quot;capture0&quot;, 0) &amp;&amp; (Capture0Input eq CY_TCPWM_INPUT_DISABLED)}`" paramId="Capture0Input">
	    <FixIt action="SET_PARAM" target="Capture0Input" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="Capture0Input" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="Capture0Input" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="Capture0Input" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
	</DRC>

	<!--Capture1Input DRCs-->
    <DRC type="ERROR" text="Capture 1 Event has to be enabled to use Capture 1 Signal." condition="`${hasConnection(&quot;capture1&quot;, 0) &amp;&amp; (Capture1Input eq CY_TCPWM_INPUT_DISABLED)}`" paramId="Capture1Input">
	    <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
	</DRC>

    <!--StopInput DRCs-->
    <DRC type="ERROR" text="Stop Event has to be enabled to use Stop Signal." condition="`${hasConnection(&quot;stop&quot;, 0) &amp;&amp; (StopInput eq CY_TCPWM_INPUT_DISABLED)}`" paramId="StopInput">
	    <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
	    <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
	</DRC>


	<!--Trigger Output DRCs-->
	<DRC type="ERROR" text="Trigger 0 Event has to be enabled to use Trigger 0 Signal." condition="`${hasConnection(&quot;tr_out0&quot;, 0) &amp;&amp; (trigger0Event eq CY_TCPWM_CNT_TRIGGER_ON_DISABLED)}`" paramId="trigger0Event">
	    <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" valid="true" />
	    <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" valid="true" />
	    <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_TC" valid="true" />
	    <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" valid="true" />
	    <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" valid="false" />
	</DRC>
	<DRC type="ERROR" text="Trigger 1 Event has to be enabled to use Trigger 1 Signal." condition="`${hasConnection(&quot;tr_out1&quot;, 0) &amp;&amp; (trigger1Event eq CY_TCPWM_CNT_TRIGGER_ON_DISABLED)}`" paramId="trigger1Event">
  	    <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" valid="true" />
	    <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" valid="true" />
	    <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_TC" valid="true" />
	    <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" valid="true" />
	    <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" valid="false" />
	</DRC>
  </DRCs>
  
  <ConfigFirmware>
    <ConfigInclude value="cy_tcpwm_counter.h" include="true" />
    <ConfigInclude value="cy_sysclk.h" include="`${pclkOk}`" />
    <ConfigInclude value="cycfg_routing.h" include="true" />
    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
    
    <ConfigDefine name="`${INST_NAME}`_HW" value="TCPWM`${tcpwmInst}`" public="true" include="true" />
    <ConfigDefine name="`${INST_NAME}`_NUM" value="`${cntInst}`UL" public="true" include="true" />
    <ConfigDefine name="`${INST_NAME}`_IRQ" value="tcpwm_`${tcpwmInst}`_interrupts_`${cntInst}`_IRQn" public="true" include="`${InterruptTC || InterruptCC0 || InterruptCC1}`" />
    <ConfigDefine name="`${INST_NAME}`_INPUT_DISABLED" value="0x7U" public="false" include="true" />
    <ConfigStruct name="`${INST_NAME . &quot;_config&quot;}`" type="cy_stc_tcpwm_counter_config_t" const="`${inFlash}`" public="true" include="true">
      <Member name="period" value="`${Period}`" />
      <Member name="clockPrescaler" value="`${ClockPrescaler}`" />
      <Member name="runMode" value="`${RunMode}`" />
      <Member name="countDirection" value="`${CountDirection}`" />
      <Member name="compareOrCapture" value="`${CompareOrCapture}`" />
      <Member name="compare0" value="`${Compare0}`" />
      <Member name="compare1" value="`${Compare1}`" />
      <Member name="enableCompareSwap" value="`${EnableCompare0Swap}`" />
      <Member name="interruptSources" value="`${InterruptSource}`" />
      <Member name="captureInputMode" value="`${Capture0Input eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : Capture0Input}`" />
      <Member name="captureInput" value="`${Capture0Input eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_CAPTURE0_VALUE&quot;)}`" />
      <Member name="reloadInputMode" value="`${ReloadInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : ReloadInput}`" />
      <Member name="reloadInput" value="`${ReloadInput eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_RELOAD_VALUE&quot;)}`" />
      <Member name="startInputMode" value="`${StartInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : StartInput}`" />
      <Member name="startInput" value="`${StartInput eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_START_VALUE&quot;)}`" />
      <Member name="stopInputMode" value="`${StopInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : StopInput}`" />
      <Member name="stopInput" value="`${StopInput eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_STOP_VALUE&quot;)}`" />
      <Member name="countInputMode" value="`${CountInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : CountInput}`" />
      <Member name="countInput" value="`${CountInput eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_1&quot; : (definePrefix . &quot;_COUNT_VALUE&quot;)}`" />
      <Member name="capture1InputMode" value="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : Capture1Input}`" />
      <Member name="capture1Input" value="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_CAPTURE1_VALUE&quot;)}`" />
      <Member name="compare2" value="`${pCntCC1 ? Compare2 : &quot;CY_TCPWM_GRP_CNT_CC0_DEFAULT&quot;}`" />
      <Member name="compare3" value="`${pCntCC1 ? Compare3 : &quot;CY_TCPWM_GRP_CNT_CC0_BUFF_DEFAULT&quot;}`" />
      <Member name="enableCompare1Swap" value="`${EnableCompare1Swap}`" />
      <Member name="trigger0Event" value="`${trigger0Event}`" />
      <Member name="trigger1Event" value="`${trigger1Event}`" />
    </ConfigStruct>
    
    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)">
      <Member name="type" value="CYHAL_RSC_TCPWM" />
      <Member name="block_num" value="`${getInstNumber(&quot;tcpwm&quot;)}`U" />
      <Member name="channel_num" value="`${getInstNumber(&quot;cnt&quot;)}`U" />
    </ConfigStruct>
    
    <ConfigInstruction value="Cy_SysClk_PeriphAssignDivider(`${pclkDst}`, `${getExposedMember(pclk, &quot;clockSel&quot;)}`);" include="`${pclkOk}`" />
    <ConfigInstruction value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
  </ConfigFirmware>
</Personality>