1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file power_v3.cypersonality
6* \version 1.0
7*
8* \brief
9* Personality description file for MCU part of Low Power Assistant.
10* This supports CAT1C devices.
11
12*
13********************************************************************************
14* \copyright
15* Copyright (c) 2022, Cypress Semiconductor Corporation (an Infineon company) or
16* an affiliate of Cypress Semiconductor Corporation.
17* SPDX-License-Identifier: Apache-2.0
18*
19* Licensed under the Apache License, Version 2.0 (the "License");
20* you may not use this file except in compliance with the License.
21* You may obtain a copy of the License at
22*
23*     http://www.apache.org/licenses/LICENSE-2.0
24*
25* Unless required by applicable law or agreed to in writing, software
26* distributed under the License is distributed on an "AS IS" BASIS,
27* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28* See the License for the specific language governing permissions and
29* limitations under the License.
30*****************************************************************************-->
31
32<Personality id="power_v3" name="Power Settings" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
33  <Dependencies>
34    <IpBlock name="mxs40srss_ver3,mxs40srss_ver2" />
35    <Resource name="srss\.power" />
36  </Dependencies>
37  <ExposedMembers>
38    <ExposedMember key="vddaMv" paramId="vddaMv" />
39	<ExposedMember key="usingUlp" paramId="usingUlp" />
40    <ExposedMember key="deepsleepWhenIdle" paramId="deepsleepWhenIdle" />
41  </ExposedMembers>
42  <Parameters>
43    <!-- Documentation -->
44    <ParamDoc id="pdlDoc" name="SysPm API Reference" group="Overview" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__syspm.html" linkText="Open SysPm Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />
45
46    <!-- Power settings -->
47    <ParamBool id="enableLowPowerProfileMode" name="Enable LPACTIVE/LPSLEEP mode" group="General" default="`${false}`" visible="true" editable="true" desc="This parameter enables the Low Power Profile mode i.e LPACTIVE/LPSLEEP" />
48
49	<ParamChoice id="minCurrRegulator" name="Regulator Min Current Mode" group="General" default="`${CY_SYSPM_LDO_MODE_NORMAL}`" visible="true" editable="true"
50      desc="Enables Regulator Minimum Current Mode.">
51      <Entry name="Normal Current LDO" value="CY_SYSPM_LDO_MODE_NORMAL" visible="true" />
52      <Entry name="Minimum Current LDO" value="CY_SYSPM_LDO_MODE_MIN" visible="true" />
53    </ParamChoice>
54
55    <ParamBool id="transistorEnable" name="Enable REGHC" group="REGHC Controls" default="false" visible="true" editable="true" desc="Enables REGHC." />
56
57	<ParamChoice id="reghcMode" name="REGHC Mode" group="REGHC Controls" default="`${CY_SYSPM_REGHC_MODE_TRANSISTOR}`" visible="`${transistorEnable}`" editable="false"
58      desc="Selects the mode for REGHC.">
59      <Entry name="External Transistor Mode" value="CY_SYSPM_REGHC_MODE_TRANSISTOR" visible="true" />
60      <Entry name="External PMIC Mode" value="CY_SYSPM_REGHC_MODE_PMIC" visible="true" />
61    </ParamChoice>
62
63    <ParamRange id="vadjMv"    name="VADJ Voltage (mV)"    group="REGHC Controls" default="1100" min="1020" max="1175" resolution="5" visible="`${transistorEnable}`" editable="true" desc="VADJ voltage in millivolts." />
64
65    <ParamString id="vadjVoltMacro" name="VADJ Voltage Macro" group="Internal" default="`${vadjMv eq &quot;1020&quot;    ? &quot;CY_SYSPM_REGHC_VADJ_1_020V&quot;   :
66                                                                                   vadjMv eq &quot;1025&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_025V&quot;   :
67                                                                                   vadjMv eq &quot;1030&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_030V&quot;   :
68                                                                                   vadjMv eq &quot;1035&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_035V&quot;   :
69																				   vadjMv eq &quot;1040&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_040V&quot;   :
70																				   vadjMv eq &quot;1045&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_045V&quot;   :
71																				   vadjMv eq &quot;1050&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_050V&quot;   :
72																				   vadjMv eq &quot;1055&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_055V&quot;   :
73																				   vadjMv eq &quot;1060&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_060V&quot;   :
74																				   vadjMv eq &quot;1065&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_065V&quot;   :
75																				   vadjMv eq &quot;1070&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_070V&quot;   :
76																				   vadjMv eq &quot;1075&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_075V&quot;   :
77																				   vadjMv eq &quot;1080&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_080V&quot;   :
78																				   vadjMv eq &quot;1085&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_085V&quot;   :
79																				   vadjMv eq &quot;1090&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_090V&quot;   :
80																				   vadjMv eq &quot;1095&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_095V&quot;   :
81																				   vadjMv eq &quot;1100&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_100V&quot;   :
82																				   vadjMv eq &quot;1105&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_105V&quot;   :
83																				   vadjMv eq &quot;1110&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_110V&quot;   :
84																				   vadjMv eq &quot;1115&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_115V&quot;   :
85																				   vadjMv eq &quot;1120&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_120V&quot;   :
86																				   vadjMv eq &quot;1125&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_125V&quot;   :
87																				   vadjMv eq &quot;1130&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_130V&quot;   :
88																				   vadjMv eq &quot;1135&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_135V&quot;   :
89																				   vadjMv eq &quot;1140&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_140V&quot;   :
90																				   vadjMv eq &quot;1145&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_145V&quot;   :
91																				   vadjMv eq &quot;1150&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_150V&quot;   :
92																				   vadjMv eq &quot;1155&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_155V&quot;   :
93																				   vadjMv eq &quot;1160&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_160V&quot;   :
94																				   vadjMv eq &quot;1165&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_165V&quot;   :
95																				   vadjMv eq &quot;1170&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_170V&quot;   :
96																				   vadjMv eq &quot;1175&quot;   ? &quot;CY_SYSPM_REGHC_VADJ_1_175V&quot;   :
97																				   &quot;CY_SYSPM_REGHC_VADJ_1_100V&quot;}`" visible="false" editable="false" desc="VADJ Voltage Macro." />
98
99
100    <ParamChoice id="backupSrc" name="vBackup Source" group="General" default="VDDD" visible="true" editable="false"
101      desc="Selects whether the backup power domain is driven by a dedicated supply (e.g. super-cap or battery), or tied to VDDD.">
102      <Entry name="VDDD" value="VDDD" visible="true" />
103      <Entry name="Dedicated Supply" value="DEDICATED" visible="true" />
104    </ParamChoice>
105
106    <ParamChoice id="idlePwrMode" name="System Idle Power Mode" group="RTOS" default="CY_CFG_PWR_MODE_DEEPSLEEP" visible="true" editable="true"
107      desc="Selects the lowest power mode the system attempts to enter when there is no active tasks to execute, i.e. the system is in idle state.
108            This option only applies for an RTOS based application.">
109      <Entry name="Active" value="CY_CFG_PWR_MODE_ACTIVE" visible="true" />
110      <Entry name="CPU Sleep" value="CY_CFG_PWR_MODE_SLEEP" visible="true" />
111      <Entry name="System Deep Sleep" value="CY_CFG_PWR_MODE_DEEPSLEEP" visible="true" />
112    </ParamChoice>
113
114    <ParamRange id="deepsleepLatency" name="Deep Sleep Latency (ms)" group="RTOS" default="0" min="0" max="1000" resolution="1" visible="true" editable="true"
115      desc="Greater between the time required to enter to and exit from the deep sleep power mode.
116            This option only applies for an RTOS based application." />
117    <!-- Operating conditions -->
118
119    <ParamRange id="vddaMv"    name="VDDA Voltage (mV)"    group="Operating Conditions" default="3300" min="2700" max="5500" resolution="1" visible="true" editable="true" desc="VDDA voltage in millivolts." />
120    <ParamRange id="vdddMv"    name="VDDD Voltage (mV)"    group="Operating Conditions" default="3300" min="2700" max="5500" resolution="1" visible="true" editable="true" desc="VDDD voltage in millivolts." />
121    <ParamRange id="vddio0Mv"  name="VDDIO0 Voltage (mV)"  group="Operating Conditions" default="3300" min="2700" max="5500" resolution="1" visible="true" editable="true" desc="VDDIO0 voltage in millivolts." />
122    <ParamRange id="vddio1Mv"  name="VDDIO1 Voltage (mV)"  group="Operating Conditions" default="3300" min="2700" max="5500" resolution="1" visible="true" editable="true" desc="VDDIO1 voltage in millivolts." />
123
124    <!-- Wakeup pins -->
125    <!-- There are a maximum of 24 wakeup pins in SRSSv3p3 -->
126    <Repeat count="24">
127      <ParamSignal port="hibernate_wakeup[$idx]" name="Hibernate Wakeup ($idx)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[$idx]&quot;)}`"
128        desc="Reserve the hibernate_wakeup[$idx] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
129        <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
130          <Parameter id="DriveModes" severity="DEFAULT" reason="">
131            <Fixed value="CY_GPIO_DM_PULLUP" />
132          </Parameter>
133        </Constraint>
134        <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
135      </ParamSignal>
136    </Repeat>
137
138    <!--<ParamSignal port="pmic_wakeup_in[0]" name="PMIC Wakeup Input" group="Wakeup Pins" visible="`${regulatorMode eq pmicEnable}`"
139      desc="Reserve the pmic_wakeup_in pin" canBeEmpty="true" >
140      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${regulatorMode eq pmicEnable}`" >
141        <Parameter id="DriveModes" severity="DEFAULT" reason="">
142          <Fixed value="CY_GPIO_DM_PULLUP" />
143        </Parameter>
144      </Constraint>
145      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
146    </ParamSignal>
147
148    <ParamSignal port="pmic_wakeup_out[0]" name="PMIC Wakeup Output" group="Wakeup Pins" visible="`${regulatorMode eq pmicEnable}`"
149      desc="Reserve the pmic_wakeup_out pin" canBeEmpty="`${!(regulatorMode eq pmicEnable)}`" >
150      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${regulatorMode eq pmicEnable}`" >
151        <Parameter id="DriveModes" severity="DEFAULT" reason="">
152          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
153        </Parameter>
154      </Constraint>
155      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
156    </ParamSignal>  -->
157    <ParamBool id="usingUlp" name="usingUlp" group="Internal" default="false" visible="false" editable="false" desc="" />
158    <ParamBool id="deepsleepWhenIdle" name="deepsleepWhenIdle" group="Internal" default="`${idlePwrMode eq CY_CFG_PWR_MODE_DEEPSLEEP}`" visible="false" editable="false" desc="" />
159
160    <ParamSignal port="reghc_isense_inp[0]" name="External PS CTL0" group="REGHC Pins" visible="`${(transistorEnable eq true) &amp;&amp; (reghcMode eq CY_SYSPM_REGHC_MODE_TRANSISTOR)}`"
161      desc="Positive terminal of the current sense resistor" canBeEmpty="true" >
162      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${(transistorEnable eq true) &amp;&amp; (reghcMode eq CY_SYSPM_REGHC_MODE_TRANSISTOR)}`">
163        <Parameter id="DriveModes" severity="DEFAULT" reason="">
164          <Fixed value="CY_GPIO_DM_PULLUP" />
165        </Parameter>
166      </Constraint>
167      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
168    </ParamSignal>
169
170    <ParamSignal port="reghc_isense_inm[0]" name="External PS CTL1" group="REGHC Pins" visible="`${(transistorEnable eq true) &amp;&amp; (reghcMode eq CY_SYSPM_REGHC_MODE_TRANSISTOR)}`"
171      desc="Negative terminal of the current sense resistor" canBeEmpty="true" >
172      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${(transistorEnable eq true) &amp;&amp; (reghcMode eq CY_SYSPM_REGHC_MODE_TRANSISTOR)}`">
173        <Parameter id="DriveModes" severity="DEFAULT" reason="">
174          <Fixed value="CY_GPIO_DM_PULLUP" />
175        </Parameter>
176      </Constraint>
177      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
178    </ParamSignal>
179
180    <!--<ParamSignal port="reghc_rst_vout[0]" name="External PS CTL2" group="Wakeup Pins" visible="`${transistorEnable}`"
181      desc="External Power Supply CTL2" canBeEmpty="true" >
182      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${transistorEnable}`" >
183        <Parameter id="DriveModes" severity="DEFAULT" reason="">
184          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
185        </Parameter>
186      </Constraint>
187      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
188    </ParamSignal> -->
189  </Parameters>
190
191  <!-- Error checking -->
192  <DRCs>
193    <DRC type="ERROR" text="The input voltage of VDDD is set to `${vdddMv}` which is out of range. The value must be between 1700 and VDDA (`${vddaMv}`)." condition="`${(vdddMv &gt; vddaMv)}`" />
194    <DRC type="ERROR" text="The input voltage of VDDIO0 is set to `${vddio0Mv}` which is out of range. The value must be between 1700 and VDDA (`${vddaMv}`)." condition="`${(vddio0Mv &gt; vddaMv)}`" />
195    <DRC type="ERROR" text="The input voltage of VDDIO1 is set to `${vddio1Mv}` which is out of range. The value must be between 1700 and VDDA (`${vddaMv}`)." condition="`${(vddio1Mv &gt; vddaMv)}`" />
196    <DRC type="ERROR" text="Assign External PS CTL 0/1 to a signal from REGHC Pins section or uncheck Enable External Transistor output from General section." condition="`${(transistorEnable &amp;&amp; !hasConnection(&quot;reghc_isense_inp&quot;, 0)) &amp;&amp; (transistorEnable &amp;&amp; !hasConnection(&quot;reghc_isense_inm&quot;, 0))}`" />
197  </DRCs>
198
199  <!-- Generated firmware -->
200  <ConfigFirmware>
201    <ConfigInclude value="cy_syspm.h" include="true" />
202    <ConfigDefine name="CY_CFG_PWR_MODE_LP"             public="true" value="0x01UL" include="true" />
203    <ConfigDefine name="CY_CFG_PWR_MODE_ULP"            public="true" value="0x02UL" include="true" />
204    <ConfigDefine name="CY_CFG_PWR_MODE_ACTIVE"         public="true" value="0x04UL" include="true" />
205    <ConfigDefine name="CY_CFG_PWR_MODE_SLEEP"          public="true" value="0x08UL" include="true" />
206    <ConfigDefine name="CY_CFG_PWR_MODE_DEEPSLEEP"      public="true" value="0x10UL" include="true" />
207    <ConfigDefine name="CY_CFG_PWR_MODE_DEEPSLEEP_RAM"  public="true" value="0x11UL" include="true" />
208    <ConfigDefine name="CY_CFG_PWR_MODE_DEEPSLEEP_OFF"  public="true" value="0x12UL" include="true" />
209    <ConfigDefine name="CY_CFG_PWR_SYS_IDLE_MODE"       public="true" value="`${idlePwrMode}`" include="true" />
210    <ConfigDefine name="CY_CFG_PWR_DEEPSLEEP_LATENCY"   public="true" value="`${deepsleepLatency}`UL" include="true" />
211    <ConfigDefine name="CY_CFG_PWR_SYS_LP_PROFILE_MODE" public="true" value="`${enableLowPowerProfileMode ? 1 : 0}`" include="true" />
212    <ConfigDefine name="CY_CFG_PWR_ENABLED"             public="false" value="1" include="true" />
213	<ConfigDefine name="CY_CFG_PWR_INIT"                public="false" value="1" include="true" />
214    <!-- <ConfigDefine name="CY_CFG_PWR_USING_PMIC"          public="false" value="`${pmicEnable ? 1 : 0}`" include="true" /> -->
215    <ConfigDefine name="CY_CFG_PWR_VBACKUP_USING_VDDD"  public="false" value="`${(backupSrc eq VDDD) ? 1 : 0}`" include="true" />
216	<ConfigDefine name="CY_CFG_PWR_REGULATOR_MODE_MIN"  public="false" value="`${((minCurrRegulator eq CY_SYSPM_LDO_MODE_MIN)) ? 1 : 0}`" include="true" />
217    <ConfigDefine name="CY_CFG_PWR_USING_ULP"           public="false" value="`${usingUlp ? 1 : 0}`" include="true" />
218    <!-- Operating conditions -->
219    <ConfigDefine name="CY_CFG_PWR_VDDA_MV"                public="true" value="`${vddaMv}`" include="true" />
220    <ConfigDefine name="CY_CFG_PWR_VDDD_MV"                public="true" value="`${vdddMv}`" include="true" />
221    <ConfigDefine name="CY_CFG_PWR_VDDIO0_MV"              public="true" value="`${vddio0Mv}`" include="true" />
222    <ConfigDefine name="CY_CFG_PWR_VDDIO1_MV"              public="true" value="`${vddio1Mv}`" include="true" />
223    <ConfigDefine name="CY_CFG_PWR_REGHC_ENABLED"          public="true" value="`${transistorEnable}`" include="true" />
224	<ConfigDefine name="CY_CFG_PWR_REGHC_MODE"             public="true" value="`${transistorEnable ? reghcMode : 0xFF}`" include="true" />
225	<ConfigDefine name="CY_CFG_PWR_REGHC_TRANS_VADJ_VOLT"  public="true" value="`${transistorEnable ? vadjVoltMacro : 0}`" include="true" />
226
227    <ConfigFunction signature="__STATIC_INLINE void init_cycfg_power(void)" body="
228   /* **Reset the Backup domain on POR, XRES, BOD only if Backup domain is supplied by VDDD** */&#xA;
229   #if (CY_CFG_PWR_VBACKUP_USING_VDDD)&#xA;
230       #ifdef CY_CFG_SYSCLK_ILO_ENABLED&#xA;
231           if (0u == Cy_SysLib_GetResetReason() /* POR, XRES, or BOD */)&#xA;
232           {&#xA;
233               Cy_SysLib_ResetBackupDomain();&#xA;
234               Cy_SysClk_IloDisable();&#xA;
235               Cy_SysClk_IloInit();&#xA;
236           }&#xA;
237       #endif /* CY_CFG_SYSCLK_ILO_ENABLED */&#xA;
238   #endif /* CY_CFG_PWR_VBACKUP_USING_VDDD */&#xA;&#xA;
239   /* **REGHC Configuration** */&#xA;
240   #if (CY_CFG_PWR_REGHC_ENABLED)&#xA;
241       Cy_SysPm_ReghcConfigure(CY_CFG_PWR_REGHC_MODE, CY_CFG_PWR_REGHC_TRANS_VADJ_VOLT);&#xA;
242   #endif /* CY_CFG_PWR_REGHC_ENABLED */&#xA;&#xA;
243
244   /* **System Active Low Power Profile(LPACTIVE/LPSLEEP) Configuration** */&#xA;
245   #if (CY_CFG_PWR_SYS_LP_PROFILE_MODE)&#xA;
246       Cy_SysPm_SystemLpActiveEnter();&#xA;
247   #endif /* CY_CFG_PWR_SYS_ACTIVE_MODE */&#xA;&#xA;
248   /* **System Regulators Low Current Configuration** */&#xA;
249   #if CY_CFG_PWR_REGULATOR_MODE_MIN&#xA;
250       Cy_SysPm_SystemSetMinRegulatorCurrent();&#xA;
251   #else&#xA;
252       Cy_SysPm_SystemSetNormalRegulatorCurrent();&#xA;
253   #endif /* CY_CFG_PWR_REGULATOR_MODE_MIN */&#xA;"
254    public="false" include="true" />
255   <!--/* Configure PMIC */&#xA;
256   Cy_SysPm_UnlockPmic();&#xA;
257   #if CY_CFG_PWR_USING_PMIC&#xA;
258       Cy_SysPm_PmicEnableOutput();&#xA;
259   #else&#xA;
260       Cy_SysPm_PmicDisableOutput();&#xA;
261   #endif /* CY_CFG_PWR_USING_PMIC */ -->
262  </ConfigFirmware>
263</Personality>
264