1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file eco_prescaler.cypersonality
6* \version 1.0
7*
8* \brief
9* ECO prescaler personality description file.
10* It supports CAT1C and CAT1D 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="eco_prescaler" name="ECO Prescaler" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
32  <Dependencies>
33    <IpBlock name="mxs40srss_ver3,mxs22srss,mxs40ssrss,mxs40srss_ver2" />
34    <Resource name="srss\.clock\.ecoprescaler" />
35  </Dependencies>
36  <ExposedMembers>
37    <ExposedMember key="frequency" paramId="frequency" />
38    <ExposedMember key="accuracy"  paramId="accuracy" />
39    <ExposedMember key="sourceClockDisplayName" paramId="sourceClockDisplayName" />
40  </ExposedMembers>
41  <Parameters>
42     <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__sysclk__eco.html" linkText="Open ECO Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
43
44     <!-- Source clock -->
45    <ParamString id="sourceClockRsc" name="Source Clock" group="Internal" default="`${&quot;srss[0].clock[0].eco[0]&quot;}`" visible="false" editable="false" desc="" />
46    <!-- Set an error if the source clock is not enabled -->
47    <ParamBool id="srcNotUsed" name="Clock Source Enabled" group="Internal" default="`${!isBlockUsed(sourceClockRsc)}`" visible="false" editable="false" desc="" />
48    <ParamBool id="error" name="Clock Error" group="Internal" default="`${srcNotUsed}`" visible="false" editable="false" desc="" />
49    <ParamRange  id="sourceFreq" name="sourceFrequency" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;frequency&quot;) : 0}`" min="0" max="24000000" 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="sourceClock" name="Source Clock" group="General" default="ECO" visible="true" editable="false" desc="Source clock " />
52    <ParamString id="sourceClockDisplayName" name="Source Clock Display Name" group="Internal" default="`${getParamValueDisplay(&quot;sourceClock&quot;)}`" visible="false" editable="false" desc="" />
53    <ParamString id="sourceFrequencyInfo" name="Source Frequency" group="General" default="`${formatFrequency(sourceFreq,accuracy)}`" visible="true" editable="false" desc="Source clock frequency" />
54
55    <!-- Resulted clock -->
56    <ParamRange id="divider" name="Integer Divider" group="General" default="1" min="1" max="1024" resolution="1" visible="true" editable="true" desc="" />
57    <ParamRange id="fractdivider" name="Fractional Divider" group="General" default="0" min="0" max="255" resolution="1" visible="true" editable="true" desc="" />
58    <ParamRange id="frequency" name="Frequency" group="Internal" default="`${(sourceFreq / (divider + (fractdivider / 256.0)))}`" min="0" max="24000000" resolution="0.1" visible="false" editable="false" desc="" />
59
60    <!-- If the frequency is less than one MHz, display its value in kHz -->
61    <ParamString id="frequencyInfo" name="Frequency" group="General" default="`${formatFrequency(frequency,accuracy)}`" visible="true" editable="false" desc="The resulting output clock frequency" />
62  </Parameters>
63  <DRCs>
64   <DRC type="ERROR" text="Source clock for ECO_PRESCALER is not enabled" condition="`${srcNotUsed}`" >
65   <FixIt action="ENABLE_BLOCK" target="`${sourceClockRsc}`" value="" valid="true" />
66    </DRC>
67  </DRCs>
68  <ConfigFirmware>
69    <ConfigInclude value="cy_sysclk.h" include="true" />
70    <ConfigDefine name="CY_CFG_SYSCLK_ECO_PRESCALER_ENABLED" value="1" public="false" include="true" />
71    <ConfigDefine name="CY_CFG_SYSCLK_ECO_PRESCALER_INT_DIVIDER" value="`${divider - 1}`"  public="false" include="true" />
72    <ConfigDefine name="CY_CFG_SYSCLK_ECO_PRESCALER_FRACT_DIVIDER" value="`${fractdivider}`"  public="false" include="true" />
73    <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_EcoPrescalerInit()" body="    Cy_SysClk_EcoPrescaleConfigure(CY_CFG_SYSCLK_ECO_PRESCALER_ENABLED, CY_CFG_SYSCLK_ECO_PRESCALER_INT_DIVIDER, CY_CFG_SYSCLK_ECO_PRESCALER_FRACT_DIVIDER);" public="false" include="true" guard="(!defined(CY_DEVICE_SECURE))" />
74  </ConfigFirmware>
75</Personality>
76