1<?xml version="1.0" encoding="utf-8"?> 2 3 4<!--**************************************************************************** 5* \file opamp.cypersonality 6* \version 1.0 7* 8* \brief 9* OpAmp personality description file. 10* 11******************************************************************************** 12* \copyright 13* Copyright 2018-2022 Cypress Semiconductor Corporation 14* SPDX-License-Identifier: Apache-2.0 15* 16* Licensed under the Apache License, Version 2.0 (the "License"); 17* you may not use this file except in compliance with the License. 18* You may obtain a copy of the License at 19* 20* http://www.apache.org/licenses/LICENSE-2.0 21* 22* Unless required by applicable law or agreed to in writing, software 23* distributed under the License is distributed on an "AS IS" BASIS, 24* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25* See the License for the specific language governing permissions and 26* limitations under the License. 27*****************************************************************************--> 28 29<Personality id="mxs40opamp" name="OpAmp" version="1.0" xmlns="http://cypress.com/xsd/cyhwpersonality_v7"> 30 <Dependencies> 31 <IpBlock name="mxs40pass,mxs40pass_ver2" /> 32 <Resource name="pass\.ctb\.oa" /> 33 </Dependencies> 34 <ExposedMembers /> 35 <Parameters> 36 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__ctb.html" linkText="Open CTB Documentation" visible="true" desc="Opens the Peripheral Driver Library Documentation" /> 39 40 <!-- Internal Parameters --> 41 <ParamBool id="debug" name="debug" group="Internal" default="false" visible="false" editable="false" desc="" /> 42 <ParamString id="version" name="version" group="Internal" default="`${getVersion()}`" visible="`${debug}`" editable="false" desc="" /> 43 <ParamBool id="verGt1" name="verGt1" desc="" group="Internal" default="`${version > 1}`" visible="`${debug}`" editable="false" /> 44 <ParamString id="ctbNum" name="CTB instance" group="Internal" default="`${getInstNumber("ctb")}`" visible="`${debug}`" editable="false" desc="Selected CTBM" /> 45 <ParamString id="opampNum" name="Opamp instance" group="Internal" default="`${getInstNumber("oa")}`" visible="`${debug}`" editable="false" desc="Selected Opamp within CTBM" /> 46 <ParamBool id="isArefEnabled" name="Is Aref Enabled" group="Internal" default="`${isBlockUsed("pass[0].aref[0]")}`" visible="`${debug}`" editable="false" desc="" /> 47 <ParamBool id="isSysAnalogEnabled" name="isSysAnalogEnabled" group="Internal" default="`${isBlockUsed("pass[0]")}`" visible="`${debug}`" editable="false" desc="" /> 48 <ParamBool id="isCTBmClockEnabled" name="isCTBmClockEnabled" group="Internal" default="`${verGt1 ? isBlockUsed("pass[0].ctbmclk[0]") : false}`" visible="`${debug}`" editable="false" desc="" /> 49 <ParamBool id="isPumpClkEnabled" name="isPumpClkEnabled" group="Internal" default="`${verGt1 ? isCTBmClockEnabled : isSysAnalogEnabled}`" visible="`${debug}`" editable="false" desc="" /> 50 <ParamString id="clockRsc" name="clockRsc" group="Internal" default="`${verGt1 ? "pass[0].ctbmclk[0]" : "pass[0]"}`" visible="`${debug}`" editable="false" desc="" /> 51 <ParamString id="pumpClkHz" name="Opamp Pump Clock Freq" group="Internal" default="`${isPumpClkEnabled ? getExposedMember(clockRsc, "frequency") : 0}`" visible="`${debug}`" editable="false" desc="Frequency of the Opamp Pump Clock in Hertz" /> 52 53 <!-- Public Parameters --> 54 <ParamChoice id="power" name="Power" group="General" default="CY_CTB_POWER_HIGH" visible="true" editable="true" desc="The Power parameter allows you to select the power level. Higher operating current increases the Opamp bandwidth." > 55 <Entry name="Off" value="CY_CTB_POWER_OFF" visible="false" /> 56 <Entry name="Low" value="CY_CTB_POWER_LOW" visible="true" /> 57 <Entry name="Medium" value="CY_CTB_POWER_MEDIUM" visible="true" /> 58 <Entry name="High" value="CY_CTB_POWER_HIGH" visible="true" /> 59 <Entry name="Power Saver Low" value="CY_CTB_POWER_PS_LOW" visible="true" /> 60 <Entry name="Power Saver Medium" value="CY_CTB_POWER_PS_MEDIUM" visible="true" /> 61 <Entry name="Power Saver High" value="CY_CTB_POWER_PS_HIGH" visible="true" /> 62 </ParamChoice> 63 <ParamChoice id="outputCurrent" name="Output Drive" group="General" default="CY_CTB_MODE_OPAMP1X" visible="true" editable="true" desc="This parameter selects an output drive mode. Selecting Output to pin allows for connections to device pins with 10x more drive current." > 64 <Entry name="Output to pin" value="CY_CTB_MODE_OPAMP10X" visible="true" /> 65 <Entry name="Internal only" value="CY_CTB_MODE_OPAMP1X" visible="true" /> 66 </ParamChoice> 67 <ParamBool id="deepSleep" name="Deep Sleep Enable" group="General" default="`${isSysAnalogEnabled ? (getExposedMember("pass[0]", "ctb" . getInstNumber("ctb") . "_deep_sleep")) : false}`" visible="true" editable="false" desc="Deep Sleep is configured in the Programmable Analog resource. When Deep Sleep is enabled, the input range of the opamp is reduced." /> 68 69 <!-- Internal Parameters --> 70 <ParamBool id="highPwr" name="Is Power High" group="Internal" default="`${power eq "CY_CTB_POWER_HIGH"}`" visible="`${debug}`" editable="false" desc="High power selected" /> 71 <ParamBool id="deepSleepClk" name="deepSleepClk" group="Internal" default="`${(deepSleep && verGt1) ? ("CY_CTB_CLK_PUMP_DEEPSLEEP" eq getExposedMember("pass[0].ctbmclk[0]", "clock")) : false}`" visible="`${debug}`" editable="false" desc="" /> 72 73 <!-- Signals --> 74 <ParamSignal port="vplus[0]" name="Vplus Input" group="Connections" visible="true" desc="Positive Opamp Input" canBeEmpty="false" /> 75 <ParamSignal port="vminus[0]" name="Vminus Input" group="Connections" visible="true" desc="Negative Opamp Input" canBeEmpty="false" > 76 </ParamSignal> 77 <ParamSignal port="out_10x[0]" name="Output (to pin)" group="Connections" visible="`${outputCurrent eq "CY_CTB_MODE_OPAMP10X"}`" desc="Opamp Output to pin" canBeEmpty="`${outputCurrent ne "CY_CTB_MODE_OPAMP10X"}`" /> 78 <ParamSignal port="out_1x[0]" name="Output (internal only)" group="Connections" visible="`${outputCurrent eq "CY_CTB_MODE_OPAMP1X"}`" desc="Opamp Output to internal" canBeEmpty="`${outputCurrent ne "CY_CTB_MODE_OPAMP1X"}`" > 79 <Constraint type="DENY" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${outputCurrent eq "CY_CTB_MODE_OPAMP1X"}`" > 80 </Constraint> 81 </ParamSignal> 82 83 <!--Config--> 84 <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)." /> 85 </Parameters> 86 <!--DRCs--> 87 <DRCs> 88 <DRC type="ERROR" text="The AREF resource must be enabled for `${INST_NAME}` to work." condition="`${!isArefEnabled}`" > 89 <FixIt action="ENABLE_BLOCK" target="pass[0].aref[0]" value="mxs40aref-1.0" valid="true" /> 90 </DRC> 91 <DRC type="ERROR" text="The Programmable Analog resource must be enabled for `${INST_NAME}` to work." condition="`${!isSysAnalogEnabled}`" > 92 <FixIt action="ENABLE_BLOCK" target="pass[0]" value="mxs40sysanalog-1.0" valid="true" /> 93 </DRC> 94 <DRC type="ERROR" text="The CTBM Clock resource must be enabled for `${INST_NAME}` to work." condition="`${verGt1 && !isPumpClkEnabled}`" > 95 <FixIt action="ENABLE_BLOCK" target="pass[0].ctbmclk[0]" value="mxs40ctbmclk-1.0" valid="true" /> 96 </DRC> 97 <DRC type="ERROR" text="The charge pump clock must be within a range from 8 MHz - 10% to 24 MHz + 10%." condition="`${isPumpClkEnabled && !deepSleepClk && !highPwr && ((pumpClkHz < 7200000) || (pumpClkHz > 26400000))}`" /> 98 <DRC type="ERROR" text="The charge pump clock must be within a range 24 MHz ± 10%." condition="`${isPumpClkEnabled && !deepSleepClk && highPwr && ((pumpClkHz < 21600000) || (pumpClkHz > 26400000))}`" /> 99 </DRCs> 100 <ConfigFirmware> 101 <ConfigInclude value="cy_ctb.h" include="true" /> 102 <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" /> 103 104 <ConfigDefine name="`${INST_NAME}`_HW" value="CTBM`${ctbNum}`" public="true" include="true" /> 105 <ConfigStruct name="`${INST_NAME . "_config"}`" type="cy_stc_ctb_opamp_config_t" const="`${inFlash}`" public="true" include="true" > 106 <Member name="deepSleep" value="`${deepSleep ? "CY_CTB_DEEPSLEEP_ENABLE" : "CY_CTB_DEEPSLEEP_DISABLE"}`" /> 107 <Member name="oaPower" value="`${power}`" /> 108 <Member name="oaMode" value="`${outputCurrent}`" /> 109 <Member name="oaPump" value="`${(deepSleep && !deepSleepClk) ? "CY_CTB_PUMP_DISABLE" : "CY_CTB_PUMP_ENABLE"}`" /> 110 <Member name="oaCompEdge" value="CY_CTB_COMP_EDGE_BOTH" /> 111 <Member name="oaCompLevel" value="CY_CTB_COMP_DSI_TRIGGER_OUT_PULSE"/> 112 <Member name="oaCompBypass" value="CY_CTB_COMP_BYPASS_SYNC"/> 113 <Member name="oaCompHyst" value="CY_CTB_COMP_HYST_DISABLE"/> 114 <Member name="oaCompIntrEn" value="false"/> 115 </ConfigStruct> 116 117 <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)"> 118 <Member name="type" value="CYHAL_RSC_OPAMP" /> 119 <Member name="block_num" value="`${getInstNumber("ctb")}`U" /> 120 <Member name="channel_num" value="`${getInstNumber("oa")}`U" /> 121 </ConfigStruct> 122 123 <ConfigStruct name="`${INST_NAME}`_hal_config" type="cyhal_opamp_configurator_t" const="`${inFlash}`" public="true" include="true" guard="defined (CY_USING_HAL)"> 124 <Member name="resource" value="&`${INST_NAME}`_obj" /> 125 <Member name="config" value="&`${INST_NAME}`_config" /> 126 </ConfigStruct> 127 128 <ConfigInstruction value="cyhal_hwmgr_reserve(&`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" /> 129 </ConfigFirmware> 130</Personality> 131