1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file counter_v2.cypersonality
6* \version 1.0
7*
8* \brief
9* Timer - Counter personality description file.
10*
11********************************************************************************
12* \copyright
13* Copyright 2018-2022 Cypress Semiconductor Corporation
14* SPDX-License-Identifier: Apache-2.0
15*
16* Licensed under the Apache License, Version 2.0 (the "License");
17* you may not use this file except in compliance with the License.
18* You may obtain a copy of the License at
19*
20*     http://www.apache.org/licenses/LICENSE-2.0
21*
22* Unless required by applicable law or agreed to in writing, software
23* distributed under the License is distributed on an "AS IS" BASIS,
24* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25* See the License for the specific language governing permissions and
26* limitations under the License.
27*****************************************************************************-->
28
29<Personality id="mxs40timercounter_ver2" name="Timer - Counter" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v8">
30  <Dependencies>
31    <IpBlock name="mxtcpwm_ver2,mxtcpwm,mxs40tcpwm" />
32    <Resource name="tcpwm\.group\.cnt" />
33    <OperatingMode value="MCU"/>
34  </Dependencies>
35  <ExposedMembers>
36    <ExposedMember key="hal_block" paramId="hal_block" />
37  </ExposedMembers>
38  <Parameters>
39    <!-- PDL documentation -->
40    <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" 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" />
41
42    <!--General-->
43    <ParamRange id="pCntGroup" name="pCntGroup" desc="pCntGroup" group="Internal"  default="`${getInstNumber(&quot;group&quot;)}`" min="0" max="3" resolution="1" visible="false" editable="false" />
44    <ParamRange id="pMaxGroupCount" name="pMaxGroupCount" desc="pMaxGroupCount" group="Internal"  default="4" min="0" max="4" resolution="1" visible="false" editable="false" />
45    <ParamString id="pCntWidthEx" name="pCntWidthEx" desc="pCntWidthEx" group="Internal"  default="GRP_NR[`${pCntGroup}`].CNT.GRP_CNT_WIDTH" visible="false" editable="false" />
46    <ParamRange id="pCntWidth" name="pCntWidth" desc="pCntWidth" group="Internal"  default="`${lookupExpression(pCntWidthEx)}`" min="0" max="32" resolution="1" visible="false" editable="false" />
47    <ParamRange id="pCntWidthMax" name="pCntWidthMax" desc="pCntWidthMax" group="Internal"  default="`${pow(2, pCntWidth)-1}`" min="0" max="4294967296" resolution="1" visible="false" editable="false" />
48    <ParamRange id="tcpwmInst" name="TCPWM Number" group="Internal" default="`${getInstNumber(&quot;tcpwm&quot;)}`" min="0" max="3" resolution="1" visible="false" editable="false" desc="" />
49    <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="" />
50    <ParamString id="pCntCC1Ex" name="pCntCC1Ex" desc="pCntCC1Ex" group="Internal" default="GRP_NR[`${pCntGroup}`].CNT.GRP_CC1_PRESENT" visible="false" editable="false" />
51    <ParamBool id="pCntCC1" name="pCntCC1" desc="pCntCC1" group="Internal" default="`${lookupExpression(pCntCC1Ex) eq 1}`" visible="false" editable="false" />
52    <ParamString id="TCPWM_version" name="TCPWM Version" group="General" default="TCPWM_ver2" visible="false" editable="false" desc="Version of the TCPWM hardware block"/>
53    <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." >
54      <Entry name="Divide by 1" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_1" visible="true" />
55      <Entry name="Divide by 2" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_2" visible="true" />
56      <Entry name="Divide by 4" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_4" visible="true" />
57      <Entry name="Divide by 8" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_8" visible="true" />
58      <Entry name="Divide by 16" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_16" visible="true" />
59      <Entry name="Divide by 32" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_32" visible="true" />
60      <Entry name="Divide by 64" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_64" visible="true" />
61      <Entry name="Divide by 128" value="CY_TCPWM_COUNTER_PRESCALER_DIVBY_128" visible="true" />
62    </ParamChoice>
63
64    <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.">
65      <Entry name="16-bits" value="CY_TCPWM_COUNTER_RESOLUTION_WIDTH_16_BITS" visible="true" />
66      <Entry name="32-bits" value="CY_TCPWM_COUNTER_RESOLUTION_WIDTH_32_BITS" visible="true" />
67    </ParamChoice>
68    <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.">
69      <Entry name="Continuous" value="CY_TCPWM_COUNTER_CONTINUOUS" visible="true" />
70      <Entry name="One Shot" value="CY_TCPWM_COUNTER_ONESHOT" visible="true" />
71    </ParamChoice>
72
73    <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)." />
74    <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.">
75      <Entry name="Capture" value="CY_TCPWM_COUNTER_MODE_CAPTURE" visible="true" />
76      <Entry name="Compare" value="CY_TCPWM_COUNTER_MODE_COMPARE" visible="true" />
77    </ParamChoice>
78    <ParamBool id="pCCeqCompare" name="pCCeqCompare" desc="pCCeqCompare" group="Internal" default="`${CompareOrCapture eq CY_TCPWM_COUNTER_MODE_COMPARE}`" visible="false" editable="false" />
79
80    <ParamBool id="copy_enable" name="Shadow Copy Enable" group="General" default="false" visible="`${(&quot;mxs40tcpwm&quot; eq getIpBlockName())}`" editable="`${(&quot;mxs40tcpwm&quot; eq getIpBlockName())}`" desc="Specifies whether swapping mechanism between CC0 and buffered CC0, CC1 and buffered CC1, PERIOD and buffered PERIOD, DT and buffered DT are disabled." />
81
82    <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." >
83      <Entry name="Up" value="CY_TCPWM_COUNTER_COUNT_UP" visible="true" />
84      <Entry name="Down" value="CY_TCPWM_COUNTER_COUNT_DOWN" visible="true" />
85      <Entry name="Up/Down1" value="CY_TCPWM_COUNTER_COUNT_UP_DOWN_1" visible="true" />
86      <Entry name="Up/Down2" value="CY_TCPWM_COUNTER_COUNT_UP_DOWN_2" visible="true" />
87    </ParamChoice>
88
89    <ParamBool id="timer_direction_available" name="Timer Direction Availability" group="General" default="false" visible="false" editable="`${(&quot;mxs40tcpwm&quot; eq getIpBlockName()) &amp;&amp; (CompareOrCapture eq CY_TCPWM_COUNTER_MODE_COMPARE) &amp;&amp; ((CountDirection eq CY_TCPWM_COUNTER_COUNT_UP) || (CountDirection eq CY_TCPWM_COUNTER_COUNT_DOWN))}`" desc="timer direction availability" />
90
91    <ParamChoice id="Timer_Direction_Mode" name="Timer Direction Mode" group="General" default="CY_TCPWM_COUNTER_DIRECTION_DISABLE" visible="`${(&quot;mxs40tcpwm&quot; eq getIpBlockName()) &amp;&amp; (CompareOrCapture eq CY_TCPWM_COUNTER_MODE_COMPARE) &amp;&amp; ((CountDirection eq CY_TCPWM_COUNTER_COUNT_UP) || (CountDirection eq CY_TCPWM_COUNTER_COUNT_DOWN))}`" editable="`${(&quot;mxs40tcpwm&quot; eq getIpBlockName()) &amp;&amp; (CompareOrCapture eq CY_TCPWM_COUNTER_MODE_COMPARE) &amp;&amp; ((CountDirection eq CY_TCPWM_COUNTER_COUNT_UP) || (CountDirection eq CY_TCPWM_COUNTER_COUNT_DOWN))}`" desc="Counter changes it's direction based on the capture 0 input ." >
92      <Entry name="Counter Direction Disable" value="CY_TCPWM_COUNTER_DIRECTION_DISABLE" visible="true" />
93      <Entry name="Counter Direction Falling" value="CY_TCPWM_COUNTER_DIRECTION_FALLING" visible="true" />
94      <Entry name="Counter Direction Rising"  value="CY_TCPWM_COUNTER_DIRECTION_RISING"  visible="true" />
95      <Entry name="Counter Direction Level"   value="CY_TCPWM_COUNTER_DIRECTION_LEVEL"   visible="true" />
96    </ParamChoice>
97
98    <!--Glitch Filter-->
99    <ParamBool id="gf_enable" name="Glitch Filter Enable" group="Glitch Filter" default="false" visible="`${(&quot;mxs40tcpwm&quot; eq getIpBlockName())}`" editable="true" desc="Enables Glitch filter for input triggers. The Number of glitch filters is design specific and if there is a glitch filter connected to this input trigger it will be used. " />
100
101    <ParamChoice id="gf_depth" name="Glitch Filter Depth" group="Glitch Filter" default="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_0" visible="`${(gf_enable) &amp;&amp; (&quot;mxs40tcpwm&quot; eq getIpBlockName())}`" editable="true" desc="Glitch filter depth support values." >
102      <Entry name="Depth Value 0"   value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_0"   visible="true" />
103      <Entry name="Depth Value 1"   value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_1"   visible="true" />
104      <Entry name="Depth Value 2"   value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_2"   visible="true" />
105      <Entry name="Depth Value 4"   value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_4"   visible="true" />
106      <Entry name="Depth Value 8"   value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_8"   visible="true" />
107      <Entry name="Depth Value 16"  value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_16"  visible="true" />
108      <Entry name="Depth Value 32"  value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_32"  visible="true" />
109      <Entry name="Depth Value 64"  value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_64"  visible="true" />
110      <Entry name="Depth Value 128" value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_128" visible="true" />
111      <Entry name="Depth Value 256" value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_256" visible="true" />
112      <Entry name="Depth Value 512" value="CY_GLITCH_FILTER_DEPTH_SUPPORT_VALUE_512" visible="true" />
113    </ParamChoice>
114
115    <!--Compare-->
116    <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." />
117    <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)." />
118    <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)." />
119    <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." />
120    <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)." />
121    <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)." />
122
123    <!--Capture-->
124    <ParamChoice id="Capture0Input" name="Capture 0 Input" group="Capture" default="CY_TCPWM_INPUT_DISABLED" visible="`${(CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE) || (Timer_Direction_Mode ne CY_TCPWM_COUNTER_DIRECTION_DISABLE)}`" editable="`${(CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE) || (Timer_Direction_Mode ne CY_TCPWM_COUNTER_DIRECTION_DISABLE)}`" desc="This parameter determines if a Capture 0 terminal is displayed." >
125      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="`${(CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE) || (Timer_Direction_Mode eq CY_TCPWM_COUNTER_DIRECTION_DISABLE)}`" />
126      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="`${(CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE) || (Timer_Direction_Mode eq CY_TCPWM_COUNTER_DIRECTION_DISABLE)}`" />
127      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="`${(CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE) || (Timer_Direction_Mode eq CY_TCPWM_COUNTER_DIRECTION_DISABLE)}`" />
128      <Entry name="Level" value="CY_TCPWM_INPUT_LEVEL" visible="`${(Timer_Direction_Mode ne CY_TCPWM_COUNTER_DIRECTION_DISABLE)}`" />
129      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
130    </ParamChoice>
131    <ParamSignal port="capture0[0]" name="Capture 0 Signal" group="Capture" visible="`${(Capture0Input ne CY_TCPWM_INPUT_DISABLED) &amp;&amp; ((CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE) || (Timer_Direction_Mode ne CY_TCPWM_COUNTER_DIRECTION_DISABLE)) }`" desc="This input triggers a capture of the current count value." canBeEmpty="`${Capture0Input eq CY_TCPWM_INPUT_DISABLED}`" >
132      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
133        <Parameter id="DriveModes" severity="DEFAULT" reason="">
134          <Fixed value="CY_GPIO_DM_HIGHZ" />
135        </Parameter>
136      </Constraint>
137      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
138        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
139          <Fixed value="CY_GPIO_DM_HIGHZ" />
140        </Parameter>
141      </Constraint>
142      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
143    </ParamSignal>
144
145    <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." >
146      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
147      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
148      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
149      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
150    </ParamChoice>
151    <ParamSignal port="capture1[0]" name="Capture 1 Signal" group="Capture" visible="`${(Capture1Input ne CY_TCPWM_INPUT_DISABLED) &amp;&amp; (pCntCC1 &amp;&amp; (CompareOrCapture eq CY_TCPWM_COUNTER_MODE_CAPTURE))}`" desc="This input triggers a capture of the current count value." canBeEmpty="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED}`" >
152      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
153        <Parameter id="DriveModes" severity="DEFAULT" reason="">
154          <Fixed value="CY_GPIO_DM_HIGHZ" />
155        </Parameter>
156      </Constraint>
157      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
158        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
159          <Fixed value="CY_GPIO_DM_HIGHZ" />
160        </Parameter>
161      </Constraint>
162      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
163    </ParamSignal>
164
165    <!--Interrupts-->
166    <ParamBool id="InterruptTC" name="Overflow &amp; Underflow" group="Interrupt Source" default="false" visible="true" editable="true" desc="Generate interrupt on Overflow &amp; Underflow events" />
167    <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" />
168    <ParamBool id="InterruptCC1" name="Compare 1 &amp; Capture 1" group="Interrupt Source" default="false" visible="`${pCntCC1}`" editable="true" desc="Generate interrupt on Compare1 event" />
169    <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" />
170
171    <!--Inputs-->
172    <ParamSignal port="clock[0]" name="Clock Signal" group="Inputs" visible="`${hasVisibleOption(&quot;clock[0]&quot;)}`" desc="The clock input defines the operating frequency." canBeEmpty="`${!hasVisibleOption(&quot;clock[0]&quot;)}`" />
173    <ParamSignal port="clock_counter_en[0]" name="Clock Signal" group="Inputs" visible="`${hasVisibleOption(&quot;clock_counter_en[0]&quot;)}`" desc="The clock input defines the operating frequency." canBeEmpty="`${!hasVisibleOption(&quot;clock_counter_en[0]&quot;)}`" />
174    <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." >
175      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
176      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
177      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
178      <Entry name="Level" value="CY_TCPWM_INPUT_LEVEL" visible="true" />
179      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
180    </ParamChoice>
181    <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}`" >
182      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
183        <Parameter id="DriveModes" severity="DEFAULT" reason="">
184          <Fixed value="CY_GPIO_DM_HIGHZ" />
185        </Parameter>
186      </Constraint>
187      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
188        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
189          <Fixed value="CY_GPIO_DM_HIGHZ" />
190        </Parameter>
191      </Constraint>
192      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
193    </ParamSignal>
194    <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." >
195      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
196      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
197      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
198      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
199    </ParamChoice>
200    <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}`" >
201      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
202        <Parameter id="DriveModes" severity="DEFAULT" reason="">
203          <Fixed value="CY_GPIO_DM_HIGHZ" />
204        </Parameter>
205      </Constraint>
206      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
207        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
208          <Fixed value="CY_GPIO_DM_HIGHZ" />
209        </Parameter>
210      </Constraint>
211      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
212    </ParamSignal>
213    <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." >
214      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
215      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
216      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
217      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
218    </ParamChoice>
219    <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}`" >
220      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
221        <Parameter id="DriveModes" severity="DEFAULT" reason="">
222          <Fixed value="CY_GPIO_DM_HIGHZ" />
223        </Parameter>
224      </Constraint>
225      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
226        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
227          <Fixed value="CY_GPIO_DM_HIGHZ" />
228        </Parameter>
229      </Constraint>
230      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
231    </ParamSignal>
232    <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." >
233      <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" />
234      <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" />
235      <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" />
236      <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" />
237    </ParamChoice>
238    <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}`" >
239      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
240        <Parameter id="DriveModes" severity="DEFAULT" reason="">
241          <Fixed value="CY_GPIO_DM_HIGHZ" />
242        </Parameter>
243      </Constraint>
244      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
245        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
246          <Fixed value="CY_GPIO_DM_HIGHZ" />
247        </Parameter>
248      </Constraint>
249      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
250    </ParamSignal>
251
252    <!--Trigger Outputs-->
253    <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." >
254      <Entry name="Overflow" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" visible="true" />
255      <Entry name="Underflow" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" visible="true" />
256      <Entry name="Terminal Count" value="CY_TCPWM_CNT_TRIGGER_ON_TC" visible="true" />
257      <Entry name="Compare 0 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" visible="true" />
258      <Entry name="Compare 1 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" visible="false" />
259      <Entry name="Disabled" value="CY_TCPWM_CNT_TRIGGER_ON_DISABLED" visible="true" />
260    </ParamChoice>
261    <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}`">
262      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
263        <Parameter id="DriveModes" severity="DEFAULT" reason="">
264          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
265        </Parameter>
266      </Constraint>
267      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
268        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
269          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
270        </Parameter>
271      </Constraint>
272      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
273    </ParamSignal>
274    <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." >
275      <Entry name="Overflow" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" visible="true" />
276      <Entry name="Underflow" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" visible="true" />
277      <Entry name="Terminal Count" value="CY_TCPWM_CNT_TRIGGER_ON_TC" visible="true" />
278      <Entry name="Compare 0 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" visible="true" />
279      <Entry name="Compare 1 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" visible="false" />
280      <Entry name="Disabled" value="CY_TCPWM_CNT_TRIGGER_ON_DISABLED" visible="true" />
281    </ParamChoice>
282    <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}`" >
283      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
284        <Parameter id="DriveModes" severity="DEFAULT" reason="">
285          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
286        </Parameter>
287      </Constraint>
288      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
289        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
290          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
291        </Parameter>
292      </Constraint>
293      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
294    </ParamSignal>
295
296    <!-- Clock Frequency -->
297    <ParamString id="sourceClock" name="sourceClock" group="General" default="`${(hasVisibleOption(&quot;clock[0]&quot;)) ? (getBlockFromSignal(&quot;clock[0]&quot;)) : (getBlockFromSignal(&quot;clock_counter_en[0]&quot;))}`" visible="false" editable="false" desc="Source Clock Resource" />
298    <ParamRange  id="tcpwmClkHz" name="tcpwmClkHz" group="General" default="`${getExposedMember(sourceClock, &quot;frequency&quot;)}`" min="0" max="400000000" resolution="1" visible="false" editable="false" desc="TCPWM clock frequency in Hz" />
299
300    <!--Config-->
301    <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)." />
302
303    <!-- Peripheral clock divider connection -->
304    <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="" />
305    <ParamString id="defineInputDisabled" name="Define input disabled" group="Internal" default="`${INST_NAME . &quot;_INPUT_DISABLED &amp; 0x3U&quot;}`" visible="false" editable="false" desc="" />
306    <ParamString id="pclk" name="PCLK" group="Internal" default="`${hasVisibleOption(&quot;clock_counter_en[0]&quot;) ? getBlockFromSignal(&quot;clock_counter_en[0]&quot;):getBlockFromSignal(&quot;clock[0]&quot;)}`" visible="false" editable="false" desc="Connected peripheral clock divider (PCLK)" />
307    <ParamBool id="pclkOk" name="PCLK Valid" group="Internal" default="`${hasVisibleOption(&quot;clock_counter_en[0]&quot;) ? hasConnection(&quot;clock_counter_en&quot;, 0) &amp;&amp; isBlockUsed(pclk) : hasConnection(&quot;clock&quot;, 0) &amp;&amp; isBlockUsed(pclk)}`" visible="false" editable="false" desc="Checks whether there is a PCLK connected and enabled" />
308    <ParamString id="pclkDst" name="PCLK Destination" group="Internal" default="`${hasVisibleOption(&quot;clock_counter_en[0]&quot;) ? &quot;PCLK_TCPWM&quot; . tcpwmInst . &quot;_CLOCK_COUNTER_EN&quot; . cntInst : &quot;PCLK_TCPWM&quot; . tcpwmInst . &quot;_CLOCKS&quot; . cntInst}`" visible="false" editable="false" desc="" />
309
310    <ParamString id="hal_block" name="hal_block" group="Internal" default="`${INST_NAME}`_hal_config" visible="false" editable="false" desc="" />
311  </Parameters>
312
313  <DRCs>
314
315    <DRC type="ERROR" paramId="clock_en[0]" text="Maximum input clock signal frequency supported is 100 Mhz. Please fix input clock setting." condition="`${(hasVisibleOption(&quot;clock[0]&quot;)) &amp;&amp; (tcpwmClkHz &gt; 100000000)}`" />
316    <DRC type="ERROR" paramId="clock_counter_en[0]" text="Maximum input clock signal frequency supported is 100 Mhz. Please fix input clock setting." condition="`${(hasVisibleOption(&quot;clock_counter_en[0]&quot;)) &amp;&amp; (tcpwmClkHz &gt; 100000000)}`" />
317
318    <!--Compare0 DRCs-->
319    <DRC type="ERROR" text="Compare 0 value must be less or equal to period." condition="`${pCCeqCompare &amp;&amp; (Compare0 &gt; Period)}`" paramId="Compare0" />
320
321    <!--CompareBuff0 DRCs-->
322    <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" />
323
324    <!--Compare1 DRCs-->
325    <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" />
326
327    <!--CompareBuff1 DRCs-->
328    <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" />
329
330    <!--CountInput DRCs-->
331    <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">
332        <FixIt action="SET_PARAM" target="CountInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
333        <FixIt action="SET_PARAM" target="CountInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
334        <FixIt action="SET_PARAM" target="CountInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
335        <FixIt action="SET_PARAM" target="CountInput" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
336    </DRC>
337
338    <!--ReloadInput DRCs-->
339    <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">
340        <FixIt action="SET_PARAM" target="ReloadInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
341        <FixIt action="SET_PARAM" target="ReloadInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
342        <FixIt action="SET_PARAM" target="ReloadInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
343        <FixIt action="SET_PARAM" target="ReloadInput" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
344    </DRC>
345
346    <!--StartInput DRCs-->
347    <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">
348        <FixIt action="SET_PARAM" target="StartInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
349        <FixIt action="SET_PARAM" target="StartInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
350        <FixIt action="SET_PARAM" target="StartInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
351        <FixIt action="SET_PARAM" target="StartInput" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
352    </DRC>
353
354    <!--Capture0Input DRCs-->
355    <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">
356        <FixIt action="SET_PARAM" target="Capture0Input" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
357        <FixIt action="SET_PARAM" target="Capture0Input" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
358        <FixIt action="SET_PARAM" target="Capture0Input" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
359        <FixIt action="SET_PARAM" target="Capture0Input" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
360    </DRC>
361
362    <!--Capture1Input DRCs-->
363    <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">
364        <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
365        <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
366        <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
367        <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
368    </DRC>
369
370    <!--StopInput DRCs-->
371    <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">
372        <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" />
373        <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" />
374        <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" />
375        <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_LEVEL" valid="true" />
376    </DRC>
377
378
379    <!--Trigger Output DRCs-->
380    <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">
381        <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" valid="true" />
382        <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" valid="true" />
383        <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_TC" valid="true" />
384        <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" valid="true" />
385        <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" valid="false" />
386    </DRC>
387    <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">
388          <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" valid="true" />
389        <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" valid="true" />
390        <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_TC" valid="true" />
391        <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" valid="true" />
392        <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" valid="false" />
393    </DRC>
394  </DRCs>
395
396  <ConfigFirmware>
397    <ConfigInclude value="cy_tcpwm_counter.h" include="true" />
398    <ConfigInclude value="cy_sysclk.h" include="`${pclkOk}`" />
399    <ConfigInclude value="cycfg_routing.h" include="true" />
400    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
401    <ConfigInclude value="cyhal.h" include="true" guard="defined (CY_USING_HAL)" />
402    <ConfigInclude value="cyhal_hw_types.h" include="true" guard="defined (CY_USING_HAL_LITE)" />
403
404    <ConfigDefine name="`${INST_NAME}`_HW" value="TCPWM`${tcpwmInst}`" public="true" include="true" />
405    <ConfigDefine name="`${INST_NAME}`_NUM" value="`${cntInst}`UL" public="true" include="true" />
406    <ConfigDefine name="`${INST_NAME}`_IRQ" value="tcpwm_`${tcpwmInst}`_interrupts_`${cntInst}`_IRQn" public="true" include="`${InterruptTC || InterruptCC0 || InterruptCC1}`" />
407    <ConfigDefine name="`${INST_NAME}`_INPUT_DISABLED" value="0x7U" public="false" include="true" />
408    <ConfigStruct name="`${INST_NAME . &quot;_config&quot;}`" type="cy_stc_tcpwm_counter_config_t" const="`${inFlash}`" public="true" include="true" >
409      <Member name="period" value="`${Period}`" />
410      <Member name="clockPrescaler" value="`${ClockPrescaler}`" />
411      <Member name="runMode" value="`${RunMode}`" />
412      <Member name="countDirection" value="`${CountDirection}`" />
413      <Member name="compareOrCapture" value="`${CompareOrCapture}`" />
414      <Member name="compare0" value="`${Compare0}`" />
415      <Member name="compare1" value="`${Compare1}`" />
416      <Member name="enableCompareSwap" value="`${pCCeqCompare ? EnableCompare0Swap : pCCeqCompare}`" />
417      <Member name="interruptSources" value="`${InterruptSource}`" />
418      <Member name="captureInputMode" value="`${Capture0Input eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : Capture0Input}`" />
419      <Member name="captureInput" value="`${Capture0Input eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_CAPTURE0_VALUE&quot;)}`" />
420      <Member name="reloadInputMode" value="`${ReloadInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : ReloadInput}`" />
421      <Member name="reloadInput" value="`${ReloadInput eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_RELOAD_VALUE&quot;)}`" />
422      <Member name="startInputMode" value="`${StartInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : StartInput}`" />
423      <Member name="startInput" value="`${StartInput eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_START_VALUE&quot;)}`" />
424      <Member name="stopInputMode" value="`${StopInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : StopInput}`" />
425      <Member name="stopInput" value="`${StopInput eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_STOP_VALUE&quot;)}`" />
426      <Member name="countInputMode" value="`${CountInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : CountInput}`" />
427      <Member name="countInput" value="`${CountInput eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_1&quot; : (definePrefix . &quot;_COUNT_VALUE&quot;)}`" />
428      <Member name="capture1InputMode" value="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : Capture1Input}`" />
429      <Member name="capture1Input" value="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED ? &quot;CY_TCPWM_INPUT_0&quot; : (definePrefix . &quot;_CAPTURE1_VALUE&quot;)}`" />
430      <Member name="compare2" value="`${pCntCC1 ? Compare2 : &quot;CY_TCPWM_GRP_CNT_CC0_DEFAULT&quot;}`" />
431      <Member name="compare3" value="`${pCntCC1 ? Compare3 : &quot;CY_TCPWM_GRP_CNT_CC0_BUFF_DEFAULT&quot;}`" />
432      <Member name="enableCompare1Swap" value="`${pCCeqCompare ? EnableCompare1Swap : pCCeqCompare}`" />
433      <Member name="trigger0Event" value="`${trigger0Event}`" />
434      <Member name="trigger1Event" value="`${trigger1Event}`" />
435      <Member name="buffer_swap_enable" value="`${copy_enable}`" guard="defined (CY_IP_MXS40TCPWM)" />
436      <Member name="direction_mode" value="`${Timer_Direction_Mode}`" guard="defined (CY_IP_MXS40TCPWM)" />
437      <Member name="glitch_filter_enable" value="`${gf_enable}`" guard="defined (CY_IP_MXS40TCPWM)" />
438      <Member name="gf_depth" value="`${gf_depth}`" guard="defined (CY_IP_MXS40TCPWM)" />
439    </ConfigStruct>
440
441    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL) || defined(CY_USING_HAL_LITE)">
442      <Member name="type" value="CYHAL_RSC_TCPWM" />
443      <Member name="block_num" value="`${(getInstNumber(&quot;tcpwm&quot;) * pMaxGroupCount) + pCntGroup}`U" />
444      <Member name="channel_num" value="`${getInstNumber(&quot;cnt&quot;)}`U" />
445    </ConfigStruct>
446
447    <ConfigStruct name="`${INST_NAME}`_clock" type="cyhal_clock_t" const="`${inFlash}`" public="true" include="true" guard="defined(CY_USING_HAL_LITE) || defined (CY_USING_HAL)">
448      <Member name="block" value="`${getExposedMember(pclk, &quot;hal_block&quot;)}`" />
449      <Member name="channel" value="`${getExposedMember(pclk, &quot;number&quot;)}`" />
450      <Member name="reserved" value="false" guard="defined (CY_USING_HAL)" />
451      <Member name="funcs" value="NULL" guard="defined (CY_USING_HAL)" />
452    </ConfigStruct>
453
454    <ConfigStruct name="`${INST_NAME}`_hal_config" type="cyhal_timer_configurator_t" const="`${inFlash}`" public="true" include="true" guard="defined (CY_USING_HAL) || defined(CY_USING_HAL_LITE)">
455      <Member name="resource" value="&amp;`${INST_NAME}`_obj" />
456      <Member name="config" value="&amp;`${INST_NAME}`_config" />
457      <Member name="clock" value="&amp;`${INST_NAME}`_clock" />
458    </ConfigStruct>
459
460    <ConfigInstruction purpose="INITIALIZE" value="Cy_SysClk_PeriGroupSlaveInit(CY_MMIO_TCPWM`${tcpwmInst}`_PERI_NR, CY_MMIO_TCPWM`${tcpwmInst}`_GROUP_NR, CY_MMIO_TCPWM`${tcpwmInst}`_SLAVE_NR, CY_MMIO_TCPWM`${tcpwmInst}`_CLK_HF_NR);" include="true" guard="defined (CY_DEVICE_CONFIGURATOR_IP_ENABLE_FEATURE)" />
461    <ConfigInstruction purpose="INITIALIZE" value="Cy_SysClk_PeriphAssignDivider(`${pclkDst}`, `${getExposedMember(pclk, &quot;clockSel&quot;)}`);" include="`${pclkOk}`"  />
462    <ConfigInstruction purpose="RESERVE" value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
463  </ConfigFirmware>
464</Personality>
465