1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file lpeco.cypersonality
6* \version 1.0
7*
8* \brief
9* LPECO personality description file. It supports TVIIC devices.
10*
11********************************************************************************
12* \copyright
13* Copyright (c) 2024, Cypress Semiconductor Corporation (an Infineon company) or
14* an affiliate of 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="lpeco" name="LPECO" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
31  <Dependencies>
32    <IpBlock name="mxs40srss_ver3" />
33    <IpBlock name="mxs40ioss" />
34    <Resource name="srss\.clock\.lpeco" />
35  </Dependencies>
36  <ExposedMembers>
37    <ExposedMember key="frequency" paramId="frequency" />
38    <ExposedMember key="accuracy"  paramId="accuracyPct" />
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__sysclk__lpeco.html" linkText="Open LPECO Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
43
44    <ParamRange id="lpecoFrequency" name="Frequency (MHz)" group="General" default="8.00" visible="true" editable="true" min="3.99" max="8.01" resolution="0.01" desc="" />
45    <ParamRange id="frequency" name="Frequency (Hz)" group="Internal" default="`${lpecoFrequency * 1000000}`" visible="false" editable="false" min="3990000" max="8010000" resolution="1" desc="" />
46
47    <ParamRange id="accuracyPpm" name="Accuracy (&#177;ppm)" group="General" default="0" min="0" max="1000000" resolution="1" visible="true" editable="true" desc="Clock accuracy in ppm" />
48    <ParamString id="accuracyPct" name="Accuracy (&#177;%)" group="General" default="`${accuracyPpm/10000.0}`" visible="true" editable="false" desc="Clock accuracy in %" />
49
50    <!-- LPECO Crystal Characteristics -->
51    <ParamRange id="cLoad" name="Load Capacitance Cload (pF)" group="General" default="18" min="5" max="25" resolution="1" visible="true" editable="true" desc="" />
52    <ParamChoice id="cAmpl" name="Oscillation Amplitude" group="General" default="CY_SYSCLK_BAK_LPECO_AMP_MAX_1P35V" visible="true" editable="true" desc="WARNING: the crystal can be permanently damaged by selecting an amplitude that exceeds the crystal limits." >
53        <Entry name="Maximum Amplitude is 1.35V"
54               value="CY_SYSCLK_BAK_LPECO_AMP_MAX_1P35V"
55               visible="true" />
56        <Entry name="Maximum Amplitude is 1.8V"
57               value="CY_SYSCLK_BAK_LPECO_AMP_MAX_1P8V"
58               visible="true" />
59    </ParamChoice>
60    <ParamString id="loadCapEnum" name="loadCapEnum" group="Internal" default="`${cLoad &lt;= 10 ? &quot;CY_SYSCLK_BAK_LPECO_LCAP_5TO10PF&quot; :
61                                                                                  cLoad &lt;= 15 ? &quot;CY_SYSCLK_BAK_LPECO_LCAP_10TO15PF&quot; :
62                                                                                  cLoad &lt;= 20 ? &quot;CY_SYSCLK_BAK_LPECO_LCAP_15TO20PF&quot; :
63                                                                                                   &quot;CY_SYSCLK_BAK_LPECO_LCAP_20TO25PF&quot;}`" visible="false" editable="false" desc="" />
64    <ParamString id="freqRangeEnum" name="freqRangeEnum" group="Internal" default="`${frequency &lt; 6000000 ? &quot;CY_SYSCLK_BAK_LPECO_FREQ_4TO6MHZ&quot; : &quot;CY_SYSCLK_BAK_LPECO_FREQ_6TO8MHZ&quot;}`" visible="false" editable="false" desc="" />
65
66    <!-- Restrict ECO connections to pins -->
67    <ParamSignal port="lpeco_in[0]" name="Input" group="Connections" visible="true" desc="The input/passive terminal of the internal LPECO circuitry" canBeEmpty="false" requirePreferred="true" isDependency="true">
68      <Constraint type="REQUIRE" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" />
69    </ParamSignal>
70    <ParamSignal port="lpeco_out[0]" name="Output" group="Connections" visible="true" desc="The output/active terminal of the internal LPECO circuitry" canBeEmpty="false" requirePreferred="true" isDependency="true">
71      <Constraint type="REQUIRE" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" />
72    </ParamSignal>
73
74    <ParamString id="gpio_in_port" name="gpio_in_port" group="General" default="`${getInstFromLocation(getParamValue(&quot;lpeco_in[0]&quot;), &quot;port&quot;)}`" visible="false" editable="false" desc="" />
75    <ParamString id="gpio_in_pin" name="gpio_in_pin" group="General" default="`${getInstFromLocation(getParamValue(&quot;lpeco_in[0]&quot;), &quot;pin&quot;)}`" visible="false" editable="false" desc="" />
76    <ParamString id="gpio_out_port" name="gpio_out_port" group="General" default="`${getInstFromLocation(getParamValue(&quot;lpeco_out[0]&quot;), &quot;port&quot;)}`" visible="false" editable="false" desc="" />
77    <ParamString id="gpio_out_pin" name="gpio_out_pin" group="General" default="`${getInstFromLocation(getParamValue(&quot;lpeco_out[0]&quot;), &quot;pin&quot;)}`" visible="false" editable="false" desc="" />
78  </Parameters>
79  <ConfigFirmware>
80    <ConfigInclude value="cy_gpio.h" include="true" />
81    <ConfigInclude value="cy_sysclk.h" include="true" />
82    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_ENABLED" value="1" public="false" include="true" />
83    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_FREQ" value="`${frequency}`UL" public="false" include="true" />
84    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_GPIO_IN_PRT" value="GPIO_PRT`${gpio_in_port}`" public="false" include="true" />
85    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_GPIO_IN_PIN" value="`${gpio_in_pin}`" public="false" include="true" />
86    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_GPIO_OUT_PRT" value="GPIO_PRT`${gpio_out_port}`" public="false" include="true" />
87    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_GPIO_OUT_PIN" value="`${gpio_out_pin}`" public="false" include="true" />
88    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_CLOAD" value="`${loadCapEnum}`" public="false" include="true" />
89    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_FREQ_RANGE" value="`${freqRangeEnum}`" public="false" include="true" />
90    <ConfigDefine name="CY_CFG_SYSCLK_LPECO_MAX_AMPLITUDE" value="`${cAmpl}`" public="false" include="true" />
91    <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_LpecoInit()" body="    (void)Cy_GPIO_Pin_FastInit(GPIO_PRT`${gpio_in_port}`, `${gpio_in_pin}`, CY_GPIO_DM_ANALOG, 0UL, HSIOM_SEL_GPIO);&#xA;    (void)Cy_GPIO_Pin_FastInit(GPIO_PRT`${gpio_out_port}`, `${gpio_out_pin}`, CY_GPIO_DM_ANALOG, 0UL, HSIOM_SEL_GPIO);&#xA;    if (CY_SYSCLK_BAD_PARAM == Cy_SysClk_LpecoConfigure(CY_CFG_SYSCLK_LPECO_CLOAD, CY_CFG_SYSCLK_LPECO_FREQ_RANGE, CY_CFG_SYSCLK_LPECO_MAX_AMPLITUDE, true))&#xA;    {&#xA;        cycfg_ClockStartupError(CY_CFG_SYSCLK_LPECO_ERROR);&#xA;    }&#xA;    if (CY_SYSCLK_TIMEOUT == Cy_SysClk_LpecoEnable(10000UL))&#xA;    {&#xA;        cycfg_ClockStartupError(CY_CFG_SYSCLK_LPECO_ERROR);&#xA;    }" public="false" include="true" guard="(!defined(CY_DEVICE_SECURE))" />
92    <ConfigInstruction value="Cy_SysClk_LpecoSetFrequency(CY_CFG_SYSCLK_LPECO_FREQ);" purpose="RESERVE" include="true" />
93    <ConfigInstruction value="SystemCoreClockUpdate();" purpose="RESERVE" include="true" />
94  </ConfigFirmware>
95</Personality>
96