Newer
Older
mbed-os / targets / TARGET_Cypress / TARGET_PSOC6 / mtb-pdl-cat1 / personalities / platform / power-1.2.cypersonality
@Dustin Crossman Dustin Crossman on 4 Jun 2021 15 KB Fix file modes.
<?xml version="1.0" encoding="utf-8"?>


<!--****************************************************************************
* \file power.cypersonality
* \version 1.2
*
* \brief
* Personality description file for MCU part of Low Power Assistant.
*
********************************************************************************
* \copyright
* Copyright 2018-2019 Cypress Semiconductor Corporation
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************-->

<Personality id="mxs40power" name="Power Settings" version="1.2" path="Power" xmlns="http://cypress.com/xsd/cyhwpersonality_v1">
  <Dependencies>
    <IpBlock name="mxs40srss" />
    <Resource name="srss\.power" used="true" />
  </Dependencies>
  <ExposedMembers>
    <ExposedMember key="vddaMv" paramId="vddaMv" />
    <ExposedMember key="usingUlp" paramId="usingUlp" />
    <ExposedMember key="deepsleepWhenIdle" paramId="deepsleepWhenIdle" />
  </ExposedMembers>
  <Parameters>
    <!-- Documentation -->
    <ParamDoc id="pdlDoc" name="SysPm API Reference" group="Documentation" 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" />

    <!-- Power settings -->
    <ParamChoice id="pwrMode" name="Power Mode" group="Internal" default="LDO_1_1" visible="false" editable="true"
      desc="This parameter was replaced by actPwrMode and coreRegulator.">
      <Entry name="0.9V Buck Regulator" value="SIMO_0_9" visible="true" />
      <Entry name="0.9V LDO Linear Regulator" value="LDO_0_9" visible="true" />
      <Entry name="1.1V Buck Regulator" value="SIMO_1_1" visible="true" />
      <Entry name="1.1V LDO Linear Regulator" value="LDO_1_1" visible="true" />
    </ParamChoice>

    <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"
      desc="Selects the system operating power mode.">
      <Entry name="LP" value="LP" visible="true" />
      <Entry name="ULP" value="ULP" visible="true" />
    </ParamChoice>

    <ParamChoice id="coreRegulator" name="Core Regulator" group="General" default="`${(pwrMode eq LDO_0_9) || (pwrMode eq LDO_1_1) ? CY_SYSPM_LDO_MODE_NORMAL : CY_SYSPM_LDO_MODE_DISABLED}`" visible="true" editable="true"
      desc="Selects the core regulator to power the device.">
      <Entry name="Normal Current LDO" value="CY_SYSPM_LDO_MODE_NORMAL" visible="true" />
      <Entry name="Minimum Current LDO" value="CY_SYSPM_LDO_MODE_MIN" visible="true" />
      <Entry name="Buck" value="CY_SYSPM_LDO_MODE_DISABLED" visible="true" />
    </ParamChoice>

    <ParamBool id="pmicEnable" name="Enable External PMIC Output" group="General" default="false" visible="true" editable="true"
      desc="Enables an external PMIC to provide VDDD power to the device." />

    <ParamChoice id="backupSrc" name="vBackup Source" group="General" default="VDDD" visible="true" editable="true"
      desc="Selects whether the backup power domain is driven by a dedicated supply (e.g. super-cap or battery), or tied to VDDD.">
      <Entry name="VDDD" value="VDDD" visible="true" />
      <Entry name="Dedicated Supply" value="DEDICATED" visible="true" />
    </ParamChoice>

    <ParamChoice id="idlePwrMode" name="System Idle Power Mode" group="RTOS" default="CY_CFG_PWR_MODE_DEEPSLEEP" visible="true" editable="true"
      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.
            This option only applies for an RTOS based application.">
      <Entry name="Active" value="CY_CFG_PWR_MODE_ACTIVE" visible="true" />
      <Entry name="CPU Sleep" value="CY_CFG_PWR_MODE_SLEEP" visible="true" />
      <Entry name="System Deep Sleep" value="CY_CFG_PWR_MODE_DEEPSLEEP" visible="true" />
    </ParamChoice>

    <ParamRange id="deepsleepLatency" name="Deep Sleep Latency (ms)" group="RTOS" default="0" min="0" max="1000" resolution="1" visible="true" editable="true"
      desc="Greater between the time required to enter to and exit from the deep sleep power mode.
            This option only applies for an RTOS based application." />

    <!-- Operating conditions -->
    <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." />
    <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." />
    <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." />
    <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." />
    <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." />
    <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." />

    <!-- Wakeup pins -->
    <ParamSignal port="hibernate_wakeup[0]" name="Hibernate Wakeup (0)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[0]&quot;)}`"
      desc="Reserve the hibernate_wakeup[0] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_PULLUP" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>

    <ParamSignal port="hibernate_wakeup[1]" name="Hibernate Wakeup (1)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[1]&quot;)}`"
      desc="Reserve the hibernate_wakeup[1] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_PULLUP" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>

    <ParamSignal port="hibernate_wakeup[2]" name="Hibernate Wakeup (2)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[2]&quot;)}`"
      desc="Reserve the hibernate_wakeup[2] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_PULLUP" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>

    <ParamSignal port="hibernate_wakeup[3]" name="Hibernate Wakeup (3)" group="Wakeup Pins" visible="`${hasVisibleOption(&quot;hibernate_wakeup[3]&quot;)}`"
      desc="Reserve the hibernate_wakeup[3] pin to use it as the wakeup source from Hibernate power mode." canBeEmpty="true" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_PULLUP" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>

    <ParamSignal port="pmic_wakeup_in[0]" name="PMIC Wakeup Input" group="Wakeup Pins" visible="`${pmicEnable}`"
      desc="Reserve the pmic_wakeup_in pin" canBeEmpty="true" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${pmicEnable}`" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_PULLUP" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>

    <ParamSignal port="pmic_wakeup_out[0]" name="PMIC Wakeup Output" group="Wakeup Pins" visible="`${pmicEnable}`"
      desc="Reserve the pmic_wakeup_out pin" canBeEmpty="`${!pmicEnable}`" >
      <Constraint type="ACCEPT" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${pmicEnable}`" >
        <Parameter id="DriveModes" severity="DEFAULT" reason="">
          <Fixed value="CY_GPIO_DM_STRONG_IN_OFF" />
        </Parameter>
      </Constraint>
      <Constraint type="ACCEPT" targetLocation=".*" valid="true" />
    </ParamSignal>

    <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="" />
    <ParamBool id="usingUlp" name="usingUlp" group="Internal" default="`${actPwrMode eq ULP}`" visible="false" editable="false" desc="" />
    <ParamBool id="deepsleepWhenIdle" name="deepsleepWhenIdle" group="Internal" default="`${idlePwrMode eq CY_CFG_PWR_MODE_DEEPSLEEP}`" visible="false" editable="false" desc="" />

  </Parameters>

  <!-- Error checking -->
  <DRCs>
    <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)}`" />
    <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)}`" />
    <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)}`" />
    <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)}`" />
    <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)}`" />
  </DRCs>

  <!-- Generated firmware -->
  <ConfigFirmware>
    <ConfigInclude value="cy_syspm.h" include="true" />
    <ConfigDefine name="CY_CFG_PWR_MODE_LP"             public="true" value="0x01UL" include="true" />
    <ConfigDefine name="CY_CFG_PWR_MODE_ULP"            public="true" value="0x02UL" include="true" />
    <ConfigDefine name="CY_CFG_PWR_MODE_ACTIVE"         public="true" value="0x04UL" include="true" />
    <ConfigDefine name="CY_CFG_PWR_MODE_SLEEP"          public="true" value="0x08UL" include="true" />
    <ConfigDefine name="CY_CFG_PWR_MODE_DEEPSLEEP"      public="true" value="0x10UL" include="true" />
    <ConfigDefine name="CY_CFG_PWR_SYS_IDLE_MODE"       public="true" value="`${idlePwrMode}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_SYS_ACTIVE_MODE"     public="true" value="CY_CFG_PWR_MODE_`${actPwrMode}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_DEEPSLEEP_LATENCY"   public="true" value="`${deepsleepLatency}`UL" include="true" />
    <ConfigDefine name="CY_CFG_PWR_USING_LDO"           public="true" value="`${usingLdo ? 1 : 0}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_ENABLED"             public="false" value="1" include="true" />
    <ConfigDefine name="CY_CFG_PWR_INIT"                public="false" value="1" include="true" />
    <ConfigDefine name="CY_CFG_PWR_USING_PMIC"          public="false" value="`${pmicEnable ? 1 : 0}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_VBACKUP_USING_VDDD"  public="false" value="`${(backupSrc eq VDDD) ? 1 : 0}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_LDO_VOLTAGE"         public="false" value="CY_SYSPM_LDO_VOLTAGE_`${actPwrMode}`" include="`${usingLdo}`" />
    <ConfigDefine name="CY_CFG_PWR_BUCK_VOLTAGE"        public="false" value="CY_SYSPM_BUCK_OUT1_VOLTAGE_`${actPwrMode}`" include="`${!usingLdo}`" />
    <ConfigDefine name="CY_CFG_PWR_USING_ULP"           public="false" value="`${usingUlp ? 1 : 0}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_LDO_MODE"            public="false" value="`${coreRegulator}`" include="true" />

    <!-- Operating conditions -->
    <ConfigDefine name="CY_CFG_PWR_VDDA_MV"    public="true" value="`${vddaMv}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_VDDD_MV"    public="true" value="`${vdddMv}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_VBACKUP_MV" public="true" value="`${vBackupMv}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_VDD_NS_MV"  public="true" value="`${vddNsMv}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_VDDIO0_MV"  public="true" value="`${vddio0Mv}`" include="true" />
    <ConfigDefine name="CY_CFG_PWR_VDDIO1_MV"  public="true" value="`${vddio1Mv}`" include="true" />

    <ConfigFunction signature="__STATIC_INLINE void init_cycfg_power(void)" body="
   /* Reset the Backup domain on POR, XRES, BOD only if Backup domain is supplied by VDDD */&#xA;
   #if (CY_CFG_PWR_VBACKUP_USING_VDDD)&#xA;
       #ifdef CY_CFG_SYSCLK_ILO_ENABLED&#xA;
           if (0u == Cy_SysLib_GetResetReason() /* POR, XRES, or BOD */)&#xA;
           {&#xA;
               Cy_SysLib_ResetBackupDomain();&#xA;
               Cy_SysClk_IloDisable();&#xA;
               Cy_SysClk_IloInit();&#xA;
           }&#xA;
       #endif /* CY_CFG_SYSCLK_ILO_ENABLED */&#xA;
   #endif /* CY_CFG_PWR_VBACKUP_USING_VDDD */&#xA;&#xA;
   /* Configure core regulator */&#xA;
   #if !((CY_CPU_CORTEX_M4) &amp;&amp; (defined(CY_DEVICE_SECURE)))&#xA;
       #if CY_CFG_PWR_USING_LDO&#xA;
           Cy_SysPm_LdoSetVoltage(CY_SYSPM_LDO_VOLTAGE_`${actPwrMode}`);&#xA;
           Cy_SysPm_LdoSetMode(`${coreRegulator}`);&#xA;
       #else&#xA;
           Cy_SysPm_BuckEnable(CY_SYSPM_BUCK_OUT1_VOLTAGE_`${actPwrMode}`);&#xA;
       #endif /* CY_CFG_PWR_USING_LDO */&#xA;
   #endif /* !((CY_CPU_CORTEX_M4) &amp;&amp; (defined(CY_DEVICE_SECURE))) */&#xA;
   /* Configure PMIC */&#xA;
   Cy_SysPm_UnlockPmic();&#xA;
   #if CY_CFG_PWR_USING_PMIC&#xA;
       Cy_SysPm_PmicEnableOutput();&#xA;
   #else&#xA;
       Cy_SysPm_PmicDisableOutput();&#xA;
   #endif /* CY_CFG_PWR_USING_PMIC */"
    public="false" include="true" guard="((!CY_CPU_CORTEX_M4) || (!defined(CY_DEVICE_SECURE)))" />
  </ConfigFirmware>
</Personality>