1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file mcwdt.cypersonality
6* \version 1.0
7*
8* \brief
9* Multi-counter watchdog personality description file. It supports CAT1C
10* 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="mcwdt_v2" name="Multi-counter watchdog" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
31  <Dependencies>
32    <IpBlock name="mxs40srss_ver2,mxs40srss_ver3" />
33    <Resource name="srss\.mcwdt" />
34  </Dependencies>
35  <ExposedMembers />
36  <Parameters>
37    <!-- PDL documentation -->
38    <ParamDoc id="pdlDoc" name="Configuration Help" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__mcwdt.html" linkText="Open MCWDT Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
39
40    <!--Clock source-->
41    <ParamString id="sourceLfClk" name="Low Frequency Clock" group="Internal" default="srss[0].clock[0].lfclk[0]" visible="false" editable="false" desc="" />
42
43    <ParamBool id="srcLfUsed" name="Clock Source Enabled" group="Internal" default="`${isBlockUsed(sourceLfClk)}`" visible="false" editable="false" desc="" />
44    <ParamBool id="errorLf" name="Low Frequency Error" group="Internal" default="`${!srcLfUsed || getExposedMember(sourceLfClk, &quot;error&quot;)}`" visible="false" editable="false" desc="" />
45
46    <ParamRange id="sourceLowFreq" name="Source Low Frequency" group="Internal" default="`${!errorLf ? getExposedMember(sourceLfClk, &quot;frequency&quot;) : 0}`" min="0" max="100000" resolution="1" visible="false" editable="false" desc="" />
47    <ParamString id="accuracyLF"  name="Accuracy LF"  group="Internal" default="`${!errorLf ? getExposedMember(sourceLfClk, &quot;accuracy&quot;) : 0}`" visible="false" editable="false" desc="" />
48    <ParamString id="sourceLowFrequencyInfo" name="Low Frequency Clock" group="Counter" default="CLK_LF (`${formatFrequency(sourceLowFreq,accuracyLF)}`)" visible="true" editable="false" desc="Source clock frequency" />
49
50    <!--Counter0-->
51    <ParamRange id="C0LowerLimit" name="C0 Lower Limit" group="Counter0" default="0" min="0" max="65535" resolution="1" visible="true" editable="true" desc="Counter0 Lower Limit Value" />
52    <ParamRange id="C0UpperLimit" name="C0 Upper Limit" group="Counter0" default="0" min="0" max="65535" resolution="1" visible="true" editable="true" desc="Counter0 Upper Limit Value" />
53    <ParamRange id="C0WarnLimit" name="C0 Warn Limit" group="Counter0" default="0" min="0" max="65535" resolution="1" visible="true" editable="true" desc="Counter0 Warn Limit Value" />
54
55	<ParamChoice id="C0LowerAction" name="C0 Lower Action" group="Counter0" default="CY_MCWDT_ACTION_NONE" visible="true" editable="true" desc="Counter0 Lower Action.">
56      <Entry name="None" value="CY_MCWDT_ACTION_NONE" visible="true" />
57      <Entry name="Fault" value="CY_MCWDT_ACTION_FAULT" visible="true" />
58      <Entry name="Fault then Reset" value="CY_MCWDT_ACTION_FAULT_THEN_RESET" visible="true" />
59    </ParamChoice>
60
61	<ParamChoice id="C0UpperAction" name="C0 Upper Action" group="Counter0" default="CY_MCWDT_ACTION_NONE" visible="true" editable="true" desc="Counter0 Upper Action.">
62      <Entry name="None" value="CY_MCWDT_ACTION_NONE" visible="true" />
63      <Entry name="Fault" value="CY_MCWDT_ACTION_FAULT" visible="true" />
64      <Entry name="Fault then Reset" value="CY_MCWDT_ACTION_FAULT_THEN_RESET" visible="true" />
65    </ParamChoice>
66
67	<ParamChoice id="C0WarnAction" name="C0 Warn Action" group="Counter0" default="CY_MCWDT_WARN_ACTION_NONE" visible="true" editable="true" desc="Counter0 Warn Action.">
68      <Entry name="None" value="CY_MCWDT_WARN_ACTION_NONE" visible="true" />
69      <Entry name="Interrupt" value="CY_MCWDT_WARN_ACTION_INT" visible="true" />
70    </ParamChoice>
71
72	<ParamBool id="C0AutoService" name="C0 Auto Service Enable" group="Counter0" default="false" visible="true" editable="true" desc="Controls if Counter0 Auto Service feature to be enabled or not." />
73   	<ParamBool id="C0DeepSleepPause" name="C0 Deep Sleep Pause Enable" group="Counter0" default="false" visible="true" editable="true" desc="Controls if Counter0 Deep Sleep Pause feature to be enabled or not." />
74	<ParamBool id="C0DebugRun" name="C0 Debug Run Enable" group="Counter0" default="false" visible="true" editable="true" desc="Controls if Counter0 Debug Run feature to be enabled or not." />
75
76    <!--Counter1-->
77    <ParamRange id="C1LowerLimit" name="C1 Lower Limit" group="Counter1" default="0" min="0" max="65535" resolution="1" visible="true" editable="true" desc="Counter1 Lower Limit Value" />
78    <ParamRange id="C1UpperLimit" name="C1 Upper Limit" group="Counter1" default="0" min="0" max="65535" resolution="1" visible="true" editable="true" desc="Counter1 Upper Limit Value" />
79    <ParamRange id="C1WarnLimit" name="C1 Warn Limit" group="Counter1" default="0" min="0" max="65535" resolution="1" visible="true" editable="true" desc="Counter1 Warn Limit Value" />
80
81	<ParamChoice id="C1LowerAction" name="C1 Lower Action" group="Counter1" default="CY_MCWDT_ACTION_NONE" visible="true" editable="true" desc="Counter1 Lower Action.">
82      <Entry name="None" value="CY_MCWDT_ACTION_NONE" visible="true" />
83      <Entry name="Fault" value="CY_MCWDT_ACTION_FAULT" visible="true" />
84      <Entry name="Fault then Reset" value="CY_MCWDT_ACTION_FAULT_THEN_RESET" visible="true" />
85    </ParamChoice>
86
87	<ParamChoice id="C1UpperAction" name="C1 Upper Action" group="Counter1" default="CY_MCWDT_ACTION_NONE" visible="true" editable="true" desc="Counter1 Upper Action.">
88      <Entry name="None" value="CY_MCWDT_ACTION_NONE" visible="true" />
89      <Entry name="Fault" value="CY_MCWDT_ACTION_FAULT" visible="true" />
90      <Entry name="Fault then Reset" value="CY_MCWDT_ACTION_FAULT_THEN_RESET" visible="true" />
91    </ParamChoice>
92
93	<ParamChoice id="C1WarnAction" name="C1 Warn Action" group="Counter1" default="CY_MCWDT_WARN_ACTION_NONE" visible="true" editable="true" desc="Counter1 Warn Action.">
94      <Entry name="None" value="CY_MCWDT_WARN_ACTION_NONE" visible="true" />
95      <Entry name="Interrupt" value="CY_MCWDT_WARN_ACTION_INT" visible="true" />
96    </ParamChoice>
97
98	<ParamBool id="C1AutoService" name="C1 Auto Service Enable" group="Counter1" default="false" visible="true" editable="true" desc="Controls if Counter1 Auto Service feature to be enabled or not." />
99   	<ParamBool id="C1DeepSleepPause" name="C1 Deep Sleep Pause Enable" group="Counter1" default="false" visible="true" editable="true" desc="Controls if Counter1 Deep Sleep Pause feature to be enabled or not." />
100	<ParamBool id="C1DebugRun" name="C1 Debug Run Enable" group="Counter1" default="false" visible="true" editable="true" desc="Controls if Counter1 Debug Run feature to be enabled or not." />
101
102    <!--Counter2-->
103    <ParamRange id="C2ToggleBit" name="C2 Toggle Bit" group="Counter2" default="0" min="0" max="31" resolution="1" visible="true" editable="true" desc="Counter 2 Toggle Bit Position Value" />
104
105	<ParamChoice id="C2Action" name="C2 Action" group="Counter2" default="CY_MCWDT_CNT2_ACTION_NONE" visible="true" editable="true" desc="Counter2 Action.">
106      <Entry name="None" value="CY_MCWDT_CNT2_ACTION_NONE" visible="true" />
107      <Entry name="Interrupt" value="CY_MCWDT_CNT2_ACTION_INT" visible="true" />
108    </ParamChoice>
109
110   	<ParamBool id="C2DeepSleepPause" name="C2 Deep Sleep Pause Enable" group="Counter2" default="false" visible="true" editable="true" desc="Controls if Counter2 Deep Sleep Pause feature to be enabled or not." />
111	<ParamBool id="C2DebugRun" name="C2 Debug Run Enable" group="Counter2" default="false" visible="true" editable="true" desc="Controls if Counter2 Debug Run feature to be enabled or not." />
112
113    <!--Core Select Feature-->
114	<ParamChoice id="CoreSelect" name="MCWDT Core Select" group="Common" default="CY_MCWDT_PAUSED_BY_NO_CORE" visible="true" editable="true" desc="Select which core the current MCWDT needs to allocated.">
115      <Entry name="No Core" value="CY_MCWDT_PAUSED_BY_NO_CORE" visible="true" />
116      <Entry name="CM0" value="CY_MCWDT_PAUSED_BY_DPSLP_CM0" visible="true" />
117      <Entry name="CM4" value="CY_MCWDT_PAUSED_BY_DPSLP_CM4" visible="`${hasCore(&quot;CORE_NAME_CM4_0&quot;)}`" />
118      <Entry name="CM7_0" value="CY_MCWDT_PAUSED_BY_DPSLP_CM7_0" visible="`${hasCore(&quot;CORE_NAME_CM7_0&quot;)}`" />
119      <Entry name="CM7_1" value="CY_MCWDT_PAUSED_BY_DPSLP_CM7_1" visible="`${hasCore(&quot;CORE_NAME_CM7_1&quot;)}`" />
120    </ParamChoice>
121
122    <!-- MCWDT instance number -->
123    <ParamString id="InstNumber" name="InstNumber" group="Internal" default="`${getInstNumber(&quot;mcwdt&quot;)}`" visible="false" editable="false" desc="MCWDT Instance name number." />
124
125    <!--Config-->
126    <ParamBool id="inFlash" name="Store Config in Flash" group="Advanced" default="true" visible="true" editable="true" desc="Controls whether the configuration structure is stored in flash (const, true) or SRAM (not const, false)." />
127  </Parameters>
128
129  <DRCs>
130    <!--MCWDT DRCs-->
131    <DRC type="ERROR" text="Source low frequency clock for MCWDT is not enabled" condition="`${!srcLfUsed}`" >
132      <FixIt action="ENABLE_BLOCK" target="`${sourceLfClk}`" value="" valid="true" />
133    </DRC>
134  </DRCs>
135
136  <ConfigFirmware>
137    <ConfigInclude value="cy_mcwdt.h" include="true" />
138    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
139
140    <ConfigDefine name="`${INST_NAME}`_HW" value="MCWDT`${InstNumber}`" public="true" include="true" />
141    <ConfigDefine name="`${INST_NAME}`_IRQ" value="srss_interrupt_mcwdt_`${InstNumber}`_IRQn" public="true" include="true" />
142    <ConfigStruct name="`${INST_NAME . &quot;_config&quot;}`" type="cy_stc_mcwdt_config_t" const="`${inFlash}`" public="true" include="true" >
143      <Member name="c0LowerLimit" value="`${C0LowerLimit}`U" />
144      <Member name="c0UpperLimit" value="`${C0UpperLimit}`U" />
145      <Member name="c0WarnLimit" value="`${C0WarnLimit}`U" />
146      <Member name="c0LowerAction" value="`${C0LowerAction}`" />
147      <Member name="c0UpperAction" value="`${C0UpperAction}`" />
148      <Member name="c0WarnAction" value="`${C0WarnAction}`" />
149      <Member name="c0AutoService" value="`${(C0AutoService eq true) ? &quot;CY_MCWDT_ENABLE&quot; : &quot;CY_MCWDT_DISABLE&quot;}`" />
150	  <Member name="c0SleepDeepPause" value="`${(C0DeepSleepPause eq true) ? &quot;CY_MCWDT_ENABLE&quot; : &quot;CY_MCWDT_DISABLE&quot;}`" />
151	  <Member name="c0DebugRun" value="`${(C0DebugRun eq true) ? &quot;CY_MCWDT_ENABLE&quot; : &quot;CY_MCWDT_DISABLE&quot;}`" />
152      <Member name="c1LowerLimit" value="`${C1LowerLimit}`U" />
153      <Member name="c1UpperLimit" value="`${C1UpperLimit}`U" />
154      <Member name="c1WarnLimit" value="`${C1WarnLimit}`U" />
155      <Member name="c1LowerAction" value="`${C1LowerAction}`" />
156      <Member name="c1UpperAction" value="`${C1UpperAction}`" />
157      <Member name="c1WarnAction" value="`${C1WarnAction}`" />
158      <Member name="c1AutoService" value="`${(C1AutoService eq true) ? &quot;CY_MCWDT_ENABLE&quot; : &quot;CY_MCWDT_DISABLE&quot;}`" />
159	  <Member name="c1SleepDeepPause" value="`${(C1DeepSleepPause eq true) ? &quot;CY_MCWDT_ENABLE&quot; : &quot;CY_MCWDT_DISABLE&quot;}`" />
160	  <Member name="c1DebugRun" value="`${(C1DebugRun eq true) ? &quot;CY_MCWDT_ENABLE&quot; : &quot;CY_MCWDT_DISABLE&quot;}`" />
161	  <Member name="c2ToggleBit" value="`${C2ToggleBit}`U" />
162	  <Member name="c2Action" value="`${C2Action}`" />
163	  <Member name="c2SleepDeepPause" value="`${(C2DeepSleepPause eq true) ? &quot;CY_MCWDT_ENABLE&quot; : &quot;CY_MCWDT_DISABLE&quot;}`" />
164	  <Member name="c2DebugRun" value="`${(C2DebugRun eq true) ? &quot;CY_MCWDT_ENABLE&quot; : &quot;CY_MCWDT_DISABLE&quot;}`" />
165      <Member name="coreSelect" value="`${CoreSelect}`" />
166	</ConfigStruct>
167
168    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)">
169      <Member name="type" value="CYHAL_RSC_LPTIMER" />
170      <Member name="block_num" value="`${getInstNumber(&quot;mcwdt&quot;)}`U" />
171      <Member name="channel_num" value="0U" />
172    </ConfigStruct>
173
174    <ConfigInstruction value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
175  </ConfigFirmware>
176</Personality>
177