1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file bakclk.cypersonality
6* \version 3.0
7*
8* \brief
9* CLK_BAK personality description file. It Supports CAT1A, CAT1B, CAT1C and CAT1D family of devices.
10*
11********************************************************************************
12* \copyright
13* Copyright (c) 2022, 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="bakclk" name="CLK_BAK" version="3.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
31  <Dependencies>
32    <IpBlock name="mxs40srss,mxs40ssrss,mxs40srss_ver3,mxs22srss" />
33    <Resource name="srss\.clock\.bakclk" />
34  </Dependencies>
35  <ExposedMembers>
36    <ExposedMember key="frequency" paramId="frequency" />
37    <ExposedMember key="accuracy" paramId="accuracy" />
38  </ExposedMembers>
39  <Parameters>
40    <!-- PDL documentation -->
41    <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__sysclk__clk__bak.html" linkText="Open Backup Domain Clock Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
42    <ParamBool id="isS40sWcoPresent" name="S40S_Wco Present" group="Internal" default="`${lookupExpression(&quot;BACKUP_PRESENT&quot;, 0)}`" visible="false" editable="false" desc="PILO Present" />
43    <ParamBool id="isWcoPresent" name="S40S_Wco Present" group="Internal" default="`${lookupExpression(&quot;WCO_PRESENT&quot;, 0)}`" visible="false" editable="false" desc="PILO Present" />
44    <ParamBool id="is40ssrssAvailable" name="is40ssrssAvailable" group="" default="`${(&quot;mxs40ssrss&quot; eq getIpBlockName())}`" visible="false" editable="false" desc="" />
45    <ParamBool id="is40srss_ver3Available" name="is40srss_ver3Available" group="" default="`${(&quot;mxs40srss_ver3&quot; eq getIpBlockName())}`" visible="false" editable="false" desc="" />
46    <ParamBool id="is22srssAvailable" name="is22srssAvailable" group="" default="`${(&quot;mxs22srss&quot; eq getIpBlockName())}`" visible="false" editable="false" desc="" />
47
48    <ParamChoice id="sourceClock" name="Source Clock" group="General" default="lfclk" visible="true" editable="true" desc="The clock source selection">
49      <Entry name="WCO" value="wco" visible="`${(isS40sWcoPresent) || (isWcoPresent)}`"/>
50      <Entry name="CLK_LF" value="lfclk" visible="true"/>
51      <Entry name="`${is40ssrssAvailable ? &quot;ILO&quot; : &quot;ILO0&quot;}`" value="ilo" visible="`${(is40ssrssAvailable || is40srss_ver3Available)}`"/>
52      <Entry name="PILO" value="pilo" visible="`${((&quot;mxs40ssrss&quot; eq getIpBlockName()) &amp;&amp; (S40S_PILO_PRESENT)) || (&quot;mxs22srss&quot; eq getIpBlockName())}`"/>
53    </ParamChoice>
54    <ParamString id="sourceClockRsc" name="Source Clock Resource" group="Internal" default="`${&quot;srss[0].clock[0].&quot; . sourceClock . &quot;[0]&quot;}`" visible="false" editable="false" desc="" />
55    <!-- Set an error if the source clock is not enabled or contains an error -->
56    <ParamBool id="srcNotUsed" name="Clock Source Enabled" group="Internal" default="`${!isBlockUsed(sourceClockRsc)}`" visible="false" editable="false" desc="" />
57    <ParamBool id="error" name="Clock Error" group="Internal" default="`${!isBlockUsed(sourceClockRsc)}`" visible="false" editable="false" desc="" />
58    <ParamRange  id="frequency" name="Frequency" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;frequency&quot;) : 0}`" min="0" max="100000" resolution="1" visible="false" editable="false" desc="" />
59    <ParamString  id="accuracy" name="accuracy" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;accuracy&quot;) : 0}`" visible="false" editable="false" desc="" />
60    <ParamString id="frequencyInfo" name="Frequency" group="General" default="`${formatFrequency(frequency,accuracy)}`" visible="true" editable="false" desc="The actual frequency" />
61    <ParamString id="sourceClockApiName" name="Source Clock API Name" group="Internal" default="`${sourceClock eq wco ? &quot;WCO&quot; : sourceClock eq ilo ? &quot;ILO&quot; : sourceClock eq pilo ? &quot;PILO&quot; : &quot;CLKLF&quot;}`" visible="false" editable="false" desc="" />
62  </Parameters>
63  <DRCs>
64    <DRC type="ERROR" text="Source clock for CLK_BAK 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_CLKBAK_ENABLED" value="1" public="false" include="true" />
71    <ConfigDefine name="CY_CFG_SYSCLK_CLKBAK_SOURCE" value="CY_SYSCLK_BAK_IN_`${sourceClockApiName}`" public="false" include="true" />
72    <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_ClkBakInit()" body="    Cy_SysClk_ClkBakSetSource(CY_SYSCLK_BAK_IN_`${sourceClockApiName}`);" public="false" include="true" guard="(!defined(CY_DEVICE_SECURE))" />
73  </ConfigFirmware>
74</Personality>
75