1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file sd_host.cypersonality
6* \version 1.0
7*
8* \brief
9* SD Host Controller personality description file. It supports CAT1A, CAT1B,
10* CAT1C and CAT1D devices.
11*
12********************************************************************************
13* \copyright
14* Copyright 2018-2022 Cypress Semiconductor Corporation
15* SPDX-License-Identifier: Apache-2.0
16*
17* Licensed under the Apache License, Version 2.0 (the "License");
18* you may not use this file except in compliance with the License.
19* You may obtain a copy of the License at
20*
21*     http://www.apache.org/licenses/LICENSE-2.0
22*
23* Unless required by applicable law or agreed to in writing, software
24* distributed under the License is distributed on an "AS IS" BASIS,
25* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26* See the License for the specific language governing permissions and
27* limitations under the License.
28*****************************************************************************-->
29
30<Personality id="mxs40sdhost" name="SD Host Controller" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
31  <Dependencies>
32    <IpBlock name="mxsdhc" />
33    <Resource name="sdhc" />
34  </Dependencies>
35  <ExposedMembers />
36  <Parameters>
37    <!-- PDL documentation -->
38    <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__sd__host.html" linkText="Open SD Host Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
39
40    <!-- Internal -->
41    <ParamString id="ip_version" name="version number" group="Internal" default="`${getVersion()}`" visible="false" editable="false" desc="" />
42
43    <!-- Timing -->
44    <ParamSignal port="clk_hf[0]" name="Clock" group="Timing" visible="true" desc="Input clock source of the SDHC block." canBeEmpty="false" />
45    <ParamString id="sourceClock" name="sourceClock" group="General" default="`${getBlockFromSignal(&quot;clk_hf[0]&quot;)}`" visible="false" editable="false" desc="" />
46    <ParamRange id="sourceFreq" name="sourceFreq" group="General" default="`${isBlockUsed(sourceClock) ? getExposedMember(sourceClock, &quot;frequency&quot;) : 0}`" min="0" max="400000000" resolution="1" visible="false" editable="false" desc="" />
47    <ParamRange  id="sdhcClk" name="Input Clock Frequency (kHz)" group="Timing" default="`${sourceFreq / 1000}`" min="0" max="400000000" resolution="0.001" visible="true" editable="false" desc="Shows the actual input clock frequency of the SDHC block." />
48
49    <!-- General -->
50    <ParamChoice id="cardType" name="Card Type" group="General" default="emmc" visible="true" editable="true" desc="Defines if the card is eMMC." >
51      <Entry name="eMMC" value="emmc" visible="true" />
52      <Entry name="SD/SDIO" value="nonEmmc" visible="true" />
53    </ParamChoice>
54    <ParamChoice id="dmaType" name="DMA Type" group="General" default="CY_SD_HOST_DMA_SDMA" visible="true" editable="true" desc="Selects the DMA type to be used." >
55      <Entry name="SDMA" value="CY_SD_HOST_DMA_SDMA" visible="true" />
56      <Entry name="ADMA2" value="CY_SD_HOST_DMA_ADMA2" visible="true" />
57      <Entry name="ADMA2-ADMA3" value="CY_SD_HOST_DMA_ADMA2_ADMA3" visible="true" />
58    </ParamChoice>
59    <ParamRange id="InstNumber" name="Instance Number" group="General" default="`${getInstNumber(&quot;sdhc&quot;)}`" min="0" max="1" resolution="1" visible="false" editable="false" desc="This parameter specifies Instance Number." />
60    <ParamBool id="enableLedControl" name="LED Control" group="General" default="false" visible="`${(InstNumber eq 1)}`" editable="true" desc="If enabled the SD clock controls one IO which is used to indicate when card is being accessed." />
61    <ParamChoice id="busWidth" name="Bus Width" group="General" default="CY_SD_HOST_BUS_WIDTH_4_BIT" visible="true" editable="true" desc="The desired bus width." >
62      <Entry name="1-bit" value="CY_SD_HOST_BUS_WIDTH_1_BIT" visible="true" />
63      <Entry name="4-bit" value="CY_SD_HOST_BUS_WIDTH_4_BIT" visible="true" />
64      <Entry name="8-bit" value="CY_SD_HOST_BUS_WIDTH_8_BIT" visible="`${(cardType eq emmc) &amp;&amp; (InstNumber eq 1)}`" />
65    </ParamChoice>
66    <ParamBool id="lowVoltageSignaling" name="Enable Low Voltage Signaling" group="General" default="false" visible="`${hasVisibleOption(&quot;io_volt_sel[0]&quot;)}`" editable="true" desc="If enabled then the host supports the 1.8V signaling." />
67
68    <!--Inputs/Outputs-->
69    <ParamSignal port="clk_card[0]" name="CLK" group="Inputs" visible="true" desc="The card clock pin." canBeEmpty="true" >
70      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
71        <Parameter id="DriveModes" severity="DEFAULT" reason="">
72          <Fixed value="CY_GPIO_DM_STRONG" />
73        </Parameter>
74      </Constraint>
75      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
76        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
77          <Fixed value="CY_GPIO_DM_STRONG" />
78        </Parameter>
79      </Constraint>
80      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
81    </ParamSignal>
82    <ParamString id="clkPin" name="clkPin" group="Internal" default="`${getBlockFromSignal(&quot;clk_card[0]&quot;)}`" visible="false" editable="false" desc="" />
83    <ParamSignal port="card_cmd[0]" name="CMD" group="Inputs" visible="true" desc="The command/response pin." canBeEmpty="true" >
84      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
85        <Parameter id="DriveModes" severity="DEFAULT" reason="">
86          <Fixed value="CY_GPIO_DM_STRONG" />
87        </Parameter>
88      </Constraint>
89      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
90        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
91          <Fixed value="CY_GPIO_DM_STRONG" />
92        </Parameter>
93      </Constraint>
94      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
95    </ParamSignal>
96    <ParamString id="cmdPin" name="cmdPin" group="Internal" default="`${getBlockFromSignal(&quot;card_cmd[0]&quot;)}`" visible="false" editable="false" desc="" />
97    <ParamSignal port="card_dat_3to0[0]" name="DAT0" group="Inputs" visible="true" desc="The Data line [Bit 0] pin." canBeEmpty="true" >
98      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
99        <Parameter id="DriveModes" severity="DEFAULT" reason="">
100          <Fixed value="CY_GPIO_DM_STRONG" />
101        </Parameter>
102      </Constraint>
103      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
104        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
105          <Fixed value="CY_GPIO_DM_STRONG" />
106        </Parameter>
107      </Constraint>
108      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
109    </ParamSignal>
110    <ParamString id="data0Pin" name="data0Pin" group="Internal" default="`${getBlockFromSignal(&quot;card_dat_3to0[0]&quot;)}`" visible="false" editable="false" desc="" />
111    <ParamSignal port="card_dat_3to0[1]" name="DAT1" group="Inputs" visible="`${(busWidth ne CY_SD_HOST_BUS_WIDTH_1_BIT)}`" desc="The Data line [Bit 1] pin." canBeEmpty="true" >
112      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
113        <Parameter id="DriveModes" severity="DEFAULT" reason="">
114          <Fixed value="CY_GPIO_DM_STRONG" />
115        </Parameter>
116      </Constraint>
117      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
118        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
119          <Fixed value="CY_GPIO_DM_STRONG" />
120        </Parameter>
121      </Constraint>
122      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
123    </ParamSignal>
124    <ParamString id="data1Pin" name="data1Pin" group="Internal" default="`${getBlockFromSignal(&quot;card_dat_3to0[1]&quot;)}`" visible="false" editable="false" desc="" />
125    <ParamSignal port="card_dat_3to0[2]" name="DAT2" group="Inputs" visible="`${(busWidth ne CY_SD_HOST_BUS_WIDTH_1_BIT)}`" desc="The Data line [Bit 2] pin." canBeEmpty="true" >
126      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
127        <Parameter id="DriveModes" severity="DEFAULT" reason="">
128          <Fixed value="CY_GPIO_DM_STRONG" />
129        </Parameter>
130      </Constraint>
131      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
132        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
133          <Fixed value="CY_GPIO_DM_STRONG" />
134        </Parameter>
135      </Constraint>
136      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
137    </ParamSignal>
138    <ParamString id="data2Pin" name="data2Pin" group="Internal" default="`${getBlockFromSignal(&quot;card_dat_3to0[2]&quot;)}`" visible="false" editable="false" desc="" />
139    <ParamSignal port="card_dat_3to0[3]" name="DAT3" group="Inputs" visible="`${(busWidth ne CY_SD_HOST_BUS_WIDTH_1_BIT)}`" desc="The Data line [Bit 3] pin." canBeEmpty="true" >
140      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
141        <Parameter id="DriveModes" severity="DEFAULT" reason="">
142          <Fixed value="CY_GPIO_DM_STRONG" />
143        </Parameter>
144      </Constraint>
145      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
146        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
147          <Fixed value="CY_GPIO_DM_STRONG" />
148        </Parameter>
149      </Constraint>
150      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
151    </ParamSignal>
152    <ParamString id="data3Pin" name="data3Pin" group="Internal" default="`${getBlockFromSignal(&quot;card_dat_3to0[3]&quot;)}`" visible="false" editable="false" desc="" />
153    <ParamSignal port="card_dat_7to4[0]" name="DAT4" group="Inputs" visible="`${(cardType eq emmc) &amp;&amp; (InstNumber eq 1) &amp;&amp; (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT)}`" desc="The Data line [Bit 4] pin." canBeEmpty="true" >
154      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
155        <Parameter id="DriveModes" severity="DEFAULT" reason="">
156          <Fixed value="CY_GPIO_DM_STRONG" />
157        </Parameter>
158      </Constraint>
159      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
160        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
161          <Fixed value="CY_GPIO_DM_STRONG" />
162        </Parameter>
163      </Constraint>
164      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
165    </ParamSignal>
166    <ParamString id="data4Pin" name="data4Pin" group="Internal" default="`${getBlockFromSignal(&quot;card_dat_7to4[0]&quot;)}`" visible="false" editable="false" desc="" />
167    <ParamSignal port="card_dat_7to4[1]" name="DAT5" group="Inputs" visible="`${(cardType eq emmc) &amp;&amp; (InstNumber eq 1) &amp;&amp; (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT)}`" desc="The Data line [Bit 5] pin." canBeEmpty="true" >
168      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
169        <Parameter id="DriveModes" severity="DEFAULT" reason="">
170          <Fixed value="CY_GPIO_DM_STRONG" />
171        </Parameter>
172      </Constraint>
173      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
174        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
175          <Fixed value="CY_GPIO_DM_STRONG" />
176        </Parameter>
177      </Constraint>
178      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
179    </ParamSignal>
180    <ParamString id="data5Pin" name="data5Pin" group="Internal" default="`${getBlockFromSignal(&quot;card_dat_7to4[1]&quot;)}`" visible="false" editable="false" desc="" />
181    <ParamSignal port="card_dat_7to4[2]" name="DAT6" group="Inputs" visible="`${(cardType eq emmc) &amp;&amp; (InstNumber eq 1) &amp;&amp; (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT)}`" desc="The Data line [Bit 6] pin." canBeEmpty="true" >
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_STRONG" />
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_STRONG" />
190        </Parameter>
191      </Constraint>
192      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
193    </ParamSignal>
194    <ParamString id="data6Pin" name="data6Pin" group="Internal" default="`${getBlockFromSignal(&quot;card_dat_7to4[2]&quot;)}`" visible="false" editable="false" desc="" />
195    <ParamSignal port="card_dat_7to4[3]" name="DAT7" group="Inputs" visible="`${(cardType eq emmc) &amp;&amp; (InstNumber eq 1) &amp;&amp; (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT)}`" desc="The Data line [Bit 7] pin." canBeEmpty="true" >
196      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
197        <Parameter id="DriveModes" severity="DEFAULT" reason="">
198          <Fixed value="CY_GPIO_DM_STRONG" />
199        </Parameter>
200      </Constraint>
201      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
202        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
203          <Fixed value="CY_GPIO_DM_STRONG" />
204        </Parameter>
205      </Constraint>
206      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
207    </ParamSignal>
208    <ParamString id="data7Pin" name="data7Pin" group="Internal" default="`${getBlockFromSignal(&quot;card_dat_7to4[3]&quot;)}`" visible="false" editable="false" desc="" />
209
210    <ParamSignal port="card_detect_n[0]" name="Card Detect" group="Inputs" visible="`${hasVisibleOption(&quot;card_detect_n[0]&quot;)}`" desc="The card detect pin. Note: You can use any GPIO custom pin for Card Detect. Add the SD Host driver Cy_SD_Host_IsCardConnected() function with the __WEAK type to your code. This function could read the value from any GPIO pin and return true when the card is connected. For more information see the Cy_SD_Host_IsCardConnected() function description." canBeEmpty="true" >
211      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
212        <Parameter id="DriveModes" severity="DEFAULT" reason="">
213          <Fixed value="CY_GPIO_DM_HIGHZ" />
214        </Parameter>
215      </Constraint>
216      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
217        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
218          <Fixed value="CY_GPIO_DM_HIGHZ" />
219        </Parameter>
220      </Constraint>
221      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
222    </ParamSignal>
223    <ParamString id="cardDetectPin" name="cardDetectPin" group="Internal" default="`${getBlockFromSignal(&quot;card_detect_n[0]&quot;)}`" visible="false" editable="false" desc="" />
224    <ParamSignal port="card_emmc_reset_n[0]" name="eMMC Reset" group="Inputs" visible="`${(cardType eq emmc) &amp;&amp; (InstNumber eq 1)}`" desc="The eMMC reset pin." canBeEmpty="true" >
225      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
226        <Parameter id="DriveModes" severity="DEFAULT" reason="">
227          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
228        </Parameter>
229      </Constraint>
230      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
231        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
232          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
233        </Parameter>
234      </Constraint>
235      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
236    </ParamSignal>
237    <ParamString id="emmcRstPin" name="emmcRstPin" group="Internal" default="`${getBlockFromSignal(&quot;card_emmc_reset_n[0]&quot;)}`" visible="false" editable="false" desc="" />
238    <ParamSignal port="led_ctrl[0]" name="Led Control" group="Inputs" visible="`${enableLedControl}`" desc="The LED control pin." canBeEmpty="true" >
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_STRONG_IN_OFF" />
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_STRONG_IN_OFF" />
247        </Parameter>
248      </Constraint>
249      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
250    </ParamSignal>
251    <ParamString id="ledCtrlPin" name="ledCtrlPin" group="Internal" default="`${getBlockFromSignal(&quot;led_ctrl[0]&quot;)}`" visible="false" editable="false" desc="" />
252    <ParamSignal port="card_mech_write_prot[0]" name="Card Mechanical Write Protect" group="Inputs" visible="`${hasVisibleOption(&quot;card_mech_write_prot[0]&quot;)}`" desc="The card mechanical write protect pin." canBeEmpty="true" >
253      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
254        <Parameter id="DriveModes" severity="DEFAULT" reason="">
255          <Fixed value="CY_GPIO_DM_HIGHZ" />
256        </Parameter>
257      </Constraint>
258      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
259        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
260          <Fixed value="CY_GPIO_DM_HIGHZ" />
261        </Parameter>
262      </Constraint>
263      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
264    </ParamSignal>
265    <ParamString id="cardMechWriteProtPin" name="cardMechWriteProtPin" group="Internal" default="`${getBlockFromSignal(&quot;card_mech_write_prot[0]&quot;)}`" visible="false" editable="false" desc="" />
266    <ParamSignal port="card_if_pwr_en[0]" name="Card if Power Enabled" group="Inputs" visible="`${hasVisibleOption(&quot;card_if_pwr_en[0]&quot;)}`" desc="The card if power enabled pin." canBeEmpty="true" >
267      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
268        <Parameter id="DriveModes" severity="DEFAULT" reason="">
269          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
270        </Parameter>
271      </Constraint>
272      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
273        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
274          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
275        </Parameter>
276      </Constraint>
277      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
278    </ParamSignal>
279    <ParamString id="cardPwrEnPin" name="cardPwrEnPin" group="Internal" default="`${getBlockFromSignal(&quot;card_if_pwr_en[0]&quot;)}`" visible="false" editable="false" desc="" />
280    <ParamSignal port="io_volt_sel[0]" name="IO Volt Select" group="Inputs" visible="`${hasVisibleOption(&quot;io_volt_sel[0]&quot;)}`" desc="The io volt select pin." canBeEmpty="true" >
281      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
282        <Parameter id="DriveModes" severity="DEFAULT" reason="">
283          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
284        </Parameter>
285      </Constraint>
286      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
287        <Parameter id="DriveModes" severity="INFO" reason="The pin Drive Mode parameter does not match expected.">
288          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
289        </Parameter>
290      </Constraint>
291      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
292    </ParamSignal>
293    <ParamString id="ioVolSelPin" name="ioVolSelPin" group="Internal" default="`${getBlockFromSignal(&quot;io_volt_sel[0]&quot;)}`" visible="false" editable="false" desc="" />
294
295    <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)." />
296  </Parameters>
297
298  <DRCs>
299    <!--Timing DRCs-->
300    <DRC type="INFO" text="To correctly set the bus speed, CLK_HF must be set to 100 MHz if the compatibility with the Capabilities register is required." condition="`${sourceFreq ne 100000000}`" />
301
302    <!--busWidth DRCs-->
303    <DRC type="ERROR" text="Only eMMC supports 8 bits bus width." condition="`${(cardType ne emmc) &amp;&amp; (busWidth eq CY_SD_HOST_BUS_WIDTH_8_BIT) ? true : false}`" />
304
305    <!-- ACLK Divider -->
306        <DRC type="ERROR" text="To achieve 50 percent duty cycle a minimum of divide by 2 of assigned divider is required." condition="`${hasExposedMember(sourceClock, &quot;divider&quot;) &amp;&amp; getExposedMember(sourceClock, &quot;divider&quot;) == 1}`" />
307
308  </DRCs>
309
310  <ConfigFirmware>
311    <ConfigInclude value="cy_sysclk.h" include="true" />
312    <ConfigInclude value="cy_sd_host.h" include="true" />
313    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
314    <ConfigInclude value="cyhal.h" include="true" guard="defined (CY_USING_HAL)" />
315
316    <ConfigDefine name="`${INST_NAME . &quot;_HW&quot;}`" value="SDHC`${InstNumber}`" public="true" include="true" />
317    <ConfigDefine name="`${INST_NAME}`_IRQ" value="sdhc_`${InstNumber}`_interrupt_general_IRQn" public="true" include="true" />
318    <ConfigVariable name="`${INST_NAME . &quot;_cardCapacity&quot;}`" type="cy_en_sd_host_card_capacity_t" const="false" value="CY_SD_HOST_SDSC" public="true" include="true"  />
319    <ConfigVariable name="`${INST_NAME . &quot;_cardType&quot;}`" type="cy_en_sd_host_card_type_t" const="false" value="`${(cardType eq emmc) ? &quot;CY_SD_HOST_EMMC&quot; : &quot;CY_SD_HOST_NOT_EMMC&quot;}`" public="true" include="true"  />
320    <ConfigVariable name="`${INST_NAME . &quot;_rca&quot;}`" type="uint32_t" const="false" value="0u" public="true" include="true"  />
321
322    <ConfigStruct name="`${INST_NAME . &quot;_config&quot;}`" type="cy_stc_sd_host_init_config_t" const="`${inFlash}`" public="true" include="true" >
323      <Member name="emmc" value="`${(cardType eq emmc) ? &quot;true&quot; : &quot;false&quot;}`" />
324      <Member name="dmaType" value="`${dmaType}`" />
325      <Member name="enableLedControl" value="`${enableLedControl ? &quot;true&quot; : &quot;false&quot;}`" />
326    </ConfigStruct>
327
328    <ConfigStruct name="`${INST_NAME . &quot;_card_cfg&quot;}`" type="cy_stc_sd_host_sd_card_config_t" const="false" public="true" include="true" >
329      <Member name="lowVoltageSignaling" value="`${lowVoltageSignaling ? &quot;true&quot; : &quot;false&quot;}`" />
330      <Member name="busWidth" value="`${busWidth}`" />
331      <Member name="cardType" value="&amp;`${INST_NAME . &quot;_cardType&quot;}`" />
332      <Member name="rca" value="&amp;`${INST_NAME . &quot;_rca&quot;}`" />
333      <Member name="cardCapacity" value="&amp;`${INST_NAME . &quot;_cardCapacity&quot;}`" />
334    </ConfigStruct>
335
336    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)">
337      <Member name="type" value="CYHAL_RSC_SDHC" />
338      <Member name="block_num" value="`${getInstNumber(&quot;sdhc&quot;)}`U" />
339      <Member name="channel_num" value="0U" />
340    </ConfigStruct>
341
342    <ConfigStruct name="`${INST_NAME}`_clock" type="cyhal_clock_t" const="`${inFlash}`" public="true" include="`${hasExposedMember(sourceClock, &quot;hal_block&quot;)}`" guard="defined (CY_USING_HAL)">
343      <Member name="block" value="`${getExposedMember(sourceClock, &quot;hal_block&quot;)}`" />
344      <Member name="channel" value="`${getExposedMember(sourceClock, &quot;number&quot;)}`" />
345      <Member name="reserved" value="false" />
346      <Member name="funcs" value="NULL" />
347    </ConfigStruct>
348
349    <ConfigStruct name="`${INST_NAME}`_sdhc_hal_config" type="cyhal_sdhc_configurator_t" const="`${inFlash}`" public="true" include="true" guard="defined (CY_USING_HAL)">
350      <Member name="resource" value="&amp;`${INST_NAME}`_obj" />
351      <Member name="host_config" value="&amp;`${INST_NAME}`_config" />
352      <Member name="card_config" value="&amp;`${INST_NAME}`_card_cfg" />
353      <Member name="clock" value="&amp;CYHAL_CLOCK_HF[`${getExposedMember(sourceClock, &quot;clockInst&quot;)}`]" include="`${hasExposedMember(sourceClock, &quot;clockInst&quot;)}`" />
354      <Member name="gpios" value="{.clk = `${clkPin &amp;&amp; hasExposedMember(clkPin, &quot;halPortPin&quot;) ? getExposedMember(clkPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, .cmd = `${cmdPin &amp;&amp; hasExposedMember(cmdPin, &quot;halPortPin&quot;) ? getExposedMember(cmdPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, .data = {`${data0Pin &amp;&amp; hasExposedMember(data0Pin, &quot;halPortPin&quot;) ? getExposedMember(data0Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data1Pin &amp;&amp; hasExposedMember(data1Pin, &quot;halPortPin&quot;) ? getExposedMember(data1Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data2Pin &amp;&amp; hasExposedMember(data2Pin, &quot;halPortPin&quot;) ? getExposedMember(data2Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data3Pin &amp;&amp; hasExposedMember(data3Pin, &quot;halPortPin&quot;) ? getExposedMember(data3Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data4Pin &amp;&amp; hasExposedMember(data4Pin, &quot;halPortPin&quot;) ? getExposedMember(data4Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data5Pin &amp;&amp; hasExposedMember(data5Pin, &quot;halPortPin&quot;) ? getExposedMember(data5Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data6Pin &amp;&amp; hasExposedMember(data6Pin, &quot;halPortPin&quot;) ? getExposedMember(data6Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data7Pin &amp;&amp; hasExposedMember(data7Pin, &quot;halPortPin&quot;) ? getExposedMember(data7Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`}, .card_detect = `${cardDetectPin &amp;&amp; hasExposedMember(cardDetectPin, &quot;halPortPin&quot;) ? getExposedMember(cardDetectPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, .card_mech_write_prot = `${cardMechWriteProtPin &amp;&amp; hasExposedMember(cardMechWriteProtPin, &quot;halPortPin&quot;) ? getExposedMember(cardMechWriteProtPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, .card_pwr_en = `${cardPwrEnPin &amp;&amp; hasExposedMember(cardPwrEnPin, &quot;halPortPin&quot;) ? getExposedMember(cardPwrEnPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, .io_volt_sel = `${ioVolSelPin &amp;&amp; hasExposedMember(ioVolSelPin, &quot;halPortPin&quot;) ? getExposedMember(ioVolSelPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, .led_ctrl = `${ledCtrlPin &amp;&amp; hasExposedMember(ledCtrlPin, &quot;halPortPin&quot;) ? getExposedMember(ledCtrlPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, .emmc_reset = `${emmcRstPin &amp;&amp; hasExposedMember(emmcRstPin, &quot;halPortPin&quot;) ? getExposedMember(emmcRstPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`}" />
355    </ConfigStruct>
356
357    <ConfigStruct name="`${INST_NAME}`_sdio_hal_config" type="cyhal_sdio_configurator_t" const="`${inFlash}`" public="true" include="true" guard="defined (CY_USING_HAL)">
358      <Member name="resource" value="&amp;`${INST_NAME}`_obj" />
359      <Member name="host_config" value="&amp;`${INST_NAME}`_config" />
360      <Member name="card_config" value="&amp;`${INST_NAME}`_card_cfg" />
361      <Member name="clock" value="&amp;CYHAL_CLOCK_HF[`${getExposedMember(sourceClock, &quot;clockInst&quot;)}`]" include="`${hasExposedMember(sourceClock, &quot;clockInst&quot;)}`" />
362      <Member name="gpios" value="{.clk = `${clkPin &amp;&amp; hasExposedMember(clkPin, &quot;halPortPin&quot;) ? getExposedMember(clkPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, .cmd = `${cmdPin &amp;&amp; hasExposedMember(cmdPin, &quot;halPortPin&quot;) ? getExposedMember(cmdPin, &quot;halPortPin&quot;) : &quot;NC&quot;}`,  .data = {`${data0Pin &amp;&amp; hasExposedMember(data0Pin, &quot;halPortPin&quot;) ? getExposedMember(data0Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data1Pin &amp;&amp; hasExposedMember(data1Pin, &quot;halPortPin&quot;) ? getExposedMember(data1Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data2Pin &amp;&amp; hasExposedMember(data2Pin, &quot;halPortPin&quot;) ? getExposedMember(data2Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`, `${data3Pin &amp;&amp; hasExposedMember(data3Pin, &quot;halPortPin&quot;) ? getExposedMember(data3Pin, &quot;halPortPin&quot;) : &quot;NC&quot;}`}}" />
363    </ConfigStruct>
364
365    <ConfigInstruction value="Cy_SysClk_PeriGroupSlaveInit(CY_MMIO_SDHC`${InstNumber}`_PERI_NR, CY_MMIO_SDHC`${InstNumber}`_GROUP_NR, CY_MMIO_SDHC`${InstNumber}`_SLAVE_NR, CY_MMIO_SDHC`${InstNumber}`_CLK_HF_NR);" include="true" guard="defined (CY_DEVICE_CONFIGURATOR_IP_ENABLE_FEATURE)" />
366    <ConfigInstruction purpose="INITIALIZE" value="Cy_SysClk_PeriPclkAssignDivider(PCLK_SDHC`${InstNumber}`_CLK_HF, `${getExposedMember(sourceClock, &quot;clockSel&quot;)}`);" include="`${(ip_version &gt; 1)}`"  />
367    <ConfigInstruction value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
368  </ConfigFirmware>
369</Personality>
370