1<?xml version="1.0" encoding="utf-8"?>
2
3<!--****************************************************************************
4* \file Timer.cypersonality
5* \version 1.0
6*
7* \brief
8* Timer personality description file.
9*
10********************************************************************************
11* \copyright
12* Copyright 2020-2022 Cypress Semiconductor Corporation
13* SPDX-License-Identifier: Apache-2.0
14*
15* Licensed under the Apache License, Version 2.0 (the "License");
16* you may not use this file except in compliance with the License.
17* You may obtain a copy of the License at
18*
19*     http://www.apache.org/licenses/LICENSE-2.0
20*
21* Unless required by applicable law or agreed to in writing, software
22* distributed under the License is distributed on an "AS IS" BASIS,
23* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24* See the License for the specific language governing permissions and
25* limitations under the License.
26*****************************************************************************-->
27
28<Personality id="mxs40timer" name="Timer" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
29  <Dependencies>
30    <IpBlock name="mxs40pass_ver2" />
31    <Resource name="pass\.timer"/>
32    <!--DependentResource name="pass.sar" /-->
33  </Dependencies>
34  <ExposedMembers>
35    <ExposedMember key="frequency" paramId="frequency" />
36    <ExposedMember key="accuracy"  paramId="accuracy" />
37    <ExposedMember key="error"     paramId="error" />
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__sysanalog.html" linkText="Open SysAnalog Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
42
43    <ParamChoice id="clock" name="Clock Source" group="General" default="CY_SYSANALOG_TIMER_CLK_PERI" visible="true" editable="true" desc="Select the input clock source" >
44      <Entry name="Peripheral Clock" value="CY_SYSANALOG_TIMER_CLK_PERI" visible="true" />
45      <Entry name="Deep Sleep Clock" value="CY_SYSANALOG_TIMER_CLK_DEEPSLEEP" visible="true" />
46      <Entry name="CLK_LF"           value="CY_SYSANALOG_TIMER_CLK_LF" visible="true" />
47    </ParamChoice>
48
49    <ParamBool id="debug" name="debug" group="Internal" default="false" visible="false" editable="false" desc="" />
50    <ParamString id="sourceClockRsc" name="sourceClockRsc" group="Internal" default="`${clock eq CY_SYSANALOG_TIMER_CLK_DEEPSLEEP ? &quot;pass[0].dpslp[0]&quot; : clock eq CY_SYSANALOG_TIMER_CLK_LF ? &quot;srss[0].clock[0].lfclk[0]&quot; : &quot;srss[0].clock[0].periclk[0]&quot;}`" visible="`${debug}`" editable="false" desc="" />
51    <ParamBool id="srcNotUsed" name="srcNotUsed" group="Internal" default="`${!isBlockUsed(sourceClockRsc)}`" visible="`${debug}`" editable="false" desc="" />
52    <ParamBool id="error" name="error" group="Internal" default="`${srcNotUsed || getExposedMember(sourceClockRsc, &quot;error&quot;)}`" visible="`${debug}`" editable="false" desc="" />
53    <ParamRange id="sourceFreq" name="sourceFreq" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;frequency&quot;) : 0}`" min="0" max="1000000000" resolution="0.001" visible="`${debug}`" editable="false" desc="" />
54    <ParamString id="accuracy" name="accuracy" group="Internal" default="`${!error ? getExposedMember(sourceClockRsc, &quot;accuracy&quot;) : 0}`" visible="`${debug}`" editable="false" desc="" />
55    <ParamString id="sourceFrequencyInfo" name="Source Frequency" group="General" default="`${formatFrequency(sourceFreq,accuracy)}`" visible="true" editable="false" desc="Source clock frequency" />
56    <ParamRange id="period" name="Period" group="General" default="4000" min="1" max="65536" resolution="1" visible="true" editable="true" desc="The Timer period"/>
57    <ParamRange id="frequency" name="frequency" group="Internal" default="`${sourceFreq / period}`" min="0" max="400000000" resolution="0.001" visible="`${debug}`" editable="false" desc="" />
58    <ParamString id="frequencyInfo" name="Frequency" group="General" default="`${formatFrequency(frequency,accuracy)}`" visible="true" editable="false" desc="The resulting TIMER output trigger frequency" />
59  </Parameters>
60
61  <DRCs>
62    <DRC type="ERROR" text="Source clock for Timer is not enabled" condition="`${error}`" >
63      <FixIt action="ENABLE_BLOCK" target="`${sourceClockRsc}`" value="" valid="true" />
64    </DRC>
65    <DRC type="ERROR" text="Timer clock source using duty cycling. Please select different clock source for Deep Sleep clock or disable duty cycling for LPOSC." condition="`${(clock eq &quot;CY_SYSANALOG_TIMER_CLK_DEEPSLEEP&quot;) ? (((isBlockUsed(&quot;pass[0].dpslp[0]&quot;)) ? (getExposedMember(&quot;pass[0].dpslp[0]&quot;, &quot;clock&quot;) eq &quot;CY_SYSANALOG_DEEPSLEEP_SRC_LPOSC&quot;) : false) ? ((isBlockUsed(&quot;pass[0].lposc[0]&quot;)) ? (getExposedMember(&quot;pass[0].lposc[0]&quot;, &quot;dsMode&quot;) eq &quot;CY_SYSANALOG_LPOSC_DUTY_CYCLED&quot;) : false) : (false)) : (false)}`" >
66    </DRC>
67  </DRCs>
68
69  <ConfigFirmware>
70    <ConfigInclude value="cy_sysanalog.h" include="true" />
71    <ConfigDefine name="CY_CFG_SYSANALOG_TIMER_CLOCK" value="`${clock}`" public="true" include="true" />
72    <ConfigDefine name="CY_CFG_SYSANALOG_TIMER_PERIOD" value="`${period}`" public="true" include="true" />
73  </ConfigFirmware>
74</Personality>
75