1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file mcwdt.cypersonality
6* \version 3.0
7*
8* \brief
9* Multi-counter watchdog personality description file. It supports CAT1A, CAT1B and
10* CAT1D devices.
11*
12********************************************************************************
13* \copyright
14* Copyright 2018-2023 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" name="Multi-counter watchdog" version="3.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
31  <Dependencies>
32    <IpBlock name="mxs40srss,mxs40ssrss,mxs22srss" />
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 (16-bit)-->
51    <ParamChoice id="C0ClearOnMatch" name="Clear on Match" group="Counter0 (16-bit)" default="FREE_RUNNING" visible="true" editable="true" desc="Controls whether the counter is free running, with a period of 65,536 counts, or clear on match, where the period equals the match value + 1.">
52      <Entry name="Free Running" value="FREE_RUNNING" visible="true" />
53      <Entry name="Clear on Match" value="CLEAR_ON_MATCH" visible="true" />
54    </ParamChoice>
55    <ParamRange id="C0Match" name="Match" group="Counter0 (16-bit)" default="32768" min="`${(C0ClearOnMatch eq CLEAR_ON_MATCH) ? 1 : 0}`" max="65535" resolution="1" visible="true" editable="true" desc="Counter match comparison value, for interrupt or watchdog timeout. The frequency is the interrupt frequency in interrupt action mode. The period is the inverse of the frequency." />
56    <ParamChoice id="C0Mode" name="Mode" group="Counter0 (16-bit)" default="CY_MCWDT_MODE_NONE" visible="true" editable="true" desc="Counter 0 mode.">
57      <Entry name="Interrupt" value="CY_MCWDT_MODE_INT" visible="true" />
58      <Entry name="Watchdog Reset" value="CY_MCWDT_MODE_RESET" visible="true" />
59      <Entry name="Three Interrupts then Watchdog Reset" value="CY_MCWDT_MODE_INT_RESET" visible="true" />
60      <Entry name="No Action" value="CY_MCWDT_MODE_NONE" visible="true" />
61    </ParamChoice>
62
63    <!--Counter1 (16-bit)-->
64    <ParamChoice id="C1ClearOnMatch" name="Clear on Match" group="Counter1 (16-bit)" default="FREE_RUNNING" visible="true" editable="true" desc="Controls whether the counter is Free Running, with a period of 65,536 counts, or clear on match, where the period equals the match value + 1.">
65      <Entry name="Free Running" value="FREE_RUNNING" visible="true" />
66      <Entry name="Clear on Match" value="CLEAR_ON_MATCH" visible="true" />
67    </ParamChoice>
68    <ParamRange id="C1Match" name="Match" group="Counter1 (16-bit)" default="32768" min="`${(C1ClearOnMatch eq CLEAR_ON_MATCH) ? 1 : 0}`" max="65535" resolution="1" visible="true" editable="true" desc="Counter match comparison value, for interrupt or watchdog timeout. The frequency is the interrupt frequency in interrupt action mode. The period is the inverse of the frequency." />
69    <ParamChoice id="C1Mode" name="Mode" group="Counter1 (16-bit)" default="CY_MCWDT_MODE_NONE" visible="true" editable="true" desc="Counter 1 mode.">
70      <Entry name="Interrupt" value="CY_MCWDT_MODE_INT" visible="true" />
71      <Entry name="Watchdog Reset" value="CY_MCWDT_MODE_RESET" visible="true" />
72      <Entry name="Three Interrupts then Watchdog Reset" value="CY_MCWDT_MODE_INT_RESET" visible="true" />
73      <Entry name="No Action" value="CY_MCWDT_MODE_NONE" visible="true" />
74    </ParamChoice>
75
76    <!--Counter2 (32-bit)-->
77    <ParamChoice id="C2Mode" name="Mode" group="Counter2 (32-bit)" default="CY_MCWDT_MODE_NONE" visible="true" editable="true" desc="Counter 2 mode.">
78      <Entry name="Interrupt" value="CY_MCWDT_MODE_INT" visible="true" />
79      <Entry name="No Action" value="CY_MCWDT_MODE_NONE" visible="true" />
80    </ParamChoice>
81    <ParamRange id="C2Period" name="Period / Toggle Bit" group="Counter2 (32-bit)" default="16" min="0" max="31" resolution="1" visible="true" editable="true" desc="Counter 2 period (toggle bit) select. The 32 values are calculated based on the counter clock frequency divided for each of the 32 bits in the counter." />
82    <ParamBool id="CascadeC0C1" name="Cascade C0C1" group="Cascade" default="false" visible="true" editable="true" desc="Controls whether Counter1 is clocked by LFCLK or from Counter0." />
83    <ParamBool id="CascadeC1C2" name="Cascade C1C2" group="Cascade" default="false" visible="true" editable="true" desc="Controls whether Counter2 is clocked by LFCLK or from Counter1 cascade." />
84
85    <!--Window Operation-->
86    <ParamChoice id="C0LowerLimitMode" name="C0 Lowerlimit Mode" group="Window Operation" default="CY_MCWDT_LOWER_LIMIT_MODE_NOTHING" visible="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`" editable="true" desc="Counter0 Lowerlimit Mode.">
87      <Entry name="No Action" value="CY_MCWDT_LOWER_LIMIT_MODE_NOTHING" visible="true" />
88      <Entry name="Interrupt" value="CY_MCWDT_LOWER_LIMIT_MODE_INT" visible="true" />
89      <Entry name="Reset" value="CY_MCWDT_LOWER_LIMIT_MODE_RESET" visible="true" />
90    </ParamChoice>
91    <ParamRange id="C0LowerLimit" name="C0 Lowerlimit" group="Window Operation" default="0" min="0" max="65535" resolution="1" visible="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`" editable="true" desc="C0 Lowerlimit." />
92
93	<ParamChoice id="C1LowerLimitMode" name="C1 Lowerlimit Mode" group="Window Operation" default="CY_MCWDT_LOWER_LIMIT_MODE_NOTHING" visible="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`" editable="true" desc="Counter1 Lowerlimit Mode.">
94      <Entry name="No Action" value="CY_MCWDT_LOWER_LIMIT_MODE_NOTHING" visible="true" />
95      <Entry name="Interrupt" value="CY_MCWDT_LOWER_LIMIT_MODE_INT" visible="true" />
96	  <Entry name="Reset" value="CY_MCWDT_LOWER_LIMIT_MODE_RESET" visible="true" />
97    </ParamChoice>
98    <ParamRange id="C1LowerLimit" name="C1 Lowerlimit" group="Window Operation" default="0" min="0" max="65535" resolution="1" visible="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`" editable="true" desc="C1 Lowerlimit." />
99
100    <!-- MCWDT instance number -->
101    <ParamString id="InstNumber" name="InstNumber" group="Internal" default="`${getInstNumber(&quot;mcwdt&quot;)}`" visible="false" editable="false" desc="MCWDT Instance name number." />
102
103    <!--Config-->
104    <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)." />
105  </Parameters>
106
107  <DRCs>
108    <!--MCWDT DRCs-->
109    <DRC type="ERROR" text="Source low frequency clock for MCWDT is not enabled" condition="`${!srcLfUsed}`" >
110      <FixIt action="ENABLE_BLOCK" target="`${sourceLfClk}`" value="" valid="true" />
111    </DRC>
112  </DRCs>
113
114  <ConfigFirmware>
115    <ConfigInclude value="cy_mcwdt.h" include="true" />
116    <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" />
117
118    <ConfigDefine name="`${INST_NAME}`_HW" value="MCWDT_STRUCT`${InstNumber}`" public="true" include="true" />
119    <ConfigDefine name="`${INST_NAME}`_IRQ" value="srss_interrupt_mcwdt_`${InstNumber}`_IRQn" public="true" include="`${(C0Mode eq CY_MCWDT_MODE_INT) || (C0Mode eq CY_MCWDT_MODE_INT_RESET) || (C1Mode eq CY_MCWDT_MODE_INT) || (C1Mode eq CY_MCWDT_MODE_INT_RESET) || (C2Mode eq CY_MCWDT_MODE_INT)}`" />
120    <ConfigStruct name="`${INST_NAME . &quot;_config&quot;}`" type="cy_stc_mcwdt_config_t" const="`${inFlash}`" public="true" include="true" >
121      <Member name="c0Match" value="`${C0Match}`U" />
122      <Member name="c1Match" value="`${C1Match}`U" />
123      <Member name="c0Mode" value="`${C0Mode}`" />
124      <Member name="c1Mode" value="`${C1Mode}`" />
125      <Member name="c2ToggleBit" value="`${C2Period}`U" />
126      <Member name="c2Mode" value="`${C2Mode}`" />
127      <Member name="c0ClearOnMatch" value="`${(C0ClearOnMatch eq CLEAR_ON_MATCH) ? &quot;true&quot; : &quot;false&quot;}`" />
128      <Member name="c1ClearOnMatch" value="`${(C1ClearOnMatch eq CLEAR_ON_MATCH) ? &quot;true&quot; : &quot;false&quot;}`" />
129      <Member name="c0c1Cascade" value="`${CascadeC0C1}`" />
130      <Member name="c1c2Cascade" value="`${CascadeC1C2}`" />
131      <Member name="c0LowerLimitMode" value="`${C0LowerLimitMode}`" include="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`" />
132      <Member name="c0LowerLimit" value="`${C0LowerLimit}`U" include="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`" />
133      <Member name="c1LowerLimitMode" value="`${C1LowerLimitMode}`" include="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`" />
134      <Member name="c1LowerLimit" value="`${C1LowerLimit}`U" include="`${(&quot;mxs40ssrss&quot; eq getIpBlockName()) || (&quot;mxs22srss&quot; eq getIpBlockName())}`" />
135    </ConfigStruct>
136
137    <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)">
138      <Member name="type" value="CYHAL_RSC_LPTIMER" />
139      <Member name="block_num" value="`${getInstNumber(&quot;mcwdt&quot;)}`U" />
140      <Member name="channel_num" value="0U" />
141    </ConfigStruct>
142
143    <ConfigInstruction value="cyhal_hwmgr_reserve(&amp;`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" />
144  </ConfigFirmware>
145</Personality>
146