1<?xml version="1.0" encoding="utf-8"?> 2 3 4<!--**************************************************************************** 5* \file quaddec_v2.cypersonality 6* \version 1.0 7* 8* \brief 9* Quadrature Decoder 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="mxs40quaddac_ver2" name="Quadrature Decoder" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7"> 30 <Dependencies> 31 <IpBlock name="mxtcpwm_ver2" /> 32 <Resource name="tcpwm\.group\.cnt" /> 33 </Dependencies> 34 <ExposedMembers /> 35 <Parameters> 36 <!-- PDL documentation --> 37 <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__tcpwm__quaddec.html" linkText="Open Quadrature Decoder (TCPWM) Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" /> 38 39 <!--General--> 40 <ParamRange id="pCntGroup" name="pCntGroup" desc="pCntGroup" group="Internal" default="`${getInstNumber("group")}`" min="0" max="3" resolution="1" visible="false" editable="false" /> 41 <ParamRange id="pMaxGroupCount" name="pMaxGroupCount" desc="pMaxGroupCount" group="Internal" default="4" min="0" max="4" resolution="1" visible="false" editable="false" /> 42 <ParamString id="pCntWidthEx" name="pCntWidthEx" desc="pCntWidthEx" group="Internal" default="GRP_NR[`${pCntGroup}`].CNT.GRP_CNT_WIDTH" visible="false" editable="false" /> 43 <ParamRange id="pCntWidth" name="pCntWidth" desc="pCntWidth" group="Internal" default="`${lookupExpression(pCntWidthEx)}`" min="0" max="32" resolution="1" visible="false" editable="false" /> 44 <ParamRange id="pCntWidthMax" name="pCntWidthMax" desc="pCntWidthMax" group="Internal" default="`${pow(2, pCntWidth)-1}`" min="0" max="4294967296" resolution="1" visible="false" editable="false" /> 45 <ParamRange id="tcpwmInst" name="TCPWM Number" group="Internal" default="`${getInstNumber("tcpwm")}`" min="0" max="3" resolution="1" visible="false" editable="false" desc="" /> 46 <ParamRange id="cntInst" name="CNT Number" group="Internal" default="`${getInstNumber("cnt") + pCntGroup * 256}`" min="0" max="1023" resolution="1" visible="false" editable="false" desc="" /> 47 <ParamString id="pCntCC1Ex" name="pCntCC1Ex" desc="pCntCC1Ex" group="Internal" default="GRP_NR[`${pCntGroup}`].CNT.GRP_CC1_PRESENT" visible="false" editable="false" /> 48 <ParamBool id="pCntCC1" name="pCntCC1" desc="pCntCC1" group="Internal" default="`${lookupExpression(pCntCC1Ex) eq 1}`" visible="false" editable="false" /> 49 50 <ParamString id="TCPWM_version" name="TCPWM Version" group="General" default="TCPWM_ver2" visible="true" editable="false" desc="Version of the TCPWM hardware block"/> 51 <ParamChoice id="QuadMode" name="Quad Mode" group="General" default="CY_TCPWM_QUADDEC_MODE_RANGE0" visible="true" editable="true" desc="Selects the Quad mode of operation."> 52 <Entry name="Range 0" value="CY_TCPWM_QUADDEC_MODE_RANGE0" visible="true" /> 53 <Entry name="Range 0 Compare" value="CY_TCPWM_QUADDEC_MODE_RANGE0_CMP" visible="true" /> 54 <Entry name="Range 1 Capture" value="CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT" visible="true" /> 55 <Entry name="Range 1 Compare" value="CY_TCPWM_QUADDEC_MODE_RANGE1_CMP" visible="true" /> 56 </ParamChoice> 57 <ParamChoice id="CounterSize" name="Quadrature Decoder Resolution" group="General" default="`${(pCntWidth eq 16) ? "16" : "32"}`" visible="true" editable="false" desc="Sets the resolution of the counter"> 58 <Entry name="16-bits" value="16" visible="true" /> 59 <Entry name="32-bits" value="32" visible="true" /> 60 </ParamChoice> 61 <ParamChoice id="Resolution" name="Quadrature Mode" group="General" default="CY_TCPWM_QUADDEC_X1" visible="true" editable="true" desc="Selects the quadrature encoding mode"> 62 <Entry name="x1" value="CY_TCPWM_QUADDEC_X1" visible="true" /> 63 <Entry name="x2" value="CY_TCPWM_QUADDEC_X2" visible="true" /> 64 <Entry name="x4" value="CY_TCPWM_QUADDEC_X4" visible="true" /> 65 <Entry name="Up/Down Rotary" value="CY_TCPWM_QUADDEC_UP_DOWN_ROTARY_COUNT" visible="true" /> 66 </ParamChoice> 67 68 <!--Capture--> 69 <ParamChoice id="CaptureOnIndex" name="Capture" group="Capture" default="true" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP}`" editable="true" desc="Selects the capture source."> 70 <Entry name="Capture on Index" value="true" visible="true" /> 71 <Entry name="Capture on Wrap Around" value="false" visible="true" /> 72 </ParamChoice> 73 74 <ParamChoice id="Capture1Input" name="Capture 1 Input" group="Inputs" default="CY_TCPWM_INPUT_DISABLED" visible="`${pCntCC1 && QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT}`" editable="true" desc="Selects which input the capture1 uses. The inputs are device-specific." > 75 <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" /> 76 <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" /> 77 <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" /> 78 <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" /> 79 </ParamChoice> 80 <ParamSignal port="capture1[0]" name="Capture 1 Signal" group="Inputs" visible="`${pCntCC1 && QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT && Capture1Input ne CY_TCPWM_INPUT_DISABLED}`" desc="This input triggers a capture of the current count value." canBeEmpty="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED}`" > 81 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 82 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 83 <Fixed value="CY_GPIO_DM_HIGHZ" /> 84 </Parameter> 85 </Constraint> 86 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 87 <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> 88 <Fixed value="CY_GPIO_DM_HIGHZ" /> 89 </Parameter> 90 </Constraint> 91 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 92 </ParamSignal> 93 94 <!--Compare0--> 95 <ParamBool id="EnableCompare0Swap" name="Enable Compare 0 Swap" group="Compare" default="false" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP}`" editable="true" desc="If enabled, allows a compare function using a CC0/CC0_BUFF." /> 96 <ParamRange id="Compare0" name="Compare 0" group="Compare" default="16384" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP}`" editable="true" desc="Sets the value for Compare0. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." /> 97 <ParamRange id="CompareBuf0" name="Compare 0 Buff" group="Compare" default="16384" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${(EnableCompare0Swap && QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP) || (EnableCompare0Swap && QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP)}`" editable="true" desc="Sets the value for the buffered Compare0. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." /> 98 99 <!--Compare1--> 100 <ParamBool id="EnableCompare1Swap" name="Enable Compare 1 Swap" group="Compare" default="false" visible="`${pCntCC1 && (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP ||QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP)}`" editable="true" desc="If enabled, allows a compare function using a CC1/CC1_BUFF." /> 101 <ParamRange id="Compare1" name="Compare 1" group="Compare" default="16384" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${pCntCC1 && (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP)}`" 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)." /> 102 <ParamRange id="CompareBuf1" name="Compare 1 Buff" group="Compare" default="16384" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${EnableCompare1Swap && pCntCC1 && (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP ||QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP)}`" editable="true" desc="Sets the buffered compare value. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." /> 103 104 <!--Interrupts--> 105 <ParamBool id="InterruptCC0" name="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0 ? "Reload/Index" : (((QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP) || (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP)) ? "Compare 0 " : "Capture 0 Event")}`" group="Interrupts" default="false" visible="true" editable="true" desc="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0 ? "Generate interrupt on Index." : ( QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP ? "Generate interrupt on Compare 0 & Capture 0." : "Generate interrupt on Capture 0 Event.")}`" /> 106 <ParamBool id="InterruptCC1" name="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT ? "Capture 1 Event" : "Compare 1"}`" group="Interrupts" default="false" visible="`${pCntCC1 && QuadMode ne CY_TCPWM_QUADDEC_MODE_RANGE0}`" editable="true" desc="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT ? "Generate interrupt on Capture 1 Event." : "Generate interrupt on Compare 1 & Capture 1."}`" /> 107 <ParamBool id="InterruptTC" name="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0 ? "Overflow & Underflow " : ((QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT) || (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP) ? "Overflow, Underflow and Index" : (!CaptureOnIndex ? "Overflow & Underflow" : "Index & Capture 0"))}`" group="Interrupts" default="false" visible="true" editable="true" desc="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0 ? "Generate interrupt on TC." : ((QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT) || (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP) ? "Generate interrupt on Overflow, Underflow and Index." : (!CaptureOnIndex ? "Generate interrupt on Overflow & Underflow." : "Generate interrupt on Index & Capture 0."))}`" /> 108 <ParamString id="InterruptSource" name="InterruptSource" desc="InterruptSource" group="Interrupt Source" default="(CY_TCPWM_INT_ON_TC `${(InterruptTC)? "" : "& 0U"}`) | (CY_TCPWM_INT_ON_CC0 `${(InterruptCC0)? "" : "& 0U"}`) | (CY_TCPWM_INT_ON_CC1 `${(InterruptCC1)? "" : "& 0U"}`)" visible="false" editable="false" /> 109 110 <!--Period--> 111 <ParamRange id="Period" name="Period" group="Period" default="32768" min="0" max="`${pCntWidthMax}`" resolution="1" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP}`" editable="true" desc="Sets the period of the Timer/Counter. Range: 0-65535 (for 16 bit resolution) or 0–4294967295 (for 32 bit resolution)." /> 112 113 <!--Inputs--> 114 <ParamSignal port="clock[0]" name="Clock Signal" group="Inputs" visible="`${hasVisibleOption("clock[0]")}`" desc="The clock input defines the operating frequency." canBeEmpty="`${!hasVisibleOption("clock[0]")}`" /> 115 <ParamSignal port="clock_counter_en[0]" name="Clock Signal" group="Inputs" visible="`${hasVisibleOption("clock_counter_en[0]")}`" desc="The clock input defines the operating frequency." canBeEmpty="`${!hasVisibleOption("clock_counter_en[0]")}`" /> 116 117 <ParamChoice id="IndexInput" name="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP ? "Index 0 Input" : "Index Input"}`" group="Inputs" default="CY_TCPWM_INPUT_DISABLED" visible="true" editable="true" desc="Determines if an index is needed and what edge causes an index to occur"> 118 <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" /> 119 <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" /> 120 <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" /> 121 <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" /> 122 </ParamChoice> 123 <ParamSignal port="reload[0]" name="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0 ? "Index Signal" : "Index 0 Signal"}`" group="Inputs" visible="`${IndexInput ne CY_TCPWM_INPUT_DISABLED}`" desc="This input causes an index (reload) event to occur (indicates a completed rotation to determine absolute position). This input is only visible if the IndexInput parameter is set to anything other than disabled." canBeEmpty="`${IndexInput eq CY_TCPWM_INPUT_DISABLED}`" > 124 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 125 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 126 <Fixed value="CY_GPIO_DM_HIGHZ" /> 127 </Parameter> 128 </Constraint> 129 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 130 <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> 131 <Fixed value="CY_GPIO_DM_HIGHZ" /> 132 </Parameter> 133 </Constraint> 134 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 135 </ParamSignal> 136 137 <ParamChoice id="phiAInputMode" name="PhiA Input" group="Inputs" default="CY_TCPWM_INPUT_LEVEL" visible="`${Resolution eq CY_TCPWM_QUADDEC_UP_DOWN_ROTARY_COUNT}`" editable="true" desc="Determines if phiA should use pass through or edge detection."> 138 <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" /> 139 <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" /> 140 <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" /> 141 <Entry name="Pass Through" value="CY_TCPWM_INPUT_LEVEL" visible="true" /> 142 </ParamChoice> 143 <ParamSignal port="count[0]" name="PhiA Signal" group="Inputs" visible="true" desc="This is the phase A input it is always required." canBeEmpty="false" > 144 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 145 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 146 <Fixed value="CY_GPIO_DM_HIGHZ" /> 147 </Parameter> 148 </Constraint> 149 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 150 <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> 151 <Fixed value="CY_GPIO_DM_HIGHZ" /> 152 </Parameter> 153 </Constraint> 154 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 155 </ParamSignal> 156 157 <ParamChoice id="phiBInputMode" name="PhiB Input" group="Inputs" default="CY_TCPWM_INPUT_LEVEL" visible="`${Resolution eq CY_TCPWM_QUADDEC_UP_DOWN_ROTARY_COUNT}`" editable="true" desc="Determines if phiB should use pass through or edge detection."> 158 <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" /> 159 <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" /> 160 <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" /> 161 <Entry name="Pass Through" value="CY_TCPWM_INPUT_LEVEL" visible="true" /> 162 </ParamChoice> 163 <ParamSignal port="start[0]" name="PhiB Signal" group="Inputs" visible="true" desc="This is the phase B input it is always required." canBeEmpty="false" > 164 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 165 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 166 <Fixed value="CY_GPIO_DM_HIGHZ" /> 167 </Parameter> 168 </Constraint> 169 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 170 <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> 171 <Fixed value="CY_GPIO_DM_HIGHZ" /> 172 </Parameter> 173 </Constraint> 174 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 175 </ParamSignal> 176 177 <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 what edges causes a stop to occur"> 178 <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" /> 179 <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" /> 180 <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" /> 181 <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" /> 182 </ParamChoice> 183 <ParamSignal port="stop[0]" name="Stop Signal" group="Inputs" visible="`${StopInput ne CY_TCPWM_INPUT_DISABLED}`" desc="This input causes the Quad Dec to stop Counting. This input is only visible if the StopInput parameter is set to anything other than disabled." canBeEmpty="`${StopInput eq CY_TCPWM_INPUT_DISABLED}`" > 184 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 185 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 186 <Fixed value="CY_GPIO_DM_HIGHZ" /> 187 </Parameter> 188 </Constraint> 189 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 190 <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> 191 <Fixed value="CY_GPIO_DM_HIGHZ" /> 192 </Parameter> 193 </Constraint> 194 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 195 </ParamSignal> 196 197 <ParamChoice id="Capture0OrIndex1Input" name="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP ? "Index 1 Input" : "Capture 0 Input"}`" group="Inputs" default="CY_TCPWM_INPUT_DISABLED" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT}`" editable="true" desc="Determines if an index1(capture0) is needed and what edge causes an index to occur."> 198 <Entry name="Rising Edge" value="CY_TCPWM_INPUT_RISINGEDGE" visible="true" /> 199 <Entry name="Falling Edge" value="CY_TCPWM_INPUT_FALLINGEDGE" visible="true" /> 200 <Entry name="Either Edge" value="CY_TCPWM_INPUT_EITHEREDGE" visible="true" /> 201 <Entry name="Disabled" value="CY_TCPWM_INPUT_DISABLED" visible="true" /> 202 </ParamChoice> 203 <ParamSignal port="capture0[0]" name="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP ? "Index 1 Signal" : "Capture 0 Signal"}`" group="Inputs" visible="`${(Capture0OrIndex1Input ne CY_TCPWM_INPUT_DISABLED) && (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT)}`" desc="This input causes an index1 (capture0) event to occur (indicates a completed rotation to determine absolute position). This input is only visible if the Input parameter is set to anything other than disabled." canBeEmpty="`${Capture0OrIndex1Input eq CY_TCPWM_INPUT_DISABLED}`" > 204 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 205 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 206 <Fixed value="CY_GPIO_DM_HIGHZ" /> 207 </Parameter> 208 </Constraint> 209 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 210 <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> 211 <Fixed value="CY_GPIO_DM_HIGHZ" /> 212 </Parameter> 213 </Constraint> 214 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 215 </ParamSignal> 216 217 <!--Trigger Outputs--> 218 <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." > 219 <Entry name="Overflow" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP}`" /> 220 <Entry name="Underflow" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP}`" /> 221 <Entry name="Terminal Count" value="CY_TCPWM_CNT_TRIGGER_ON_TC" visible="true" /> 222 <Entry name="Compare 0 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" visible="true" /> 223 <Entry name="Compare 1 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" visible="`${pCntCC1 && !(QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0)}`" /> 224 <Entry name="Disabled" value="CY_TCPWM_CNT_TRIGGER_ON_DISABLED" visible="true" /> 225 </ParamChoice> 226 <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}`" > 227 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 228 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 229 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 230 </Parameter> 231 </Constraint> 232 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 233 <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> 234 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 235 </Parameter> 236 </Constraint> 237 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 238 </ParamSignal> 239 <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." > 240 <Entry name="Overflow" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP}`" /> 241 <Entry name="Underflow" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" visible="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT || QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP}`" /> 242 <Entry name="Terminal Count" value="CY_TCPWM_CNT_TRIGGER_ON_TC" visible="true" /> 243 <Entry name="Compare 0 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" visible="true" /> 244 <Entry name="Compare 1 Match" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" visible="`${pCntCC1 && !(QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0)}`" /> 245 <Entry name="Disabled" value="CY_TCPWM_CNT_TRIGGER_ON_DISABLED" visible="true" /> 246 </ParamChoice> 247 <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}`" > 248 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 249 <Parameter id="DriveModes" severity="DEFAULT" reason=""> 250 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 251 </Parameter> 252 </Constraint> 253 <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" > 254 <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected."> 255 <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" /> 256 </Parameter> 257 </Constraint> 258 <Constraint type="ACCEPT" targetLocation=".*" valid="true" /> 259 </ParamSignal> 260 261 <!--Config--> 262 <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)." /> 263 264 <!-- Peripheral clock divider connection --> 265 <ParamRange id="tcpwmInst" name="TCPWM Number" group="Internal" default="`${getInstNumber("tcpwm")}`" min="0" max="127" resolution="1" visible="false" editable="false" desc="" /> 266 <ParamRange id="cntInst" name="CNT Number" group="Internal" default="`${getInstNumber("cnt")}`" min="0" max="31" resolution="1" visible="false" editable="false" desc="" /> 267 <ParamString id="definePrefix" name="Define prefix" group="Internal" default="`${"TCPWM" . tcpwmInst . "_GRP" . pCntGroup . "_CNT" . getInstNumber("cnt")}`" visible="false" editable="false" desc="" /> 268 <ParamString id="defineInputDisabled" name="Define input disabled" group="Internal" default="`${INST_NAME . "_INPUT_DISABLED & 0x3U"}`" visible="false" editable="false" desc="" /> 269 <ParamString id="pclk" name="PCLK" group="Internal" default="`${hasVisibleOption("clock_counter_en[0]") ? getBlockFromSignal("clock_counter_en[0]"):getBlockFromSignal("clock[0]")}`" visible="false" editable="false" desc="Connected peripheral clock divider (PCLK)" /> 270 <ParamBool id="pclkOk" name="PCLK Valid" group="Internal" default="`${hasVisibleOption("clock_counter_en[0]") ? hasConnection("clock_counter_en", 0) && isBlockUsed(pclk) : hasConnection("clock", 0) && isBlockUsed(pclk)}`" visible="false" editable="false" desc="Checks whether there is a PCLK connected and enabled" /> 271 <ParamString id="pclkDst" name="PCLK Destination" group="Internal" default="`${hasVisibleOption("clock_counter_en[0]") ? "PCLK_TCPWM" . tcpwmInst . "_CLOCK_COUNTER_EN" . cntInst : "PCLK_TCPWM" . tcpwmInst . "_CLOCKS" . cntInst}`" visible="false" editable="false" desc="" /> 272 273 <!-- Clock Frequency --> 274 <ParamString id="sourceClock" name="sourceClock" group="General" default="`${(hasVisibleOption("clock[0]")) ? (getBlockFromSignal("clock[0]")) : (getBlockFromSignal("clock_counter_en[0]"))}`" visible="false" editable="false" desc="Source Clock Resource" /> 275 <ParamRange id="tcpwmClkHz" name="tcpwmClkHz" group="General" default="`${getExposedMember(sourceClock, "frequency")}`" min="0" max="400000000" resolution="1" visible="false" editable="false" desc="TCPWM clock frequency in Hz" /> 276 277 </Parameters> 278 279 <DRCs> 280 <DRC type="ERROR" paramId="clock_en[0]" text="Maximum input clock signal frequency supported is 100 Mhz. Please fix input clock setting." condition="`${(hasVisibleOption("clock[0]")) && (tcpwmClkHz > 100000000)}`" /> 281 <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("clock_counter_en[0]")) && (tcpwmClkHz > 100000000)}`" /> 282 283 <!--Compare0 DRC--> 284 <DRC type="INFO" text="Compare 0 value have to be less or equal to Period" condition="`${(QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP) && (Compare0 > Period)}`" paramId="Compare0" /> 285 <!--CompareBuff0 DRC--> 286 <DRC type="INFO" text="Compare 0 Buffer value have to be less or equal to Period" condition="`${(EnableCompare0Swap) && (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP) && (CompareBuf0 > Period)}`" paramId="CompareBuf0" /> 287 288 <!--Compare1 DRC--> 289 <DRC type="INFO" text="Compare 1 value have to be less or equal to Period" condition="`${pCntCC1 && (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP) && (Compare1 > Period)}`" paramId="Compare1"/> 290 <!--CompareBuf1 DRC--> 291 <DRC type="INFO" text="Compare 1 Buffer value have to be less or equal to Period" condition="`${pCntCC1 &&(EnableCompare1Swap) && (QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE1_CMP) && (CompareBuf1 > Period)}`" paramId="CompareBuf1" /> 292 293 <!--IndexInput DRCs--> 294 <DRC type="ERROR" text="Index Input Event has to be enabled to use Index Signal." condition="`${hasConnection("reload", 0) && (IndexInput eq CY_TCPWM_INPUT_DISABLED)}`" paramId="IndexInput"> 295 <FixIt action="SET_PARAM" target="IndexInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" /> 296 <FixIt action="SET_PARAM" target="IndexInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" /> 297 <FixIt action="SET_PARAM" target="IndexInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" /> 298 </DRC> 299 300 <!--IndexInput1/Capture0 DRCs--> 301 <DRC type="ERROR" text="Capture 0 or Index 1 Input cannot be used in Range 0 Quad Mode." condition="`${(QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0) && hasConnection("capture0", 0)}`" paramId="Capture0OrIndex1Input"> 302 <FixIt action="SET_PARAM" target="QuadMode" value="CY_TCPWM_QUADDEC_MODE_RANGE0_CMP" valid="true" /> 303 <FixIt action="SET_PARAM" target="QuadMode" value="CY_TCPWM_QUADDEC_MODE_RANGE1_CAPT" valid="true" /> 304 </DRC> 305 <DRC type="ERROR" text="`${QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0_CMP ? "Index 1 Input Event has to be enabled to use Index Signal." : "Capture 0 Input Event has to be enabled to use Index Signal."}`" condition="`${!(QuadMode eq CY_TCPWM_QUADDEC_MODE_RANGE0) && hasConnection("capture0", 0) && (Capture0OrIndex1Input eq CY_TCPWM_INPUT_DISABLED)}`" paramId="Capture0OrIndex1Input"> 306 <FixIt action="SET_PARAM" target="Capture0OrIndex1Input" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" /> 307 <FixIt action="SET_PARAM" target="Capture0OrIndex1Input" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" /> 308 <FixIt action="SET_PARAM" target="Capture0OrIndex1Input" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" /> 309 </DRC> 310 311 <!--Capture1 DRCs--> 312 <DRC type="ERROR" text="Capture 1 Input Event has to be enabled to use Index Signal." condition="`${hasConnection("capture1", 0) && (Capture1Input eq CY_TCPWM_INPUT_DISABLED)}`" paramId="Capture1Input"> 313 <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" /> 314 <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" /> 315 <FixIt action="SET_PARAM" target="Capture1Input" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" /> 316 </DRC> 317 318 <!--StopInput DRCs--> 319 <DRC type="ERROR" text="Stop Event has to be enabled to use Stop Signal." condition="`${hasConnection("stop", 0) && (StopInput eq CY_TCPWM_INPUT_DISABLED)}`" paramId="StopInput"> 320 <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_RISINGEDGE" valid="true" /> 321 <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_FALLINGEDGE" valid="true" /> 322 <FixIt action="SET_PARAM" target="StopInput" value="CY_TCPWM_INPUT_EITHEREDGE" valid="true" /> 323 </DRC> 324 325 <!--Trigger Output DRCs--> 326 <DRC type="ERROR" text="Trigger 0 Event has to be enabled to use Trigger 0 Signal." condition="`${hasConnection("tr_out0", 0) && (trigger0Event eq CY_TCPWM_CNT_TRIGGER_ON_DISABLED)}`" paramId="trigger0Event"> 327 <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" valid="true" /> 328 <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" valid="true" /> 329 <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_TC" valid="true" /> 330 <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" valid="true" /> 331 <FixIt action="SET_PARAM" target="trigger0Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" valid="false" /> 332 </DRC> 333 <DRC type="ERROR" text="Trigger 1 Event has to be enabled to use Trigger 1 Signal." condition="`${hasConnection("tr_out1", 0) && (trigger1Event eq CY_TCPWM_CNT_TRIGGER_ON_DISABLED)}`" paramId="trigger1Event"> 334 <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_OVERFLOW" valid="true" /> 335 <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_UNDEFLOW" valid="true" /> 336 <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_TC" valid="true" /> 337 <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC0_MATCH" valid="true" /> 338 <FixIt action="SET_PARAM" target="trigger1Event" value="CY_TCPWM_CNT_TRIGGER_ON_CC1_MATCH" valid="false" /> 339 </DRC> 340 </DRCs> 341 342 <ConfigFirmware> 343 <ConfigInclude value="cy_tcpwm_quaddec.h" include="true" /> 344 <ConfigInclude value="cy_sysclk.h" include="`${pclkOk}`" /> 345 <ConfigInclude value="cycfg_routing.h" include="true" /> 346 <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" /> 347 348 <ConfigDefine name="`${INST_NAME}`_HW" value="TCPWM`${tcpwmInst}`" public="true" include="true" /> 349 <ConfigDefine name="`${INST_NAME}`_NUM" value="`${cntInst}`UL" public="true" include="true" /> 350 <ConfigDefine name="`${INST_NAME}`_IRQ" value="tcpwm_`${tcpwmInst}`_interrupts_`${cntInst}`_IRQn" public="true" include="`${InterruptTC || InterruptCC0 || InterruptCC1}`" /> 351 <ConfigDefine name="`${INST_NAME}`_INPUT_DISABLED" value="0x7U" public="false" include="true" /> 352 <ConfigStruct name="`${INST_NAME . "_config"}`" type="cy_stc_tcpwm_quaddec_config_t" const="`${inFlash}`" public="true" include="true" > 353 <Member name="quadMode" value="`${QuadMode}`" /> 354 <Member name="resolution" value="`${Resolution}`" /> 355 <Member name="interruptSources" value="`${InterruptSource}`" /> 356 <Member name="indexInputMode" value="`${IndexInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : IndexInput}`" /> 357 <Member name="indexInput" value="`${IndexInput eq CY_TCPWM_INPUT_DISABLED ? "CY_TCPWM_INPUT_0" : (definePrefix . "_RELOAD_VALUE")}`" /> 358 <Member name="stopInputMode" value="`${StopInput eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : StopInput}`" /> 359 <Member name="stopInput" value="`${StopInput eq CY_TCPWM_INPUT_DISABLED ? "CY_TCPWM_INPUT_0" : (definePrefix . "_STOP_VALUE")}`" /> 360 <Member name="phiAInput" value="`${(definePrefix . "_COUNT_VALUE")}`" /> 361 <Member name="phiBInput" value="`${(definePrefix . "_START_VALUE")}`" /> 362 <Member name="phiAInputMode" value="`${Resolution eq CY_TCPWM_QUADDEC_UP_DOWN_ROTARY_COUNT ? phiAInputMode : CY_TCPWM_INPUT_LEVEL }`" /> 363 <Member name="phiBInputMode" value="`${Resolution eq CY_TCPWM_QUADDEC_UP_DOWN_ROTARY_COUNT ? phiBInputMode : CY_TCPWM_INPUT_LEVEL }`" /> 364 <Member name="trigger0Event" value="`${trigger0Event}`" /> 365 <Member name="trigger1Event" value="`${trigger1Event}`" /> 366 <Member name="captureOnIndex" value="`${QuadMode ne CY_TCPWM_QUADDEC_MODE_RANGE0_CMP ? defineInputDisabled : CaptureOnIndex}`"/> 367 <Member name="compare0" value="`${Compare0}`" /> 368 <Member name="compareBuf0" value="`${CompareBuf0}`" /> 369 <Member name="enableCompare0Swap" value="`${EnableCompare0Swap}`" /> 370 <Member name="compare1" value="`${pCntCC1 ? Compare1 : "CY_TCPWM_GRP_CNT_CC0_DEFAULT"}`" /> 371 <Member name="compareBuf1" value="`${pCntCC1 ? CompareBuf1 : "CY_TCPWM_GRP_CNT_CC0_BUFF_DEFAULT"}`" /> 372 <Member name="enableCompare1Swap" value="`${EnableCompare1Swap}`" /> 373 <Member name="capture0OrIndex1InputMode" value="`${Capture0OrIndex1Input eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : Capture0OrIndex1Input}`" /> 374 <Member name="capture0OrIndex1Input" value="`${Capture0OrIndex1Input eq CY_TCPWM_INPUT_DISABLED ? "CY_TCPWM_INPUT_0" : (definePrefix . "_CAPTURE0_VALUE")}`" /> 375 <Member name="period0" value="`${Period}`" /> 376 <Member name="capture1InputMode" value="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED ? defineInputDisabled : Capture1Input}`" /> 377 <Member name="capture1Input" value="`${Capture1Input eq CY_TCPWM_INPUT_DISABLED ? "CY_TCPWM_INPUT_0" : (definePrefix . "_CAPTURE1_VALUE")}`" /> 378 </ConfigStruct> 379 380 <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)"> 381 <Member name="type" value="CYHAL_RSC_TCPWM" /> 382 <Member name="block_num" value="`${(getInstNumber("tcpwm") * pMaxGroupCount) + pCntGroup}`U" /> 383 <Member name="channel_num" value="`${getInstNumber("cnt")}`U" /> 384 </ConfigStruct> 385 386 <ConfigInstruction value="Cy_SysClk_PeriphAssignDivider(`${pclkDst}`, `${getExposedMember(pclk, "clockSel")}`);" include="`${pclkOk}`" /> 387 <ConfigInstruction value="cyhal_hwmgr_reserve(&`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" /> 388 </ConfigFirmware> 389</Personality> 390