<?xml version="1.0" encoding="utf-8"?> <!--**************************************************************************** * \file opamp.cypersonality * \version 1.0 * * \brief * OpAmp personality description file. * ******************************************************************************** * \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="mxs40opamp" name="OpAmp" version="1.0" path="Analog/Amplifiers" xmlns="http://cypress.com/xsd/cyhwpersonality_v1"> <Dependencies> <IpBlock name="mxs40pass,mxs40pass_ver2" /> <Resource name="pass\.ctb\.oa" used="true" /> </Dependencies> <ExposedMembers /> <Parameters> <!-- <ParamChoice id="mode" name="Mode" group="General" default="CY_CTB_MODE_OPAMP" visible="true" editable="true" desc="This parameter defines feedback routing of the Opamp." > <Entry name="Opamp" value="CY_CTB_MODE_OPAMP" visible="true" /> <Entry name="Follower" value="CY_CTB_MODE_FOLLOWER" visible="true" /> </ParamChoice> --> <!-- PDL documentation --> <ParamDoc id="pdlDoc" name="Configuration Help" group="Peripheral Documentation" 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" /> <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." > <Entry name="Off" value="CY_CTB_POWER_OFF" visible="false" /> <Entry name="Low" value="CY_CTB_POWER_LOW" visible="true" /> <Entry name="Medium" value="CY_CTB_POWER_MEDIUM" visible="true" /> <Entry name="High" value="CY_CTB_POWER_HIGH" visible="true" /> </ParamChoice> <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." > <Entry name="Output to pin" value="CY_CTB_MODE_OPAMP10X" visible="true" /> <Entry name="Internal only" value="CY_CTB_MODE_OPAMP1X" visible="true" /> </ParamChoice> <!-- Internal Parameters --> <ParamBool id="debug" name="debug" group="Internal" default="false" visible="false" editable="false" desc="" /> <ParamString id="version" name="version" group="Internal" default="`${getVersion()}`" visible="`${debug}`" editable="false" desc="" /> <ParamBool id="verGt1" name="verGt1" desc="" group="Internal" default="`${version > 1}`" visible="`${debug}`" editable="false" /> <ParamString id="ctbNum" name="CTB instance" group="Internal" default="`${getInstNumber("ctb")}`" visible="`${debug}`" editable="false" desc="Selected CTBM" /> <ParamString id="opampNum" name="Opamp instance" group="Internal" default="`${getInstNumber("oa")}`" visible="`${debug}`" editable="false" desc="Selected Opamp within CTBM" /> <ParamBool id="isArefEnabled" name="Is Aref Enabled" group="Internal" default="`${isBlockUsed("pass[0].aref[0]")}`" visible="`${debug}`" editable="false" desc="" /> <ParamBool id="isSysAnalogEnabled" name="isSysAnalogEnabled" group="Internal" default="`${isBlockUsed("pass[0]")}`" visible="`${debug}`" editable="false" desc="" /> <ParamBool id="isCTBmClockEnabled" name="isCTBmClockEnabled" group="Internal" default="`${verGt1 ? isBlockUsed("pass[0].ctbmclk[0]") : false}`" visible="`${debug}`" editable="false" desc="" /> <ParamBool id="isPumpClkEnabled" name="isPumpClkEnabled" group="Internal" default="`${verGt1 ? isCTBmClockEnabled : isSysAnalogEnabled}`" visible="`${debug}`" editable="false" desc="" /> <ParamString id="clockRsc" name="clockRsc" group="Internal" default="`${verGt1 ? "pass[0].ctbmclk[0]" : "pass[0]"}`" visible="`${debug}`" editable="false" desc="" /> <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" /> <ParamBool id="highPwr" name="Is Power High" group="Internal" default="`${power eq "CY_CTB_POWER_HIGH"}`" visible="`${debug}`" editable="false" desc="High power selected" /> <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." /> <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="" /> <!-- Signals --> <ParamSignal port="vplus[0]" name="Vplus Input" group="Connections" visible="true" desc="Positive Opamp Input" canBeEmpty="false" /> <ParamSignal port="vminus[0]" name="Vminus Input" group="Connections" visible="true" desc="Negative Opamp Input" canBeEmpty="false" > </ParamSignal> <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"}`" /> <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"}`" > <Constraint type="DENY" targetLocation="ioss\[\d+\]\.port\[\d+\]\.pin.*" valid="`${outputCurrent eq "CY_CTB_MODE_OPAMP1X"}`" > </Constraint> </ParamSignal> <!--Config--> <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)." /> </Parameters> <!--DRCs--> <DRCs> <DRC type="ERROR" text="The AREF resource must be enabled for `${INST_NAME}` to work." condition="`${!isArefEnabled}`" > <FixIt action="ENABLE_BLOCK" target="pass[0].aref[0]" value="mxs40aref-1.0" valid="true" /> </DRC> <DRC type="ERROR" text="The Programmable Analog resource must be enabled for `${INST_NAME}` to work." condition="`${!isSysAnalogEnabled}`" > <FixIt action="ENABLE_BLOCK" target="pass[0]" value="mxs40sysanalog-1.0" valid="true" /> </DRC> <DRC type="ERROR" text="The CTBM Clock resource must be enabled for `${INST_NAME}` to work." condition="`${verGt1 && !isPumpClkEnabled}`" > <FixIt action="ENABLE_BLOCK" target="pass[0].ctbmclk[0]" value="mxs40ctbmclk-1.0" valid="true" /> </DRC> <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))}`" /> <DRC type="ERROR" text="The charge pump clock must be within a range 24 MHz ± 10%." condition="`${isPumpClkEnabled && !deepSleepClk && highPwr && ((pumpClkHz < 21600000) || (pumpClkHz > 26400000))}`" /> </DRCs> <ConfigFirmware> <ConfigInclude value="cy_ctb.h" include="true" /> <ConfigInclude value="cyhal_hwmgr.h" include="true" guard="defined (CY_USING_HAL)" /> <ConfigDefine name="`${INST_NAME}`_HW" value="CTBM`${ctbNum}`" public="true" include="true" /> <ConfigStruct name="`${INST_NAME . "_config"}`" type="cy_stc_ctb_opamp_config_t" const="`${inFlash}`" public="true" include="true"> <Member name="deepSleep" value="`${deepSleep ? "CY_CTB_DEEPSLEEP_ENABLE" : "CY_CTB_DEEPSLEEP_DISABLE"}`" /> <Member name="oaPower" value="`${power}`" /> <Member name="oaMode" value="`${outputCurrent}`" /> <Member name="oaPump" value="`${(deepSleep && !deepSleepClk) ? "CY_CTB_PUMP_DISABLE" : "CY_CTB_PUMP_ENABLE"}`" /> <Member name="oaCompEdge" value="CY_CTB_COMP_EDGE_BOTH" /> <Member name="oaCompLevel" value="CY_CTB_COMP_DSI_TRIGGER_OUT_PULSE"/> <Member name="oaCompBypass" value="CY_CTB_COMP_BYPASS_SYNC"/> <Member name="oaCompHyst" value="CY_CTB_COMP_HYST_DISABLE"/> <Member name="oaCompIntrEn" value="false"/> </ConfigStruct> <ConfigStruct name="`${INST_NAME}`_obj" type="cyhal_resource_inst_t" const="true" public="true" include="true" guard="defined (CY_USING_HAL)"> <Member name="type" value="CYHAL_RSC_OPAMP" /> <Member name="block_num" value="`${getInstNumber("ctb")}`U" /> <Member name="channel_num" value="`${getInstNumber("oa")}`U" /> </ConfigStruct> <ConfigInstruction value="cyhal_hwmgr_reserve(&`${INST_NAME}`_obj);" include="true" guard="defined (CY_USING_HAL)" /> </ConfigFirmware> </Personality>