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


<!--****************************************************************************
* \file eco.cypersonality
* \version 2.0
*
* \brief
* ECO personality description file.
*
********************************************************************************
* \copyright
* Copyright 2018-2020 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="mxs40eco" name="ECO" version="2.0" path="Clocks/Fast" xmlns="http://cypress.com/xsd/cyhwpersonality_v1">
  <Dependencies>
    <IpBlock name="mxs40srss" />
    <IpBlock name="mxs40ioss" />
    <Resource name="srss\.clock\.eco" used="true" />
  </Dependencies>
  <ExposedMembers>
    <ExposedMember key="frequency" paramId="frequency" />
    <ExposedMember key="accuracy"  paramId="accuracyPct" />
  </ExposedMembers>
  <Parameters>
    <!-- PDL documentation -->
    <ParamDoc id="pdlDoc" name="Configuration Help" group="Peripheral Documentation" default="file:///`${cy_libs_path()}`/docs/pdl_api_reference_manual/html/group__group__sysclk__eco.html" linkText="Open ECO Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" />

    <ParamRange id="ecoFrequency" name="Frequency (MHz)" group="General" default="24.0000" visible="true" editable="true" min="16" max="35" resolution="0.0001" desc="" />
    <ParamRange id="frequency" name="Frequency (Hz)" group="Internal" default="`${ecoFrequency * 1000000}`" visible="false" editable="false" min="16000000" max="35000000" resolution="1" desc="" />

    <ParamRange id="accuracyPpm" name="Accuracy (&#177;ppm)" group="General" default="0" min="0" max="1000000" resolution="1" visible="true" editable="true" desc="Clock accuracy in ppm" />
    <ParamString id="accuracyPct" name="Accuracy (&#177;%)" group="General" default="`${accuracyPpm/10000.0}`" visible="true" editable="false" desc="Clock accuracy in %" />

    <ParamRange id="driveLevel" name="Drive Level (uW)" group="General" default="100" min="1" max="1000" resolution="1" visible="true" editable="true" desc="" />
    <ParamRange id="esr" name="Equivalent Series Resistance ESR (ohm)" group="General" default="50" min="1" max="1000" resolution="1" visible="true" editable="true" desc="" />
    <ParamRange id="c0" name="Crystal Shunt Capacitance C0 (pF)" group="General" default="0" min="0" max="100" resolution="1" visible="true" editable="true" desc="" />
    <ParamRange id="cLoad" name="Parallel Load Capacitance Cload (pF)" group="General" default="18" min="1" max="100" resolution="1" visible="true" editable="true" desc="" />
    <ParamRange id="csum" name="summary capacitance" group="General" default="`${c0 + cLoad}`" min="1" max="200" resolution="1" visible="false" editable="false" desc="" />

    <ParamBool id="debug" name="debug" group="General" default="false" visible="false" editable="false" desc="" />

    <ParamRange id="maxAmpl" name="Max Ampl" group="General" default="`${sqrt(driveLevel / (2.0 * esr)) * 1000 / (3.14 * ecoFrequency * csum)}`" min="0" max="100000" resolution="0.001" visible="`${debug}`" editable="false" desc="" />
    <ParamRange id="maxAmplpp" name="Max Ampl Vpp" group="General" default="`${2 * maxAmpl}`" min="0" max="100000" resolution="0.001" visible="`${debug}`" editable="false" desc="" />
    <ParamRange id="gmMin" name="GM Min" group="General" default="`${(5 * 4 * 3.14 * 3.14 * ecoFrequency * ecoFrequency * csum * csum * 4 * esr) / 1000000000}`" min="0" max="100000" resolution="0.001" visible="`${debug}`" editable="false" desc="" />
    <ParamRange id="amplSect" name="ampl sections" group="General" default="`${floor(gmMin / 9)}`" visible="`${debug}`" editable="false" min="0" max="100000" resolution="1" desc="" />

    <ParamBool id="error" name="error" group="General" default="`${maxAmplpp &lt; 1.3 || amplSect &gt; 3}`" visible="`${debug}`" editable="false" desc="" />

    <ParamRange id="agcEn" name="AGC EN" group="General" default="1" min="0" max="100000" resolution="1" visible="`${debug}`" editable="false" desc="" />
    <ParamRange id="wdTrim" name="WD Trim" group="General" default="7" min="0" max="100000" resolution="1" visible="`${debug}`" editable="false" desc="" />
    <ParamRange id="aTrim" name="A Trim" group="General" default="15" min="0" max="100000" resolution="1" visible="`${debug}`" editable="false" desc="" />
    <ParamRange id="fTrim" name="F Trim" group="General" default="3" min="0" max="100000" resolution="1" visible="`${debug}`" editable="false" desc="" />
    <ParamRange id="rTrim" name="R Trim" group="General" default="0" min="0" max="100000" resolution="1" visible="`${debug}`" editable="false" desc="" />
    <ParamRange id="gTrim" name="G Trim" group="General" default="`${amplSect > 1 ? amplSect : amplSect == 1 ? 0 : 1}`" min="0" max="100000" resolution="1" visible="`${debug}`" editable="false" desc="" />

    <!-- Restrict ECO connections to pins -->
    <ParamSignal port="eco_in[0]" name="Input" group="Connections" visible="true" desc="The input/passive terminal of the internal ECO circuitry" canBeEmpty="false" requirePreferred="true">
      <Constraint type="REQUIRE" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" />
    </ParamSignal>
    <ParamSignal port="eco_out[0]" name="Output" group="Connections" visible="true" desc="The output/active terminal of the internal ECO circuitry" canBeEmpty="false" requirePreferred="true">
      <Constraint type="REQUIRE" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="true" />
    </ParamSignal>
    
    <ParamString id="gpio_in_port" name="gpio_in_port" group="General" default="`${getInstFromLocation(getParamValue(&quot;eco_in[0]&quot;), &quot;port&quot;)}`" visible="false" editable="false" desc="" />
    <ParamString id="gpio_in_pin" name="gpio_in_pin" group="General" default="`${getInstFromLocation(getParamValue(&quot;eco_in[0]&quot;), &quot;pin&quot;)}`" visible="false" editable="false" desc="" />
    <ParamString id="gpio_out_port" name="gpio_out_port" group="General" default="`${getInstFromLocation(getParamValue(&quot;eco_out[0]&quot;), &quot;port&quot;)}`" visible="false" editable="false" desc="" />
    <ParamString id="gpio_out_pin" name="gpio_out_pin" group="General" default="`${getInstFromLocation(getParamValue(&quot;eco_out[0]&quot;), &quot;pin&quot;)}`" visible="false" editable="false" desc="" />
  </Parameters>
  <DRCs>
    <DRC type="ERROR" text="Parameters provided cause the maximum trans-conductance and amplitude control range to exceed the legal design limits." condition="`${error}`" />
    <DRC type="ERROR" text="The sum of C0 and Cload should not exceed 100 pF." condition="`${csum &gt; 100}`" />
  </DRCs>
  <ConfigFirmware>
    <ConfigInclude value="cy_gpio.h" include="true" />
    <ConfigInclude value="cy_sysclk.h" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_ENABLED" value="1" public="false" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_FREQ" value="`${frequency}`UL" public="false" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_GPIO_IN_PRT" value="GPIO_PRT`${gpio_in_port}`" public="false" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_GPIO_IN_PIN" value="`${gpio_in_pin}`" public="false" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_GPIO_OUT_PRT" value="GPIO_PRT`${gpio_out_port}`" public="false" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_GPIO_OUT_PIN" value="`${gpio_out_pin}`" public="false" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_CLOAD" value="`${cLoad}`UL" public="false" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_ESR" value="`${esr}`UL" public="false" include="true" />
    <ConfigDefine name="CY_CFG_SYSCLK_ECO_DRIVE_LEVEL" value="`${driveLevel}`UL" public="false" include="true" />
    <ConfigFunction signature="__STATIC_INLINE void Cy_SysClk_EcoInit()" body="    (void)Cy_GPIO_Pin_FastInit(GPIO_PRT`${gpio_in_port}`, `${gpio_in_pin}`, CY_GPIO_DM_ANALOG, 0UL, HSIOM_SEL_GPIO);&#xA;    (void)Cy_GPIO_Pin_FastInit(GPIO_PRT`${gpio_out_port}`, `${gpio_out_pin}`, CY_GPIO_DM_ANALOG, 0UL, HSIOM_SEL_GPIO);&#xA;    if (CY_SYSCLK_BAD_PARAM == Cy_SysClk_EcoConfigure(CY_CFG_SYSCLK_ECO_FREQ, `${csum}`UL, `${esr}`UL, `${driveLevel}`UL))&#xA;    {&#xA;        cycfg_ClockStartupError(CY_CFG_SYSCLK_ECO_ERROR);&#xA;    }&#xA;    if (CY_SYSCLK_TIMEOUT == Cy_SysClk_EcoEnable(3000UL))&#xA;    {&#xA;        cycfg_ClockStartupError(CY_CFG_SYSCLK_ECO_ERROR);&#xA;    }" public="false" include="`${!error}`" guard="((!CY_CPU_CORTEX_M4) || (!defined(CY_DEVICE_SECURE)))" />
  </ConfigFirmware>
</Personality>