1<?xml version="1.0" encoding="utf-8"?>
2
3
4<!--****************************************************************************
5* \file power.cypersonality
6* \version 1.3
7*
8* \brief
9* Personality description file for MCU part of Low Power Assistant.
10* This supports CAT1A devices.
11*
12********************************************************************************
13* \copyright
14* Copyright (c) 2022, Cypress Semiconductor Corporation (an Infineon company) or
15* an affiliate of Cypress Semiconductor Corporation.
16* SPDX-License-Identifier: Apache-
17*
18* Licensed under the Apache License, Version 2.0 (the "License");
19* you may not use this file except in compliance with the License.
20* You may obtain a copy of the License at
21*
22*     http://www.apache.org/licenses/LICENSE-2.0
23*
24* Unless required by applicable law or agreed to in writing, software
25* distributed under the License is distributed on an "AS IS" BASIS,
26* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27* See the License for the specific language governing permissions and
28* limitations under the License.
29*****************************************************************************-->
30
31<Personality id="power" name="Power Settings" version="1.3" xmlns="http://cypress.com/xsd/cyhwpersonality_v7">
32  <Dependencies>
33    <IpBlock name="mxs40srss" />
34    <Resource name="srss\.power" />
35  </Dependencies>
36  <ExposedMembers>
37    <ExposedMember key="vddaMv" paramId="vddaMv" />
38    <ExposedMember key="usingUlp" paramId="usingUlp" />
39    <ExposedMember key="deepsleepWhenIdle" paramId="deepsleepWhenIdle" />
40  </ExposedMembers>
41  <Parameters>
42    <!-- Documentation -->
43    <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" />
44
45    <!-- Power settings -->
46    <ParamChoice id="pwrMode" name="Power Mode" group="Internal" default="LDO_1_1" visible="false" editable="true"
47      desc="This parameter was replaced by actPwrMode and coreRegulator.">
48      <Entry name="0.9V Buck Regulator" value="SIMO_0_9" visible="true" />
49      <Entry name="0.9V LDO Linear Regulator" value="LDO_0_9" visible="true" />
50      <Entry name="1.1V Buck Regulator" value="SIMO_1_1" visible="true" />
51      <Entry name="1.1V LDO Linear Regulator" value="LDO_1_1" visible="true" />
52    </ParamChoice>
53
54    <ParamChoice id="actPwrMode" name="System Active Power Mode" group="General" default="`${(pwrMode eq LDO_0_9) || (pwrMode eq SIMO_0_9) ? ULP : LP}`" visible="true" editable="true"
55      desc="Selects the system operating power mode.">
56      <Entry name="LP" value="LP" visible="true" />
57      <Entry name="ULP" value="ULP" visible="true" />
58    </ParamChoice>
59
60    <ParamChoice id="coreRegulator" name="Core Regulator" group="General" default="`${(pwrMode eq LDO_0_9) ? CY_SYSPM_LDO_MODE_MIN : ((pwrMode eq LDO_1_1) ? CY_SYSPM_LDO_MODE_NORMAL : ((pwrMode eq SIMO_0_9) ? CY_SYSPM_BUCK_MODE_MIN : CY_SYSPM_BUCK_MODE_NORMAL))}`" visible="true" editable="true"
61      desc="Selects the core regulator to power the device.">
62      <Entry name="Normal Current LDO" value="CY_SYSPM_LDO_MODE_NORMAL" visible="true" />
63      <Entry name="Minimum Current LDO" value="CY_SYSPM_LDO_MODE_MIN" visible="true" />
64      <Entry name="Normal Current Buck" value="CY_SYSPM_BUCK_MODE_NORMAL" visible="true" />
65      <Entry name="Minimum Current Buck" value="CY_SYSPM_BUCK_MODE_MIN" visible="true" />
66    </ParamChoice>
67
68    <ParamBool id="pmicEnable" name="Enable External PMIC Output" group="General" default="false" visible="true" editable="true"
69      desc="Enables an external PMIC to provide VDDD power to the device." />
70
71    <ParamChoice id="backupSrc" name="vBackup Source" group="General" default="VDDD" visible="true" editable="true"
72      desc="Selects whether the backup power domain is driven by a dedicated supply (e.g. super-cap or battery), or tied to VDDD.">
73      <Entry name="VDDD" value="VDDD" visible="true" />
74      <Entry name="Dedicated Supply" value="DEDICATED" visible="true" />
75    </ParamChoice>
76
77    <ParamChoice id="idlePwrMode" name="System Idle Power Mode" group="RTOS" default="CY_CFG_PWR_MODE_DEEPSLEEP" visible="true" editable="true"
78      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.
79            This option only applies for an RTOS based application.">
80      <Entry name="Active" value="CY_CFG_PWR_MODE_ACTIVE" visible="true" />
81      <Entry name="CPU Sleep" value="CY_CFG_PWR_MODE_SLEEP" visible="true" />
82      <Entry name="System Deep Sleep" value="CY_CFG_PWR_MODE_DEEPSLEEP" visible="true" />
83    </ParamChoice>
84
85    <ParamRange id="deepsleepLatency" name="Deep Sleep Latency (ms)" group="RTOS" default="0" min="0" max="1000" resolution="1" visible="true" editable="true"
86      desc="Greater between the time required to enter to and exit from the deep sleep power mode.
87            This option only applies for an RTOS based application." />
88
89    <!-- Operating conditions -->
90    <ParamRange id="vddaMv"    name="VDDA Voltage (mV)"    group="Operating Conditions" default="3300" min="1700" max="3600" resolution="1" visible="true" editable="true" desc="VDDA voltage in millivolts." />
91    <ParamRange id="vdddMv"    name="VDDD Voltage (mV)"    group="Operating Conditions" default="3300" min="1700" max="3600" resolution="1" visible="true" editable="true" desc="VDDD voltage in millivolts." />
92    <ParamRange id="vBackupMv" name="VBACKUP Voltage (mV)" group="Operating Conditions" default="3300" min="1700" max="3600" resolution="1" visible="true" editable="true" desc="VBACKUP voltage in millivolts." />
93    <ParamRange id="vddNsMv"   name="VDD_NS Voltage (mV)"  group="Operating Conditions" default="3300" min="1700" max="3600" resolution="1" visible="true" editable="true" desc="VDD_NS voltage in millivolts." />
94    <ParamRange id="vddio0Mv"  name="VDDIO0 Voltage (mV)"  group="Operating Conditions" default="3300" min="1700" max="3600" resolution="1" visible="true" editable="true" desc="VDDIO0 voltage in millivolts." />
95    <ParamRange id="vddio1Mv"  name="VDDIO1 Voltage (mV)"  group="Operating Conditions" default="3300" min="1700" max="3600" resolution="1" visible="true" editable="true" desc="VDDIO1 voltage in millivolts." />
96
97    <!-- Wakeup pins -->
98    <ParamSignal port="hibernate_wakeup[0]" name="Hibernate Wakeup (0)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[0]&quot;)}`"
99      desc="Reserve the hibernate_wakeup[0] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
100      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
101        <Parameter id="DriveModes" severity="DEFAULT" reason="">
102          <Fixed value="CY_GPIO_DM_PULLUP" />
103        </Parameter>
104      </Constraint>
105      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
106    </ParamSignal>
107
108    <ParamSignal port="hibernate_wakeup[1]" name="Hibernate Wakeup (1)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[1]&quot;)}`"
109      desc="Reserve the hibernate_wakeup[1] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
110      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
111        <Parameter id="DriveModes" severity="DEFAULT" reason="">
112          <Fixed value="CY_GPIO_DM_PULLUP" />
113        </Parameter>
114      </Constraint>
115      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
116    </ParamSignal>
117
118    <ParamSignal port="hibernate_wakeup[2]" name="Hibernate Wakeup (2)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[2]&quot;)}`"
119      desc="Reserve the hibernate_wakeup[2] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
120      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
121        <Parameter id="DriveModes" severity="DEFAULT" reason="">
122          <Fixed value="CY_GPIO_DM_PULLUP" />
123        </Parameter>
124      </Constraint>
125      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
126    </ParamSignal>
127
128    <ParamSignal port="hibernate_wakeup[3]" name="Hibernate Wakeup (3)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[3]&quot;)}`"
129      desc="Reserve the hibernate_wakeup[3] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
130      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
131        <Parameter id="DriveModes" severity="DEFAULT" reason="">
132          <Fixed value="CY_GPIO_DM_PULLUP" />
133        </Parameter>
134      </Constraint>
135      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
136    </ParamSignal>
137
138    <ParamSignal port="pmic_wakeup_in[0]" name="PMIC Wakeup Input" group="Wakeup Pins" visible="`${pmicEnable}`"
139      desc="Reserve the pmic_wakeup_in pin" canBeEmpty="true" >
140      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${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="`${pmicEnable}`"
149      desc="Reserve the pmic_wakeup_out pin" canBeEmpty="`${!pmicEnable}`" >
150      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${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
158    <ParamBool id="usingLdo" name="usingLdo" group="Internal" default="`${(coreRegulator eq CY_SYSPM_LDO_MODE_MIN) || (coreRegulator eq CY_SYSPM_LDO_MODE_NORMAL)}`" visible="false" editable="false" desc="" />
159    <ParamBool id="usingUlp" name="usingUlp" group="Internal" default="`${actPwrMode eq ULP}`" visible="false" editable="false" desc="" />
160    <ParamBool id="deepsleepWhenIdle" name="deepsleepWhenIdle" group="Internal" default="`${idlePwrMode eq CY_CFG_PWR_MODE_DEEPSLEEP}`" visible="false" editable="false" desc="" />
161
162  </Parameters>
163
164  <!-- Error checking -->
165  <DRCs>
166    <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) &amp;&amp; !isBlockUsed(&quot;csd[0].csd[0]&quot;)}`" />
167    <DRC type="ERROR" text="The input voltage of VBACKUP is set to `${vBackupMv}` which is out of range. The value must be between 1700 and VDDA (`${vddaMv}`)." condition="`${(vBackupMv &gt; vddaMv) &amp;&amp; !isBlockUsed(&quot;csd[0].csd[0]&quot;)}`" />
168    <DRC type="ERROR" text="The input voltage of VDD_NS is set to `${vddNsMv}` which is out of range. The value must be between 1700 and VDDA (`${vddaMv}`)." condition="`${(vddNsMv &gt; vddaMv) &amp;&amp; !isBlockUsed(&quot;csd[0].csd[0]&quot;)}`" />
169    <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) &amp;&amp; !isBlockUsed(&quot;csd[0].csd[0]&quot;)}`" />
170    <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) &amp;&amp; !isBlockUsed(&quot;csd[0].csd[0]&quot;)}`" />
171  </DRCs>
172
173  <!-- Generated firmware -->
174  <ConfigFirmware>
175    <ConfigInclude value="cy_syspm.h" include="true" />
176    <ConfigDefine name="CY_CFG_PWR_MODE_LP"             public="true" value="0x01UL" include="true" />
177    <ConfigDefine name="CY_CFG_PWR_MODE_ULP"            public="true" value="0x02UL" include="true" />
178    <ConfigDefine name="CY_CFG_PWR_MODE_ACTIVE"         public="true" value="0x04UL" include="true" />
179    <ConfigDefine name="CY_CFG_PWR_MODE_SLEEP"          public="true" value="0x08UL" include="true" />
180    <ConfigDefine name="CY_CFG_PWR_MODE_DEEPSLEEP"      public="true" value="0x10UL" include="true" />
181    <ConfigDefine name="CY_CFG_PWR_SYS_IDLE_MODE"       public="true" value="`${idlePwrMode}`" include="true" />
182    <ConfigDefine name="CY_CFG_PWR_SYS_ACTIVE_MODE"     public="true" value="CY_CFG_PWR_MODE_`${actPwrMode}`" include="true" />
183    <ConfigDefine name="CY_CFG_PWR_DEEPSLEEP_LATENCY"   public="true" value="`${deepsleepLatency}`UL" include="true" />
184    <ConfigDefine name="CY_CFG_PWR_USING_LDO"           public="true" value="`${usingLdo ? 1 : 0}`" include="true" />
185    <ConfigDefine name="CY_CFG_PWR_ENABLED"             public="false" value="1" include="true" />
186    <ConfigDefine name="CY_CFG_PWR_INIT"                public="false" value="1" include="true" />
187    <ConfigDefine name="CY_CFG_PWR_USING_PMIC"          public="false" value="`${pmicEnable ? 1 : 0}`" include="true" />
188    <ConfigDefine name="CY_CFG_PWR_VBACKUP_USING_VDDD"  public="false" value="`${(backupSrc eq VDDD) ? 1 : 0}`" include="true" />
189    <ConfigDefine name="CY_CFG_PWR_LDO_VOLTAGE"         public="false" value="CY_SYSPM_LDO_VOLTAGE_`${actPwrMode}`" include="`${usingLdo}`" />
190    <ConfigDefine name="CY_CFG_PWR_BUCK_VOLTAGE"        public="false" value="CY_SYSPM_BUCK_OUT1_VOLTAGE_`${actPwrMode}`" include="`${!usingLdo}`" />
191    <ConfigDefine name="CY_CFG_PWR_USING_ULP"           public="false" value="`${usingUlp ? 1 : 0}`" include="true" />
192    <ConfigDefine name="CY_CFG_PWR_REGULATOR_MODE_MIN"  public="false" value="`${((coreRegulator eq CY_SYSPM_LDO_MODE_MIN) || (coreRegulator eq CY_SYSPM_BUCK_MODE_MIN)) ? true : false}`" include="true" />
193    <ConfigDefine name="CY_CFG_PWR_BKP_ERROR"           public="false" value="6" include="true" />
194
195    <!-- Operating conditions -->
196    <ConfigDefine name="CY_CFG_PWR_VDDA_MV"    public="true" value="`${vddaMv}`" include="true" />
197    <ConfigDefine name="CY_CFG_PWR_VDDD_MV"    public="true" value="`${vdddMv}`" include="true" />
198    <ConfigDefine name="CY_CFG_PWR_VBACKUP_MV" public="true" value="`${vBackupMv}`" include="true" />
199    <ConfigDefine name="CY_CFG_PWR_VDD_NS_MV"  public="true" value="`${vddNsMv}`" include="true" />
200    <ConfigDefine name="CY_CFG_PWR_VDDIO0_MV"  public="true" value="`${vddio0Mv}`" include="true" />
201    <ConfigDefine name="CY_CFG_PWR_VDDIO1_MV"  public="true" value="`${vddio1Mv}`" include="true" />
202
203    <ConfigFunction signature="__STATIC_INLINE void init_cycfg_power(void)" body="
204   /* Reset the Backup domain on POR, XRES, BOD only if Backup domain is supplied by VDDD */&#xA;
205    #if (CY_CFG_PWR_VBACKUP_USING_VDDD)&#xA;
206        #ifdef CY_CFG_SYSCLK_ILO_ENABLED&#xA;
207            if (0u == Cy_SysLib_GetResetReason() /* POR, XRES, or BOD */)&#xA;
208            {&#xA;
209            #if CY_CFG_SYSCLK_WCO_ENABLED&#xA;
210                uint32_t wcoTrim = Cy_SysLib_GetWcoTrim();&#xA;
211                if (CY_SYSLIB_SUCCESS != Cy_SysLib_ResetBackupDomain())&#xA;
212                {&#xA;
213                    Cy_SysLib_DelayUs(1U);&#xA;
214                    if (CY_SYSLIB_SUCCESS != Cy_SysLib_GetResetStatus())&#xA;
215                    {&#xA;
216                        cycfg_ClockStartupError(CY_CFG_PWR_BKP_ERROR);&#xA;
217                    }&#xA;
218                }&#xA;
219                Cy_SysLib_SetWcoTrim(wcoTrim);&#xA;
220            #else /* CY_CFG_SYSCLK_WCO_ENABLED */&#xA;
221                (void) Cy_SysLib_ResetBackupDomain();&#xA;
222            #endif /* CY_CFG_SYSCLK_WCO_ENABLED */&#xA;
223               Cy_SysClk_IloDisable();&#xA;
224               Cy_SysClk_IloInit();&#xA;
225           }&#xA;
226       #endif /* CY_CFG_SYSCLK_ILO_ENABLED */&#xA;
227   #endif /* CY_CFG_PWR_VBACKUP_USING_VDDD */&#xA;&#xA;
228   /* Configure core regulator */&#xA;
229   #if !(defined(CY_DEVICE_SECURE))&#xA;
230       #if defined (CY_IP_M4CPUSS)&#xA;
231           #if CY_CFG_PWR_USING_LDO&#xA;
232               Cy_SysPm_LdoSetVoltage(CY_SYSPM_LDO_VOLTAGE_`${actPwrMode}`);&#xA;
233           #else&#xA;
234               Cy_SysPm_BuckEnable(CY_SYSPM_BUCK_OUT1_VOLTAGE_`${actPwrMode}`);&#xA;
235           #endif /* CY_CFG_PWR_USING_LDO */&#xA;
236       #endif /* defined (CY_IP_M4CPUSS) */&#xA;
237       #if CY_CFG_PWR_REGULATOR_MODE_MIN&#xA;
238           Cy_SysPm_SystemSetMinRegulatorCurrent();&#xA;
239       #else&#xA;
240           Cy_SysPm_SystemSetNormalRegulatorCurrent();&#xA;
241       #endif /* CY_CFG_PWR_REGULATOR_MODE_MIN */&#xA;
242   #endif /* !(defined(CY_DEVICE_SECURE)) */&#xA;
243   /* Configure PMIC */&#xA;
244   Cy_SysPm_UnlockPmic();&#xA;
245   #if CY_CFG_PWR_USING_PMIC&#xA;
246       Cy_SysPm_PmicEnableOutput();&#xA;
247   #else&#xA;
248       Cy_SysPm_PmicDisableOutput();&#xA;
249   #endif /* CY_CFG_PWR_USING_PMIC */"
250    public="false" include="true" guard="(!defined(CY_DEVICE_SECURE))" />
251  </ConfigFirmware>
252</Personality>
253