1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file periclk.cypersonality
6* \version 2.0
7*
8* \brief
9* CLK_PERI personality description file.
10* This supports CAT1A and CAT1C 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="periclk" name="CLK_PERI" version="2.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
31  <Dependencies>
32    <IpBlock name="mxs40srss,mxs40srss_ver3,mxs40srss_ver2" />
33    <Resource name="srss\.clock\.periclk" />
34  </Dependencies>
35  <ExposedMembers>
36    <ExposedMember key="frequency"     paramId="frequency" />
37    <ExposedMember key="accuracy"      paramId="accuracy" />
38    <ExposedMember key="error"         paramId="error" />
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__clk__peri.html" linkText="Open Peripheral Clock Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
43
44    <ParamString id="sourceClockRsc" name="Source Clock" group="Internal" default="srss[0].clock[0].hfclk[0]" visible="false" editable="false" desc="" />
45    <!-- Set an error if the source clock is not enabled -->
46    <ParamBool id="srcNotUsed" name="Clock Source Enabled" group="Internal" default="`${!isBlockUsed(sourceClockRsc)}`" visible="false" editable="false" desc="" />
47    <ParamBool id="error" name="Clock Error" group="Internal" default="`${srcNotUsed || getExposedMember(sourceClockRsc, &quot;error&quot;)}`" visible="false" editable="false" desc="" />
48    <!-- Use default values in case of error -->
49    <ParamRange id="sourceFreq" name="sourceFrequency" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;frequency&quot;) : 0}`" min="0" max="`${((&quot;mxs40srss_ver3&quot; eq getIpBlockName()) ? 200000000 : 150000000)}`" resolution="1" visible="false" editable="false" desc="" />
50    <ParamString id="accuracy"  name="Accuracy"  group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;accuracy&quot;) : 0}`" visible="false" editable="false" desc="" />
51    <ParamString id="sourceFrequencyInfo" name="Source Clock" group="General" default="CLK_HF0 (`${formatFrequency(sourceFreq,accuracy)}`)" visible="true" editable="false" desc="Source clock frequency" />
52
53    <ParamRange id="divider" name="Divider" group="General" default="2" min="1" max="256" resolution="1" visible="true" editable="true" desc="" />
54    <ParamRange id="frequency" name="Frequency" group="Internal" default="`${sourceFreq / divider}`" min="0" max="`${sourceFreq}`" resolution="1" visible="false" editable="false" desc="" />
55    <!-- If the frequency is less than one MHz display its value in kHz -->
56    <ParamString id="frequencyInfo" name="Frequency" group="General" default="`${formatFrequency(frequency,accuracy)}`" visible="true" editable="false" desc="The resulting CLK_PERI output clock frequency" />
57
58    <ParamBool id="usingUlp" name="usingUlp" group="Internal" default="`${isBlockUsed(&quot;srss[0].power[0]&quot;) &amp;&amp; getExposedMember(&quot;srss[0].power[0]&quot;, &quot;usingUlp&quot;)}`" visible="false" editable="false" desc="" />
59  </Parameters>
60  <DRCs>
61    <DRC type="ERROR" text="Source clock for CLK_PERI is not enabled" condition="`${srcNotUsed}`" >
62      <FixIt action="ENABLE_BLOCK" target="`${sourceClockRsc}`" value="" valid="true" />
63    </DRC>
64    <DRC type="ERROR" text="CLK_PERI `${frequencyInfo}` is faster than legal maximum 100 MHz"  condition="`${!usingUlp &amp;&amp; frequency &gt; 100000000}`" paramId="frequencyInfo" />
65    <DRC type="ERROR" text="CLK_PERI `${frequencyInfo}` exceeds the maximum of 25 MHz when the ULP mode is used"  condition="`${usingUlp &amp;&amp; frequency &gt; 25000000}`" paramId="frequencyInfo" />
66  </DRCs>
67  <ConfigFirmware>
68    <ConfigInclude value="cy_sysclk.h" include="true" />
69    <ConfigDefine name="CY_CFG_SYSCLK_CLKPERI_ENABLED" value="1" public="true" include="true" />
70    <ConfigDefine name="CY_CFG_SYSCLK_CLKPERI_DIVIDER" value="`${divider - 1}`"  public="true" include="true" />
71    <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_ClkPeriInit()" body="    Cy_SysClk_ClkPeriSetDivider(`${divider - 1}`U);" public="false" include="true" guard="(!defined(CY_DEVICE_SECURE))" />
72  </ConfigFirmware>
73</Personality>
74