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), 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  <Parameters>
38    <!-- PDL documentation -->
39    <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" />
40
41    <!--General-->
42    <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" />
43    <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" />
44    <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" />
45    <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." >
46      <Entry name="Strong Drive. Input buffer on"                                                    value="CY_GPIO_DM_STRONG"                       visible="true" />
47      <Entry name="Strong Drive. Input buffer off"                                                   value="CY_GPIO_DM_STRONG_IN_OFF"                visible="true" />
48      <Entry name="Open Drain, Drives Low. Input buffer off"                                         value="CY_GPIO_DM_OD_DRIVESLOW_IN_OFF"          visible="true" />
49      <Entry name="Open Drain, Drives High. Input buffer off"                                        value="CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF"         visible="true" />
50      <Entry name="Open Drain, Drives Low. Input buffer on"                                          value="CY_GPIO_DM_OD_DRIVESLOW"                 visible="true" />
51      <Entry name="Open Drain, Drives High. Input buffer on"                                         value="CY_GPIO_DM_OD_DRIVESHIGH"                visible="true" />
52      <Entry name="Resistive Pull-Up. Input buffer off"                                              value="CY_GPIO_DM_PULLUP_IN_OFF"                visible="true" />
53      <Entry name="Resistive Pull-Down. Input buffer off"                                            value="CY_GPIO_DM_PULLDOWN_IN_OFF"              visible="true" />
54      <Entry name="Resistive Pull-Up/Down. Input buffer off"                                         value="CY_GPIO_DM_PULLUP_DOWN_IN_OFF"           visible="true" />
55      <Entry name="Resistive Pull-Up. Input buffer on"                                               value="CY_GPIO_DM_PULLUP"                       visible="true" />
56      <Entry name="Resistive Pull-Down. Input buffer on"                                             value="CY_GPIO_DM_PULLDOWN"                     visible="true" />
57      <Entry name="Resistive Pull-Up/Down. Input buffer on"                                          value="CY_GPIO_DM_PULLUP_DOWN"                  visible="true" />
58      <Entry name="Digital High-Z. Input buffer on"                                                  value="CY_GPIO_DM_HIGHZ"                        visible="true" />
59      <Entry name="Analog High-Z. Input buffer off"                                                  value="CY_GPIO_DM_ANALOG"                       visible="true" />
60      <Entry name="Strong Drive/Resistive Pull-Up/High-Z based on data_out_en and data_out signals"  value="CY_GPIO_DM_CFGOUT3_STRONG_PULLUP_HIGHZ"  visible="`${(driveModeExtension eq 4)}`" />
61    </ParamChoice>
62    <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." >
63      <Entry name="High (1)" value="1" visible="true" />
64      <Entry name="Low (0)"  value="0" visible="true" />
65    </ParamChoice>
66    <ParamChoice id="nonSec" name="Secure attribute" group="General" default="1" visible="`${secExtAvailable eq 1}`" editable="true" desc="This parameter specifies the secure attribute for each pin of a port." >
67      <Entry name="Non-secure access (1)" value="1" visible="true" />
68      <Entry name="Secure access (0)"  value="0" visible="true" />
69    </ParamChoice>
70    <!--Misc-->
71    <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" />
72    <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" />
73    <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" />
74    <!--Input-->
75    <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)." >
76      <Entry name="CMOS" value="CY_GPIO_VTRIP_CMOS" visible="true" />
77      <Entry name="TTL"  value="CY_GPIO_VTRIP_TTL"  visible="true" />
78    </ParamChoice>
79    <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." >
80      <Entry name="None"         value="CY_GPIO_INTR_DISABLE" visible="true" />
81      <Entry name="Rising Edge"  value="CY_GPIO_INTR_RISING"  visible="true" />
82      <Entry name="Falling Edge" value="CY_GPIO_INTR_FALLING" visible="true" />
83      <Entry name="Both Edges"   value="CY_GPIO_INTR_BOTH"    visible="true" />
84    </ParamChoice>
85    <ParamBool id="sioInputBuffer" name="SIO Input Buffer Differential" group="Input" default="false" visible="`${hasSIO}`" editable="`${hasSIO}`" desc="Selects the input buffer mode" />
86    <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." >
87      <Entry name="CMOS (single-ended)"                 value="CY_SIO_VTRIP_CMOS"             visible="true" />
88      <Entry name="TTL (single-ended)"                  value="CY_SIO_VTRIP_TTL"              visible="true" />
89      <Entry name="0.5xVddio or 0.5xVoh (differential)" value="CY_SIO_VTRIP_0_5VDDIO_0_5VOH"  visible="true" />
90      <Entry name="0.4xVddio or 0.4xVoh (differential)" value="CY_SIO_VTRIP_0_4VDDIO_1_0VREF" visible="true" />
91    </ParamChoice>
92    <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." >
93      <Entry name="Analog Pin"              value="CY_SIO_VREF_PINREF" visible="true" />
94      <Entry name="Internal 1.2V Reference" value="CY_SIO_VREF_1_2V"   visible="true" />
95      <Entry name="AMUXBUS A"               value="CY_SIO_VREF_AMUX_A" visible="true" />
96      <Entry name="AMUXBUS B"               value="CY_SIO_VREF_AMUX_B" visible="true" />
97    </ParamChoice>
98    <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." >
99      <Entry name="1 x Reference"    value="CY_SIO_VOH_1_00" visible="true" />
100      <Entry name="1.25 x Reference" value="CY_SIO_VOH_1_25" visible="true" />
101      <Entry name="1.49 x Reference" value="CY_SIO_VOH_1_49" visible="true" />
102      <Entry name="1.67 x Reference" value="CY_SIO_VOH_1_67" visible="true" />
103      <Entry name="2.08 x Reference" value="CY_SIO_VOH_2_08" visible="true" />
104      <Entry name="2.50 x Reference" value="CY_SIO_VOH_2_50" visible="true" />
105      <Entry name="2.78 x Reference" value="CY_SIO_VOH_2_78" visible="true" />
106      <Entry name="4.16 x Reference" value="CY_SIO_VOH_4_16" visible="true" />
107    </ParamChoice>
108
109    <!--Output-->
110    <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." >
111      <Entry name="Fast" value="CY_GPIO_SLEW_FAST" visible="true" />
112      <Entry name="Slow" value="CY_GPIO_SLEW_SLOW" visible="true" />
113    </ParamChoice>
114    <ParamChoice id="driveStrength"  name="Drive Strength" group="Output" default="CY_GPIO_DRIVE_1_2" visible="true" editable="true" 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." >
115      <Entry name="Full" value="CY_GPIO_DRIVE_FULL" visible="true" />
116      <Entry name="1 / 2" value="CY_GPIO_DRIVE_1_2" visible="true" />
117      <Entry name="1 / 4" value="CY_GPIO_DRIVE_1_4" visible="true" />
118      <Entry name="1 / 8" value="CY_GPIO_DRIVE_1_8" visible="true" />
119    </ParamChoice>
120    <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" />
121    <ParamChoice id="pullUpRes" name="Pull-up resistor" group="Output" default="CY_GPIO_PULLUP_RES_DISABLE" visible="`${pullUpResAvailable}`" editable="true" desc="The Pull-up resistor parameter configures the additional pull-up resistors." >
122      <Entry name="Disable additional Pull-up resistors" value="CY_GPIO_PULLUP_RES_DISABLE" visible="true" />
123      <Entry name="570Ω pull-up resistance"              value="CY_GPIO_PULLUP_RES_570"     visible="`${hasPullUpRes}`" />
124      <Entry name="720Ω pull-up resistance"              value="CY_GPIO_PULLUP_RES_720"     visible="`${hasPullUpRes}`" />
125      <Entry name="840Ω pull-up resistance"              value="CY_GPIO_PULLUP_RES_840"     visible="`${hasPullUpRes}`" />
126      <Entry name="1100Ω pull-up resistance"             value="CY_GPIO_PULLUP_RES_1100"    visible="`${hasPullUpRes}`" />
127      <Entry name="1200Ω pull-up resistance"             value="CY_GPIO_PULLUP_RES_1200"    visible="`${hasPullUpRes}`" />
128      <Entry name="1800Ω pull-up resistance"             value="CY_GPIO_PULLUP_RES_1800"    visible="`${hasPullUpRes}`" />
129      <Entry name="2800Ω pull-up resistance"             value="CY_GPIO_PULLUP_RES_2800"    visible="`${hasPullUpRes}`" />
130    </ParamChoice>
131
132    <!--Internal Connection-->
133    <ParamSignal port="analog[0]" name="Analog" group="Internal Connection" visible="`${hasVisibleOption(&quot;analog[0]&quot;)}`" desc="An analog signal to connect to" canBeEmpty="true" />
134    <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" />
135    <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" />
136    <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" />
137    <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" />
138    <ParamSignal port="oe[0]" name="OE" group="Internal Connection" visible="`${hasVisibleOption(&quot;oe[0]&quot;)}`" desc="The Output Enable terminal." canBeEmpty="true" />
139
140    <!-- Skip amuxbus code gen -->
141    <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="" />
142    <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" />
143
144    <!--Config-->
145    <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)." />
146    <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="" />
147    <ParamRange id="port" name="Port number" group="Internal" default="`${getInstNumber(&quot;port&quot;)}`" min="0" max="127" resolution="1" visible="false" editable="false" desc="" />
148    <ParamRange id="pin" name="Pin number" group="Internal" default="`${getInstNumber(&quot;pin&quot;)}`" min="0" max="7" resolution="1" visible="false" editable="false" desc="" />
149    <ParamString id="blockName" name="Block name" group="Internal" default="`${&quot;ioss_0_port_&quot; . port . &quot;_pin_&quot; . pin}`" visible="false" editable="false" desc="" />
150
151    <ParamString id="smif" name="smif" group="smif" default="`${findConnectedBlock(&quot;aux[0]&quot;, &quot;smif.core&quot;)}`" visible="false" editable="false" desc="" />
152    <ParamBool id="hasSmifConn" name="hasSmifConn" group="Internal" default="`${smif ne &quot;&quot;}`" visible="false" editable="false" desc="" />
153    <ParamString id="smifCore" name="smifCore" group="smif" default="`${ hasSmifConn ? getInstFromLocation(findConnectedBlock(&quot;aux[0]&quot;, &quot;smif.core&quot;), &quot;core&quot;) : &quot;&quot;}`" visible="false" editable="false" desc="" />
154	<ParamString id="smifPortString" name="SMIF Port String" group="Internal" default="`${hasSmifConn ? &quot;(GPIO_PRT_Type*)SMIF0_CORE&quot; . smifCore . &quot;_SMIF_GPIO_SMIF_PRT0&quot; : &quot;&quot;}`" visible="false" editable="false" desc="SMIF Port Number" />
155
156  </Parameters>
157
158  <DRCs>
159    <!--sioOutputBuffer DRCs-->
160    <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)}`" />
161    <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)}`" />
162    <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)}`" />
163
164    <DRC type="WARNING" paramId="driveStrength" text="To limit noise, full drive strength is not recommended " condition="`${(driveStrength eq CY_GPIO_DRIVE_FULL)}`" >
165        <FixIt action="SET_PARAM" target="driveStrength" value="CY_GPIO_DRIVE_1_2" valid="true" />
166    </DRC>
167  </DRCs>
168
169  <ConfigFirmware>
170    <ConfigInclude value="cy_gpio.h" include="true" />
171    <ConfigInclude value="cycfg_routing.h" include="`${hasDigitalOrAnalogConnection}`" />
172    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
173
174    <ConfigDefine name="`${INST_NAME}`_PORT" value="`${hasSmifConn ? smifPortString : &quot;GPIO_PRT&quot;. port}`" public="true" include="true" />
175    <ConfigDefine name="`${INST_NAME}`_PORT_NUM" value="`${port}`U" public="true" include="true" />
176    <ConfigDefine name="`${INST_NAME}`_PIN" value="`${pin}`U" public="true" include="true" />
177    <ConfigDefine name="`${INST_NAME}`_NUM" value="`${pin}`U" public="true" include="true" />
178    <ConfigDefine name="`${INST_NAME}`_DRIVEMODE" value="`${DriveModes}`" public="true" include="true" />
179    <ConfigDefine name="`${INST_NAME}`_INIT_DRIVESTATE" value="`${initialState}`" public="true" include="true" />
180    <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" />
181    <ConfigDefine name="`${INST_NAME}`_HSIOM" value="`${blockName . &quot;_HSIOM&quot;}`" public="true" include="`${!(INST_NAME eq blockName)}`" />
182    <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}`" />
183    <ConfigDefine name="`${INST_NAME}`_HAL_PORT_PIN" value="P`${port}`_`${pin}`" public="true" include="true" guard="defined (CY_USING_HAL)"/>
184    <ConfigDefine name="`${INST_NAME}`" value="P`${port}`_`${pin}`" public="true" include="true" guard="defined (CY_USING_HAL)" />
185    <ConfigDefine name="`${INST_NAME}`_HAL_IRQ" value="`${(isrTrigger eq CY_GPIO_INTR_DISABLE) ? &quot;CYHAL_GPIO_IRQ_NONE&quot; :
186                                                          (isrTrigger eq CY_GPIO_INTR_RISING) ? &quot;CYHAL_GPIO_IRQ_RISE&quot; :
187                                                          (isrTrigger eq CY_GPIO_INTR_FALLING) ? &quot;CYHAL_GPIO_IRQ_FALL&quot; : &quot;CYHAL_GPIO_IRQ_BOTH&quot;}`"
188                                                public="true" include="true" guard="defined (CY_USING_HAL)" />
189    <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; :
190                                                          ((DriveModes eq CY_GPIO_DM_STRONG_IN_OFF) ||
191                                                           (DriveModes eq CY_GPIO_DM_OD_DRIVESLOW_IN_OFF) ||
192                                                           (DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF) ||
193                                                           (DriveModes eq CY_GPIO_DM_PULLUP_IN_OFF) ||
194                                                           (DriveModes eq CY_GPIO_DM_PULLDOWN_IN_OFF) ||
195                                                           (DriveModes eq CY_GPIO_DM_PULLUP_DOWN_IN_OFF)) ? &quot;CYHAL_GPIO_DIR_OUTPUT &quot; : &quot;CYHAL_GPIO_DIR_BIDIRECTIONAL &quot;}`"
196                                                public="true" include="true" guard="defined (CY_USING_HAL)" />
197    <ConfigDefine name="`${INST_NAME}`_HAL_DRIVEMODE" value="`${(DriveModes eq CY_GPIO_DM_HIGHZ) ? &quot;CYHAL_GPIO_DRIVE_NONE&quot; :
198                                                                (DriveModes eq CY_GPIO_DM_ANALOG) ? &quot;CYHAL_GPIO_DRIVE_ANALOG&quot; :
199                                                               ((DriveModes eq CY_GPIO_DM_PULLUP_IN_OFF) ||
200                                                                (DriveModes eq CY_GPIO_DM_PULLUP)) ? &quot;CYHAL_GPIO_DRIVE_PULLUP&quot; :
201                                                               ((DriveModes eq CY_GPIO_DM_PULLDOWN_IN_OFF) ||
202                                                                (DriveModes eq CY_GPIO_DM_PULLDOWN)) ? &quot;CYHAL_GPIO_DRIVE_PULLDOWN&quot; :
203                                                               ((DriveModes eq CY_GPIO_DM_OD_DRIVESLOW_IN_OFF) ||
204                                                                (DriveModes eq CY_GPIO_DM_OD_DRIVESLOW)) ? &quot;CYHAL_GPIO_DRIVE_OPENDRAINDRIVESLOW&quot; :
205                                                               ((DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH_IN_OFF) ||
206                                                                (DriveModes eq CY_GPIO_DM_OD_DRIVESHIGH)) ? &quot;CYHAL_GPIO_DRIVE_OPENDRAINDRIVESHIGH&quot; :
207                                                               ((DriveModes eq CY_GPIO_DM_STRONG_IN_OFF) ||
208                                                                (DriveModes eq CY_GPIO_DM_STRONG)) ? &quot;CYHAL_GPIO_DRIVE_STRONG&quot; : &quot;CYHAL_GPIO_DRIVE_PULLUPDOWN&quot;}`"
209                                                      public="true" include="true" guard="defined (CY_USING_HAL)" />
210
211    <ConfigStruct name="`${INST_NAME}`_config" type="cy_stc_gpio_pin_config_t" const="`${inFlash}`" public="true" include="true" >
212      <Member name="outVal" value="`${initialState}`" />
213      <Member name="driveMode" value="`${DriveModes}`" />
214      <Member name="hsiom" value="`${INST_NAME}`_HSIOM" />
215      <Member name="intEdge" value="`${isrTrigger}`" />
216      <Member name="intMask" value="`${isrTrigger eq CY_GPIO_INTR_DISABLE ? 0 : 1}`UL" />
217      <Member name="vtrip" value="`${vtrip}`" />
218      <Member name="slewRate" value="`${slewRate}`" />
219      <Member name="driveSel" value="`${driveStrength}`" />
220      <Member name="vregEn" value="`${(!hasSIO) ? &quot;0UL&quot; :
221                                      sioOutputBuffer ? &quot;1UL&quot; : &quot;0UL&quot;}`" />
222      <Member name="ibufMode" value="`${(!hasSIO) ? &quot;0UL&quot; :
223                                      sioInputBuffer ? &quot;1UL&quot; : &quot;0UL&quot;}`" />
224      <Member name="vtripSel" value="`${hasSIO ? sioTrip : &quot;0UL&quot;}`" />
225      <Member name="vrefSel" value="`${hasSIO ? sioRef : &quot;0UL&quot;}`" />
226      <Member name="vohSel" value="`${hasSIO ? sioVoltage : &quot;0UL&quot;}`" />
227      <Member name="pullUpRes" value="`${pullUpRes}`" include="`${pullUpResAvailable}`"/>
228      <Member name="nonSec" value="`${(secExtAvailable eq 1) ? nonSec : &quot;1UL&quot;}`" include="`${secExtAvailable ne -1}`"/>
229    </ConfigStruct>
230
231    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)">
232      <Member name="type" value="CYHAL_RSC_GPIO" />
233      <Member name="block_num" value="`${INST_NAME}`_PORT_NUM" />
234      <Member name="channel_num" value="`${INST_NAME}`_PIN" />
235    </ConfigStruct>
236
237    <ConfigInstruction value="Cy_GPIO_Pin_Init(`${INST_NAME}`_PORT, `${INST_NAME}`_PIN, &amp;`${INST_NAME}`_config);" include="`${!skipConfigCodeGen}`" />
238    <ConfigInstruction value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
239  </ConfigFirmware>
240</Personality>
241