1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file pin.cypersonality
6* \version 3.0
7*
8* \brief
9* Pin personality description file. It supports CAT1A, CAT1B, CAT1C and CAT1D
10* devices.
11*
12********************************************************************************
13* \copyright
14* Copyright (c) (2022-2023), Cypress Semiconductor Corporation (an Infineon company) or
15* an affiliate of Cypress Semiconductor Corporation.
16* SPDX-License-Identifier: Apache-2.0
17*
18* Licensed under the Apache License, Version 2.0 (the "License");
19* you may not use this file except in compliance with the License.
20* You may obtain a copy of the License at
21*
22*     http://www.apache.org/licenses/LICENSE-2.0
23*
24* Unless required by applicable law or agreed to in writing, software
25* distributed under the License is distributed on an "AS IS" BASIS,
26* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27* See the License for the specific language governing permissions and
28* limitations under the License.
29*****************************************************************************-->
30
31<Personality id="pin" name="Pin" version="3.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
32  <Dependencies>
33    <IpBlock name="mxs40ioss,mxs40sioss,mxs22ioss" />
34    <Resource name="ioss\.port\.pin" />
35  </Dependencies>
36  <ExposedMembers>
37    <ExposedMember key="halPortPin" paramId="pinPort" />
38    <ExposedMember key="driveMode" paramId="DriveModes" />
39  </ExposedMembers>
40  <Parameters>
41    <!-- PDL documentation -->
42    <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__gpio.html" linkText="Open GPIO Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
43
44    <!--General-->
45    <ParamBool id="is_mxs40ioss" name="is_mxs40ioss_ip" group="Internal" default="`${(getIpBlockName() eq &quot;mxs40ioss&quot;)}`" visible="false" editable="false" desc="Internal parameter." />
46    <ParamBool id="is_mxs22ioss" name="is_mxs22ioss_ip" group="Internal" default="`${(getIpBlockName() eq &quot;mxs22ioss&quot;)}`" visible="false" editable="false" desc="Internal parameter." />
47    <ParamBool id="is_mxs40sioss" name="is_mxs40sioss_ip" group="Internal" default="`${(getIpBlockName() eq &quot;mxs40sioss&quot;)}`" visible="false" editable="false" desc="Internal parameter." />
48    <ParamBool id="ipVersion" name="IP version" group="Internal" default="`${getVersion()}`" visible="false" editable="false" desc="Internal parameter." />
49    <ParamString id="driveModeExtension" name="Drive Mode Extension" group="Internal" default="`${lookupExpression(&quot;GPIO.GPIO_PORT_NR[&quot; . getInstNumber(&quot;port&quot;) . &quot;].GPIO_PRT.DRIVEMODE_WIDTH&quot;, 0)}`" visible="false" editable="false" desc="The drive mode extension" />
50    <ParamRange id="pullUpResAvailable" name="Pull-up resistor" group="Internal" default="`${lookupExpression(&quot;GPIO.GPIO_PORT_NR[3].GPIO_PRT.RES_CFG&quot;, 0)}`" min="-1" max="1" resolution="1" visible="false" editable="false" desc="The pull-up resistor configuration" />
51    <ParamString id="secExtAvailable" name="Secure Extension" group="Internal" default="`${lookupExpression(&quot;GPIO.SECEXT&quot;, lookupExpression(&quot;SECEXT&quot;, -1))}`" visible="false" editable="false" desc="Secure extension" />
52    <ParamBool id="deepsleep" name="deepsleep" group="Internal" default="`${lookupExpression(&quot;GPIO.GPIO_PORT_NR[&quot; . getInstNumber(&quot;port&quot;) . &quot;].GPIO_PRT.DEEPSLEEP&quot;, 0)}`" visible="false" editable="false" desc="Internal parameter." />
53    <ParamChoice id="DriveModes" name="Drive Mode" group="General" default="CY_GPIO_DM_ANALOG" visible="true" editable="true" desc="The Drive Mode parameter configures the pin provide to one of the eight available pin drive modes. Please see the device DS for more details on each drive mode." >
54      <Entry name="Strong Drive. Input buffer on"                                                    value="CY_GPIO_DM_STRONG"                       visible="true" />
55      <Entry name="Strong Drive. Input buffer off"                                                   value="CY_GPIO_DM_STRONG_IN_OFF"                visible="true" />
56      <Entry name="Open Drain, Drives Low. Input buffer off"                                         value="CY_GPIO_DM_OD_DRIVESLOW_IN_OFF"          visible="true" />
57      <Entry name="Open Drain, Drives High. Input buffer off"                                        value="CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF"         visible="true" />
58      <Entry name="Open Drain, Drives Low. Input buffer on"                                          value="CY_GPIO_DM_OD_DRIVESLOW"                 visible="true" />
59      <Entry name="Open Drain, Drives High. Input buffer on"                                         value="CY_GPIO_DM_OD_DRIVESHIGH"                visible="true" />
60      <Entry name="Resistive Pull-Up. Input buffer off"                                              value="CY_GPIO_DM_PULLUP_IN_OFF"                visible="true" />
61      <Entry name="Resistive Pull-Down. Input buffer off"                                            value="CY_GPIO_DM_PULLDOWN_IN_OFF"              visible="true" />
62      <Entry name="Resistive Pull-Up/Down. Input buffer off"                                         value="CY_GPIO_DM_PULLUP_DOWN_IN_OFF"           visible="true" />
63      <Entry name="Resistive Pull-Up. Input buffer on"                                               value="CY_GPIO_DM_PULLUP"                       visible="true" />
64      <Entry name="Resistive Pull-Down. Input buffer on"                                             value="CY_GPIO_DM_PULLDOWN"                     visible="true" />
65      <Entry name="Resistive Pull-Up/Down. Input buffer on"                                          value="CY_GPIO_DM_PULLUP_DOWN"                  visible="true" />
66      <Entry name="Digital High-Z. Input buffer on"                                                  value="CY_GPIO_DM_HIGHZ"                        visible="true" />
67      <Entry name="Analog High-Z. Input buffer off"                                                  value="CY_GPIO_DM_ANALOG"                       visible="true" />
68      <Entry name="Strong Drive/Resistive Pull-Up/High-Z"  value="CY_GPIO_DM_CFGOUT3_STRONG_PULLUP_HIGHZ"  visible="`${(driveModeExtension eq 4)}`" />
69    </ParamChoice>
70    <ParamChoice id="initialState" name="Initial Drive State" group="General" default="1" visible="true" editable="true" desc="This parameter specifies the pin-specific initial value written to the pin's OUT Register after a device reset/power-on." >
71      <Entry name="High (1)" value="1" visible="true" />
72      <Entry name="Low (0)"  value="0" visible="true" />
73    </ParamChoice>
74    <ParamChoice id="nonSec" name="Secure attribute" group="General" default="`${(is_mxs40sioss &amp;&amp; (secExtAvailable eq 1)) ? 0 : 1}`" visible="`${secExtAvailable eq 1}`" editable="true" desc="This parameter specifies the secure attribute for each pin of a port." >
75      <Entry name="Non-secure access (1)" value="1" visible="true" />
76      <Entry name="Secure access (0)"  value="0" visible="true" />
77    </ParamChoice>
78    <!--Misc-->
79    <ParamBool id="hasSIO" name="HasSIO" group="Misc" default="`${lookupExpression(&quot;GPIO.GPIO_PORT_NR[&quot; . getInstNumber(&quot;port&quot;) . &quot;].GPIO_PRT.SIO&quot;) &gt; 0}`" visible="false" editable="false" desc="Has SIO" />
80    <ParamBool id="hasPullUpRes" name="HasPullUpRes" group="Misc" default="`${pullUpResAvailable ? (lookupExpression(&quot;GPIO.GPIO_PORT_NR[&quot; . getInstNumber(&quot;port&quot;) . &quot;].GPIO_PRT.RES_CFG&quot;) &gt; 0) : 0}`" visible="false" editable="false" desc="Has pull-up resistor" />
81    <ParamBool id="hasIRQ" name="HasIRQ" group="Misc" default="`${lookupExpression(&quot;GPIO.GPIO_PORT_NR[&quot; . getInstNumber(&quot;port&quot;) . &quot;].GPIO_PRT.IRQ&quot;, 0) &gt; 0}`" visible="false" editable="false" desc="Has dedicated IRQ" />
82    <!--Input-->
83    <ParamChoice id="vtrip" name="Threshold" group="Input" default="CY_GPIO_VTRIP_CMOS" visible="true" editable="true" desc="This parameter selects the threshold levels that define a logic high level (1) and a logic low level (0)." >
84      <Entry name="CMOS" value="CY_GPIO_VTRIP_CMOS" visible="true" />
85      <Entry name="TTL"  value="CY_GPIO_VTRIP_TTL"  visible="true" />
86    </ParamChoice>
87    <ParamChoice id="isrTrigger" name="Interrupt Trigger Type" group="Input" default="CY_GPIO_INTR_DISABLE" visible="`${hasIRQ}`" editable="true" desc="This parameter selects whether the pin can generate an interrupt and, if selected, the interrupt type." >
88      <Entry name="None"         value="CY_GPIO_INTR_DISABLE" visible="true" />
89      <Entry name="Rising Edge"  value="CY_GPIO_INTR_RISING"  visible="true" />
90      <Entry name="Falling Edge" value="CY_GPIO_INTR_FALLING" visible="true" />
91      <Entry name="Both Edges"   value="CY_GPIO_INTR_BOTH"    visible="true" />
92    </ParamChoice>
93    <ParamBool id="sioInputBuffer" name="SIO Input Buffer Differential" group="Input" default="false" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects the input buffer mode" />
94    <ParamChoice id="sioTrip" name="SIO Input Buffer Trip Mode" group="Input" default="CY_SIO_VTRIP_CMOS" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects the input buffer trip-point in single ended input buffer mode." >
95      <Entry name="CMOS (single-ended)"                 value="CY_SIO_VTRIP_CMOS"             visible="true" />
96      <Entry name="TTL (single-ended)"                  value="CY_SIO_VTRIP_TTL"              visible="true" />
97      <Entry name="0.5xVddio or 0.5xVoh (differential)" value="CY_SIO_VTRIP_0_5VDDIO_0_5VOH"  visible="true" />
98      <Entry name="0.4xVddio or 0.4xVoh (differential)" value="CY_SIO_VTRIP_0_4VDDIO_1_0VREF" visible="true" />
99    </ParamChoice>
100    <ParamChoice id="sioRef" name="SIO Reference Voltage" group="Input" default="CY_SIO_VREF_PINREF" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects reference voltage (Vref) trip-point of the input buffer." >
101      <Entry name="Analog Pin"              value="CY_SIO_VREF_PINREF" visible="true" />
102      <Entry name="Internal 1.2V Reference" value="CY_SIO_VREF_1_2V"   visible="true" />
103      <Entry name="AMUXBUS A"               value="CY_SIO_VREF_AMUX_A" visible="true" />
104      <Entry name="AMUXBUS B"               value="CY_SIO_VREF_AMUX_B" visible="true" />
105    </ParamChoice>
106    <ParamChoice id="sioVoltage"  name="Regulated Output Voltage Level (Voh)" group="Input" default="CY_SIO_VOH_1_00" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects the regulated Voh output level and trip point of the input buffer for a specific SIO pin pair. Voh depends on the selected reference voltage." >
107      <Entry name="1 x Reference"    value="CY_SIO_VOH_1_00" visible="true" />
108      <Entry name="1.25 x Reference" value="CY_SIO_VOH_1_25" visible="true" />
109      <Entry name="1.49 x Reference" value="CY_SIO_VOH_1_49" visible="true" />
110      <Entry name="1.67 x Reference" value="CY_SIO_VOH_1_67" visible="true" />
111      <Entry name="2.08 x Reference" value="CY_SIO_VOH_2_08" visible="true" />
112      <Entry name="2.50 x Reference" value="CY_SIO_VOH_2_50" visible="true" />
113      <Entry name="2.78 x Reference" value="CY_SIO_VOH_2_78" visible="true" />
114      <Entry name="4.16 x Reference" value="CY_SIO_VOH_4_16" visible="true" />
115    </ParamChoice>
116
117    <!--Output-->
118    <ParamChoice id="slewRate" name="Slew Rate" group="Output" default="CY_GPIO_SLEW_FAST" visible="true" editable="true" desc="The slew rate parameter determines the rise and fall ramp rate for the pin as it changes output logic levels." >
119      <Entry name="Fast" value="CY_GPIO_SLEW_FAST" visible="true" />
120      <Entry name="Slow" value="CY_GPIO_SLEW_SLOW" visible="true" />
121    </ParamChoice>
122    <ParamBool id="extended_drive_sel" name="Extended Drive Strength" group="Output" default="false" visible="`${is_mxs22ioss}`" editable="`${is_mxs22ioss}`" desc="Extended Drive strength selection." />
123    <ParamChoice id="driveStrength"  name="Drive Strength" group="Output" default="CY_GPIO_DRIVE_1_2" visible="`${!extended_drive_sel}`" editable="`${!extended_drive_sel}`" desc="Drive strength can be defined to select how much of the IO driver is enabled to provide additional control of the rising and falling edge slew rates." >
124      <Entry name="Full" value="CY_GPIO_DRIVE_FULL" visible="true" />
125      <Entry name="1 / 2" value="CY_GPIO_DRIVE_1_2" visible="true" />
126      <Entry name="1 / 4" value="CY_GPIO_DRIVE_1_4" visible="true" />
127      <Entry name="1 / 8" value="CY_GPIO_DRIVE_1_8" visible="true" />
128    </ParamChoice>
129    <ParamChoice id="extended_driveStrength"  name="Drive Strength" group="Output" default="CY_GPIO_DRIVE_SEL_3" visible="`${extended_drive_sel}`" editable="`${extended_drive_sel}`" desc="Drive strength can be defined to select how much of the IO driver is enabled to provide additional control of the rising and falling edge slew rates." >
130      <Entry name="7 (Full)" value="CY_GPIO_DRIVE_SEL_7" visible="true" />
131	  <Entry name="6 (7 / 8)" value="CY_GPIO_DRIVE_SEL_6" visible="true" />
132	  <Entry name="5 (3 / 4)" value="CY_GPIO_DRIVE_SEL_5" visible="true" />
133	  <Entry name="4 (5 / 8)" value="CY_GPIO_DRIVE_SEL_4" visible="true" />
134	  <Entry name="3 (1 / 2)" value="CY_GPIO_DRIVE_SEL_3" visible="true" />
135	  <Entry name="2 (3 / 8)" value="CY_GPIO_DRIVE_SEL_2" visible="true" />
136	  <Entry name="1 (1 / 4)" value="CY_GPIO_DRIVE_SEL_1" visible="true" />
137	  <Entry name="0 (1 / 8)" value="CY_GPIO_DRIVE_SEL_0" visible="true" />
138    </ParamChoice>
139    <ParamBool id="sioOutputBuffer"  name="SIO Output Buffer Regulated" group="Output" default="true" visible="`${hasSIO &amp;&amp; DigitalOutput}`" editable="true" desc="Selects the output buffer mode" />
140    <ParamChoice id="pullUpRes" name="Pull-up resistor" group="Output" default="CY_GPIO_PULLUP_RES_DISABLE" visible="`${pullUpResAvailable &amp;&amp; (DriveModes eq CY_GPIO_DM_CFGOUT3_STRONG_PULLUP_HIGHZ)}`" editable="true" desc="The Pull-up resistor parameter configures the additional pull-up resistors." >
141      <Entry name="Disable additional Pull-up resistors" value="CY_GPIO_PULLUP_RES_DISABLE" visible="true" />
142      <Entry name="570Ω pull-up resistance"              value="CY_GPIO_PULLUP_RES_570"     visible="`${hasPullUpRes}`" />
143      <Entry name="720Ω pull-up resistance"              value="CY_GPIO_PULLUP_RES_720"     visible="`${hasPullUpRes}`" />
144      <Entry name="840Ω pull-up resistance"              value="CY_GPIO_PULLUP_RES_840"     visible="`${hasPullUpRes}`" />
145      <Entry name="1100Ω pull-up resistance"             value="CY_GPIO_PULLUP_RES_1100"    visible="`${hasPullUpRes}`" />
146      <Entry name="1200Ω pull-up resistance"             value="CY_GPIO_PULLUP_RES_1200"    visible="`${hasPullUpRes}`" />
147      <Entry name="1800Ω pull-up resistance"             value="CY_GPIO_PULLUP_RES_1800"    visible="`${hasPullUpRes}`" />
148      <Entry name="2800Ω pull-up resistance"             value="CY_GPIO_PULLUP_RES_2800"    visible="`${hasPullUpRes}`" />
149    </ParamChoice>
150
151    <!--Internal Connection-->
152    <ParamSignal port="analog[0]" name="Analog" group="Internal Connection" visible="`${hasVisibleOption(&quot;analog[0]&quot;)}`" desc="An analog signal to connect to" canBeEmpty="true" />
153    <ParamSignal port="digital_in[0]" name="Digital Input" group="Internal Connection" visible="`${hasVisibleOption(&quot;digital_in[0]&quot;)}`" desc="A digital input signal to connect to" canBeEmpty="true" />
154    <ParamSignal port="digital_out[0]" name="Digital Output" group="Internal Connection" visible="`${hasVisibleOption(&quot;digital_out[0]&quot;)}`" desc="A digital output signal to connect to" canBeEmpty="true" />
155    <ParamSignal port="digital_inout[0]" name="Digital InOut" group="Internal Connection" visible="`${hasVisibleOption(&quot;digital_inout[0]&quot;)}`" desc="A digital inout signal to connect to" canBeEmpty="true" />
156    <ParamSignal port="aux[0]" name="AUX" group="Internal Connection" visible="`${hasVisibleOption(&quot;aux[0]&quot;)}`" desc="A fixed function signal to connect to" canBeEmpty="true" />
157    <ParamSignal port="oe[0]" name="OE" group="Internal Connection" visible="`${hasVisibleOption(&quot;oe[0]&quot;)}`" desc="The Output Enable terminal." canBeEmpty="true" />
158
159    <!-- Skip amuxbus code gen -->
160    <ParamString id="analogValue" name="Analog Connection Value" group="Internal" default="`${hasConnection(&quot;analog&quot;, 0) ? getBlockFromSignal(&quot;analog[0]&quot;) : &quot;&quot;}`" visible="false" editable="false" desc="" />
161    <ParamBool id="skipConfigCodeGen" name="Skip Configuration Code Gen" group="Internal" default="`${hasConnection(&quot;analog&quot;, 0) &amp;&amp; hasExposedMember(analogValue, &quot;suppressCodeGen&quot;) &amp;&amp; getExposedMember(analogValue, &quot;suppressCodeGen&quot;)}`" visible="false" editable="false" desc="Whether configuration code generation should be skipped" />
162
163    <!-- Skip Gpio Init code gen for Non-secure for EXTCLK -->
164    <ParamBool id="skipConfigCodeGenExtClk" name="Skip Configuration Code Gen for EXT_CLK" group="Internal" default="`${is_mxs22ioss &amp;&amp;(getParamValueDisplay(&quot;digital_in[0]&quot;) eq &quot;EXTCLK ext_clk [USED]&quot;)}`" visible="false" editable="false" desc="Whether configuration code generation should be skipped" />
165
166    <!--Config-->
167    <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)." />
168    <ParamBool id="hasDigitalOrAnalogConnection" name="Has digital or analog connection" group="Internal" default="`${hasConnection(&quot;digital_in&quot;, 0) || hasConnection(&quot;digital_out&quot;, 0) || hasConnection(&quot;digital_inout&quot;, 0) || hasConnection(&quot;analog&quot;, 0)}`" visible="false" editable="false" desc="" />
169    <ParamRange id="port" name="Port number" group="Internal" default="`${getInstNumber(&quot;port&quot;)}`" min="0" max="127" resolution="1" visible="false" editable="false" desc="" />
170    <ParamRange id="pin" name="Pin number" group="Internal" default="`${getInstNumber(&quot;pin&quot;)}`" min="0" max="7" resolution="1" visible="false" editable="false" desc="" />
171    <ParamString id="blockName" name="Block name" group="Internal" default="`${&quot;ioss_0_port_&quot; . port . &quot;_pin_&quot; . pin}`" visible="false" editable="false" desc="" />
172    <ParamString id="pinPort" name="PinPort" group="Internal" default="P`${getInstNumber(&quot;port&quot;)}`_`${getInstNumber(&quot;pin&quot;)}`" visible="false" editable="false" desc="" />
173
174    <ParamString id="smif" name="smif" group="smif" default="`${findConnectedBlock(&quot;aux[0]&quot;, &quot;smif.core&quot;)}`" visible="false" editable="false" desc="" />
175    <ParamBool id="hasSmifConn" name="hasSmifConn" group="Internal" default="`${smif ne &quot;&quot;}`" visible="false" editable="false" desc="" />
176    <ParamRange id="smifVersion" name="SMIF Version" group="Internal" max="7" min="5" resolution="1" default="`${hasSmifConn &amp;&amp; hasExposedMember(&quot;smif[0].core[0]&quot;, &quot;smif_ip_version&quot;)  ? getExposedMember(&quot;smif[0].core[0]&quot;, &quot;smif_ip_version&quot;) : 5}`" visible="true" editable="false" desc="SMIF IP Version" />
177    <ParamString id="smifCore" name="smifCore" group="smif" default="`${ hasSmifConn ? ((smifVersion == 5) ? getInstFromLocation(findConnectedBlock(&quot;aux[0]&quot;, &quot;smif.core&quot;), &quot;core&quot;) : getInstFromLocation(findConnectedBlock(&quot;aux[0]&quot;, &quot;smif.core&quot;), &quot;smif&quot;)) : &quot;&quot;}`" visible="false" editable="false" desc="" />
178    <ParamString id="smifPortString" name="SMIF Port String" group="Internal" default="`${hasSmifConn ? ((smifVersion == 5) ? &quot;(GPIO_PRT_Type*)SMIF0_CORE&quot; . smifCore . &quot;_SMIF_GPIO_SMIF_PRT0&quot; : &quot;(GPIO_PRT_Type*)SMIF&quot; . smifCore . &quot;_CORE_SMIF_GPIO_SMIF_PRT0&quot;) : &quot;&quot;}`" visible="false" editable="false" desc="SMIF Port Number" />
179
180  </Parameters>
181
182  <DRCs>
183    <!--sioOutputBuffer DRCs-->
184    <DRC type="WARNING" text="The SIO Output Buffer Regulated mode is selected ONLY if the Drive Mode is set to the &quot;Open Drain, Drives High. Input buffer off&quot; mode. If the Drive Mode is set to any other mode the regulated output buffer will be disabled and the standard CMOS output buffer is used." condition="`${hasSIO &amp;&amp; sioOutputBuffer &amp;&amp; (DriveModes ne CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF)}`" />
185    <DRC type="ERROR" text="The digital_in terminal cannot be connected when the digital_inout terminal is connected." condition="`${hasConnection(&quot;digital_in&quot;, 0) &amp;&amp; hasConnection(&quot;digital_inout&quot;, 0)}`" />
186    <DRC type="ERROR" text="The digital_out terminal cannot be connected when the digital_inout terminal is connected." condition="`${hasConnection(&quot;digital_out&quot;, 0) &amp;&amp; hasConnection(&quot;digital_inout&quot;, 0)}`" />
187
188    <DRC type="WARNING" paramId="driveStrength" text="To limit noise, full drive strength is not recommended " condition="`${(driveStrength eq CY_GPIO_DRIVE_FULL)}`" >
189        <FixIt action="SET_PARAM" target="driveStrength" value="CY_GPIO_DRIVE_1_2" valid="true" />
190    </DRC>
191  </DRCs>
192
193  <ConfigFirmware>
194    <ConfigInclude value="cy_gpio.h" include="true" />
195    <ConfigInclude value="cycfg_routing.h" include="`${hasDigitalOrAnalogConnection}`" />
196    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
197    <ConfigInclude value="cyhal_hw_types.h" include="true" guard="defined (CY_USING_HAL_LITE)" />
198
199    <ConfigDefine name="`${INST_NAME}`_PORT" value="`${hasSmifConn ? smifPortString : &quot;GPIO_PRT&quot;. port}`" public="true" include="true" />
200    <ConfigDefine name="`${INST_NAME}`_PORT_NUM" value="`${port}`U" public="true" include="true" />
201    <ConfigDefine name="`${INST_NAME}`_PIN" value="`${pin}`U" public="true" include="true" />
202    <ConfigDefine name="`${INST_NAME}`_NUM" value="`${pin}`U" public="true" include="true" />
203    <ConfigDefine name="`${INST_NAME}`_DRIVEMODE" value="`${DriveModes}`" public="true" include="true" />
204    <ConfigDefine name="`${INST_NAME}`_INIT_DRIVESTATE" value="`${initialState}`" public="true" include="true" />
205    <ConfigDefine name="`${blockName . &quot;_HSIOM&quot;}`" value="`${hasSmifConn ? &quot;HSIOM_SEL_ACT_15&quot; : &quot;HSIOM_SEL_GPIO&quot;}`" public="true" include="true" preventOverride="true" />
206    <ConfigDefine name="`${INST_NAME}`_HSIOM" value="`${blockName . &quot;_HSIOM&quot;}`" public="true" include="`${!(INST_NAME eq blockName)}`" />
207    <ConfigDefine name="`${INST_NAME}`_IRQ" value="`${(nonSec eq 1) ? &quot;ioss_interrupts_&quot; : &quot;ioss_interrupts_sec_&quot;}`gpio_`${port}`_IRQn" public="true" include="`${hasIRQ &amp;&amp; !(is_mxs40ioss &amp;&amp; (ipVersion eq 3))}`" />
208    <ConfigDefine name="`${INST_NAME}`_IRQ" value="`${(deepsleep eq 1) ? &quot;ioss_interrupts_gpio_dpslp&quot; : &quot;ioss_interrupts_gpio_act&quot;}`_`${port}`_IRQn" public="true" include="`${hasIRQ &amp;&amp; (is_mxs40ioss &amp;&amp; (ipVersion eq 3))}`" />
209    <ConfigDefine name="`${INST_NAME}`_HAL_PORT_PIN" value="P`${port}`_`${pin}`" public="true" include="true" guard="defined (CY_USING_HAL) || (CY_USING_HAL_LITE)"/>
210    <ConfigDefine name="`${INST_NAME}`" value="P`${port}`_`${pin}`" public="true" include="true" guard="defined (CY_USING_HAL) || (CY_USING_HAL_LITE)" />
211    <ConfigDefine name="`${INST_NAME}`_HAL_IRQ" value="`${(isrTrigger eq CY_GPIO_INTR_DISABLE) ? &quot;CYHAL_GPIO_IRQ_NONE&quot; :
212                                                          (isrTrigger eq CY_GPIO_INTR_RISING) ? &quot;CYHAL_GPIO_IRQ_RISE&quot; :
213                                                          (isrTrigger eq CY_GPIO_INTR_FALLING) ? &quot;CYHAL_GPIO_IRQ_FALL&quot; : &quot;CYHAL_GPIO_IRQ_BOTH&quot;}`"
214                                                public="true" include="true" guard="defined (CY_USING_HAL) || (CY_USING_HAL_LITE)" />
215    <ConfigDefine name="`${INST_NAME}`_HAL_DIR" value="`${((DriveModes eq CY_GPIO_DM_HIGHZ) || (DriveModes eq CY_GPIO_DM_ANALOG)) ? &quot;CYHAL_GPIO_DIR_INPUT &quot; :
216                                                          ((DriveModes eq CY_GPIO_DM_STRONG_IN_OFF) ||
217                                                           (DriveModes eq CY_GPIO_DM_OD_DRIVESLOW_IN_OFF) ||
218                                                           (DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF) ||
219                                                           (DriveModes eq CY_GPIO_DM_PULLUP_IN_OFF) ||
220                                                           (DriveModes eq CY_GPIO_DM_PULLDOWN_IN_OFF) ||
221                                                           (DriveModes eq CY_GPIO_DM_PULLUP_DOWN_IN_OFF)) ? &quot;CYHAL_GPIO_DIR_OUTPUT &quot; : &quot;CYHAL_GPIO_DIR_BIDIRECTIONAL &quot;}`"
222                                                public="true" include="true" guard="defined (CY_USING_HAL) || (CY_USING_HAL_LITE)" />
223    <ConfigDefine name="`${INST_NAME}`_HAL_DRIVEMODE" value="`${(DriveModes eq CY_GPIO_DM_HIGHZ) ? &quot;CYHAL_GPIO_DRIVE_NONE&quot; :
224                                                                (DriveModes eq CY_GPIO_DM_ANALOG) ? &quot;CYHAL_GPIO_DRIVE_ANALOG&quot; :
225                                                               ((DriveModes eq CY_GPIO_DM_PULLUP_IN_OFF) ||
226                                                                (DriveModes eq CY_GPIO_DM_PULLUP)) ? &quot;CYHAL_GPIO_DRIVE_PULLUP&quot; :
227                                                               ((DriveModes eq CY_GPIO_DM_PULLDOWN_IN_OFF) ||
228                                                                (DriveModes eq CY_GPIO_DM_PULLDOWN)) ? &quot;CYHAL_GPIO_DRIVE_PULLDOWN&quot; :
229                                                               ((DriveModes eq CY_GPIO_DM_OD_DRIVESLOW_IN_OFF) ||
230                                                                (DriveModes eq CY_GPIO_DM_OD_DRIVESLOW)) ? &quot;CYHAL_GPIO_DRIVE_OPENDRAINDRIVESLOW&quot; :
231                                                               ((DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF) ||
232                                                                (DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH)) ? &quot;CYHAL_GPIO_DRIVE_OPENDRAINDRIVESHIGH&quot; :
233                                                               ((DriveModes eq CY_GPIO_DM_STRONG_IN_OFF) ||
234                                                                (DriveModes eq CY_GPIO_DM_STRONG)) ? &quot;CYHAL_GPIO_DRIVE_STRONG&quot; : &quot;CYHAL_GPIO_DRIVE_PULLUPDOWN&quot;}`"
235                                                      public="true" include="true" guard="defined (CY_USING_HAL) || (CY_USING_HAL_LITE)" />
236
237    <ConfigStruct name="`${INST_NAME}`_config" type="cy_stc_gpio_pin_config_t" const="`${inFlash}`" public="true" include="true" >
238      <Member name="outVal" value="`${initialState}`" />
239      <Member name="driveMode" value="`${DriveModes}`" />
240      <Member name="hsiom" value="`${INST_NAME}`_HSIOM" />
241      <Member name="intEdge" value="`${isrTrigger}`" />
242      <Member name="intMask" value="`${isrTrigger eq CY_GPIO_INTR_DISABLE ? 0 : 1}`UL" />
243      <Member name="vtrip" value="`${vtrip}`" />
244      <Member name="slewRate" value="`${slewRate}`" />
245      <Member name="driveSel" value="`${extended_drive_sel ? extended_driveStrength : driveStrength}`" />
246      <Member name="vregEn" value="`${(!hasSIO) ? &quot;0UL&quot; :
247                                      sioOutputBuffer ? &quot;1UL&quot; : &quot;0UL&quot;}`" />
248      <Member name="ibufMode" value="`${(!hasSIO) ? &quot;0UL&quot; :
249                                      sioInputBuffer ? &quot;1UL&quot; : &quot;0UL&quot;}`" />
250      <Member name="vtripSel" value="`${hasSIO ? sioTrip : &quot;0UL&quot;}`" />
251      <Member name="vrefSel" value="`${hasSIO ? sioRef : &quot;0UL&quot;}`" />
252      <Member name="vohSel" value="`${hasSIO ? sioVoltage : &quot;0UL&quot;}`" />
253      <Member name="pullUpRes" value="`${pullUpRes}`" include="`${pullUpResAvailable}`"/>
254      <Member name="nonSec" value="`${(secExtAvailable eq 1) ? nonSec : &quot;1UL&quot;}`" include="`${secExtAvailable ne -1}`"/>
255    </ConfigStruct>
256
257    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL) || (CY_USING_HAL_LITE)">
258      <Member name="type" value="CYHAL_RSC_GPIO" />
259      <Member name="block_num" value="`${INST_NAME}`_PORT_NUM" />
260      <Member name="channel_num" value="`${INST_NAME}`_PIN" />
261    </ConfigStruct>
262
263    <ConfigInstruction value="Cy_GPIO_Pin_Init(`${INST_NAME}`_PORT, `${INST_NAME}`_PIN, &amp;`${INST_NAME}`_config);" include="`${(!skipConfigCodeGenExtClk) ? (!skipConfigCodeGen) : false}`" />
264    <ConfigInstruction value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
265  </ConfigFirmware>
266</Personality>
267